deming/pageE/mine/Contact.vue

101 lines
2.4 KiB
Vue
Raw Normal View History

2020-09-11 03:24:05 +00:00
<template>
<view class="contact">
<view class="item-view" @click="makePhone">
<view class="title">联系电话</view>
<view class="content">{{ phoneNumber }}</view>
<u-icon name="arrow-right" color="#9A9A9A" size="24"></u-icon>
</view>
<view class="item-view" @click="customerService">
<view class="title">客服服务</view>
<u-icon name="arrow-right" color="#9A9A9A" size="24"></u-icon>
</view>
</view>
</template>
<script>
export default {
data() {
return {
phoneNumber: '',
}
},
created() {
this.getPhone();
},
methods: {
getPhone() {
this.$u.api.getConfigInfo({
code: 'site_tel400'
}).then(res => {
this.phoneNumber = res.data.config.value;
})
},
makePhone() {
uni.makePhoneCall({
phoneNumber: this.phoneNumber,
});
},
customerService(){
if(!this.$store.state.hasLogin){
this.$u.toast('请先登录');
} else {
function Friend(uuid, name, avatar,time = "", text = "",date = "") {
this.uuid = uuid;
this.name = name;
this.avatar = avatar;
this.online = false;
this.unReadMessage = 0;
this.text = text;
this.time = time;
this.date = date
}
const token = uni.getStorageSync('token');
let that = this
uni.request({
url:"https://mall.dmygkeji.com/api/Specialci/getAtwillUserInfo",
data:{
userId: 1
},
method:"POST",
header:{
"Authorization" : 'Bearer' + " " + token
},
success(res){
res = res.data;
2020-09-11 09:59:05 +00:00
let user = new Friend(res.data.member_id,"官方平台客服",res.data.member_avatar);
2020-09-11 03:24:05 +00:00
that.$u.route({
url:"/pageD/privateChat/privateChat",
params:{
id:JSON.stringify(user)
}
})
}
})
}
},
}
};
</script>
<style lang="scss" scoped>
.contact {
border-top: 1rpx solid #ECECEC;
.item-view {
display: flex;
align-items: center;
justify-content: space-between;
padding: 34rpx 30rpx;
border-bottom: 2rpx solid #ECECEC;
.title {
font-size: 30rpx;
color: #343434;
}
.content {
margin-left: auto;
font-size: 28rpx;
color: #666666;
}
.u-icon {
margin-left: 20rpx;
}
}
}
</style>