开放企业微信客服
parent
cf7e0295fc
commit
a492c1b6be
|
@ -2,6 +2,10 @@
|
|||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"app-plus" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<view @tap="chooseBtn" :class="noAuthBtn?'isNyin':'noyin'" class="btn btn-no">暂不授权</view>
|
||||
<view :class="yesAuthBtn?'isOyin':'noyin'" class="btn btn-yes">
|
||||
<text>立即授权</text>
|
||||
<button open-type="getUserInfo" @tap="authEv" class="auth-btn">立即授权</button>
|
||||
<button @tap="authEv" class="auth-btn">立即授权</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -64,7 +64,8 @@
|
|||
showAuth:false, // 是否显示授权弹框
|
||||
currentPage:'', // 当前页面路径
|
||||
showMobile:true ,// 是否显示手机授权弹框
|
||||
showUserInfo:false
|
||||
showUserInfo:false,
|
||||
flag:true
|
||||
};
|
||||
},
|
||||
destroyed() {
|
||||
|
@ -122,26 +123,31 @@
|
|||
this.noAuthBtn = true;
|
||||
},
|
||||
authEv(){//立即授权事件
|
||||
this.$toolAll.tools.showToast('正在调起授权...');
|
||||
this.yesAuthBtn = true;
|
||||
uni.getUserProfile({//调起微信授权弹框
|
||||
desc: '登录',
|
||||
lang: 'zh_CN',
|
||||
success: (res) => {
|
||||
uni.login({// 获取登录用户code
|
||||
provider: 'weixin',
|
||||
success: (result)=> {
|
||||
uni.hideToast()
|
||||
// 调用更新用户信息事件
|
||||
this.updateUserInfo(result.code,res.userInfo);
|
||||
},
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
// console.log('用户拒绝授权');
|
||||
this.yesAuthBtn = false;
|
||||
}
|
||||
});
|
||||
if(this.flag) {
|
||||
this.flag = false;
|
||||
this.$toolAll.tools.showToast('正在调起授权...');
|
||||
this.yesAuthBtn = true;
|
||||
uni.getUserProfile({//调起微信授权弹框
|
||||
desc: '登录',
|
||||
lang: 'zh_CN',
|
||||
success: (res) => {
|
||||
uni.login({// 获取登录用户code
|
||||
provider: 'weixin',
|
||||
success: (result)=> {
|
||||
uni.hideToast()
|
||||
// 调用更新用户信息事件
|
||||
this.updateUserInfo(result.code,res.userInfo);
|
||||
},
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
// console.log('用户拒绝授权');
|
||||
this.yesAuthBtn = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('请勿重复点击');
|
||||
}
|
||||
},
|
||||
// 更新用户信息事件
|
||||
updateUserInfo(code,userInfo) {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<view class="posir" :class="index==2 ? 'centerBox-item':''">
|
||||
<image :class="index==2 ? 'centerImg':'moImg'" v-if="newcurrent==index" :src="itemi.selectedIconPath"></image>
|
||||
<image :class="index==2 ? 'centerImg':'moImg'" v-else :src="itemi.iconPath"></image>
|
||||
<button v-if="index==2 && isKef" class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact">客服</button>
|
||||
<!-- <button v-if="index==2 && isKef" class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact">客服</button> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -102,11 +102,11 @@
|
|||
break;
|
||||
case 2:
|
||||
if(existMobile!=''){
|
||||
// wx.openCustomerServiceChat({
|
||||
// extInfo: {url: `https://work.weixin.qq.com/kfid/kfcb3bba5b57d9a42ba?enc_scene=ENC616HXDjLYNcmsR49PBE75UERg8Ncv3dygpYjfnh3XVvA&scene_param=${uni.getStorageSync('openid')}`},
|
||||
// corpId: 'ww1f86f258d4ff5817',
|
||||
// success(res) {}
|
||||
// })
|
||||
wx.openCustomerServiceChat({
|
||||
extInfo: {url: `https://work.weixin.qq.com/kfid/kfcb3bba5b57d9a42ba?enc_scene=ENC616HXDjLYNcmsR49PBE75UERg8Ncv3dygpYjfnh3XVvA&scene_param=${uni.getStorageSync('openid')}`},
|
||||
corpId: 'ww1f86f258d4ff5817',
|
||||
success(res) {}
|
||||
})
|
||||
this.$requst.post('user/rand-bind-service').then(res=>{})
|
||||
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
||||
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
|
||||
|
|
|
@ -5,9 +5,15 @@ console.log(ENV,2);
|
|||
// 清理所有缓存并前往授权页
|
||||
const goLogin = () => {
|
||||
uni.clearStorageSync();
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
uni.showToast({
|
||||
title:'信息错误请重新登录',
|
||||
icon:'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
},1000)
|
||||
}
|
||||
// 请求错误处理
|
||||
const checkError = (e) => {
|
||||
|
@ -90,6 +96,8 @@ const request = (method, url, options) => {
|
|||
})
|
||||
checkError(res)
|
||||
}
|
||||
} else if(res.statusCode==500) {
|
||||
goLogin();
|
||||
} else {
|
||||
checkError(res)
|
||||
}
|
||||
|
|
|
@ -211,8 +211,9 @@ const tools = {
|
|||
return arrEntities[t];
|
||||
})
|
||||
.replace('<section', '<div')
|
||||
.replace(/\<img/g, '<img @tap="pre" style="max-width:100%!important;height:auto" ')
|
||||
.replace(/\<img/g, '<img @tap="pre" style="max-width:100%!important;height:auto;" ')
|
||||
.replace(/src=\"/g,'src="https://oss.hmzfyy.cn');
|
||||
// 去除图片间隙 vertical-align:middle;
|
||||
},
|
||||
updaX(){//检测小程序版本以及更新小程序
|
||||
// 获取小程序的运行环境、版本号、appId 注意:线上小程序版本号仅支持在正式版小程序中获取,开发版和体验版中无法获取。
|
||||
|
@ -333,6 +334,7 @@ const tools = {
|
|||
if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){
|
||||
// (开发版,体验版)-配置全局域名
|
||||
uni.setStorageSync('hostapi','https://hengmei.scdxtc.cn/api/');
|
||||
// uni.setStorageSync('hostapi','https://hm.hmzfyy.cn/api/');
|
||||
} else {
|
||||
// 清除所有输出日志
|
||||
console.log = () =>{};
|
||||
|
|
|
@ -55,7 +55,8 @@
|
|||
"appid" : "wxa02e44170bc722cd",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"ad" : {}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<view v-if="isLoading" :style="{paddingTop: statusHNH+'px'}" class="pad-zy32 pad-x180">
|
||||
<view class="fon36 col3 bold mar-sx20" style="line-height: 50rpx;">{{detailObj.title}}</view>
|
||||
<view class="disac mar-x20">
|
||||
<image :src="headImg" style="width: 60rpx;height: 60rpx;border-radius: 100%;" mode="aspectFill"></image>
|
||||
<image :src="headImg" style="width: 60rpx;height: 60rpx;border-radius: 100%;" mode="widthFix"></image>
|
||||
<view class="mar-z10">
|
||||
<view class="fon28 col3">{{name}}</view>
|
||||
<view class="fon20 col9" style="margin-top: 6rpx;">{{detailObj.published_at}}发布</view>
|
||||
|
@ -109,6 +109,10 @@
|
|||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkDetail(options.id);
|
||||
this.checkAbout(this.category_id);
|
||||
this.$requst.get('index/base-config').then(res=>{
|
||||
this.headImg = this.$http + res.data.logo;
|
||||
this.name = res.data.logo_title;
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue