fix:遗漏问题

main
Tuzki 1 year ago
parent 8e840630b4
commit fa440e08cb
  1. 2
      pages/addUserinfo/addUserinfo.vue
  2. 10
      pages/orderDetail/orderDetail.vue
  3. 48
      pages/payResult/payResult.vue
  4. 43
      pages/shoppingTrolley/shoppingTrolley.vue

@ -64,7 +64,7 @@
<script>
import * as Reader from '../../uni_modules/yzwl-nfc-reader';
// import * as Reader from '../../uni_modules/yzwl-nfc-reader';
export default {
data() {

@ -156,8 +156,14 @@ export default {
})
},
back() {
this.cancelOrder()
cancelOrder(that.orderDetail.orderInfo.orderNumber).then(res=>{
console.log(res)
}).catch(err=>{
console.log(err)
})
uni.navigateBack({
delta:1,
})
}
}
};

@ -1,6 +1,7 @@
<template>
<view class="m-content">
<uni-nav-bar dark :fixed="true" shadow background-color="#007AFF" status-bar left-icon="left" left-text="" title="支付结果" @clickLeft="back" />
<uni-nav-bar dark :fixed="true" shadow background-color="#007AFF" status-bar left-icon="left" left-text=""
title="支付结果" @clickLeft="back" />
<view class="m-ico"></view>
<uni-icons type="checkbox-filled" color="#00ae00" size="155"></uni-icons>
<view class="m-status">支付成功</view>
@ -10,6 +11,7 @@
</template>
<script>
import { parseTime } from '../../utils/ruoyi';
const sunmi_print = uni.requireNativePlugin('Sunmi-Print-Inner');
export default {
data() {
@ -28,11 +30,20 @@ export default {
},
onUnload() {
//使
if(sunmi_print){
if (sunmi_print) {
sunmi_print.disconnect();
}
},
methods: {
parseTime(val) {
return parseTime(val, '{y}-{m}-{d}')
},
toDate(timeStr) {
//
let now = new Date();
let [hours, minutes] = timeStr.split(':').map(Number);
return new Date(now.getFullYear(), now.getMonth(), now.getDate(), hours, minutes);
},
back() {
uni.reLaunch({
url: '/pages/index'
@ -46,7 +57,7 @@ export default {
if (res.connect == 'hello') {
console.log('打印机成功连接');
//
that.ticketList.forEach((item,index) => {
that.ticketList.forEach((item, index) => {
sunmi_print.printDividingline({
style: '4',
height: '30'
@ -75,7 +86,33 @@ export default {
height: '10'
});
sunmi_print.printText({
text: '金额:'+item.salesAmount+'元 '+item.usersNumber+' 人',
text: '金额:' + item.salesAmount + '元 ' + item.usersNumber + ' 人',
align: 0,
size: 22,
bold: false,
underline: false,
compact: true,
skip: true
});
sunmi_print.printDividingline({
style: '4',
height: '10'
});
sunmi_print.printText({
text: '使用日期:' + item.startdate == item.enddate ? this.parseTime(item.startdate) : this.parseTime(item.startdate) + '-' + this.parseTime(item.enddate),
align: 0,
size: 22,
bold: false,
underline: false,
compact: true,
skip: true
});
sunmi_print.printDividingline({
style: '4',
height: '10'
});
sunmi_print.printText({
text: '使用时段:' + this.toDate(item.startTimeslot) == this.toDate(item.endTimeslot) ? '全天' : item.startTimeslot + '-' + item.endTimeslot,
align: 0,
size: 22,
bold: false,
@ -93,7 +130,7 @@ export default {
errorlevel: 1,
align: 1
});
//
sunmi_print.printDividingline({
style: '4',
@ -133,6 +170,7 @@ export default {
background: linear-gradient(90deg, #5097fa 0%, #2277f0 100%);
border-radius: 16upx;
}
.m-btn-line {
color: #5097fa;
background: #fff;

@ -354,12 +354,6 @@ export default {
if (index != -1) {
const currentNum = that.car[index].num;
if (Number(that.selectItem.currentinventory) - currentNum >= 1) {
//
uni.showToast({
icon: 'none',
title: '库存不足'
});
} else {
let newItem = { ...that.selectItem, date: e.fulldate, num: currentNum + 1, zkc: that.selectItem.currentinventory };
uni.setStorageSync('ALL_TICKET', that.car)
const data = JSON.stringify(newItem)
@ -368,6 +362,12 @@ export default {
uni.navigateTo({
url: '/pages/addUserinfo/addUserinfo?needInfoItem=' + data + '&event=' + eve
})
} else {
//
uni.showToast({
icon: 'none',
title: '库存不足'
});
}
} else {
let newItem = { ...that.selectItem, date: e.fulldate, num: 1, zkc: that.selectItem.currentinventory };
@ -536,6 +536,8 @@ export default {
//
debugger;
if (item.datesettings == 1) {
const date = this.parseTime(new Date(),'{y}-{m}-{d}')
item.date = date
//
if (item.inventorySettings == 1) {
//
@ -561,7 +563,34 @@ export default {
that.$refs.cartAnimation.touchOnGoods(that.event, that.busPos);
}
//
// //
// if (item.touristInformation == 2) {
// let index,
// if (that.car.length > 0) {
// index = that.car.findIndex(items=>Number(items.id) == Number(item.id)&&items.date == item.date)
// if(index!=-1){
// that.car[index].num++
// uni.setStorageSync('ALL_TICKET', that.car)
// }else{
// uni.setStorageSync('ALL_TICKET', that.car)
// const data = JSON.stringify(item)
// const eve = JSON.stringify(event)
// item.btnLoading = false;
// uni.navigateTo({
// url: '/pages/addUserinfo/addUserinfo?needInfoItem=' + data + '&event=' + eve
// })
// }
// }else{
// uni.setStorageSync('ALL_TICKET', that.car)
// const data = JSON.stringify(item)
// const eve = JSON.stringify(event)
// item.btnLoading = false;
// uni.navigateTo({
// url: '/pages/addUserinfo/addUserinfo?needInfoItem=' + data + '&event=' + eve
// })
// }
// }
//
if (item.touristInformation == 2 || item.touristInformation == 3) {
uni.setStorageSync('ALL_TICKET', that.car)
const data = JSON.stringify(item)

Loading…
Cancel
Save