This commit is contained in:
xiaofajia 2024-11-06 16:10:35 +08:00
commit 7c3f5cdc1b
3 changed files with 68 additions and 3 deletions

View File

@ -28,7 +28,7 @@
<script>
import request from '../../utils/request';
import {setToken,setUserInfo,getInviteId} from '@/utils/auth.js'
import {setToken,setUserInfo,getInviteId,setJSONData} from '@/utils/auth.js'
export default{
data(){
return{
@ -120,6 +120,8 @@
//token
setToken(rex.data.data.token)
setUserInfo(JSON.stringify(rex.data.data.userinfo))
//
this.getMyAdviser()
uni.reLaunch({
url: '/pages-home/home/home'
})
@ -149,6 +151,18 @@
}
})
},
getMyAdviser(){
request({
url: "/app-api/company/staff/getMyAdviser",
method: 'get',
params:{},
tenantIdFlag:false
}).then(res=>{
if(res.code==200 && res.data){
setJSONData("myAdviser",res.data)
}
})
}
}
}

View File

@ -39,6 +39,14 @@
<image class="bmg" src="../../static/images/image2.png" mode="aspectFit"></image>
</view>
</view>
<view class="menuCard" v-if="myAdviser.id">
<view class="menu-item">
<text class="menu-item-title">我的服务人员</text>
<text class="text-detail" @click="callPhone(myAdviser.tel)">
{{myAdviser.roleName?myAdviser.roleName+"-":"" }}{{myAdviser.name}}-{{myAdviser.tel}}
</text>
</view>
</view>
<view class="menuCard">
<view @click="goToPage(item.path)" v-for="(item, index) in menuCard1" :key="item.title" class="menu-item">
<image class="menu-item-icon" :src="item.icon" mode="aspectFit"></image>
@ -67,7 +75,7 @@
import tabBarVue from '@/components/tabBar/tabBar.vue'
import request from "@/utils/request";
import config from '@/config'
import {getToken,getUserInfo} from '@/utils/auth'
import {getToken,getUserInfo,getJSONData,setJSONData} from '@/utils/auth'
export default {
components: {
tabBarVue,
@ -84,6 +92,12 @@
this.customInfo = JSON.parse(getUserInfo())
//
this.getNoReadNum()
if(!getJSONData("myAdviser")){
//
this.getMyAdviser()
}else{
this.myAdviser = getJSONData("myAdviser")
}
}
},
data() {
@ -91,6 +105,8 @@
//
customInfo:{},
imgUrlPrex:config.baseImageUrl,
//
myAdviser:{},
menuCard1: [
{ title: '我的资料', icon: require('@/static/icons/my-menu-icon1.png'), path: '/pages/my/myInfo' },
{ title: '我的卡券', icon: require('@/static/icons/my-menu-icon5.png'), path: "/pages/my/cardRoll" },
@ -110,11 +126,17 @@
url: path
})
},
callPhone(phone){
uni.makePhoneCall({
phoneNumber: phone //
});
},
showEquity() {
uni.navigateTo({
url: '/pages/my/myEquity'
})
},
//
async getNoReadNum(){
await request({
url: "/app-api/system/notify-message/get-unread-count",
@ -125,6 +147,19 @@
this.noReadNum = res.data
}
})
},
getMyAdviser(){
request({
url: "/app-api/company/staff/getMyAdviser",
method: 'get',
params:{},
tenantIdFlag:false
}).then(res=>{
if(res.code==200 && res.data){
setJSONData("myAdviser",res.data)
this.myAdviser = res.data
}
})
}
}
}
@ -313,6 +348,12 @@
font-size: 20rpx;
color: #FFFFFF;
}
.text-detail {
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
}
}
}
</style>

View File

@ -172,7 +172,9 @@
allServicerNameList:["请选择"],
//
servicerIndex:0,
};
//
myAdviser:null
}
},
onLoad(data){
//
@ -194,6 +196,7 @@
url: '/pages/login/login'
})
}
this.myAdviser = getJSONData("myAdviser")
this.initDateList()
},
methods: {
@ -214,6 +217,13 @@
})
if(res.code==200 && res.data.length>0){
this.servicerList = this.servicerList.concat(res.data)
if(this.myAdviser && this.myAdviser.userId){
this.servicerList.map((item,index)=>{
if(this.myAdviser.userId==item.id){
this.servicerIndex = index
}
})
}
this.allServicerNameList = this.allServicerNameList.concat(res.data.map((item)=>{return item.nickname}))
}
},