From 417b7e0490ba5e42dc9a309e15573d83b5dbcc30 Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Thu, 13 Jul 2023 09:31:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 10 ++-- common/share.js | 11 +++- components/cart-choose/cart-choose.vue | 19 ++++--- pages/goods/externalCoupon/externalCoupon.vue | 10 ++-- pages/goods/store-list/store-details.vue | 7 +++ pages/login/register.vue | 7 +++ pages/tabBar/user/user.vue | 6 +-- pages/user/deposit/deposit.vue | 6 ++- pages/welcome/welcome.vue | 50 +++++++++++++------ 9 files changed, 91 insertions(+), 35 deletions(-) diff --git a/App.vue b/App.vue index dbda976..0cf1d52 100644 --- a/App.vue +++ b/App.vue @@ -81,11 +81,11 @@ const methodToPatch = ['navigateTo', 'redirectTo', 'switchTab', ]; let arr = [ - "/subPages/recharge-centre/recharge-centre",//话费充值 + // "/subPages/recharge-centre/recharge-centre",//话费充值 "/pages/user/mineCoupons/mineCoupons",//卡券中心 "/pages/user/myPromotion/myPromotion",//我的推广 "/subPages/cardsList/cardsList",//卡管理 - "/pages/user/deposit/deposit",//积分充值 + // "/pages/user/deposit/deposit",//积分充值 "/physical-merchants/address/address",//我的地址 "/pages/goods/recording/recording",//积分记录 "../../../subPages/cardsList/cardsList",//卡管理 @@ -96,7 +96,11 @@ "/physical-merchants/classify/cart/cart",//我的购物车 "../order/confirmation",//兑换 - "../coupon-comfirmation/coupon-comfirmation",//天天好券 + "../coupon-comfirmation/coupon-comfirmation",//天天好券,每日好券 + "/pages/goods/refuel-confirm/refuel-confirm",//加油下单 + "../unionComfirmation/unionComfirmation",//话费充值下单 + "/physical-merchants/settleAccounts/settleAccounts",//实物下单 + "../rec-confirmation/rec-confirmation",//会员充值 ]; diff --git a/common/share.js b/common/share.js index b603ef9..5a2f569 100644 --- a/common/share.js +++ b/common/share.js @@ -162,7 +162,7 @@ export default { /* h5分享页面的回退 */ const app = getApp(); let str = uni.getStorageSync("accountType"); - if(str == "0000016&key"){ + // if(str == "0000016&key"){ if(getCurrentPages().length == 2 && getCurrentPages()[0].route == "pages/welcome/welcome"){ uni.switchTab({ @@ -172,7 +172,16 @@ export default { return true; } + // } + + if(getCurrentPages().length == 1){ + uni.switchTab({ + url:"/pages/tabBar/home/home" + }) + return true; } + + return false; }, diff --git a/components/cart-choose/cart-choose.vue b/components/cart-choose/cart-choose.vue index a28bf7c..30cc2bb 100644 --- a/components/cart-choose/cart-choose.vue +++ b/components/cart-choose/cart-choose.vue @@ -234,15 +234,20 @@ if (res.return_code == '000000') { title = "加入购物车成功"; this.$emit("refreshCartNum") + uni.showToast({ + title: title, + icon: 'none', + duration: 2000 + }) }else{ - title = res.return_msg; + // title = res.return_msg; } - uni.showToast({ - title: title, - icon: 'none', - duration: 2000 - }) + // uni.showToast({ + // title: title, + // icon: 'none', + // duration: 2000 + // }) this.chooseNumber = 1; @@ -262,7 +267,7 @@ //立即购买 toBuy(){ - console.log(this.specificationList[this.chooseIndex],this.goodsDetail) + // console.log(this.specificationList[this.chooseIndex],this.goodsDetail) let _this = this let obj =[{ diff --git a/pages/goods/externalCoupon/externalCoupon.vue b/pages/goods/externalCoupon/externalCoupon.vue index 13fb42d..eff2937 100644 --- a/pages/goods/externalCoupon/externalCoupon.vue +++ b/pages/goods/externalCoupon/externalCoupon.vue @@ -215,20 +215,20 @@ setTimeout(()=>{ - /* let res = uni.getStorageSync("user"); + let res = uni.getStorageSync("user"); app.globalData.userInfo = res; console.log(app.globalData.userInfo,"=========app.globalData.userInfo=========") if (app.globalData.userInfo.phone) { this.userInfo = 2; } else { this.userInfo = 1; - } */ + } - uni.getStorage({ + /* uni.getStorage({ key: 'user', success: (res) => { app.globalData.userInfo = res.data; - if (app.globalData.userInfo.phone) { + if (app.globalData.userInfo&&app.globalData.userInfo.phone) { this.userInfo = 2; } else { this.userInfo = 1; @@ -237,7 +237,7 @@ fail() { this.userInfo = 1; } - }); + }); */ },0) diff --git a/pages/goods/store-list/store-details.vue b/pages/goods/store-list/store-details.vue index a8a4db6..a443c66 100644 --- a/pages/goods/store-list/store-details.vue +++ b/pages/goods/store-list/store-details.vue @@ -125,9 +125,16 @@ methods: { //获取登陆信息 getuserinfo() { + // #ifdef MP uni.navigateTo({ url: '../../userLogin/userLogin' }) + // #endif + // #ifdef H5 + uni.navigateTo({ + url: '/pages/login/register' + }) + // #endif }, //查询门店详情 getMerchantStoreById() { diff --git a/pages/login/register.vue b/pages/login/register.vue index 20705bf..a003775 100644 --- a/pages/login/register.vue +++ b/pages/login/register.vue @@ -161,6 +161,13 @@ smsCode: this.code, openIdH5:app.globalData.openId } + + if(app.globalData.accountType == '0000017&key'){ + let value = uni.getStorageSync('goUrl'); + value = value.slice(0, value.lastIndexOf("#")); + params.popularizeUserId = value; + } + phone(params).then(res => { uni.hideLoading(); if (res.return_code == '000000') { diff --git a/pages/tabBar/user/user.vue b/pages/tabBar/user/user.vue index b27d93c..b68e9a0 100644 --- a/pages/tabBar/user/user.vue +++ b/pages/tabBar/user/user.vue @@ -32,20 +32,20 @@ - {{textnum}} + {{textnum || 0}} 卡券 - {{textSend}} + {{textSend || 0}} 优惠券 - {{payactivitynum}} + {{payactivitynum || 0}} 活动券 diff --git a/pages/user/deposit/deposit.vue b/pages/user/deposit/deposit.vue index 5f3c19c..37f4d51 100644 --- a/pages/user/deposit/deposit.vue +++ b/pages/user/deposit/deposit.vue @@ -94,14 +94,16 @@ } - + this.findUser(); }, onShow() { this.getThirdPartyByDetail(); - this.findUser(); + if(app.globalData.userInfo){ + this.findUser(); + } console.log(this.user,"user") }, diff --git a/pages/welcome/welcome.vue b/pages/welcome/welcome.vue index 9fe7c9d..2a6e326 100644 --- a/pages/welcome/welcome.vue +++ b/pages/welcome/welcome.vue @@ -82,6 +82,7 @@ // 0014 直领优惠券 // 0016分享的界面跳转进来 + // 0017携带登录的code if (app.globalData.accountType == '0000011&key' && app.globalData.h5code) { @@ -136,6 +137,18 @@ return; } + + // 从页面进来携带参数值跳向登陆页面,goUrl + if (app.globalData.accountType == '0000017&key' && app.globalData.h5code){ + if(!app.globalData.userInfo||!app.globalData.token){ + uni.navigateTo({ + url: '/pages/login/register' + }) + return + } + + } + uni.switchTab({ url: '../tabBar/home/home' }) @@ -169,10 +182,7 @@ if(arr1.indexOf("code") != -1){ let goUrl =arr1.slice(Number(arr1.indexOf("code"))+5) ; - uni.setStorage({ - key: "goUrl", - data: decodeURIComponent(goUrl) - }) + uni.setStorageSync("goUrl",decodeURIComponent(goUrl)); } @@ -255,16 +265,28 @@ data: res.return_data.uniqueCode }) }else{ - app.globalData.userInfo = ''; - app.globalData.token = ''; - uni.setStorage({ - key: "user", - data: '' - }) - uni.setStorage({ - key: "token", - data: '' - }) + if(uni.getStorageSync("accountId")=="0000011&key"){ + app.globalData.userInfo = ''; + app.globalData.token = ''; + uni.setStorage({ + key: "user", + data: '' + }) + uni.setStorage({ + key: "token", + data: '' + }) + } + // app.globalData.userInfo = ''; + // app.globalData.token = ''; + // uni.setStorage({ + // key: "user", + // data: '' + // }) + // uni.setStorage({ + // key: "token", + // data: '' + // }) }