Merge branch 'master' of http://122.51.230.86:3000/sunliwei/lanan-repair
This commit is contained in:
commit
7c3f5cdc1b
@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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}))
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user