开放企业微信客服

master
chen 2022-03-25 19:26:07 +08:00
parent cf7e0295fc
commit a492c1b6be
26 changed files with 78 additions and 53 deletions

View File

@ -2,6 +2,10 @@
// launchtypelocalremote, localremote // launchtypelocalremote, localremote
"version": "0.0", "version": "0.0",
"configurations": [{ "configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" : "default" :
{ {
"launchtype" : "local" "launchtype" : "local"

View File

@ -16,7 +16,7 @@
<view @tap="chooseBtn" :class="noAuthBtn?'isNyin':'noyin'" class="btn btn-no">暂不授权</view> <view @tap="chooseBtn" :class="noAuthBtn?'isNyin':'noyin'" class="btn btn-no">暂不授权</view>
<view :class="yesAuthBtn?'isOyin':'noyin'" class="btn btn-yes"> <view :class="yesAuthBtn?'isOyin':'noyin'" class="btn btn-yes">
<text>立即授权</text> <text>立即授权</text>
<button open-type="getUserInfo" @tap="authEv" class="auth-btn">立即授权</button> <button @tap="authEv" class="auth-btn">立即授权</button>
</view> </view>
</view> </view>
</view> </view>
@ -64,7 +64,8 @@
showAuth:false, // showAuth:false, //
currentPage:'', // currentPage:'', //
showMobile:true ,// showMobile:true ,//
showUserInfo:false showUserInfo:false,
flag:true
}; };
}, },
destroyed() { destroyed() {
@ -122,26 +123,31 @@
this.noAuthBtn = true; this.noAuthBtn = true;
}, },
authEv(){// authEv(){//
this.$toolAll.tools.showToast('正在调起授权...'); if(this.flag) {
this.yesAuthBtn = true; this.flag = false;
uni.getUserProfile({// this.$toolAll.tools.showToast('正在调起授权...');
desc: '登录', this.yesAuthBtn = true;
lang: 'zh_CN', uni.getUserProfile({//
success: (res) => { desc: '登录',
uni.login({// code lang: 'zh_CN',
provider: 'weixin', success: (res) => {
success: (result)=> { uni.login({// code
uni.hideToast() provider: 'weixin',
// success: (result)=> {
this.updateUserInfo(result.code,res.userInfo); uni.hideToast()
}, //
}); this.updateUserInfo(result.code,res.userInfo);
}, },
fail: (err) => { });
// console.log(''); },
this.yesAuthBtn = false; fail: (err) => {
} // console.log('');
}); this.yesAuthBtn = false;
}
});
} else {
this.$toolAll.tools.showToast('请勿重复点击');
}
}, },
// //
updateUserInfo(code,userInfo) { updateUserInfo(code,userInfo) {

View File

@ -17,7 +17,7 @@
<view class="posir" :class="index==2 ? 'centerBox-item':''"> <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-if="newcurrent==index" :src="itemi.selectedIconPath"></image>
<image :class="index==2 ? 'centerImg':'moImg'" v-else :src="itemi.iconPath"></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> </view>
</view> </view>
@ -102,11 +102,11 @@
break; break;
case 2: case 2:
if(existMobile!=''){ if(existMobile!=''){
// wx.openCustomerServiceChat({ wx.openCustomerServiceChat({
// extInfo: {url: `https://work.weixin.qq.com/kfid/kfcb3bba5b57d9a42ba?enc_scene=ENC616HXDjLYNcmsR49PBE75UERg8Ncv3dygpYjfnh3XVvA&scene_param=${uni.getStorageSync('openid')}`}, extInfo: {url: `https://work.weixin.qq.com/kfid/kfcb3bba5b57d9a42ba?enc_scene=ENC616HXDjLYNcmsR49PBE75UERg8Ncv3dygpYjfnh3XVvA&scene_param=${uni.getStorageSync('openid')}`},
// corpId: 'ww1f86f258d4ff5817', corpId: 'ww1f86f258d4ff5817',
// success(res) {} success(res) {}
// }) })
this.$requst.post('user/rand-bind-service').then(res=>{}) this.$requst.post('user/rand-bind-service').then(res=>{})
this.$toolAll.tools.closeTimer()// this.$toolAll.tools.closeTimer()//
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{}) this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})

View File

@ -5,9 +5,15 @@ console.log(ENV,2);
// 清理所有缓存并前往授权页 // 清理所有缓存并前往授权页
const goLogin = () => { const goLogin = () => {
uni.clearStorageSync(); uni.clearStorageSync();
uni.navigateTo({ uni.showToast({
url: '/pages/login/login' title:'信息错误请重新登录',
}) icon:'none'
})
setTimeout(()=>{
uni.reLaunch({
url: '/pages/login/login'
})
},1000)
} }
// 请求错误处理 // 请求错误处理
const checkError = (e) => { const checkError = (e) => {
@ -90,6 +96,8 @@ const request = (method, url, options) => {
}) })
checkError(res) checkError(res)
} }
} else if(res.statusCode==500) {
goLogin();
} else { } else {
checkError(res) checkError(res)
} }

View File

@ -211,8 +211,9 @@ const tools = {
return arrEntities[t]; return arrEntities[t];
}) })
.replace('<section', '<div') .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'); .replace(/src=\"/g,'src="https://oss.hmzfyy.cn');
// 去除图片间隙 vertical-align:middle;
}, },
updaX(){//检测小程序版本以及更新小程序 updaX(){//检测小程序版本以及更新小程序
// 获取小程序的运行环境、版本号、appId 注意:线上小程序版本号仅支持在正式版小程序中获取,开发版和体验版中无法获取。 // 获取小程序的运行环境、版本号、appId 注意:线上小程序版本号仅支持在正式版小程序中获取,开发版和体验版中无法获取。
@ -333,6 +334,7 @@ const tools = {
if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){ if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){
// (开发版,体验版)-配置全局域名 // (开发版,体验版)-配置全局域名
uni.setStorageSync('hostapi','https://hengmei.scdxtc.cn/api/'); uni.setStorageSync('hostapi','https://hengmei.scdxtc.cn/api/');
// uni.setStorageSync('hostapi','https://hm.hmzfyy.cn/api/');
} else { } else {
// 清除所有输出日志 // 清除所有输出日志
console.log = () =>{}; console.log = () =>{};

View File

@ -55,7 +55,8 @@
"appid" : "wxa02e44170bc722cd", "appid" : "wxa02e44170bc722cd",
"UniversalLinks" : "" "UniversalLinks" : ""
} }
} },
"ad" : {}
} }
} }
}, },

View File

@ -5,7 +5,7 @@
<view v-if="isLoading" :style="{paddingTop: statusHNH+'px'}" class="pad-zy32 pad-x180"> <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="fon36 col3 bold mar-sx20" style="line-height: 50rpx;">{{detailObj.title}}</view>
<view class="disac mar-x20"> <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="mar-z10">
<view class="fon28 col3">{{name}}</view> <view class="fon28 col3">{{name}}</view>
<view class="fon20 col9" style="margin-top: 6rpx;">{{detailObj.published_at}}发布</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){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkDetail(options.id); this.checkDetail(options.id);
this.checkAbout(this.category_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() {// 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