|
@@ -9,10 +9,11 @@
|
|
<icon class="list-icon tel-icon"></icon>
|
|
<icon class="list-icon tel-icon"></icon>
|
|
<text>头像</text>
|
|
<text>头像</text>
|
|
<icon class="head-img-box" :style="{backgroundImage: 'url(' + myInfoData.userImg + ')'}"></icon>
|
|
<icon class="head-img-box" :style="{backgroundImage: 'url(' + myInfoData.userImg + ')'}"></icon>
|
|
- </view>
|
|
|
|
|
|
+ </view>
|
|
<view class="list-row" @click="nichengClick">
|
|
<view class="list-row" @click="nichengClick">
|
|
<icon class="list-icon tel-icon"></icon>
|
|
<icon class="list-icon tel-icon"></icon>
|
|
<text>昵称</text>
|
|
<text>昵称</text>
|
|
|
|
+ <text>{{myInfoData.nichengValue}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="list-row" @click="telClick">
|
|
<view class="list-row" @click="telClick">
|
|
<icon class="list-icon tel-icon"></icon>
|
|
<icon class="list-icon tel-icon"></icon>
|
|
@@ -39,19 +40,19 @@
|
|
<icon class="list-icon login-out-icon"></icon>
|
|
<icon class="list-icon login-out-icon"></icon>
|
|
<text>退出登录</text>
|
|
<text>退出登录</text>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
<CustomTabBar :levelId="levelId" :currentTabNumber="3" :typeId="typeId" :subjectId="subjectId"
|
|
<CustomTabBar :levelId="levelId" :currentTabNumber="3" :typeId="typeId" :subjectId="subjectId"
|
|
:tipFlag="tipFlag">
|
|
:tipFlag="tipFlag">
|
|
</CustomTabBar>
|
|
</CustomTabBar>
|
|
<tip-small-dialog ref="exitDialogRef" @confirm-btn="exitBtn" :content="tipContent"></tip-small-dialog>
|
|
<tip-small-dialog ref="exitDialogRef" @confirm-btn="exitBtn" :content="tipContent"></tip-small-dialog>
|
|
- <tip-big-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :imgShow="true"></tip-big-dialog>
|
|
|
|
<tip-small-dialog ref="zhuxiaoDialogRef" @confirm-btn="zhuxiaoBtn" :content="zhuxiaoContent"></tip-small-dialog>
|
|
<tip-small-dialog ref="zhuxiaoDialogRef" @confirm-btn="zhuxiaoBtn" :content="zhuxiaoContent"></tip-small-dialog>
|
|
<duihuanmaDialog ref="duihuanmaDialogRef" @confirm-btn="duihuanmaBtn" title="兑换"></duihuanmaDialog>
|
|
<duihuanmaDialog ref="duihuanmaDialogRef" @confirm-btn="duihuanmaBtn" title="兑换"></duihuanmaDialog>
|
|
<tel-dialog @telClose="telClose" @bindBtn="bindBtn" v-if="telDialogFlag"></tel-dialog>
|
|
<tel-dialog @telClose="telClose" @bindBtn="bindBtn" v-if="telDialogFlag"></tel-dialog>
|
|
<agree-content-dialog ref="agreeContentDialogRef" :agreeType="agreeType"></agree-content-dialog>
|
|
<agree-content-dialog ref="agreeContentDialogRef" :agreeType="agreeType"></agree-content-dialog>
|
|
<tip-small-dialog ref="kefuDialogRef" :title="kefuTitle" @confirm-btn="kefuBtn" :content="kefuContent"
|
|
<tip-small-dialog ref="kefuDialogRef" :title="kefuTitle" @confirm-btn="kefuBtn" :content="kefuContent"
|
|
class="kefu-dialog"></tip-small-dialog>
|
|
class="kefu-dialog"></tip-small-dialog>
|
|
|
|
+ <nichengDialog ref="nichengDialogRef" @confirm-btn="nichengBtn" title="修改昵称"></nichengDialog>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -69,14 +70,12 @@
|
|
myInfo,
|
|
myInfo,
|
|
zhuxiao,
|
|
zhuxiao,
|
|
duihuanmaCode,
|
|
duihuanmaCode,
|
|
|
|
+ nichengUpdate,
|
|
myCardList,
|
|
myCardList,
|
|
commonCardList
|
|
commonCardList
|
|
} from '@/api/my.js'
|
|
} from '@/api/my.js'
|
|
import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
|
|
import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
|
|
import {
|
|
import {
|
|
- getCurrentInstance
|
|
|
|
- } from 'vue';
|
|
|
|
- import {
|
|
|
|
onLoad
|
|
onLoad
|
|
} from '@dcloudio/uni-app';
|
|
} from '@dcloudio/uni-app';
|
|
import {
|
|
import {
|
|
@@ -85,38 +84,18 @@
|
|
} from "vue";
|
|
} from "vue";
|
|
import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue';
|
|
import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue';
|
|
import duihuanmaDialog from '@/components/dialog/duihuanmaDialog.vue';
|
|
import duihuanmaDialog from '@/components/dialog/duihuanmaDialog.vue';
|
|
|
|
+ import nichengDialog from '@/components/dialog/nichengDialog.vue';
|
|
import tipMiddleDialog from '@/components/dialog/tipMiddleDialog.vue';
|
|
import tipMiddleDialog from '@/components/dialog/tipMiddleDialog.vue';
|
|
import tipBigDialog from '@/components/dialog/tipBigDialog.vue';
|
|
import tipBigDialog from '@/components/dialog/tipBigDialog.vue';
|
|
import telDialog from './telDialog.vue'
|
|
import telDialog from './telDialog.vue'
|
|
import {
|
|
import {
|
|
- MESSAGE_VISITER_TO_LOGIN
|
|
|
|
- } from "@/utils/constant.js"
|
|
|
|
- import {
|
|
|
|
onShow
|
|
onShow
|
|
} from '@dcloudio/uni-app';
|
|
} from '@dcloudio/uni-app';
|
|
- onShow(() => {
|
|
|
|
- if (!cacheManager.get('auth')) {
|
|
|
|
- youkeFun();
|
|
|
|
- } else {
|
|
|
|
- // 非游客
|
|
|
|
- noYoukeFun();
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
const agreeType = ref(null);
|
|
const agreeType = ref(null);
|
|
const agreeContentDialogRef = ref(null);
|
|
const agreeContentDialogRef = ref(null);
|
|
- const subjectId = ref(null); //游客使用
|
|
|
|
- const levelId = ref(null); //游客使用
|
|
|
|
- const typeId = ref(null); //游客使用
|
|
|
|
- const tipFlag = ref(null); //游客使用
|
|
|
|
|
|
+
|
|
const tipContent = '你确定要执行这个操作吗?';
|
|
const tipContent = '你确定要执行这个操作吗?';
|
|
const zhuxiaoContent = '你确定要执行这个操作吗?';
|
|
const zhuxiaoContent = '你确定要执行这个操作吗?';
|
|
- const duihuanmaContent = '你确定要执行这个操作吗?';
|
|
|
|
- let hyqyData = reactive({
|
|
|
|
- indicatorDots: true,
|
|
|
|
- autoplay: true,
|
|
|
|
- interval: 10000,
|
|
|
|
- duration: 500
|
|
|
|
- });
|
|
|
|
let loginFlag = ref(false);
|
|
let loginFlag = ref(false);
|
|
let telDialogFlag = ref(false);
|
|
let telDialogFlag = ref(false);
|
|
let myInfoData = reactive({
|
|
let myInfoData = reactive({
|
|
@@ -124,33 +103,34 @@
|
|
userName: '',
|
|
userName: '',
|
|
credit: '',
|
|
credit: '',
|
|
vipFlag: '',
|
|
vipFlag: '',
|
|
|
|
+ nichengValue: '',
|
|
});
|
|
});
|
|
let routerOpt = ref(false);
|
|
let routerOpt = ref(false);
|
|
let appleCode = ref(null);
|
|
let appleCode = ref(null);
|
|
let currentPlatform = ref(null);
|
|
let currentPlatform = ref(null);
|
|
const exitDialogRef = ref(null);
|
|
const exitDialogRef = ref(null);
|
|
- const youkeDialogRef = ref(null);
|
|
|
|
const zhuxiaoDialogRef = ref(null);
|
|
const zhuxiaoDialogRef = ref(null);
|
|
- const duihuanmaDialogRef = ref(null);
|
|
|
|
- const bannerArr = ref(null);
|
|
|
|
|
|
+ const nichengDialogRef = ref(null);
|
|
|
|
|
|
const kefuDialogRef = ref(null);
|
|
const kefuDialogRef = ref(null);
|
|
const kefuTitle = '提示';
|
|
const kefuTitle = '提示';
|
|
const kefuContent = '客服电话:17304117625';
|
|
const kefuContent = '客服电话:17304117625';
|
|
-
|
|
|
|
const exitLogin = () => {
|
|
const exitLogin = () => {
|
|
exitDialogRef.value.handleShow();
|
|
exitDialogRef.value.handleShow();
|
|
}
|
|
}
|
|
|
|
+
|
|
function handleBack() {
|
|
function handleBack() {
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
url: '/pages/my/index'
|
|
url: '/pages/my/index'
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
function headClick() {
|
|
function headClick() {
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
function nichengClick() {
|
|
function nichengClick() {
|
|
-
|
|
|
|
|
|
+ nichengDialogRef.value.handleShow();
|
|
}
|
|
}
|
|
// 退出按钮
|
|
// 退出按钮
|
|
const exitBtn = () => {
|
|
const exitBtn = () => {
|
|
@@ -171,7 +151,6 @@
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
const zhuxiaoBtn = () => {
|
|
const zhuxiaoBtn = () => {
|
|
let req = {
|
|
let req = {
|
|
|
|
|
|
@@ -191,28 +170,17 @@
|
|
zhuxiaoDialogRef.value.handleShow();
|
|
zhuxiaoDialogRef.value.handleShow();
|
|
}
|
|
}
|
|
|
|
|
|
- function duihuamaDuihuan() {
|
|
|
|
- duihuanmaDialogRef.value.handleShow();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- function duihuanmaBtn(data) {
|
|
|
|
|
|
+ function nichengBtn(data) {
|
|
console.log('data', data);
|
|
console.log('data', data);
|
|
let req = {
|
|
let req = {
|
|
- code: data
|
|
|
|
|
|
+ nickName: data
|
|
}
|
|
}
|
|
- duihuanmaCode(req).then(res => {
|
|
|
|
|
|
+ nichengUpdate(req).then(res => {
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
- toast('兑换成功')
|
|
|
|
- const localList = cacheManager.get('auth').levelIdList || []
|
|
|
|
- const mergeList = [...new Set([...localList, ...res.data.levelIdList])]
|
|
|
|
- cacheManager.updateObject('auth', {
|
|
|
|
- levelIdList: mergeList
|
|
|
|
- })
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url: '/pages/my/index'
|
|
|
|
- })
|
|
|
|
|
|
+ toast('修改成功')
|
|
|
|
+ myInfoData.nichengValue = data
|
|
} else {
|
|
} else {
|
|
- toast('兑换失败请重试或联系管理员')
|
|
|
|
|
|
+ toast('修改失败请重试或联系管理员')
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
@@ -232,19 +200,6 @@
|
|
function kefuBtn() {
|
|
function kefuBtn() {
|
|
kefuDialogRef.value.handleClose();
|
|
kefuDialogRef.value.handleClose();
|
|
}
|
|
}
|
|
- // 游客弹窗---确定
|
|
|
|
-
|
|
|
|
- function ykConfirm() {
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url: '/pages/login/index'
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- function yingyongshezhi() {
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url: '/pages/my/yingyongshezhi'
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// 手机号码
|
|
// 手机号码
|
|
function telClick() {
|
|
function telClick() {
|
|
if (loginFlag.value) {
|
|
if (loginFlag.value) {
|
|
@@ -254,18 +209,15 @@
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
// 手机号码绑定
|
|
// 手机号码绑定
|
|
function bindBtn() {
|
|
function bindBtn() {
|
|
telDialogFlag.value = false;
|
|
telDialogFlag.value = false;
|
|
myGetAuth()
|
|
myGetAuth()
|
|
}
|
|
}
|
|
-
|
|
|
|
// 关闭手机号码弹窗
|
|
// 关闭手机号码弹窗
|
|
function telClose() {
|
|
function telClose() {
|
|
telDialogFlag.value = false;
|
|
telDialogFlag.value = false;
|
|
}
|
|
}
|
|
-
|
|
|
|
// 关于我们
|
|
// 关于我们
|
|
function aboutClick() {
|
|
function aboutClick() {
|
|
if (loginFlag.value) {
|
|
if (loginFlag.value) {
|
|
@@ -278,133 +230,12 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
- function sxtkClick() {
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url: '/pages/my/sxtkPage'
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- function xxjlClick() {
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url: '/pages/my/xuexiJilu'
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- // 产品商城
|
|
|
|
- function cpscClick() {
|
|
|
|
-
|
|
|
|
- if (loginFlag.value) {
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url: '/pages/mall/mallPage'
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url: `/pages/mall/mallPage?levelId=${routerOpt.levelId}&typeId=${routerOpt.typeId}&subjectId=${routerOpt.subjectId}&tipFlag=${routerOpt.tipFlag}`
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 订单
|
|
|
|
- function orderClick() {
|
|
|
|
- if (loginFlag.value) {
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url: '/pages/pay/order'
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- youkeDialogRef.value.handleShow();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// 获取用户数据
|
|
// 获取用户数据
|
|
function getMyInfo() {
|
|
function getMyInfo() {
|
|
myInfo({}).then(res => {
|
|
myInfo({}).then(res => {
|
|
- getUserImg(res.data.growthType)
|
|
|
|
myInfoData.userName = res.data.userName;
|
|
myInfoData.userName = res.data.userName;
|
|
myInfoData.credit = res.data.credit;
|
|
myInfoData.credit = res.data.credit;
|
|
})
|
|
})
|
|
- getMyCardList();
|
|
|
|
- }
|
|
|
|
- // 登录人员的cardlist
|
|
|
|
- function getMyCardList() {
|
|
|
|
- myCardList({}).then(res => {
|
|
|
|
- bannerArr.value = res.data;
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- // 游客的cardList
|
|
|
|
- function getCommonCardList() {
|
|
|
|
- commonCardList({}).then(res => {
|
|
|
|
- bannerArr.value = res.data;
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 获取用户头像
|
|
|
|
- function getUserImg(data) {
|
|
|
|
- switch (data) {
|
|
|
|
- case 0:
|
|
|
|
- myInfoData.userImg = 'static/images/my/head-img0.png'
|
|
|
|
- break;
|
|
|
|
- case 1:
|
|
|
|
- myInfoData.userImg = 'static/images/my/head-img1.png'
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
- myInfoData.userImg = 'static/images/my/head-img2.png'
|
|
|
|
- break;
|
|
|
|
- case 3:
|
|
|
|
- myInfoData.userImg = 'static/images/my/head-img3.png'
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- myInfoData.userImg = 'static/images/my/head-unlogin-img.png'
|
|
|
|
- break;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // 点击card
|
|
|
|
- function hyqyBtn(data) {
|
|
|
|
- if (loginFlag.value) {
|
|
|
|
-
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url: '/pages/mall/mallPage?cardId=' + data.id + '&subjectId=' + data.subjectId + '&from=myPage'
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url: `/pages/mall/mallPage?levelId=${routerOpt.levelId}&typeId=${routerOpt.typeId}&cardId=${data.id}&subjectId=${data.subjectId}&tipFlag=${routerOpt.tipFlag}`
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 判断是否是游客
|
|
|
|
- function myGetAuth() {
|
|
|
|
- let LocalStorage = cacheManager.get('auth');
|
|
|
|
- if (LocalStorage) {
|
|
|
|
- // 非游客
|
|
|
|
- noYoukeFun()
|
|
|
|
- } else {
|
|
|
|
- youkeFun();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 游客
|
|
|
|
- function youkeFun() {
|
|
|
|
- // 获取广告
|
|
|
|
- getCommonCardList();
|
|
|
|
- levelId.value = routerOpt.levelId
|
|
|
|
- typeId.value = routerOpt.typeId
|
|
|
|
- subjectId.value = routerOpt.subjectId
|
|
|
|
- tipFlag.value = routerOpt.tipFlag
|
|
|
|
- // my游客
|
|
|
|
- loginFlag.value = false;
|
|
|
|
- myInfoData.userName = '游客';
|
|
|
|
- myInfoData.userImg = 'static/images/my/head-unlogin-img.png'
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 非游客
|
|
|
|
- function noYoukeFun() {
|
|
|
|
- loginFlag.value = true;
|
|
|
|
- getMyInfo();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
function isIOSorAndroid() {
|
|
function isIOSorAndroid() {
|
|
@@ -418,29 +249,9 @@
|
|
return currentPlatform.value = 'android'
|
|
return currentPlatform.value = 'android'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
- if (!cacheManager.get('auth')) {
|
|
|
|
- // 游客
|
|
|
|
- routerOpt = options;
|
|
|
|
- } else {
|
|
|
|
- appleCode.value = cacheManager.get("auth").appleCode.toString()
|
|
|
|
- isIOSorAndroid()
|
|
|
|
- }
|
|
|
|
|
|
+ isIOSorAndroid()
|
|
|
|
+ loginFlag.value = true;
|
|
|
|
+ getMyInfo();
|
|
})
|
|
})
|
|
-
|
|
|
|
- function checkWrong() {
|
|
|
|
- if (loginFlag.value) {
|
|
|
|
- const AuthCode = getUserIdentity();
|
|
|
|
- if (AuthCode == 'Visitor') {
|
|
|
|
- youkeDialogRef.value.handleShow();
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url: '/pages/wrong/index'
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- youkeDialogRef.value.handleShow();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
</script>
|
|
</script>
|