更新代客下单模块
This commit is contained in:
@@ -58,16 +58,15 @@
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<view class="bg-fff box-shadow u-p-t-30 u-p-l-50 u-p-r-50 card top border-r-12 ">
|
||||
|
||||
|
||||
</view>
|
||||
<view class="bg-fff box-shadow u-p-t-30 u-p-l-50 u-p-r-50 card bottom border-r-12 ">
|
||||
|
||||
<view class="bg-fff box-shadow u-p-t-30 u-p-l-50 u-p-r-50 card bottom border-r-12 ">
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<edit-discount title="优惠金额" :ref="setModel" name="editMoney" :price="order.amount"></edit-discount>
|
||||
</view>
|
||||
@@ -84,7 +83,7 @@
|
||||
} from '@dcloudio/uni-app'
|
||||
import * as Api from '@/http/yskApi/Instead.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
import editDiscount from '@/pagesCreateOrder/components/edit-discount.vue'
|
||||
import editDiscount from '/pagesCreateOrder/components/edit-discount.vue'
|
||||
const pays = reactive({
|
||||
list: ['扫码收款', '二维码收款'],
|
||||
selIndex: 0,
|
||||
@@ -116,27 +115,37 @@
|
||||
pays.payTypes.selIndex = i
|
||||
}
|
||||
//支付成功回调
|
||||
function paySuccess(){
|
||||
function paySuccess() {
|
||||
infoBox.showToast('支付成功')
|
||||
setTimeout(() => {
|
||||
// uni.$emit('orderDetail:update')
|
||||
uni.navigateBack({delta:2})
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
async function payOrder() {
|
||||
async function payOrder(code) {
|
||||
const payType = pays.payTypes.list[pays.payTypes.selIndex].payType
|
||||
await Api.$payOrder({
|
||||
console.log({
|
||||
tableId: order.tableId,
|
||||
masterId: order.masterId,
|
||||
orderId: order.id||order.orderId,
|
||||
orderId: order.id || order.orderId,
|
||||
payType,
|
||||
vipUserId: order.userId,
|
||||
discount: 1,
|
||||
code: ''
|
||||
code: code
|
||||
});
|
||||
await Api.$payOrder({
|
||||
tableId: order.tableId,
|
||||
masterId: order.masterId,
|
||||
orderId: order.id || order.orderId,
|
||||
payType,
|
||||
vipUserId: order.userId,
|
||||
code: code
|
||||
})
|
||||
paySuccess()
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getPayType()
|
||||
})
|
||||
@@ -148,18 +157,10 @@
|
||||
const item = pays.payTypes.list[pays.payTypes.selIndex]
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
success:function (res) {
|
||||
success: function(res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
Api.$payOrder({
|
||||
"orderId": order.orderId, // 订单id
|
||||
"payType": item.payType, //
|
||||
"discount": order.discount,
|
||||
"code": res.result
|
||||
}).then(res=>{
|
||||
console.log(res);
|
||||
paySuccess()
|
||||
})
|
||||
payOrder(res.result)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user