diff --git a/api/advanceOrder/index.js b/api/advanceOrder/index.js index 6a079ba..69e4eca 100644 --- a/api/advanceOrder/index.js +++ b/api/advanceOrder/index.js @@ -111,10 +111,14 @@ export function syncPayStateApi(data) { }) } - - - - +//获取取餐柜/生鲜柜 +export function getCounterBypageApi(data) { + return request({ + url: '/smart-canteen/api/v1/applet/machine/getCounterBypage', + method: 'get', + params:data + }) +} diff --git a/api/index/index.js b/api/index/index.js index 8199b07..90c3cff 100644 --- a/api/index/index.js +++ b/api/index/index.js @@ -15,7 +15,7 @@ export function getWalletBalanceAPI(data) { */ export function getOrderQRCodeAPI(data) { return request({ - url: '/smart-canteen/custInfo/getOrderQRCode', + url: '/smart-canteen/custInfo/get-yst-timestamp', method: 'post', data }) diff --git a/api/mine/index.js b/api/mine/index.js index 6fb9ece..d86c2b7 100644 --- a/api/mine/index.js +++ b/api/mine/index.js @@ -144,5 +144,12 @@ export function rebindMobileApi(data) { } - +//app端电子券列表 +export function couponMobileGroupApi(data) { + return request({ + url: '/smart-canteen/api/v2/mkt/coupon/list-electron-mobile-group', + method: 'post', + data + }) +} diff --git a/pages.json b/pages.json index 20a15cc..07bd192 100644 --- a/pages.json +++ b/pages.json @@ -275,6 +275,12 @@ "navigationBarTitleText": "历史记录" } }, + { + "path": "pages/mine/coupon/index", + "style": { + "navigationBarTitleText": "我的卡券" + } + }, { "path": "pages/review/index", "style": { diff --git a/pages/code/index.vue b/pages/code/index.vue index 3794382..0633aed 100644 --- a/pages/code/index.vue +++ b/pages/code/index.vue @@ -17,7 +17,7 @@ :data="qrCodeUrl" > - 有效时间15分钟 + @@ -31,22 +31,31 @@ export default { data() { return { + timer:null, fontValue:uni.getStorageSync('fontSize') || 8, custName:uni.getStorageSync('custName'), - qrCodeUrl:"" // 替换为实际的二维码URL + qrCodeUrl:`xnzn{\"s\":1,\"y\":3,\"p\":\"${uni.getStorageSync('custId')}\",\"t\":\"${uni.getStorageSync('codeTime')}\"}`// 替换为实际的二维码URL }; }, - onShow() { - this.getOrderQRCodeData() + onLoad() { + this.timer = setInterval(() => { + console.log("codeTime") + this.getOrderQRCodeData() + }, 4000) + }, + onUnload() { + clearInterval(this.timer) + this.timer = null; + uni.navigateBack() }, methods: { // 获取二维码 async getOrderQRCodeData() { const res = await getOrderQRCodeAPI({ "custId":uni.getStorageSync('custId') }) - console.log(res, '二维码信息--') - if(res.code==200){ - this.qrCodeUrl=res.msg; - } + uni.setStorageSync("codeTime",res); + this.qrCodeUrl = `xnzn{\"s\":1,\"y\":3,\"p\":\"${uni.getStorageSync('custId')}\",\"t\":\"${uni.getStorageSync('codeTime')}\"}` + // console.log(res, '二维码信息--') + }, refreshQrCode() { // 模拟刷新二维码 diff --git a/pages/index.vue b/pages/index.vue index 1827b03..301511e 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -185,13 +185,15 @@ export default { } }, onLoad() { - this.getUserInfo() - this.getWalletBalanceData(uni.getStorageSync('custId') || '') - this.getOrderQRCodeData(uni.getStorageSync('custId') || '') - this.getUnReadNoticeNum() this.timer = setInterval(() => { - this.getWalletBalanceData(uni.getStorageSync('custId')||'') - }, 10000) + this.getOrderQRCodeData() + }, 30000) + }, + onShow() { + this.getUserInfo() + this.getWalletBalanceData() + this.getUnReadNoticeNum() + this.getOrderQRCodeData() }, onUnload() { clearInterval(this.timer) @@ -254,9 +256,9 @@ export default { }) }, // 获取钱包余额 - async getWalletBalanceData(custId) { + async getWalletBalanceData() { let param = { - "custId": custId.toString(), + "custId": uni.getStorageSync('custId'), "openid": uni.getStorageSync('openId'), "sourceType": "1" } @@ -265,9 +267,9 @@ export default { // console.log(res, '余额信息--') }, // 获取二维码 - async getOrderQRCodeData(custId) { - const res = await getOrderQRCodeAPI({ custId }) - // console.log(res, '二维码信息--') + async getOrderQRCodeData() { + const res = await getOrderQRCodeAPI({ "custId":uni.getStorageSync('custId') }) + uni.setStorageSync("codeTime",res); }, //通知消息数量 async getUnReadNoticeNum() { diff --git a/pages/login.vue b/pages/login.vue index 5a7bebb..351486c 100644 --- a/pages/login.vue +++ b/pages/login.vue @@ -171,7 +171,7 @@ export default { // this.getCode() // } }) - this.$tab.reLaunch('/pages/system') + // this.$tab.reLaunch('/pages/system') }, // 登录成功后,处理函数 loginSuccess(result) { diff --git a/pages/mine/coupon/index.vue b/pages/mine/coupon/index.vue new file mode 100644 index 0000000..df2d3e4 --- /dev/null +++ b/pages/mine/coupon/index.vue @@ -0,0 +1,344 @@ + + + + + diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 31683c5..44fe0e3 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -62,6 +62,14 @@ 健康监测 + + + + + + + 电子餐券 + diff --git a/pages/work/details.vue b/pages/work/details.vue index f2c778d..61985b1 100644 --- a/pages/work/details.vue +++ b/pages/work/details.vue @@ -11,7 +11,7 @@ 您对本单满意吗? - + 退单 + ¥{{ (Number(item.salePrice/100)*item.quantity).toFixed(2) }} + + + x{{ item.quantity }} + 已退款¥{{ (item.refundAmount/100).toFixed(2) }} + + + + + 订单金额 + ¥{{ (detailData.realAmount/100).toFixed(2) }} + 配送费 {{ detailData.deliveryAmount>0? "¥"+(detailData.deliveryAmount/100).toFixed(2):"免配送费" }} @@ -67,11 +75,8 @@ 优惠金额 -¥{{ (detailData.discountsAmount/100).toFixed(2) }} - - 订单金额 - ¥{{ (detailData.payableAmount/100).toFixed(2) }} - - + + 退款金额 ¥{{ (detailData.refundAmount/100).toFixed(2) }} diff --git a/static/images/my/cancellation.png b/static/images/my/cancellation.png new file mode 100644 index 0000000..619449f Binary files /dev/null and b/static/images/my/cancellation.png differ diff --git a/static/images/my/coupon.png b/static/images/my/coupon.png new file mode 100644 index 0000000..f47da6c Binary files /dev/null and b/static/images/my/coupon.png differ diff --git a/static/images/my/expired.png b/static/images/my/expired.png new file mode 100644 index 0000000..70439f4 Binary files /dev/null and b/static/images/my/expired.png differ diff --git a/static/images/my/notTakeEffect.png b/static/images/my/notTakeEffect.png new file mode 100644 index 0000000..cfd079d Binary files /dev/null and b/static/images/my/notTakeEffect.png differ diff --git a/static/images/my/used.png b/static/images/my/used.png new file mode 100644 index 0000000..ab7aecf Binary files /dev/null and b/static/images/my/used.png differ