This commit is contained in:
Vinjor 2024-11-06 13:58:20 +08:00
parent 6708283fa0
commit 5ef6399555
3 changed files with 68 additions and 3 deletions

View File

@ -28,7 +28,7 @@
<script> <script>
import request from '../../utils/request'; import request from '../../utils/request';
import {setToken,setUserInfo,getInviteId} from '@/utils/auth.js' import {setToken,setUserInfo,getInviteId,setJSONData} from '@/utils/auth.js'
export default{ export default{
data(){ data(){
return{ return{
@ -120,6 +120,8 @@
//token //token
setToken(rex.data.data.token) setToken(rex.data.data.token)
setUserInfo(JSON.stringify(rex.data.data.userinfo)) setUserInfo(JSON.stringify(rex.data.data.userinfo))
//
this.getMyAdviser()
uni.reLaunch({ uni.reLaunch({
url: '/pages-home/home/home' 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> <image class="bmg" src="../../static/images/image2.png" mode="aspectFit"></image>
</view> </view>
</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 class="menuCard">
<view @click="goToPage(item.path)" v-for="(item, index) in menuCard1" :key="item.title" class="menu-item"> <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> <image class="menu-item-icon" :src="item.icon" mode="aspectFit"></image>
@ -67,7 +75,7 @@
import tabBarVue from '@/components/tabBar/tabBar.vue' import tabBarVue from '@/components/tabBar/tabBar.vue'
import request from "@/utils/request"; import request from "@/utils/request";
import config from '@/config' import config from '@/config'
import {getToken,getUserInfo} from '@/utils/auth' import {getToken,getUserInfo,getJSONData,setJSONData} from '@/utils/auth'
export default { export default {
components: { components: {
tabBarVue, tabBarVue,
@ -84,6 +92,12 @@
this.customInfo = JSON.parse(getUserInfo()) this.customInfo = JSON.parse(getUserInfo())
// //
this.getNoReadNum() this.getNoReadNum()
if(!getJSONData("myAdviser")){
//
this.getMyAdviser()
}else{
this.myAdviser = getJSONData("myAdviser")
}
} }
}, },
data() { data() {
@ -91,6 +105,8 @@
// //
customInfo:{}, customInfo:{},
imgUrlPrex:config.baseImageUrl, imgUrlPrex:config.baseImageUrl,
//
myAdviser:{},
menuCard1: [ menuCard1: [
{ title: '我的资料', icon: require('@/static/icons/my-menu-icon1.png'), path: '/pages/my/myInfo' }, { 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" }, { title: '我的卡券', icon: require('@/static/icons/my-menu-icon5.png'), path: "/pages/my/cardRoll" },
@ -110,11 +126,17 @@
url: path url: path
}) })
}, },
callPhone(phone){
uni.makePhoneCall({
phoneNumber: phone //
});
},
showEquity() { showEquity() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/my/myEquity' url: '/pages/my/myEquity'
}) })
}, },
//
async getNoReadNum(){ async getNoReadNum(){
await request({ await request({
url: "/app-api/system/notify-message/get-unread-count", url: "/app-api/system/notify-message/get-unread-count",
@ -125,6 +147,19 @@
this.noReadNum = res.data 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; font-size: 20rpx;
color: #FFFFFF; color: #FFFFFF;
} }
.text-detail {
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
}
} }
} }
</style> </style>

View File

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