diff --git a/pages.json b/pages.json index 5652a92..b018799 100644 --- a/pages.json +++ b/pages.json @@ -223,6 +223,13 @@ "navigationBarTitleText": "全部订单" } }, + { + "path": "order/orderDetail", + "style": { + "navigationBarTitleText": "订单详情", + "navigationStyle": "custom" + } + }, { "path": "homestay/index", "style": { diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue index 765e1ac..76282f3 100644 --- a/pages/cart/cart.vue +++ b/pages/cart/cart.vue @@ -16,13 +16,12 @@ 删除 - + - + {{goods.sku.use_type==1?"自提":goods.sku.use_type==2?"核销": goods.sku.use_type==3?"邮寄或自提":"邮寄"}} @@ -218,7 +217,7 @@ if (v.sku.flag== "off") { v.is_seld = false } else { - if (v.product.type == 'hotel'&&(!v.strat_time||!v.end_time)) { + if (v.product.type == 'hotel'&&(!v.startDay||!v.endDay)) { v.is_seld = false } else { v.is_seld = true @@ -241,7 +240,7 @@ if (v.sku.flag== "off") { v.is_seld = false } else { - if (v.product.type == 'hotel'&&(!v.strat_time||!v.end_time)) { + if (v.product.type == 'hotel'&&(!v.startDay||!v.endDay)) { v.is_seld = false } else { v.is_seld = true @@ -263,7 +262,7 @@ if (item.sku.flag== "off") { item.is_seld = false } else { - if (item.product.type == 'hotel'&&(!item.strat_time||!item.end_time)) { + if (item.product.type == 'hotel'&&(!item.startDay||!item.endDay)) { item.is_seld = false uni.showToast({ title:'酒店产品需要选择时间', @@ -322,6 +321,7 @@ judgeHotelTime (data) { this.$set(this.selectHotel, "startDay", data.startDay) this.$set(this.selectHotel, "endDay", data.endDay) + this.$set(this.selectHotel, "differDays", data.differDays) this.$refs.calendarPopup.close(); return this.Post({ @@ -332,6 +332,7 @@ if (res && res.code && res.data) { this.$set(this.selectHotel, "startDay", data.startDay) this.$set(this.selectHotel, "endDay", data.endDay) + this.$set(this.selectHotel, "differDays", data.differDays) this.$refs.calendarPopup.close(); } else { uni.showToast({ @@ -382,7 +383,17 @@ sInfo: {...v.sku, buyNum: v.num} }) } else if (v.product.type == "hotel") { - hotelOrderList.push(v) + console.log(v) + v.sku.selectDate = { + startDay: v.startDay, + endDay: v.endDay, + differDays: v.differDays + } + v.sku.buyNum = v.num + v.allSeldDate = [] + hotelOrderList.push({ + skuInfo: v.sku + }) } }) @@ -391,6 +402,7 @@ this.$store.commit("changeTicketOrderList", ticketOrderList); this.$store.commit("changeFoodOrderList", foodOrderList); this.$store.commit("changeHotelOrderList", hotelOrderList); + uni.setStorageSync('hotelOrderInfo', JSON.stringify(hotelOrderList)) // 邮寄 > 门票 > 农家乐 > 酒店 this.goCartNextPage(0) diff --git a/pages/index/index.vue b/pages/index/index.vue index 2bd2014..319a86f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -124,7 +124,7 @@ this.gotoDetailByType(item.product_model) break; case 2: - this.gotoPath(item.tdata.url) + this.gotoPath(item.front_model.inside) break; case 3: this.gotoWebUrl(item.tdata.url) diff --git a/pages/login/login.vue b/pages/login/login.vue index 5ab064a..549692a 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -27,6 +27,7 @@ export default { data() { return { isAgreed: false, + openid: '' }; }, onLoad(options) { @@ -46,10 +47,10 @@ export default { code: e.detail.code, encryptedData: e.detail.encryptedData, iv: e.detail.iv, - token: uni.getStorageSync('token1') - }, '/api/mini_program/bindPhoneNumber') + openid: this.openid + }, '/api/uservice/user/bindPhoneNumber') .then(res => { - this.$store.commit('changeUserInfo', res.data.userinfo); + this.$store.commit('changeUserInfo', res.data); this.navigateBasedOnPath(); }) .catch(error => { @@ -107,11 +108,11 @@ export default { loginType: 3 }, '/api/uservice/user/wxLogin') .then(resTwo => { - this.$store.commit('changeUserInfo', resTwo.data.userinfo); - if (resTwo.data.userinfo.mobile) { + this.$store.commit('changeUserInfo', resTwo.data); + if (resTwo.data.isBindMobile) { this.navigateBasedOnPath(); } else { - uni.setStorageSync('token1', resTwo.data.userinfo.token); + this.openid = resTwo.data.openid this.$refs.popup.open('bottom'); } }) diff --git a/pages/user/user.vue b/pages/user/user.vue index ec2bca9..a2a76a6 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -10,7 +10,7 @@ class="headImg" v-else> {{userInfo.nickname}} - 请登录/注册 > + 请登录/注册 > 个人信息 diff --git a/static/js/CommonFunction.js b/static/js/CommonFunction.js index 8a7dc85..06d7dcb 100644 --- a/static/js/CommonFunction.js +++ b/static/js/CommonFunction.js @@ -251,7 +251,7 @@ Vue.prototype.gotoWebUrl = url => { Vue.prototype.gotoDetailByType = item => { let url = '' if(item.is_package) { - url = '/subPackages/food/detail?id=' + item.id + url = '/subPackages/food/detail?id=' + item.product_id Vue.prototype.gotoPath(url) return; @@ -267,7 +267,7 @@ Vue.prototype.gotoDetailByType = item => { url = '/subPackages/ticket/detail?id=' + (item.scene_id || item.id) break; case 'post': - url = '/subPackages/techan/detail?id=' + item.id + url = '/subPackages/techan/detail?id=' + (item.product_id || item.id) break; default: break; diff --git a/subPackages/homestay/order.vue b/subPackages/homestay/order.vue index 2889b00..38bb9ba 100644 --- a/subPackages/homestay/order.vue +++ b/subPackages/homestay/order.vue @@ -309,6 +309,8 @@ } ] } + + console.log('data',data) this.Post({ method: 'POST', @@ -316,13 +318,12 @@ }, '/api/order/create').then(res => { console.log('成功'); if (res.code == 1) { - return; uni.removeStorageSync('hotelOrderInfo') this.Post({ order_id: res.data.order_id, - type: "miniprogram", - platform: 'miniprogram' - }, '/api/pay/unify').then(res => { + pay_platform: "miniprogram", + pay_method: 'abc' + }, '/api/order/pay').then(res => { if (res.data) { uni.requestPayment({ nonceStr: res.data.nonceStr, diff --git a/subPackages/line/order.vue b/subPackages/line/order.vue index 15c6dd7..33eb19e 100644 --- a/subPackages/line/order.vue +++ b/subPackages/line/order.vue @@ -218,11 +218,13 @@ return; } const info = this.getPriceInfo(selectMonth, day); - if (info && info.product_price && info.product_price !== null && info.stock !== 0) { + console.log(info) + if (info && info.stock !== 0) { info.selectMonth = selectMonth; info.selectDate = day; this.selectDate = info; } + this.$forceUpdate() }, // 减少数量 minus(index) { diff --git a/subPackages/line/orders.vue b/subPackages/line/orders.vue index 3918ef3..32ffc9d 100644 --- a/subPackages/line/orders.vue +++ b/subPackages/line/orders.vue @@ -254,8 +254,6 @@ data: JSON.stringify(data), method: 'POST', },'/api/order/create').then(res => { - console.log(res) - return; if(res.code == 1) { let order_id = res.data.order_id this.$store.commit("changeLineInfo", null); @@ -263,9 +261,9 @@ this.Post({ order_id: order_id, - type: "miniprogram", - platform: 'miniprogram' - }, '/api/pay/unify').then(res => { + pay_platform: "miniprogram", + pay_method: 'abc' + }, '/api/order/pay').then(res => { if (res.data) { uni.requestPayment({ nonceStr: res.data.nonceStr, diff --git a/subPackages/order/orderDetail.vue b/subPackages/order/orderDetail.vue new file mode 100644 index 0000000..8534a4a --- /dev/null +++ b/subPackages/order/orderDetail.vue @@ -0,0 +1,671 @@ + + + + + \ No newline at end of file diff --git a/subPackages/order/trades.vue b/subPackages/order/trades.vue index b66a2c0..7954d0d 100644 --- a/subPackages/order/trades.vue +++ b/subPackages/order/trades.vue @@ -1,678 +1,768 @@ \ No newline at end of file diff --git a/subPackages/techan/order.vue b/subPackages/techan/order.vue index 9f6d83f..453d990 100644 --- a/subPackages/techan/order.vue +++ b/subPackages/techan/order.vue @@ -508,10 +508,10 @@ export default { this.Post( { order_id: res.data.order_id, - type: 'miniprogram', - platform: 'miniprogram' + pay_platform: "miniprogram", + pay_method: 'abc' }, - '/api/pay/unify' + '/api/order/pay' ).then(res => { if (res.data) { uni.requestPayment({ @@ -520,10 +520,7 @@ export default { paySign: res.data.paySign, signType: res.data.signType, timeStamp: res.data.timeStamp, - success: () => { - this.getSubscribeMessage() - }, - fail() { + complete: () => { uni.navigateTo({ url: '/subPackages/order/trades' }) diff --git a/subPackages/ticket/order.vue b/subPackages/ticket/order.vue index c19dbb3..ee4139f 100644 --- a/subPackages/ticket/order.vue +++ b/subPackages/ticket/order.vue @@ -470,9 +470,9 @@ this.$store.commit("choseCoupon", ""); this.Post({ order_id: order_id, - type: "miniprogram", - platform: 'miniprogram' - }, '/api/pay/unify').then(res => { + pay_platform: "miniprogram", + pay_method: 'abc' + }, '/api/order/pay').then(res => { if (res.data) { uni.requestPayment({ nonceStr: res.data.nonceStr, @@ -480,13 +480,8 @@ paySign: res.data.paySign, signType: res.data.signType, timeStamp: res.data.timeStamp, - success: () => { - this.getSubscribeMessage() - }, - fail() { - uni.navigateTo({ - url: '/subPackages/order/trades' - }) + complete: () => { + this.gotoPath('/subPackages/order/trades') } }) }