diff --git a/framework/0-conf.js b/framework/0-conf.js index 22a4322..485d7f3 100644 --- a/framework/0-conf.js +++ b/framework/0-conf.js @@ -5,16 +5,17 @@ const proxyApi = "/api" // #ifdef MP-WEIXIN || APP // const proxyApi = 'http://192.168.2.133:9889/cashierService' // 王伟 // const proxyApi = 'http://101.37.12.135:9889/cashierService' // 帆哥 -const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' +const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试 +const proxyApiwws = 'ws://wxcashiertest.sxczgkj.cn/cashierService' // 测试 // #endif // #ifdef H5 const baseUrl = debug ? proxyApi : "https://wxcashiertest.sxczgkj.cn/cashierService" -const baseUrlwws = 'wss://cashier.sxczgkj.cn/cashierService' // 线上 +const baseUrlwws = 'ws://cashier.sxczgkj.cn/cashierService' // #endif // #ifdef APP || MP-WEIXIN -const baseUrl = debug ? proxyApi : 'https://wxcashiertest.sxczgkj.cn/cashierService' -const baseUrlwws = 'wss://wxcashiertest.sxczgkj.cn/cashierService' // 线上 +const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.cn/cashierService'// 线上 +const baseUrlwws = debug ? proxyApiwws : 'wss://cashier.sxczgkj.cn/cashierService' // 线上 // #endif // import VConsole from "./vConsole.js" diff --git a/framework/11-api.js b/framework/11-api.js index e7b6c31..8d9dbb0 100644 --- a/framework/11-api.js +++ b/framework/11-api.js @@ -92,10 +92,13 @@ async function request(options) { title: res.message || res.msg, icon: "none", success: () => { - uni.cache.clear(); - uni.redirectTo({ - url: '/pages/login/login' - }); + setTimeout(res => { + uni.cache.clear(); + uni.redirectTo({ + url: '/pages/login/login' + }); + }, 1000) + } }) } else if (res.code == 482) { diff --git a/pages/index/coupons/index.vue b/pages/index/coupons/index.vue index 2e23a03..fa30219 100644 --- a/pages/index/coupons/index.vue +++ b/pages/index/coupons/index.vue @@ -6,7 +6,8 @@ 可使用红包 {{totalnumber}}张 - + + :key="index1" @click="clickicon(item1)"> @@ -81,7 +82,7 @@ - + @@ -113,16 +114,53 @@ size: 10, //页容量 status: 'loadmore' }, - + orderfood: '', //等于0扫码点餐下单 + amount: '' //下单金额传来的值 }; }, + onLoad(e) { + try { + this.orderfood = e.orderfood //等于0扫码点餐下单 + this.amount = e.amount + } catch (e) { + //TODO handle the exception + } + }, onShow() { this.ordermineCouponsthis() this.ordergetYhqParass() }, methods: { - clickicon(e){ + clickicon(e) { //团购优惠卷 this.item1id = e.id + e.clickiconone = 1 + let data = e + if (this.orderfood == 0) { //等于0扫码点餐下单 + if (this.amount > e.couponsAmount) { + uni.$emit('emitclickorderfood', e) + uni.navigateBack() + } else { + uni.showToast({ + title: '此优惠卷不能用于目前订单', + icon: "none", + }) + } + } + }, + clickiconone(e) { //自己优惠劵处理 + e.clickiconone = 0 + let data = e + if (this.orderfood == 0) { //等于0扫码点餐下单 + if (this.amount > e.couponsAmount) { + uni.$emit('emitclickorderfood', data) + uni.navigateBack() + } else { + uni.showToast({ + title: '此优惠卷不能用于目前订单', + icon: "none", + }) + } + } }, async ordergetYhqParass() { //类型列表 let res = await this.api.ordergetYhqPara() diff --git a/pages/order_detail/order_detail.vue b/pages/order_detail/order_detail.vue index 4d62408..50885c1 100644 --- a/pages/order_detail/order_detail.vue +++ b/pages/order_detail/order_detail.vue @@ -1,6 +1,6 @@