整改授权
parent
d558380c8b
commit
3349b9a301
|
@ -51,7 +51,7 @@
|
|||
data() {
|
||||
return {
|
||||
isOk:false,
|
||||
isNo:false
|
||||
isNo:false,
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
|
@ -120,6 +120,12 @@
|
|||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
console.log('第一次登录');
|
||||
uni.setStorageSync('params',params)
|
||||
uni.setStorageSync('userId',res.data.account_id)
|
||||
uni.setStorageSync('token',res.data.token)//缓存token
|
||||
uni.setStorageSync('expire',res.data.expire)//缓存失效时间(时间戳格式)
|
||||
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
||||
uni.setStorageSync('invite_code',res.data.invite_code)
|
||||
ya.successAfterEv(userInfo)
|
||||
}
|
||||
},error => {})
|
||||
|
@ -127,21 +133,13 @@
|
|||
successAfterEv(userInfo){//缓存信息
|
||||
let ya = this
|
||||
uni.hideToast()
|
||||
uni.setStorageSync('params',params)
|
||||
uni.setStorageSync('userId',res.data.account_id)
|
||||
uni.setStorageSync('token',res.data.token)//缓存token
|
||||
uni.setStorageSync('expire',res.data.expire)//缓存失效时间(时间戳格式)
|
||||
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
||||
uni.setStorageSync('invite_code',res.data.invite_code)
|
||||
uni.setStorageSync('isShareK',true)
|
||||
uni.setStorageSync('headImg',userInfo.avatarUrl)//缓存用户头像
|
||||
// console.log(uni.getStorageSync('headImg'));
|
||||
ya.$toolAll.tools.showToast('授权成功','success')
|
||||
ya.$emit('cancleEv',0)
|
||||
ya.$emit('buttonH',true)
|
||||
if(ya.url!=''){
|
||||
setTimeout(()=>{uni.navigateTo({url:ya.url})},1000)
|
||||
}
|
||||
ya.$emit('cancleEv',0)
|
||||
ya.$emit('buttonH',true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
if(!this.jieDuan){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
uni.navigateTo({url:'/pages/tabbar/cate/cate'})
|
||||
uni.reLaunch({url:'/pages/tabbar/cate/cate'})
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="isDot" class="banner-box">
|
||||
<swiper :current="bcurrent" @change="changeBanner" :style="{height: newHeight+'px'}" :autoplay="true" :circular="true" :interval="3000" :duration="2000">
|
||||
<swiper :current="bcurrent" @change="changeBanner" :style="{height: newHeight+'px'}" :autoplay="true" :circular="true" :interval="3000" :duration="500">
|
||||
<swiper-item v-for="(item,index) in bannerList" :key="index">
|
||||
<view @tap="chooseImg(index)" class="posir">
|
||||
<image :style="{borderRadius:newRadius+'px',height:newHeight+'px'}" class="img" :src="item.imgSrc" mode="aspectFill"></image>
|
||||
|
|
|
@ -14,7 +14,18 @@
|
|||
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">《用户服务协议》</text></view>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<pu-po :isShowT="isShowT" :contentVal="'请完善个人资料'" :clearVal="'否'" :comfrimVal="'是'" @comfirmev="goInfo" @cancleev="quXiao"></pu-po>
|
||||
<view v-if="isShowP" class="disjcac posAll">
|
||||
<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 @tap="refuse" 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">
|
||||
立即绑定
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="posia syxzo">立即绑定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -25,49 +36,48 @@
|
|||
publicColor:uni.getStorageSync('publicColor'),
|
||||
canIGetUserProfile: false,
|
||||
imgSrc: '/static/public/logo.png',//默认logo头像
|
||||
invite_code:'',//用户邀请码(选填)(恒美)
|
||||
channel:'',//来源渠道,二维码或分享链接中携带的来源渠道参数(恒美)
|
||||
invite_source:'',//邀请码来源[def默认|link分享注册|qr扫码注册]
|
||||
isShowT:false,
|
||||
infoObj:{},
|
||||
titleList:[],//底部导航文字
|
||||
imgList:[],//底部导航图标
|
||||
isShowP:false
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('showPhone')!='') this.isShowT = uni.getStorageSync('showPhone')
|
||||
let ya = this;
|
||||
// 微信扫码后会自动编码,所以需要解码
|
||||
if (options && options.q) {
|
||||
let arr = decodeURIComponent(options.q).split('?')[1].split('&')
|
||||
let obj = {}
|
||||
arr.forEach(item => {
|
||||
let brr = item.split('=')
|
||||
obj[brr[0]] = brr[1]
|
||||
})
|
||||
// console.log(obj) //得到参数组成的对象
|
||||
ya.invite_code = obj.invite_code
|
||||
}
|
||||
// let ya = this;
|
||||
// // 微信扫码后会自动编码,所以需要解码
|
||||
// if (options && options.q) {
|
||||
// let arr = decodeURIComponent(options.q).split('?')[1].split('&')
|
||||
// let obj = {}
|
||||
// arr.forEach(item => {
|
||||
// let brr = item.split('=')
|
||||
// obj[brr[0]] = brr[1]
|
||||
// })
|
||||
// // console.log(obj) //得到参数组成的对象
|
||||
// ya.invite_code = obj.invite_code
|
||||
// }
|
||||
if (uni.getUserProfile) {
|
||||
this.canIGetUserProfile = true;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goInfo(){
|
||||
uni.setStorageSync('firstInfo',this.infoObj)
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/nodifyData/nodifyData?whereNum=2'
|
||||
})
|
||||
this.isShowT = false
|
||||
},
|
||||
quXiao(){
|
||||
refuse(){
|
||||
this.isShowP=false
|
||||
this.$toolAll.tools.showToast('登录成功','success')
|
||||
setTimeout(()=>{
|
||||
uni.reLaunch({
|
||||
url:'/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
},1000)
|
||||
this.isShowT = false
|
||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
},
|
||||
getphonenumber(e){//授权绑定手机号
|
||||
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
||||
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
||||
// console.log('手机号信息:',res);
|
||||
if(res.code==0){
|
||||
this.isShowP = false
|
||||
this.$toolAll.tools.showToast('手机号绑定成功','success')
|
||||
uni.setStorageSync('bindPhone',false)
|
||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
}
|
||||
},error=>{})
|
||||
} else {
|
||||
this.isShowP = false
|
||||
this.$toolAll.tools.showToast('登录成功','success')
|
||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
}
|
||||
},
|
||||
goXie(){
|
||||
uni.navigateTo({
|
||||
|
@ -127,9 +137,6 @@
|
|||
city: ya.userInfo.city,//用户所在城市
|
||||
gender: ya.userInfo.gender,//用户性别
|
||||
language:ya.userInfo.language,//语言
|
||||
invite_code:ya.invite_code,//用户邀请码
|
||||
invite_source:ya.invite_source,//邀请码来源[def默认|link分享注册|qr扫码注册]
|
||||
channel:ya.channel,//来源渠道,二维码或分享链接中携带的来源渠道参数
|
||||
is_active:1
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
|
@ -141,13 +148,8 @@
|
|||
uni.setStorageSync('expire',res.data.expire)//缓存失效时间(时间戳格式)
|
||||
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
||||
uni.setStorageSync('invite_code',res.data.invite_code)
|
||||
this.isShowT = true
|
||||
this.infoObj = {
|
||||
headimgurl:ya.userInfo.avatarUrl,
|
||||
nickname:ya.userInfo.nickName,
|
||||
gender:ya.userInfo.gender,
|
||||
coding:res.data.coding
|
||||
}
|
||||
uni.hideToast()
|
||||
this.isShowP = true
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
|
|
|
@ -59,19 +59,6 @@
|
|||
<!-- 底部弹框 -->
|
||||
<!-- <city @choseVal="choseValue" :lotusAddressData="lotusAddressData"></city> -->
|
||||
<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm" themeColor="#007AFF"></simple-address>
|
||||
<!-- 弹框 -->
|
||||
<view v-if="isShowT" class="disjcac posAll">
|
||||
<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 @tap="isShowT=false" 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">
|
||||
立即绑定
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="posia syxzo">获取手机号</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部客服 -->
|
||||
<public-customer :nbottom="100"></public-customer>
|
||||
</view>
|
||||
|
@ -123,7 +110,6 @@
|
|||
newCity:'',//当前城市
|
||||
newDistrict:'',//当前区县
|
||||
whereCome:0,
|
||||
isShowT:true
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
@ -135,8 +121,6 @@
|
|||
onLoad(options) {
|
||||
if(options.whereNum==2){
|
||||
this.whereCome = options.whereNum
|
||||
} else {
|
||||
this.isShowT = false
|
||||
}
|
||||
let chuo = new Date().getTime()// 获取当前时间戳
|
||||
let time = this.$toolAll.tools.timestampToTime(chuo)// 转换日期格式为XXXX-XX-XX
|
||||
|
@ -148,7 +132,6 @@
|
|||
},
|
||||
})
|
||||
let firstObj = uni.getStorageSync('firstInfo')
|
||||
console.log('firstObj',firstObj);
|
||||
if(firstObj==''){
|
||||
let obj = uni.getStorageSync('uinfo')
|
||||
if(obj!='') this.uinfo = obj
|
||||
|
@ -168,16 +151,6 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getphonenumber(e){
|
||||
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
||||
// console.log('手机号信息:',res);
|
||||
if(res.code==0){
|
||||
uni.setStorageSync('bindPhone',false)
|
||||
this.dataList[6].content = res.data.phone//恒美ID
|
||||
this.isShowT = false
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
cancleEv(){
|
||||
uni.setStorageSync('bindPhone',false)
|
||||
},
|
||||
|
|
|
@ -42,6 +42,19 @@
|
|||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2" @cancleEv="cancleEv"></empower>
|
||||
<!-- 底部客服 -->
|
||||
<public-customer :nbottom="140"></public-customer>
|
||||
<!-- 弹框 -->
|
||||
<view v-if="isShowP" @touchmove.stop.prevent="moveHandle" class="disjcac posAll">
|
||||
<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 @tap="isShowP=false" 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">
|
||||
立即绑定
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="posia syxzo">立即绑定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -65,7 +78,8 @@
|
|||
haveImg:true,
|
||||
detailId:'',
|
||||
invite_code:'',
|
||||
vision:false
|
||||
vision:false,
|
||||
isShowP:false
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
|
@ -113,10 +127,30 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
buttonH(e){
|
||||
this.haveImg = e
|
||||
moveHandle(){//禁止底层滑动
|
||||
return false
|
||||
},
|
||||
cancleEv(e){
|
||||
getphonenumber(e){//授权绑定手机号
|
||||
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
||||
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
||||
// console.log('手机号信息:',res);
|
||||
if(res.code==0){
|
||||
this.isShowP = false
|
||||
this.$toolAll.tools.showToast('手机号绑定成功','success')
|
||||
}
|
||||
},error=>{})
|
||||
} else {
|
||||
this.isShowP = false
|
||||
}
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
cancleEv(e){//取消授权
|
||||
if(e==0) this.vision = false
|
||||
},
|
||||
backHome(){
|
||||
|
|
|
@ -135,6 +135,19 @@
|
|||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2" @cancleEv="cancleEv"></empower>
|
||||
<!-- 弹框 -->
|
||||
<view v-if="isShowP" @touchmove.stop.prevent="moveHandle" class="disjcac posAll">
|
||||
<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 @tap="isShowP=false" 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">
|
||||
立即绑定
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="posia syxzo">立即绑定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
@ -183,7 +196,8 @@
|
|||
active:'',//是否是详情页
|
||||
// jieDuan:false,
|
||||
share_id:0,
|
||||
invite_code:''
|
||||
invite_code:'',
|
||||
isShowP:false
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -263,6 +277,22 @@
|
|||
if(options.share_id!=undefined) this.share_id = options.share_id
|
||||
},
|
||||
methods: {
|
||||
moveHandle(){//禁止底层滑动
|
||||
return false
|
||||
},
|
||||
getphonenumber(e){//授权绑定手机号
|
||||
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
||||
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
||||
// console.log('手机号信息:',res);
|
||||
if(res.code==0){
|
||||
this.isShowP = false
|
||||
this.$toolAll.tools.showToast('手机号绑定成功','success')
|
||||
}
|
||||
},error=>{})
|
||||
} else {
|
||||
this.isShowP = false
|
||||
}
|
||||
},
|
||||
chooseLike(e){//收藏事件
|
||||
// console.log(this.dataList[e].is_collected);
|
||||
let cateId = ''
|
||||
|
@ -324,7 +354,14 @@
|
|||
// 调用取消收藏事件
|
||||
cancleCollectionEV({action:'collect',archive_id:this.xgList[e].id})
|
||||
},
|
||||
cancleEv(e){
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
cancleEv(e){//取消授权
|
||||
if(e==0) this.vision = false
|
||||
},
|
||||
backHome(){
|
||||
|
@ -355,12 +392,6 @@
|
|||
this.vision = true
|
||||
}
|
||||
},
|
||||
buttonH(e){
|
||||
this.haveImg = e
|
||||
},
|
||||
cancleEv(e){
|
||||
if(e==0) this.vision = false
|
||||
},
|
||||
checkDetail(newId){
|
||||
this.$requst.post('archives/detail',{id:newId,share_id:this.share_id}).then(res=>{
|
||||
// console.log('详情数据:',res);
|
||||
|
@ -462,7 +493,7 @@
|
|||
id:item.id,
|
||||
imgSrc: item.headimg!=null ? item.headimg : '',
|
||||
name:item.name,
|
||||
cyear:item.work_time,
|
||||
cyear:parseFloat(item.work_time),
|
||||
bmen:item.dept_name,
|
||||
zcheng:'主任医师',
|
||||
goodAt:item.diseases,
|
||||
|
|
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
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