|
@@ -92,6 +92,7 @@
|
|
|
},
|
|
|
scanCode(type) {
|
|
|
uni.scanCode({
|
|
|
+ onlyFromCamera:true,
|
|
|
success: (res) => {
|
|
|
console.log('扫码结果:' + res.result);
|
|
|
// 扫码成功后的操作,例如:
|
|
@@ -105,14 +106,14 @@
|
|
|
// 处理扫码结果的函数,可以根据实际需求进行扩展
|
|
|
handleScanResult(result, type) {
|
|
|
// 例如:导航到某个页面,或者处理其他业务逻辑
|
|
|
- let sendData = {};
|
|
|
- sendData.playDate = this.orderInfo.playDate;
|
|
|
- sendData.playTime = this.orderInfo.playTime;
|
|
|
- sendData.playLength = this.orderInfo.playLength || 1;
|
|
|
- sendData.merchantId = this.orderInfo.merchantId;
|
|
|
- sendData.orderType = this.orderInfo.orderType;
|
|
|
- sendData.type = type;
|
|
|
- sendData.writeOffCode = "70";
|
|
|
+ let sendData={};
|
|
|
+ sendData.playDate=this.orderInfo.playDate;
|
|
|
+ sendData.playTime=this.orderInfo.playTime;
|
|
|
+ sendData.playLength=this.orderInfo.playLength||1;
|
|
|
+ sendData.merchantId=this.orderInfo.merchantId;
|
|
|
+ sendData.orderType=this.orderInfo.orderType;
|
|
|
+ sendData.type=type;
|
|
|
+ sendData.writeOffCode=result;
|
|
|
console.log(sendData)
|
|
|
|
|
|
this.$api.post('/scenic/order/scanCode', sendData).then(res => {
|
|
@@ -128,6 +129,8 @@
|
|
|
} else {
|
|
|
this.data.push(res.data.data)
|
|
|
}
|
|
|
+ }else{
|
|
|
+ this.$showToast(res.data.msg)
|
|
|
}
|
|
|
})
|
|
|
},
|