客服更改
parent
a492c1b6be
commit
3ffc98b979
66
App.vue
66
App.vue
|
@ -6,6 +6,7 @@
|
|||
outside:true//是否外界进来,默认是
|
||||
},
|
||||
onLaunch: function() {
|
||||
this.autoUpdate();
|
||||
// 检测当前运行环境并缓存域名
|
||||
toolAll.tools.currentContext();
|
||||
// 设置电量栏和导航栏的高度
|
||||
|
@ -33,7 +34,7 @@
|
|||
onShow: function() {
|
||||
if(uni.getStorageSync('token')!='') {
|
||||
toolAll.tools.networkStatus();//检查当前网络状态
|
||||
toolAll.tools.updaX();//检测版本更新
|
||||
// toolAll.tools.updaX();//检测版本更新
|
||||
toolAll.tools.isLogin();//刷新token
|
||||
}
|
||||
toolAll.tools.checkQuan(); // 查询首页活动券
|
||||
|
@ -44,6 +45,69 @@
|
|||
uni.removeStorageSync('quanImg'); // 清空优惠券图片缓存
|
||||
uni.removeStorageSync('quanId'); // 清空优惠券id缓存
|
||||
uni.removeStorageSync('isVedio'); // 清空是否是视频缓存
|
||||
},
|
||||
methods:{
|
||||
autoUpdate: function() {
|
||||
var self = this;
|
||||
// 获取小程序更新机制兼容
|
||||
if (wx.canIUse('getUpdateManager')) {
|
||||
const updateManager = wx.getUpdateManager() //1. 检查小程序是否有新版本发布
|
||||
updateManager.onCheckForUpdate(function(res) { // 请求完新版本信息的回调
|
||||
if (res.hasUpdate) {
|
||||
//检测到新版本,需要更新,给出提示
|
||||
wx.showModal({
|
||||
title: '更新提示',
|
||||
content: '检测到新版本,是否下载新版本并重启小程序?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
//2. 用户确定下载更新小程序,小程序下载及更新静默进行
|
||||
self.downLoadAndUpdate(updateManager)
|
||||
uni.clearStorage();
|
||||
} else if (res.cancel) {
|
||||
//用户点击取消按钮的处理,如果需要强制更新,则给出二次弹窗,如果不需要,则这里的代码都可以删掉了
|
||||
wx.showModal({
|
||||
title: '温馨提示~',
|
||||
content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~',
|
||||
showCancel:false,//隐藏取消按钮
|
||||
confirmText:"确定更新",//只保留确定更新按钮
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
//下载新版本,并重新应用
|
||||
self.downLoadAndUpdate(updateManager)
|
||||
console.log(5);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else { // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 下载小程序新版本并重启应用
|
||||
* */
|
||||
downLoadAndUpdate: function (updateManager){
|
||||
var self = this;
|
||||
wx.showLoading(); //静默下载更新小程序新版本
|
||||
updateManager.onUpdateReady(function () {
|
||||
wx.hideLoading() //新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||
updateManager.applyUpdate()
|
||||
uni.clearStorage();
|
||||
})
|
||||
updateManager.onUpdateFailed(function () { // 新的版本下载失败
|
||||
wx.showModal({
|
||||
title: '已经有新版本了哟~',
|
||||
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~',
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<view>是否选择授权登录</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="auth-center">申请 获取你的昵称、头像</view>
|
||||
<view class="auth-center">为了给您提供更好的服务,向您申请微信头像及昵称授权。</view>
|
||||
<view class="auth-bottom">
|
||||
<view @tap="chooseBtn" :class="noAuthBtn?'isNyin':'noyin'" class="btn btn-no">暂不授权</view>
|
||||
<view :class="yesAuthBtn?'isOyin':'noyin'" class="btn btn-yes">
|
||||
|
@ -26,8 +26,8 @@
|
|||
<view class="bacf radius20 width100 tank-box">
|
||||
<view class="tc tank-box-itemone">请授权绑定手机号</view>
|
||||
<view class="fon28 colf pad-x30 pad-zy30 tc disjb">
|
||||
<view class="pad-sx10 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view>
|
||||
<view class="pad-sx10 radius10 tank-btn posir pbackc">
|
||||
<view class="pad-sx20 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view>
|
||||
<view class="pad-sx20 radius10 tank-btn posir pbackc">
|
||||
立即绑定
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="posia syxzo">立即绑定</button>
|
||||
</view>
|
||||
|
@ -47,10 +47,10 @@
|
|||
return {}
|
||||
}
|
||||
},
|
||||
appletImg:{//小程序头像
|
||||
type:String,
|
||||
default:'/static/public/like.png'
|
||||
},
|
||||
// appletImg:{//小程序头像
|
||||
// type:String,
|
||||
// default:'/static/public/like.png'
|
||||
// },
|
||||
appletName:{//小程序名称
|
||||
type:String,
|
||||
default:''
|
||||
|
@ -65,7 +65,8 @@
|
|||
currentPage:'', // 当前页面路径
|
||||
showMobile:true ,// 是否显示手机授权弹框
|
||||
showUserInfo:false,
|
||||
flag:true
|
||||
flag:true,
|
||||
appletImg:''//小程序logo
|
||||
};
|
||||
},
|
||||
destroyed() {
|
||||
|
@ -73,6 +74,7 @@
|
|||
uni.removeStorageSync('urlparams');
|
||||
},
|
||||
mounted() {
|
||||
this.appletImg = uni.getStorageSync('appletImg');
|
||||
// 转发进入:获取页面路径
|
||||
let pages = getCurrentPages(); //获取加载的页面
|
||||
let currentPage = pages[pages.length - 1]; //获取当前页面的对象
|
||||
|
@ -197,6 +199,9 @@
|
|||
this.showMobile = false;
|
||||
uni.setStorageSync('phone_active',1);//是否第一次授权
|
||||
uni.setStorageSync('outside',6);//表示外界进来授权的
|
||||
setTimeout(()=>{
|
||||
this.authEv();
|
||||
},2000)
|
||||
// this.showAuth = false; // 关闭手机号授权弹框
|
||||
// uni.reLaunch({ // 重新进入当前页面
|
||||
// url:uni.getStorageSync('urlparams')
|
||||
|
@ -222,7 +227,7 @@
|
|||
.auth-top-content view:nth-child(1) {font-size: 30rpx;font-weight: bold;margin-top: 0;}
|
||||
.auth-center {font-size: 28rpx;margin: 30rpx 0;border-bottom: 1rpx solid #F5F5F5;border-top: 1rpx solid #F5F5F5;padding: 20rpx 0;}
|
||||
.auth-bottom {display: flex;justify-content: center;align-items: center;font-size: 24rpx;}
|
||||
.btn {padding: 12rpx 40rpx;border-radius: 4rpx;}
|
||||
.btn {padding: 20rpx 60rpx;border-radius: 4rpx;}
|
||||
.btn-no {color: #07ad60;background-color: #FFFFFF;border: 1rpx solid #CCCCCC;}
|
||||
.btn-yes {color: #FFFFFF;background-color: #07ad60;border: 1rpx solid #07ad60;position: relative;margin-left: 20rpx;}
|
||||
.auth-btn {position: absolute;top: 0;left: 0;right: 0;bottom: 0;opacity: 0;}
|
||||
|
|
|
@ -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=>{})
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
},
|
||||
titleVal:{//标题内容
|
||||
type:String,
|
||||
default:'恒美植发'
|
||||
default:''
|
||||
},
|
||||
whereCome:{//来自哪个页面
|
||||
type:Number,
|
||||
|
|
|
@ -79,8 +79,20 @@ const request = (method, url, options) => {
|
|||
break;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
let hostapi = '';
|
||||
// #ifdef MP-WEIXIN
|
||||
let hInfo = wx.getAccountInfoSync();
|
||||
// console.log(hInfo.envVersion);//develop:开发版 trial:体验版 release:正式版
|
||||
if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){
|
||||
// (开发版,体验版)域名
|
||||
hostapi = 'https://hengmei.scdxtc.cn/api/';
|
||||
} else {
|
||||
// 正式版-域名
|
||||
hostapi = 'https://hm.hmzfyy.cn/api/';
|
||||
}
|
||||
// #endif
|
||||
uni.request({
|
||||
url: `${uni.getStorageSync('hostapi')}${url}`,
|
||||
url: `${hostapi}${url}`,
|
||||
method: methods,
|
||||
data: options,
|
||||
header: headers,
|
||||
|
|
|
@ -315,6 +315,8 @@ const tools = {
|
|||
success: res => {
|
||||
if(res.data.code==0){
|
||||
res.data.data.v==0 ? uni.setStorageSync('isVedio',false) : uni.setStorageSync('isVedio',true);
|
||||
let appletImg = 'https://oss.hmzfyy.cn' + res.data.data.logo;
|
||||
uni.setStorageSync('appletImg',appletImg);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
<view class="bacf radius20 width100 tank-box">
|
||||
<view class="tc tank-box-itemone">微信授权</view>
|
||||
<view class="fon28 colf pad-x30 pad-zy30 tc disjb">
|
||||
<view class="pad-sx10 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view>
|
||||
<view :style="{background:publicColor}" class="pad-sx10 radius10 tank-btn posir">
|
||||
<view class="pad-sx20 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view>
|
||||
<view :style="{background:publicColor}" class="pad-sx20 radius10 tank-btn posir">
|
||||
立即授权
|
||||
<button @click="bindGetUserInfo" class="posia syxzo">立即授权</button>
|
||||
</view>
|
||||
|
|
|
@ -161,7 +161,7 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('electric_nav_height'),
|
||||
statusHNH:uni.getSystemInfoSync().statusBarHeight + 54,
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
tongList:[
|
||||
{num:'0',title:'我的积分'},
|
||||
|
|
|
@ -413,8 +413,7 @@
|
|||
url:res.data.ad[2].link,
|
||||
}
|
||||
}
|
||||
// this.publicColor = res.data.mainColor
|
||||
this.publicColor = uni.getStorageSync('publicColor')
|
||||
this.publicColor = res.data.mainColor
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
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