From 4e38320e3ac499b47fd94b979599d3dbfd825c37 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Sat, 2 Mar 2024 16:34:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A1=A5=E8=B4=B4,=E6=89=AB?= =?UTF-8?q?=E7=A0=81=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/payment/get_payment.vue | 2 +- pages/store/home/index.vue | 17 ++++++++++++++--- pages/users/login/login_copy.vue | 30 +++++++++++++++++++----------- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/pages/payment/get_payment.vue b/pages/payment/get_payment.vue index e94019e..384307f 100644 --- a/pages/payment/get_payment.vue +++ b/pages/payment/get_payment.vue @@ -110,7 +110,7 @@ }, onShow() { if (!this.isLogin) { - Cache.set("login_back_url_weixin", getCurrentPages()[0].route + "?mer_id=" + this.mer_id); + Cache.set("login_back_url_weixin", "/" + getCurrentPages()[0].route + "?mer_id=" + this.mer_id); this.isAuto = true; this.isShowAuth = true; } else { diff --git a/pages/store/home/index.vue b/pages/store/home/index.vue index a97202a..fa82d8a 100644 --- a/pages/store/home/index.vue +++ b/pages/store/home/index.vue @@ -572,6 +572,7 @@ page: 1, limit: 10 }, + mer_cate_id: '', // 下拉菜单 select: { show: false, @@ -737,6 +738,7 @@ }, onLoad: function(options) { this.isLihaiYun = options.LihaiYun // 是否是里海云仓 + this.mer_cate_id = options.mer_cate_id this.type = parseInt(options.type) || 3 this.id = options.mer_id || options.id || 0; this.isCoupon = options.coupon || 0; @@ -833,7 +835,10 @@ if (that.goodsLoading) return; that.goodsLoading = true; that.loadTitle = ''; - getProductSpuAPI(that.id, that.where).then(res => { + getProductSpuAPI(that.id, { + ...that.where, + mer_cate_id: that.mer_cate_id + }).then(res => { that.goodsLoading = false; let list = res.data.list; let goodsList = that.$util.SplitArray(list, that.goods); @@ -960,7 +965,10 @@ that.goodsLoading = true; that.loadTitle = ''; that.where.product_type = '' - storeServiceList(that.id, that.where).then(res => { + storeServiceList(that.id, { + ...that.where, + mer_cate_id: that.mer_cate_id + }).then(res => { that.goodsLoading = false; let list = res.data.list; let productList = that.$util.SplitArray(list, that.productList); @@ -1047,7 +1055,10 @@ if (that.goodsLoading) return; that.goodsLoading = true; that.loadTitle = ''; - getStoreGoods(that.id, that.where).then(res => { + getStoreGoods(that.id, { + ...that.where, + mer_cate_id: that.mer_cate_id + }).then(res => { that.goodsLoading = false; let list = res.data.list; let goodsList = that.$util.SplitArray(list, that.goods); diff --git a/pages/users/login/login_copy.vue b/pages/users/login/login_copy.vue index ffce2df..c736d04 100644 --- a/pages/users/login/login_copy.vue +++ b/pages/users/login/login_copy.vue @@ -347,8 +347,9 @@ import { Toast } from "../../../libs/uniApi"; }).then(({ data }) => { - const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index"; + const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; that.$Cache.clear(BACK_URL); + that.$Cache.clear('login_back_url_weixin'); that.$store.commit("LOGIN", { 'token': data.token, 'time': data.exp @@ -465,8 +466,9 @@ import { Toast } from "../../../libs/uniApi"; }).then(res => { const data = res.data; if (res.data.status == 200) { - const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index"; + const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; that.$Cache.clear(BACK_URL); + that.$Cache.clear('login_back_url_weixin'); that.$store.commit("LOGIN", { 'token': data.result.token, 'time': data.result.exp @@ -554,8 +556,9 @@ import { Toast } from "../../../libs/uniApi"; }).then(res => { const data = res.data; if (res.data.status == 200) { - const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index"; + const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; that.$Cache.clear(BACK_URL); + that.$Cache.clear('login_back_url_weixin'); that.$store.commit("LOGIN", { 'token': data.result.token, 'time': data.result.exp @@ -648,22 +651,23 @@ import { Toast } from "../../../libs/uniApi"; data }) => { this.checkOpenId(data.user) - const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index"; - that.$Cache.clear(BACK_URL); + const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; that.$store.commit("LOGIN", { 'token': data.token, 'time': data.exp }); that.$store.commit("SETUID", data.user.uid); that.$store.commit('UPDATE_USERINFO', data.user); - - - if(data.is_new_user){ + + if(data.is_new_user && !that.$Cache.get('login_back_url_weixin')){ return uni.navigateTo({ url: '/pages/helpPeople/helpPeople' }) } + that.$Cache.clear(BACK_URL); + that.$Cache.clear('login_back_url_weixin'); + let method let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', '/pages/goods_cate/goods_cate', @@ -734,6 +738,8 @@ import { Toast } from "../../../libs/uniApi"; that.$store.commit("SETUID", res.data.user.uid); that.$store.commit('UPDATE_USERINFO', res.data.user); const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; + that.$Cache.clear(BACK_URL); + that.$Cache.clear('login_back_url_weixin'); let method let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', '/pages/goods_cate/goods_cate', @@ -826,8 +832,7 @@ import { Toast } from "../../../libs/uniApi"; data }) => { this.checkOpenId(data.user) - const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index"; - that.$Cache.clear(BACK_URL); + const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; that.$store.commit("LOGIN", { 'token': data.token, 'time': data.exp @@ -835,12 +840,15 @@ import { Toast } from "../../../libs/uniApi"; that.$store.commit("SETUID", data.user.uid); that.$store.commit('UPDATE_USERINFO', data.user); - if(data.is_new_user){ + if(data.is_new_user && !that.$Cache.get('login_back_url_weixin')){ return uni.navigateTo({ url: '/pages/helpPeople/helpPeople' }) } + that.$Cache.clear(BACK_URL); + that.$Cache.clear('login_back_url_weixin'); + let method let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', '/pages/goods_cate/goods_cate',