From 672b78150f9fec76517287b9f7f381d4bc3c02c3 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Fri, 17 Jan 2025 12:15:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/model/info.js | 7 ++++ components/couponList/couponList.vue | 3 ++ components/couponPopup/couponPopup.vue | 15 +++++--- config.js | 2 +- pages/index/category.vue | 63 ++++++++++++++++++++++------------ pages/index/order.vue | 9 +++-- 6 files changed, 69 insertions(+), 30 deletions(-) diff --git a/api/model/info.js b/api/model/info.js index fdbc62c..a695abd 100644 --- a/api/model/info.js +++ b/api/model/info.js @@ -103,6 +103,13 @@ const api = { url: '/info_common/getCartPageList', method: 'GET', }, + // 领取新人优惠券 + getRiceCoupon: { + url: '/info_common/getRiceCoupon', + method: 'GET', + limit: 500, + auth: true, + }, } export default api \ No newline at end of file diff --git a/components/couponList/couponList.vue b/components/couponList/couponList.vue index b3bced2..0db611d 100644 --- a/components/couponList/couponList.vue +++ b/components/couponList/couponList.vue @@ -83,6 +83,9 @@ //格式化年月日 formatDate(date) { + if(!date){ + return '' + } date = new Date(date.replace(/-/g,'/')); // const year = date.getFullYear(); const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1,并且确保是两位数 diff --git a/components/couponPopup/couponPopup.vue b/components/couponPopup/couponPopup.vue index e82a924..1fa604e 100644 --- a/components/couponPopup/couponPopup.vue +++ b/components/couponPopup/couponPopup.vue @@ -5,10 +5,11 @@ customStyle="background-color: transparent;" :z-index="999999"> - + - @@ -20,7 +21,7 @@ (购物即可抵扣!) - @@ -48,8 +49,12 @@ //跳转优惠券页面 toCoupon() { this.$refs.couponPopup.close() - uni.navigateTo({ - url: "/pages_order/mine/coupon" + this.$api('getRiceCoupon', res => { + if(res.code == 200){ + uni.navigateTo({ + url: "/pages_order/mine/coupon" + }) + } }) }, close(){ diff --git a/config.js b/config.js index 1660015..8ece511 100644 --- a/config.js +++ b/config.js @@ -6,7 +6,7 @@ import uvUI from '@/uni_modules/uv-ui-tools' Vue.use(uvUI); // 当前环境 -const type = 'dev' +const type = 'prod' // 环境配置 diff --git a/pages/index/category.vue b/pages/index/category.vue index b724dfd..3a007bd 100644 --- a/pages/index/category.vue +++ b/pages/index/category.vue @@ -25,27 +25,41 @@ + + + + + - - - - - {{ item.name }} - - - - - - - - + + + + @@ -73,6 +87,7 @@ return { mixinsListApi: 'getClassShopPageList', current : 0, + currentChildren : 0, } }, computed: { @@ -100,7 +115,11 @@ methods: { change(e) { // this.queryParams.classId = this.category[e].id - this.current = e + this.currentChildren = e + }, + clickTabs({index}){ + this.current = index + this.currentChildren = 0 }, search(){ for(let i = 0;i < 10;i++){ @@ -116,15 +135,15 @@