diff --git a/manifest.json b/manifest.json index c48d5a0..d152c15 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { - "name" : "芋道移动端", + "name" : "手持机售票", "appid" : "__UNI__EF91AFC", - "description" : "", + "description" : "手持机售票系统", "versionName" : "1.0.0", "versionCode" : "100", "transformPx" : false, diff --git a/pages/addUserinfo/addUserinfo.vue b/pages/addUserinfo/addUserinfo.vue index a2c618d..87762c9 100644 --- a/pages/addUserinfo/addUserinfo.vue +++ b/pages/addUserinfo/addUserinfo.vue @@ -169,12 +169,12 @@ export default { let that = this; that.allTicket = allTickets; if (options.needInfoItem) { - debugger; + //debugger; const ticket = JSON.parse(options.needInfoItem); this.event = options.event ? options.event : null; //单个游客信息 if (ticket.touristInformation == 2) { - debugger; + //debugger; console.log('allTickets:', allTickets); // 打印allTickets数组 console.log('ticket:', ticket); // 打印ticket对象 let index = allTickets.findIndex(item => Number(item.id) == Number(ticket.id) && item.date == ticket.date); @@ -192,7 +192,7 @@ export default { } //全部游客信息 if (ticket.touristInformation == 3) { - debugger; + //debugger; console.log('allTickets:', allTickets); // 打印allTickets数组 console.log('ticket:', ticket); // 打印ticket对象 let index = allTickets.findIndex(item => Number(item.id) == Number(ticket.id) && item.date == ticket.date); @@ -204,7 +204,7 @@ export default { that.count = allTickets[index].usersNumber * allTickets[index].num - counts; that.ticket = allTickets[index]; } else { - debugger + //debugger ticket.num = 1; that.count = 1 * ticket.usersNumber; that.ticket = ticket; @@ -225,7 +225,7 @@ export default { } that.ticket = allTickets[index]; } else { - debugger + //debugger ticket.num = 1; that.count = 1 * ticket.usersNumber; that.ticket = ticket; @@ -238,20 +238,20 @@ export default { this.allTicket = []; let allTickets = []; if (options.needInfoItem) { - debugger; + //debugger; const ticket = JSON.parse(options.needInfoItem); this.event = options.event ? options.event : null; let that = this; //需要填写单人信息 if (ticket.touristInformation == 2) { - debugger; + //debugger; ticket.num = 1; that.count = 1; that.ticket = ticket; } //需要填写所有人信息 if (ticket.touristInformation == 3) { - debugger; + //debugger; ticket.num = 1; that.count = 1 * ticket.usersNumber; that.ticket = ticket; @@ -330,7 +330,7 @@ export default { },10000) }, saveUserInfo() { - debugger + //debugger let that = this if (that.event) { uni.removeStorageSync('EVENT', that.event) @@ -377,7 +377,7 @@ export default { } }, editPerson(val) { - debugger + //debugger if (this.ticket.touristInformation == 2) { this.count = 1 this.editIng = true @@ -398,7 +398,7 @@ export default { content: '确定删除此名游客信息吗?', success: function (res) { if (res.confirm) { - debugger + //debugger const validItems = that.ticket.visitorInfoList.filter(item => item !== undefined && item !== null); const index = validItems.findIndex(item => Number(item.idx) == Number(val.idx)) that.ticket.visitorInfoList.splice(index, 1) @@ -450,7 +450,7 @@ export default { this.$refs[ref] .validate() .then((res) => { - debugger + //debugger console.log('success', res); if (that.customFormData.idx == null) { that.count--; diff --git a/pages/login.vue b/pages/login.vue index e72b9a0..cc7f3fc 100644 --- a/pages/login.vue +++ b/pages/login.vue @@ -47,8 +47,8 @@ captchaEnabled: true, // 验证码开关 TODO 芋艿:需要抽到配置里 globalConfig: getApp().globalData.config, loginForm: { - username: "13292812222", - password: "812222", + username: "15900000090", + password: "000090", captchaVerification: "" }, tentId:null diff --git a/pages/orderDetail/orderDetail.vue b/pages/orderDetail/orderDetail.vue index 07c7632..4fb03bd 100644 --- a/pages/orderDetail/orderDetail.vue +++ b/pages/orderDetail/orderDetail.vue @@ -156,6 +156,7 @@ export default { }) }, back() { + let that = this cancelOrder(that.orderDetail.orderInfo.orderNumber).then(res=>{ console.log(res) }).catch(err=>{ diff --git a/pages/shoppingCar/shoppingCar.vue b/pages/shoppingCar/shoppingCar.vue index 2049031..989127f 100644 --- a/pages/shoppingCar/shoppingCar.vue +++ b/pages/shoppingCar/shoppingCar.vue @@ -78,7 +78,7 @@ export default { }; }, onShow(params) { - debugger + //debugger const allTicket = uni.getStorageSync('ALL_TICKET'); const oldTicket = uni.getStorageSync('oldTicket') console.log(oldTicket) @@ -89,8 +89,10 @@ export default { console.log(allTicket) allTicket.forEach((i) => { // i.disablePlus = false + const priceInCents = Math.round(Number(i.settlementPrice) * 100); + const quantity = Number(i.num); allSum += i.num; - allPrice += i.num * i.settlementPrice; + allPrice += quantity * priceInCents/100; }); this.ticketList = allTicket; this.ticketSum = allSum; @@ -100,9 +102,11 @@ export default { const index = allTicket.findIndex(i => Number(i.id) == Number(oldTicket.id) && i.date == oldTicket.date);//需要更新的索引 allTicket.splice(index, 1, oldTicket) allTicket.forEach((i) => { + const priceInCents = Math.round(Number(i.settlementPrice) * 100); + const quantity = Number(i.num); // i.disablePlus = false allSum += i.num; - allPrice += i.num * i.settlementPrice; + allPrice += quantity * priceInCents/100; }); this.ticketList = allTicket; this.ticketSum = allSum; @@ -125,23 +129,23 @@ export default { ticketList: { handler(val) { - console.log(val); let obj = {}; let allSum = 0, allPrice = 0; val.forEach((item) => { - debugger + //debugger obj.ticketId = item.id; obj.ticketName = item.ticketname; obj.num = item.num; obj.ticketPrice = item.settlementPrice; obj.date = item.date; obj.visitorInfoList = item.visitorInfoList - + const priceInCents = Math.round(Number(item.settlementPrice) * 100); + const quantity = Number(item.num); allSum += item.num; - allPrice += Number(item.num) * Number(item.settlementPrice); - + allPrice += Number(item.num) * Math.round(Number(item.settlementPrice) * 100)/100; + console.log(allPrice); }); uni.setStorageSync('ALL_TICKET', val); @@ -160,7 +164,7 @@ export default { methods: { getMaxValue(item) { - debugger + //debugger if (item.inventorySettings == 1) { // 如果库存不限,则不设置最大值 return Number.MAX_SAFE_INTEGER; @@ -198,7 +202,7 @@ export default { orderPrice: this.priceSum, settlementAmount: this.priceSum, }; - debugger + //debugger uni.showLoading({ title: '请等待...' }); @@ -214,7 +218,9 @@ export default { }) }, sumPrice(val) { - return val.num * val.settlementPrice; + const priceInCents = Math.round(Number(val.settlementPrice) * 100); + const quantity = Number(val.num); + return quantity * priceInCents/100; }, overlimit(val) { console.log(val); @@ -227,7 +233,7 @@ export default { if (e.value >= 1) { //不限库存 if (itm.inventorySettings == 1) { - debugger + //debugger //无需游客信息/需要一个游客信息 if (itm.touristInformation == 1 || itm.touristInformation == 2) { itm.num = e.value @@ -235,7 +241,7 @@ export default { } //需要全部游客信息 if (itm.touristInformation == 3) { - debugger + //debugger uni.setStorageSync('oldTicket', itm) uni.setStorageSync('ALL_TICKET', that.ticketList) const data = JSON.stringify(itm) @@ -246,7 +252,7 @@ export default { } //总库存 if (itm.inventorySettings == 2) { - debugger + //debugger //无需游客信息/需要一个游客信息 if (itm.touristInformation == 1 || itm.touristInformation == 2) { // const filteredItems = that.ticketList.filter(item => item.id == itm.id && item.date == itm.date); @@ -311,7 +317,7 @@ export default { } //日库存 if (itm.inventorySettings == 3) { - debugger + //debugger //无需游客信息/需要一个游客信息 if (itm.touristInformation == 1 || itm.touristInformation == 2) { // if (Number(itm.num) >= Number(itm.rkc)) { diff --git a/pages/shoppingTrolley/shoppingTrolley.vue b/pages/shoppingTrolley/shoppingTrolley.vue index ca94a5a..3021c8e 100644 --- a/pages/shoppingTrolley/shoppingTrolley.vue +++ b/pages/shoppingTrolley/shoppingTrolley.vue @@ -146,21 +146,25 @@ export default { this.ticketSumPrice = 0; if (Array.isArray(val) && val.length > 0) { val.forEach((i) => { + const priceInCents = Math.round(Number(i.settlementPrice) * 100); + const quantity = Number(i.num); this.ticketSumNum += i.num; - this.ticketSumPrice += i.num * i.settlementPrice; + this.ticketSumPrice += quantity * priceInCents/100; }); } - } + }, } }, onShow() { - debugger + //debugger const allTicket = uni.getStorageSync('ALL_TICKET'); - + if (allTicket && Array.isArray(allTicket) && allTicket.length > 0) { this.car = allTicket }else{ this.car = [] + this.ticketSumNum = 0; + this.ticketSumPrice = 0; } }, onReady() { @@ -243,7 +247,7 @@ export default { calendarConfirm(e) { let that = this; console.log(e); - debugger; + //debugger; //不限库存 if (that.selectItem.inventorySettings == 1) { @@ -302,12 +306,12 @@ export default { if (that.selectItem.touristInformation == 1) { if (that.car.length > 0) { - debugger; + //debugger; console.log(that.car, 'car里的数据'); index = that.car.findIndex((items) => Number(items.id) == Number(that.selectItem.id) && items.date == e.fulldate); if (index != -1) { - debugger; + //debugger; const currentNum = that.car[index].num; if (Number(that.selectItem.currentinventory) - currentNum >= 1) { @@ -334,7 +338,7 @@ export default { } } else { - debugger; + //debugger; const newItem = { ...that.selectItem, num: 1, date: e.fulldate, zkc: that.selectItem.currentinventory }; // that.$set(that.car, that.car.length, that.selectItem); that.car.push(newItem); @@ -346,7 +350,7 @@ export default { //需要一个游客信息/需要全部游客信息 if (that.selectItem.touristInformation == 2 || that.selectItem.touristInformation == 3) { if (that.car.length > 0) { - debugger; + //debugger; console.log('that.selectItem.id:', that.selectItem.id); console.log('e.fulldate:', e.fulldate); console.log('that.car:', that.car); @@ -398,7 +402,7 @@ export default { //日库存 if (that.selectItem.inventorySettings == 3) { let index; - debugger + //debugger const cartItem = that.car.find((item) => Number(item.id) == Number(that.selectItem.id) && item.date == e.fulldate); const cartQuantity = cartItem ? cartItem.num : 0; @@ -421,7 +425,7 @@ export default { index = that.car.findIndex((items) => Number(items.id) == Number(that.selectItem.id) && items.date == e.fulldate); console.log('index:', index); if (index != -1) { - debugger; + //debugger; const currentNum = that.car[index].num; // 创建一个新的对象,并设置num为当前值加1 @@ -430,7 +434,7 @@ export default { that.$set(that.car, index, newItem); uni.setStorageSync('ALL_TICKET', that.car) } else { - debugger; + //debugger; const newItem = { ...that.selectItem, num: 1, date: e.fulldate, rkc: inventory }; // that.$set(that.car, that.car.length, that.selectItem); that.car.push(newItem); @@ -443,7 +447,7 @@ export default { index = that.car.findIndex((items) => Number(items.id) == Number(that.selectItem.id) && items.date == e.fulldate); console.log('index:', index); if (index != -1) { - debugger; + //debugger; const currentNum = that.car[index].num; // 创建一个新的对象,并设置num为当前值加1 @@ -455,7 +459,7 @@ export default { url: '/pages/addUserinfo/addUserinfo?needInfoItem=' + data + '&event=' + eve }) } else { - debugger; + //debugger; const newItem = { ...that.selectItem, num: 1, date: e.fulldate, rkc: inventory }; const data = JSON.stringify(newItem) const eve = JSON.stringify(that.event) @@ -538,18 +542,19 @@ export default { item.btnLoading = true; let that = this; //有效期模式, - debugger; + //debugger; if (item.datesettings == 1) { - const date = this.parseTime(new Date(),'{y}-{m}-{d}') + const date = this.parseTime(new Date(),'{y}-{m}-{d}') item.date = date // 不限库存 if (item.inventorySettings == 1) { //无需游客信息 if (item.touristInformation == 1) { - item.num += 1; if (that.car.length > 0) { const index = that.car.findIndex((items) => Number(items.id) == Number(item.id)); if (index !== -1) { + that.car[index].num+=1 + item.num = that.car[index].num // 使用 Vue.set 或 that.$set 来保证响应式 that.$set(that.car, index, item); uni.setStorageSync('ALL_TICKET', that.car) @@ -612,11 +617,11 @@ export default { if (item.touristInformation == 1) { if (Number(item.currentinventory) > item.num) { //没超过总库存 - item.num += 1; - if (that.car.length > 0) { const index = that.car.findIndex((items) => Number(items.id) == Number(item.id)); if (index !== -1) { + that.car[index].num+=1 + item.num = that.car[index].num // 使用 Vue.set 或 that.$set 来保证响应式 that.$set(that.car, index, item); uni.setStorageSync('ALL_TICKET', that.car) diff --git a/uni_modules/wu-calendar/components/wu-calendar/wu-calendar.vue b/uni_modules/wu-calendar/components/wu-calendar/wu-calendar.vue index c61445b..ce40b32 100644 --- a/uni_modules/wu-calendar/components/wu-calendar/wu-calendar.vue +++ b/uni_modules/wu-calendar/components/wu-calendar/wu-calendar.vue @@ -309,7 +309,7 @@ }, selected: { handler(newVal) { - debugger + //debugger this.cale.setSelectInfo(this.nowDate.fullDate, newVal) this.assignmentWeeks() // 找出目前的信息weeks 并 将 this.calendar重新赋值