搜索事件更改为打开企业微信
parent
e8f3205187
commit
8e37f1abd5
|
@ -23,10 +23,10 @@
|
|||
</view> -->
|
||||
<view class='login-header'>
|
||||
<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image>
|
||||
<view class="logo-name">恒美植发</view>
|
||||
<view class="logo-name">{{appletName}}</view>
|
||||
</view>
|
||||
<view class="login-box">
|
||||
<view>
|
||||
<view @tap="setMiniColor">
|
||||
<button class='login-btn' open-type="getPhoneNumber" @getphonenumber="getphonenumber" :style="{background:publicColor}" type='primary'>手机号授权登录</button>
|
||||
</view>
|
||||
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">《用户服务协议》</text></view>
|
||||
|
@ -53,18 +53,17 @@
|
|||
publicColor:uni.getStorageSync('publicColor'),
|
||||
canIGetUserProfile: false,
|
||||
imgSrc: '/static/public/logo.png',//默认logo头像
|
||||
appletName:'恒美植发',//小程序名称
|
||||
isShowP:false,
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
// 检测当前运行环境并缓存域名
|
||||
this.$toolAll.tools.currentContext();
|
||||
this.setLogo();
|
||||
// 设置电量栏和导航栏的高度
|
||||
uni.setStorageSync('electric_nav_height',uni.getSystemInfoSync().statusBarHeight + 54);
|
||||
this.$toolAll.tools.isVedio();
|
||||
this.$requst.get(`index/mini-program-setting`).then(res=>{
|
||||
uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57
|
||||
})
|
||||
// let ya = this;
|
||||
// // 微信扫码后会自动编码,所以需要解码
|
||||
// if (options && options.q) {
|
||||
|
@ -82,11 +81,25 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
// 设置logo图
|
||||
setLogo(){
|
||||
this.$requst.get('index/base-config').then(res=>{
|
||||
this.imgSrc = this.$http + res.data.logo;
|
||||
this.appletName = res.data.appletName;
|
||||
})
|
||||
},
|
||||
refuse(){//暂不绑定事件
|
||||
this.isShowP=false;
|
||||
this.$toolAll.tools.showToast('登录成功','success')
|
||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
},
|
||||
// 设置主题色
|
||||
setMiniColor(){
|
||||
this.$requst.get(`index/mini-program-setting`).then(res=>{
|
||||
this.publicColor = res.data.mainColor;
|
||||
uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57
|
||||
})
|
||||
},
|
||||
getphonenumber(e){//授权绑定手机号
|
||||
let ya = this;
|
||||
wx.login({
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
<!-- 竖线 -->
|
||||
<view class="linev"></view>
|
||||
<!-- 搜索 -->
|
||||
<view @tap="searchEv" class="searchT flexs fon34" :style="{color:publicColor}">搜索</view>
|
||||
<!-- <view @tap="searchEv" class="searchT flexs fon34" :style="{color:publicColor}">搜索</view> -->
|
||||
<view @tap="enterprise" class="searchT flexs fon34" :style="{color:publicColor}">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pad-x180">
|
||||
|
@ -171,6 +172,9 @@
|
|||
getApp().globalData.outside = false;
|
||||
},
|
||||
onLoad(options) {
|
||||
this.$requst.get(`index/mini-program-setting`).then(res=>{
|
||||
uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57
|
||||
})
|
||||
if(options.q!=undefined){
|
||||
// 解码一:unescape("http%3A//www.baidu.com%3Fname%3Dzhang@xiao@jie%26order%3D1");
|
||||
// 解码二:decodeURIComponent("http%3A%2F%2Fwww.baidu.com%3Fname%3Dzhang%40xiao%40jie%26order%3D1")
|
||||
|
@ -524,19 +528,27 @@
|
|||
},
|
||||
searchEv(){//搜索事件
|
||||
// log(this.searchVal);
|
||||
if(this.$toolAll.tools.judgeAuth()){
|
||||
this.$requst.post('archives/keyword-check',{keyword:this.searchVal}).then(res=>{
|
||||
if(res.data.has) {
|
||||
uni.navigateTo({
|
||||
url:`/${res.data.target}`
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/searchPage/searchPage?keyWorld='+this.searchVal
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
// if(this.$toolAll.tools.judgeAuth()){
|
||||
// this.$requst.post('archives/keyword-check',{keyword:this.searchVal}).then(res=>{
|
||||
// if(res.data.has) {
|
||||
// uni.navigateTo({
|
||||
// url:`/${res.data.target}`
|
||||
// })
|
||||
// } else {
|
||||
// uni.navigateTo({
|
||||
// url:'/pagesB/searchPage/searchPage?keyWorld='+this.searchVal
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
},
|
||||
// 打开企业客服
|
||||
enterprise(){
|
||||
wx.openCustomerServiceChat({
|
||||
extInfo: {url: 'https://work.weixin.qq.com/kfid/kfcde3c314a587e1a94?enc_scene=ENCFUmhyT3hWCYZXnXNQUVycNKrv8wSPZ5nGDjvuLUmPeUZ'},
|
||||
corpId: 'ww1f86f258d4ff5817',
|
||||
success(res) {}
|
||||
})
|
||||
},
|
||||
chooseReEv(index){
|
||||
if(this.$toolAll.tools.judgeAuth()){
|
||||
|
|
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