This commit is contained in:
2024-01-08 22:18:19 +08:00
parent 5cc5f8b81b
commit 3b28b1f7ab
21 changed files with 948 additions and 20 deletions

View File

@@ -28,14 +28,14 @@
<view style="color: #888;font-size: 12px;">我要定 </view>
<input type="number" @input="numbers" v-model="page.number" maxlength="3"
style="font-size: 12px; border: 1px #AEAEAE solid;border-radius: 5px;text-align: center; width: 25px;margin-left: 5px;margin-right: 5px;padding-left: 3px;padding-right: 3px;" />
<view style="color: #888;font-size: 12px;">个云</view>
<view style="color: #888;font-size: 12px;">个云菜</view>
</view>
</view>
<view v-for="(item,index) in data.goods" :key="index" @click="itemClick(item.goodsSid)"
style="display: flex;flex-direction: column;margin-top: 14px; " >
style="display: flex;flex-direction: column;margin-top: 14px; ">
<view :style="{'border-bottom':(index===data.goods.length-1 ? 'none':'1px #EFEFEF solid')}" style="display: flex;flex-direction: column;
margin-left: 20px;margin-right: 20px;padding-bottom: 10px;">
@@ -94,7 +94,8 @@
<text
style="background: #EE752F; text-align: center; color: #fff; border-radius: 5px;padding: 5px 20px; margin-right: 40px; ">结算</text>
style="background: #EE752F; text-align: center; color: #fff; border-radius: 5px;padding: 5px 20px; margin-right: 40px; "
@click="settlement()">结算</text>
</view>
@@ -141,6 +142,10 @@
this.request()
},
onPageScroll(res) {
// 渐变
this.$refs.nav.defaultColorBgAlpha(res)
},
methods: {
itemClick(goodsSid) {
uni.navigateTo({
@@ -149,11 +154,6 @@
},
request() {
let _this = this
// _this.$nextTick(() => {
// _this.$refs.pageView.setLoadState(2)
// })
// this.getPrice()
_this.$api.getGiftBagBySid(this.page.sid).then((resp) => {
@@ -180,6 +180,83 @@
this.page.price = Number(this.data.price * this.page.number).toFixed(2)
else
this.page.price = "0.00"
},
settlement() {
// 支付
if (!Number(this.page.number) > 0) {
this.shortToast('请输入要定制几份云菜窖')
return
}
let list = []
for (var i = 0; i < this.data.goods.length; i++) {
var item = this.data.goods[i]
if (item.goodsNumber > 0)
list.push({
goodsSid: item.goodsSid,
goodsName: item.name,
partNumber: item.goodsNumber,
numofPart: item.weight,
priceUnit: item.jprice,
pricePart: item.price,
})
}
// console.log("ddd", list);
if(list.length==0){
this.shortToast('请添加商品')
return
}
var params = {
customerSid: getApp().globalData.sid,
cardNumber: this.page.number,
totalTee: this.page.price,
ordOrderDetailsVoList: list
}
// console.log("params", params);
let _this = this
_this.$api.createOrder(params).then((resp) => {
// console.log("resp", resp);
this.$pay(resp)
}).catch(e => {
})
// var data = {
// "price": "0.01",
// "trade_no_url": {
// "url": "http://192.168.2.110:7777/order/orderQuery",
// "params": {
// "mainSid": "954fbec1-b12e-4f29-87c1-4d9ff6332e7c"
// }
// },
// "pay_url": {
// "url": "http://192.168.2.110:7777/order/pay ",
// "params": {
// "mainSid": "954fbec1-b12e-4f29-87c1-4d9ff6332e7c"
// }
// },
// "order_url": {
// "page": "/pages/index2/index2",
// "params": {}
// },
// "orderId": "288320940398",
// "remainder": 96,
// "goods": "无骨鸡柳等3件商品",
// "bus": [
// "pay"
// ]
// }
}
}
}

View File

@@ -31,7 +31,7 @@
<view style="color: #888;font-size: 12px;">我要定 </view>
<input type="number" @input="numbers" v-model="page.number" maxlength="3"
style="font-size: 12px; border: 1px #AEAEAE solid;border-radius: 5px;text-align: center; width: 25px;margin-left: 5px;margin-right: 5px;padding-left: 3px;padding-right: 3px;" />
<view style="color: #888;font-size: 12px;">个云</view>
<view style="color: #888;font-size: 12px;">个云菜</view>
</view>
</view>
@@ -106,7 +106,8 @@
<text
style="background: #EE752F; text-align: center; color: #fff; border-radius: 5px;padding: 5px 20px; margin-right: 40px; ">结算</text>
style="background: #EE752F; text-align: center; color: #fff; border-radius: 5px;padding: 5px 20px; margin-right: 40px; "
@click="settlement()">结算</text>
</view>
@@ -136,6 +137,10 @@
}
},
onPageScroll(res) {
// 渐变
this.$refs.nav.defaultColorBgAlpha(res)
},
onLoad(options) {
let info = uni.getSystemInfoSync();
@@ -208,6 +213,59 @@
}
this.page.weight = num
},
settlement() {
// 支付
if (this.page.weight < 200) {
this.shortToast('满200斤才可定制云菜窖哦请继续选菜吧。')
return
}
if (!Number(this.page.number) > 0) {
this.shortToast('请输入要定制几份云菜窖')
return
}
let list = []
for (var i = 0; i < this.data.length; i++) {
var item = this.data[i]
if (item.goodsNumber > 0)
list.push({
goodsSid: item.goodsSid,
goodsName: item.name,
partNumber: item.goodsNumber,
numofPart: item.weight,
priceUnit: item.jprice,
pricePart: item.price,
})
}
// console.log("ddd", list);
if(list.length==0){
this.shortToast('请添加商品')
return
}
var params = {
customerSid: getApp().globalData.sid,
cardNumber: this.page.number,
totalTee: this.page.price,
ordOrderDetailsVoList: list
}
// console.log("params", params);
let _this = this
_this.$api.createOrder(params).then((resp) => {
// console.log("resp", resp);
this.$pay(resp)
}).catch(e => {
})
}
}