From e46e35cfbd5f6dddd32c5c7bb25f2f668937ec3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=94=90=E6=98=8E=E6=98=8E?= <970899069@qq.com>
Date: Fri, 14 Jan 2022 08:55:54 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=E7=99=BB=E5=BD=95=E6=8B=A6=E6=88=AA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/user/index.vue | 94 +++++++++++++++++++++-----------------------
1 file changed, 45 insertions(+), 49 deletions(-)
diff --git a/pages/user/index.vue b/pages/user/index.vue
index 726353f..382a52a 100644
--- a/pages/user/index.vue
+++ b/pages/user/index.vue
@@ -13,7 +13,7 @@
- 未登录
+ 未登录
@@ -61,23 +61,23 @@
-
+
全部订单
-
+
待付款
-
+
待发货
-
+
待收货
-
+
已完成
@@ -135,11 +135,9 @@
getInfo(){
if(this.$store.state.token === '') return
info().then(res => {
- console.log(res)
uni.setNavigationBarTitle({
title: res.nickname
})
-
this.userInfo = res
}).catch(err => {
uni.showToast({
@@ -150,57 +148,55 @@
},
// 开通会员
openVip(){
- if(this.$store.state.token === ''){
- this.Login()
- return
- }
- uni.showActionSheet({
- itemList: ["我是新用户", "我是老用户"],
- success: res=> {
- switch (res.tapIndex){
- case 0:
- uni.showModal({
- title: '开通提示',
- content: '平台新用户完成手笔订单,即可获赠ZH健康会员',
- showCancel:false,
- cancelText: '去完成',
- success: res => {
- console.log(res)
- this.$Router.pushTab({name: 'Store'})
- }
- })
- break;
- case 1:
- uni.showToast({
- title: '老用户渠道暂未开放',
- icon : 'none'
- })
- break;
+ if(this.isLogin()){
+ uni.showActionSheet({
+ itemList: ["我是新用户", "我是老用户"],
+ success: res=> {
+ switch (res.tapIndex){
+ case 0:
+ uni.showModal({
+ title: '开通提示',
+ content: '平台新用户完成手笔订单,即可获赠ZH健康会员',
+ showCancel:false,
+ cancelText: '去完成',
+ success: res => {
+ console.log(res)
+ this.$Router.pushTab({name: 'Store'})
+ }
+ })
+ break;
+ case 1:
+ uni.showToast({
+ title: '老用户渠道暂未开放',
+ icon : 'none'
+ })
+ break;
+ }
}
- }
- })
+ })
+ }
},
// 开通钱包
onWallet(){
- if(this.$store.state.token === ''){
- this.Login()
- return
+ if(this.isLogin()){
+ if(this.userInfo.is_wallet) this.$Router.push({name: 'WalletProperty'})
+ else this.$Router.push({name: 'WalletAdd'})
}
- if(this.userInfo.is_wallet) this.$Router.push({name: 'WalletProperty'})
- else this.$Router.push({name: 'WalletAdd'})
},
// 按钮导航
onBtn(name, params){
- if(this.$store.state.token === ''){
- this.Login()
- return
+ if(this.isLogin()){
+ this.$Router.push({name, params})
}
- this.$Router.push({name, params})
},
- // 登录
- Login(){
- const Auth = new userAuth()
- Auth.Login()
+ // 检查登录
+ isLogin(){
+ if(this.$store.state.token === ''){
+ const Auth = new userAuth()
+ Auth.Login()
+ return false
+ }
+ return true
},
// 退出登录
logOut(){