|
@@ -27,20 +27,26 @@
|
|
|
<icon class="list-icon yysz-icon"></icon>
|
|
<icon class="list-icon yysz-icon"></icon>
|
|
|
<text>应用设置</text>
|
|
<text>应用设置</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="list-item" @click="shangcheng">
|
|
|
|
|
- <icon class="list-icon yysz-icon"></icon>
|
|
|
|
|
- <text>商城</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <!-- <view v-if="appleCode=='true'&¤tPlatform=='ios' || currentPlatform=='android'" class="list-item" -->
|
|
|
|
|
- <view class="list-item"
|
|
|
|
|
- @click="duihuamaDuihuan">
|
|
|
|
|
|
|
+ <view class="list-item" @click="shangcheng">
|
|
|
|
|
+ <icon class="list-icon yysz-icon"></icon>
|
|
|
|
|
+ <text>商城</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <!-- <view v-if="appleCode=='true'&¤tPlatform=='ios' || currentPlatform=='android'" class="list-item" -->
|
|
|
|
|
+ <view class="list-item" @click="duihuamaDuihuan">
|
|
|
<icon class="list-icon yysz-icon"></icon>
|
|
<icon class="list-icon yysz-icon"></icon>
|
|
|
<text>兑换码</text>
|
|
<text>兑换码</text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view v-if="isShowBindPhone" class="list-item" @click="bangPhone">
|
|
|
|
|
+ <icon class="list-icon yysz-icon"></icon>
|
|
|
|
|
+ <text>绑定手机号</text>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<goLogin ref="loginRef" @success="handleSuccess"></goLogin>
|
|
<goLogin ref="loginRef" @success="handleSuccess"></goLogin>
|
|
|
|
|
+ <bindPhone ref="bindPhoneRef" @success="bingPhoneSuccess"></bindPhone>
|
|
|
<!-- 底部 -->
|
|
<!-- 底部 -->
|
|
|
<custom-tab-bar :show="true" :current-index="currentTabIndex" />
|
|
<custom-tab-bar :show="true" :current-index="currentTabIndex" />
|
|
|
</view>
|
|
</view>
|
|
@@ -58,6 +64,7 @@
|
|
|
} from '@/api/my.js'
|
|
} from '@/api/my.js'
|
|
|
import CustomTabBar from '@/components/custom-tabbar/index.vue';
|
|
import CustomTabBar from '@/components/custom-tabbar/index.vue';
|
|
|
import goLogin from "@/components/goLogin/goLogin.vue"
|
|
import goLogin from "@/components/goLogin/goLogin.vue"
|
|
|
|
|
+ import bindPhone from "@/components/bindPhone/bindPhone.vue"
|
|
|
import {
|
|
import {
|
|
|
onLoad,
|
|
onLoad,
|
|
|
onShow
|
|
onShow
|
|
@@ -66,12 +73,16 @@
|
|
|
reactive,
|
|
reactive,
|
|
|
ref
|
|
ref
|
|
|
} from "vue";
|
|
} from "vue";
|
|
|
- import {getUserIsYouke} from "../../utils/common";
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ getUserIsYouke,
|
|
|
|
|
+ toast
|
|
|
|
|
+ } from "../../utils/common";
|
|
|
|
|
|
|
|
- let appleCode =ref(null)
|
|
|
|
|
|
|
+ let appleCode = ref(null)
|
|
|
let currentPlatform = ref(null);
|
|
let currentPlatform = ref(null);
|
|
|
let authInfo = ref(null);
|
|
let authInfo = ref(null);
|
|
|
let loginRef = ref(null);
|
|
let loginRef = ref(null);
|
|
|
|
|
+ let isShowBindPhone = ref(false);
|
|
|
let currentTabIndex = ref(3)
|
|
let currentTabIndex = ref(3)
|
|
|
let myInfoData = reactive({
|
|
let myInfoData = reactive({
|
|
|
userImg: '',
|
|
userImg: '',
|
|
@@ -85,9 +96,14 @@
|
|
|
|
|
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
|
currentTabIndex.value = 3
|
|
currentTabIndex.value = 3
|
|
|
- if(pageFrom.value ==='myInfo'){
|
|
|
|
|
|
|
+ if (pageFrom.value === 'myInfo') {
|
|
|
getMyInfo();
|
|
getMyInfo();
|
|
|
}
|
|
}
|
|
|
|
|
+ if (getUserIsYouke()) {
|
|
|
|
|
+ isShowBindPhone.value = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ isShowBindPhone.value = false
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
/***************** 测试 ******************/
|
|
/***************** 测试 ******************/
|
|
|
const testRef = ref(null)
|
|
const testRef = ref(null)
|
|
@@ -97,6 +113,14 @@
|
|
|
}
|
|
}
|
|
|
/***************** 测试 ******************/
|
|
/***************** 测试 ******************/
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ function bingPhoneSuccess(flag, tel) {
|
|
|
|
|
+ toast("绑定成功")
|
|
|
|
|
+ cacheManager.updateObject('auth', {
|
|
|
|
|
+ userName: tel,
|
|
|
|
|
+ })
|
|
|
|
|
+ isShowBindPhone.value = false
|
|
|
|
|
+ }
|
|
|
// 获取用户数据
|
|
// 获取用户数据
|
|
|
function getMyInfo() {
|
|
function getMyInfo() {
|
|
|
myInfo({}).then(res => {
|
|
myInfo({}).then(res => {
|
|
@@ -146,12 +170,19 @@
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function ddBtn(){
|
|
|
|
|
|
|
+ function ddBtn() {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: '/pages/chanpinMy/order'
|
|
url: '/pages/chanpinMy/order'
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function bangPhone() {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // authInfo.value = cacheManager.get('auth');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function duihuamaDuihuan() {
|
|
function duihuamaDuihuan() {
|
|
|
// 兑换码兑换策略
|
|
// 兑换码兑换策略
|
|
|
if (getUserIsYouke()) {
|
|
if (getUserIsYouke()) {
|
|
@@ -160,19 +191,19 @@
|
|
|
} else {
|
|
} else {
|
|
|
// 已登录
|
|
// 已登录
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url:'/pages/chanpinMy/duihuanma'
|
|
|
|
|
|
|
+ url: '/pages/chanpinMy/duihuanma'
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function handleSuccess(authInfo) {
|
|
|
|
|
- // 登录成功更改用户名
|
|
|
|
|
- myInfoData.userName = authInfo.userName;
|
|
|
|
|
- // 前往兑换码
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url:'/pages/chanpinMy/duihuanma'
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ function handleSuccess(authInfo) {
|
|
|
|
|
+ // 登录成功更改用户名
|
|
|
|
|
+ myInfoData.userName = authInfo.userName;
|
|
|
|
|
+ // 前往兑换码
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '/pages/chanpinMy/duihuanma'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
|
uni.hideTabBar()
|
|
uni.hideTabBar()
|
|
@@ -195,10 +226,10 @@
|
|
|
authInfo.value = cacheManager.get('auth');
|
|
authInfo.value = cacheManager.get('auth');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 商城
|
|
|
|
|
- function shangcheng() {
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: '/pages/chanpinShop/index'
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 商城
|
|
|
|
|
+ function shangcheng() {
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '/pages/chanpinShop/index'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
</script>
|
|
</script>
|