|
|
@@ -8,38 +8,34 @@
|
|
|
<view class="yysz-row-box">
|
|
|
<view class="yysz-item img-item" @click="headClick">
|
|
|
<text>头像</text>
|
|
|
- <icon class="yysz-img-box"
|
|
|
- :style="{backgroundImage: 'url(' + myInfoData.icon + ')'}"></icon>
|
|
|
+ <icon class="yysz-img-box" :style="{backgroundImage: 'url(' + myInfoData.icon + ')'}"></icon>
|
|
|
</view>
|
|
|
- <view class="yysz-item" @click="nichengClick">
|
|
|
- <text>昵称</text>
|
|
|
- <text class="item-text">{{myInfoData.nickName}}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="yysz-row-box">
|
|
|
<view class="yysz-item" @click="telClick">
|
|
|
<text>手机号码</text>
|
|
|
<text class="item-text">{{myInfoData.userName}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="yysz-row-box">
|
|
|
+ <view class="yysz-row-box">
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <view class="yysz-row-box">
|
|
|
<view class="yysz-item border-item" @click="aboutClick">
|
|
|
<text>关于我们</text>
|
|
|
</view>
|
|
|
- <view v-if="loginFlag" class="yysz-item border-item" @click="yinsizhengce">
|
|
|
+ <view class="yysz-item border-item" @click="yinsizhengce">
|
|
|
<text>隐私政策</text>
|
|
|
</view>
|
|
|
<view class="yysz-item border-item" @click="kefudianhua">
|
|
|
<text>客服与投诉</text>
|
|
|
<text class="item-text">4001750778</text>
|
|
|
</view>
|
|
|
- <view v-if="loginFlag" class="yysz-item border-item" @click="yonghuzhuxiao">
|
|
|
+ <view class="yysz-item border-item" @click="yonghuzhuxiao">
|
|
|
<text>用户注销</text>
|
|
|
</view>
|
|
|
- <view class="yysz-item" @click="exitLogin">
|
|
|
+ <view class="yysz-item" @click="exitLogin">
|
|
|
<text>退出登录</text>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<!-- <CustomTabBar :currentTabNumber="3"> </CustomTabBar> -->
|
|
|
<tip-small-dialog ref="exitDialogRef" @confirm-btn="exitBtn" :content="tipContent"></tip-small-dialog>
|
|
|
@@ -56,6 +52,7 @@
|
|
|
import agreeContentDialog from '@/pages/login/agreeContentDialog.vue';
|
|
|
import {
|
|
|
toast,
|
|
|
+ getUserIsYouke
|
|
|
} from "@/utils/common";
|
|
|
import cacheManager from '@/utils/cacheManager.js';
|
|
|
import {
|
|
|
@@ -73,7 +70,8 @@
|
|
|
} from '@/api/my.js'
|
|
|
// import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
|
|
|
import {
|
|
|
- onLoad,onShow
|
|
|
+ onLoad,
|
|
|
+ onShow
|
|
|
} from '@dcloudio/uni-app';
|
|
|
import {
|
|
|
reactive,
|
|
|
@@ -85,16 +83,18 @@
|
|
|
import tipMiddleDialog from '@/components/dialog/tipMiddleDialog.vue';
|
|
|
import tipBigDialog from '@/components/dialog/tipBigDialog.vue';
|
|
|
import telDialog from './components/telDialog.vue'
|
|
|
-
|
|
|
- import { usePermission } from "@/store/permissionStore.js"
|
|
|
+
|
|
|
+ import {
|
|
|
+ usePermission
|
|
|
+ } from "@/store/permissionStore.js"
|
|
|
const permissionStore = usePermission()
|
|
|
-
|
|
|
+
|
|
|
const agreeType = ref(null);
|
|
|
const agreeContentDialogRef = ref(null);
|
|
|
|
|
|
const tipContent = '你确定要执行这个操作吗?';
|
|
|
const zhuxiaoContent = '你确定要执行这个操作吗?';
|
|
|
- let loginFlag = ref(false);
|
|
|
+ const isYouke = ref(false);
|
|
|
let telDialogFlag = ref(false);
|
|
|
let myInfoData = reactive({
|
|
|
userImg: '',
|
|
|
@@ -125,6 +125,10 @@
|
|
|
}
|
|
|
|
|
|
function headClick() {
|
|
|
+ if (isYouke.value) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
chooseImage()
|
|
|
}
|
|
|
|
|
|
@@ -138,14 +142,14 @@
|
|
|
}
|
|
|
const chooseImage = async () => {
|
|
|
try {
|
|
|
- // await checkAlbumPermission()
|
|
|
+ // await checkAlbumPermission()
|
|
|
/* #ifdef APP */
|
|
|
const systemInfo = uni.getSystemInfoSync();
|
|
|
if (systemInfo.platform != 'ios') {
|
|
|
if (!await permissionStore.requstPermission('READ_EXTERNAL_STORAGE')) return
|
|
|
}
|
|
|
/* #endif */
|
|
|
-
|
|
|
+
|
|
|
uni.chooseImage({
|
|
|
count: 1,
|
|
|
sizeType: ['compressed'],
|
|
|
@@ -229,28 +233,17 @@
|
|
|
})
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- function nichengClick() {
|
|
|
- nichengDialogRef.value.handleShow();
|
|
|
- }
|
|
|
// 退出按钮
|
|
|
const exitBtn = () => {
|
|
|
- if (loginFlag.value) {
|
|
|
- logout().then(res => {
|
|
|
- toast('退出登录成功')
|
|
|
- cacheManager.clearAll();
|
|
|
- uni.reLaunch({
|
|
|
- url: '/pages/login/index'
|
|
|
- });
|
|
|
- }).catch(err => {
|
|
|
- toast('退出登录失败,请稍后重试')
|
|
|
- })
|
|
|
- } else {
|
|
|
+ logout().then(res => {
|
|
|
+ toast('退出登录成功')
|
|
|
+ cacheManager.clearAll();
|
|
|
uni.reLaunch({
|
|
|
url: '/pages/login/index'
|
|
|
});
|
|
|
- }
|
|
|
-
|
|
|
+ }).catch(err => {
|
|
|
+ toast('退出登录失败,请稍后重试')
|
|
|
+ })
|
|
|
}
|
|
|
const zhuxiaoBtn = () => {
|
|
|
let req = {
|
|
|
@@ -273,7 +266,7 @@
|
|
|
|
|
|
function nichengBtn(data) {
|
|
|
console.log('data', data);
|
|
|
-
|
|
|
+
|
|
|
let req = {
|
|
|
nickName: data
|
|
|
}
|
|
|
@@ -307,12 +300,10 @@
|
|
|
}
|
|
|
// 手机号码
|
|
|
function telClick() {
|
|
|
- if (loginFlag.value) {
|
|
|
- telDialogFlag.value = true;
|
|
|
- } else {
|
|
|
- youkeDialogRef.value.handleShow();
|
|
|
+ if (isYouke.value) {
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
+ telDialogFlag.value = true;
|
|
|
}
|
|
|
// 手机号码绑定
|
|
|
function bindBtn() {
|
|
|
@@ -351,28 +342,14 @@
|
|
|
}
|
|
|
|
|
|
function getUserImg(data) {
|
|
|
- switch (data) {
|
|
|
- case 0:
|
|
|
- myInfoData.icon = 'static/images/my/head-img0.png'
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- myInfoData.icon = 'static/images/my/head-img1.png'
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- myInfoData.icon = 'static/images/my/head-img2.png'
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- myInfoData.icon = 'static/images/my/head-img3.png'
|
|
|
- break;
|
|
|
- default:
|
|
|
- myInfoData.icon = 'static/images/my/head-unlogin-img.png'
|
|
|
- break;
|
|
|
-
|
|
|
- }
|
|
|
+ myInfoData.icon = 'static/images/my/head-img1.png'
|
|
|
}
|
|
|
|
|
|
onLoad((options) => {
|
|
|
- loginFlag.value = true;
|
|
|
getMyInfo();
|
|
|
})
|
|
|
+
|
|
|
+ onShow(() => {
|
|
|
+ isYouke.value = getUserIsYouke()
|
|
|
+ })
|
|
|
</script>
|