236 lines
8.1 KiB
Vue
236 lines
8.1 KiB
Vue
<template>
|
|
<view class="content">
|
|
<myNav title="我的" bgColor="#fff" titleColor="#614D49" :backIcon="false" :backHome="false" :flex="false"></myNav>
|
|
<view
|
|
style="display: flex;margin-top: 20rpx; flex-direction: column;align-items: center;padding: 40rpx;box-sizing: border-box;width: 100%;">
|
|
<view style="display: flex;align-items: center;justify-content: space-between;width: 100%;">
|
|
<view style="display: flex;align-items: center;">
|
|
<image v-if="showObj.avatarUrl" :src="showObj.avatarUrl" style="width: 120rpx;height: 120rpx;border-radius: 120rpx;"></image>
|
|
<image v-else src="/static/n-pc/head.png" style="width: 120rpx;height: 120rpx;"></image>
|
|
<text v-if="showObj.nickName" class="p-name" style="margin-left: 48rpx;">{{showObj.nickName}}</text>
|
|
<text v-else class="p-name" style="margin-left: 48rpx;">未登录</text>
|
|
|
|
</view>
|
|
<view style="display: flex;justify-content: flex-end;align-items: center;height: 50%;width: 80rpx;" @click="editUserInfo">
|
|
<image src="/static/n-pc/p-left.png" style="width: 12rpx;height: 22rpx" ></image>
|
|
|
|
</view>
|
|
</view>
|
|
<view
|
|
style="display: flex;align-items: center;justify-content: space-between;width: 100%;margin-top: 40rpx;">
|
|
<view style="position: relative;width: 316rpx;height: 138rpx;" @click="myOrder">
|
|
<image src="/static/n-pc/order-bg.png"
|
|
style="position: absolute;width: 100%;height: 100%;z-index: 0;"></image>
|
|
<view style="display: flex;position: absolute;z-index: 1;width: 316rpx;height: 138rpx;">
|
|
<image src="/static/n-pc/wd-dd.png" mode="heightFix"
|
|
style="height: 74rpx;width: 66rpx;margin-left: 40rpx;margin-top: 28rpx;"></image>
|
|
<view
|
|
style="display: flex;flex-direction: column;margin-top: 26rpx;margin-left:20rpx;align-items: center;">
|
|
<text class="p-title">我的订单</text>
|
|
<text v-if="notReadNumObj?.orderNum&¬ReadNumObj?.orderNum>0" class="p-num" style="margin-top: -10rpx;color: #B6640B;">{{notReadNumObj?.orderNum ? notReadNumObj?.orderNum : 0}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view style="position: relative;width: 316rpx;height: 138rpx;" @click="myFocus">
|
|
<image src="/static/n-pc/focus-bg.png"
|
|
style="position: absolute;width: 100%;height: 100%;z-index: 0;"></image>
|
|
<view style="display: flex;position: absolute;z-index: 1;width: 316rpx;height: 138rpx;">
|
|
<image src="/static/n-pc/wd-gz.png" mode="heightFix"
|
|
style="height: 74rpx;width: 66rpx;margin-left: 40rpx;margin-top: 28rpx;"></image>
|
|
<view
|
|
style="display: flex;flex-direction: column;margin-top: 26rpx;margin-left:20rpx;align-items: center;">
|
|
<text class="p-title">我的关注</text>
|
|
<text v-if="notReadNumObj?.focusNum&¬ReadNumObj?.focusNum>0" class="p-num" style="margin-top: -10rpx;color: #DC2602;">{{notReadNumObj?.focusNum ? notReadNumObj?.focusNum : 0}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view style="display: flex;justify-content: space-between;width: 100%;margin-top: 40rpx;flex-direction: column;padding: 40rpx 40rpx;
|
|
border-radius: 32rpx; box-sizing: border-box;background-color: #fff;">
|
|
|
|
<view style="display: flex;align-items: center;" @click="toMyTest">
|
|
<image src="/static/n-pc/wd-wdpc.png" style="width:38rpx ;height: 38rpx;"></image>
|
|
<text class="p-menu" style="margin-left:42rpx; ">我的评测</text>
|
|
<view style="flex: 1;text-align: right;">
|
|
<image src="/static/n-pc/p-left.png" style="width: 12rpx;height: 22rpx;"></image>
|
|
</view>
|
|
</view>
|
|
<view style="display: flex;align-items: center;margin-top: 62rpx" @click="toConsultAppointment">
|
|
<image src="/static/n-pc/wd-zxyx.png" style="width:38rpx ;height: 38rpx;"></image>
|
|
<text class="p-menu" style="margin-left:42rpx; ">咨询预约协议</text>
|
|
<view style="flex: 1;text-align: right;">
|
|
<image src="/static/n-pc/p-left.png" style="width: 12rpx;height: 22rpx;"></image>
|
|
</view>
|
|
</view>
|
|
<view style="display: flex;align-items: center;margin-top: 62rpx" @click="toKefu">
|
|
<image src="/static/n-pc/wd-kf.png" style="width:38rpx ;height: 38rpx;"></image>
|
|
<text class="p-menu" style="margin-left:42rpx; ">联系客服</text>
|
|
<view style="flex: 1;text-align: right;">
|
|
<image src="/static/n-pc/p-left.png" style="width: 12rpx;height: 22rpx;"></image>
|
|
</view>
|
|
</view>
|
|
<view style="display: flex;align-items: center;margin-top: 62rpx" @click="toFeedback">
|
|
<image src="/static/n-pc/wd-yj.png" style="width:38rpx ;height: 38rpx;"></image>
|
|
<text class="p-menu" style="margin-left:42rpx; ">意见反馈</text>
|
|
<view style="flex: 1;text-align: right;">
|
|
<image src="/static/n-pc/p-left.png" style="width: 12rpx;height: 22rpx;"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import myNav from '@/components/my-nav.vue'
|
|
import {
|
|
urls
|
|
} from '@/util/apiUrl.js'
|
|
import dohttp from '@/util/requestConfig.js'
|
|
|
|
const onShareAppMessage = () => {
|
|
return {
|
|
title: '快来体验一下吧~',
|
|
path: '/pages/index/index', // 分享的路径
|
|
};
|
|
};
|
|
|
|
const onShareTimeline = () => {
|
|
return {
|
|
title: '快来体验一下吧~',
|
|
query: 'id=4', // 分享路径的参数
|
|
};
|
|
};
|
|
|
|
const editUserInfo = () => {
|
|
dohttp.navigateTo("/pages/edit-userinfo/edit-userinfo")
|
|
}
|
|
|
|
const toKefu = () => {
|
|
dohttp.navigateTo("/pages/customer-service/customer-service")
|
|
}
|
|
const toFeedback = () => {
|
|
dohttp.navigateTo("/pages/feedback/feedback")
|
|
}
|
|
|
|
const myFocus=()=>{
|
|
dohttp.navigateTo("/pages/my-focus/my-focus?num="+notReadNumObj.value?.focusNum)
|
|
}
|
|
const myOrder=()=>{
|
|
dohttp.navigateTo("/pages/order/order?num="+notReadNumObj.value?.orderNum)
|
|
|
|
}
|
|
const showObj=ref({
|
|
id: null,
|
|
avatarUrl: null,
|
|
nickName: null
|
|
})
|
|
const notReadNumObj=ref({})
|
|
const notReadNum=()=>{
|
|
dohttp.get(urls.notReadNum).then((result) => {
|
|
notReadNumObj.value.id= result.id
|
|
notReadNumObj.value.focusNum = result.focusNum
|
|
notReadNumObj.value.orderNum = result.orderNum
|
|
})
|
|
}
|
|
|
|
onLoad((option) => {
|
|
const isLoggedIn = uni.getStorageSync('token'); // 假设 token 保存在本地存储
|
|
if (!isLoggedIn) {
|
|
// uni.navigateTo({
|
|
// "url": "/pages/login-pop/login-pop?type=3&path=/pages/personal-center/personal-center",
|
|
// "animationType": "pop-in"
|
|
// })
|
|
return
|
|
}
|
|
|
|
const userinfo = uni.getStorageSync('userinfo')
|
|
if(userinfo){
|
|
showObj.value.avatarUrl= userinfo.avatarUrl
|
|
showObj.value.nickName = userinfo.nickName
|
|
if(!showObj.value.nickName){
|
|
showObj.value.nickName = "微信用户"
|
|
}
|
|
}else{
|
|
getUserInfo()
|
|
}
|
|
|
|
notReadNum()
|
|
})
|
|
const getUserInfo = () => {
|
|
dohttp.get(urls.getSelfInfo).then((result) => {
|
|
const userinfo = {
|
|
avatarUrl: result.avatarUrl,
|
|
nickName: result.nickName
|
|
}
|
|
uni.setStorageSync('userinfo', userinfo)
|
|
showObj.value.avatarUrl= result.avatarUrl
|
|
showObj.value.nickName = result.nickName
|
|
if(!showObj.value.nickName){
|
|
showObj.value.nickName = "微信用户"
|
|
}
|
|
})
|
|
|
|
}
|
|
onShow(() => {
|
|
const userinfo = uni.getStorageSync('userinfo')
|
|
if(userinfo){
|
|
showObj.value.avatarUrl= userinfo.avatarUrl
|
|
showObj.value.nickName = userinfo.nickName
|
|
if(!showObj.value.nickName){
|
|
showObj.value.nickName = "微信用户"
|
|
}
|
|
}else{
|
|
getUserInfo()
|
|
}
|
|
notReadNum()
|
|
})
|
|
const toConsultAppointment=()=>{
|
|
dohttp.navigateTo("/pages/consult-appointment/consult-appointment")
|
|
}
|
|
const toMyTest=()=> {
|
|
dohttp.navigateTo("/pages/my-test/my-test")
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.content {
|
|
width: 100vw;
|
|
height: 100vh;
|
|
background-color: #F9F6F5;
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-family: SourceHanSans;
|
|
background-image: url('https://miniapp.yuxingu.com.cn/yxg-mp/pic/botton.png');
|
|
background-size: cover;
|
|
background-position: center;
|
|
background-repeat: no-repeat;
|
|
}
|
|
|
|
.p-name {
|
|
font-size: 40rpx;
|
|
font-family: SourceHanSansBold;
|
|
color: #3D3D3D;
|
|
}
|
|
|
|
.p-title {
|
|
font-size: 28rpx;
|
|
font-family: SourceHanSansBold;
|
|
color: #614D49;
|
|
|
|
}
|
|
|
|
.p-num {
|
|
font-size: 40rpx;
|
|
font-family: SourceHanSansBold;
|
|
}
|
|
|
|
.p-menu {
|
|
font-size: 28rpx;
|
|
color: #3D3D3D;
|
|
}
|
|
</style> |