整改授权

master
chen 2021-08-27 11:04:06 +08:00
parent d558380c8b
commit 3349b9a301
39 changed files with 168 additions and 130 deletions

View File

@ -51,7 +51,7 @@
data() { data() {
return { return {
isOk:false, isOk:false,
isNo:false isNo:false,
}; };
}, },
methods:{ methods:{
@ -120,6 +120,12 @@
this.$requst.post('user/login',params).then(res => { this.$requst.post('user/login',params).then(res => {
if(res.data.token!=''){ if(res.data.token!=''){
console.log('第一次登录'); 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) ya.successAfterEv(userInfo)
} }
},error => {}) },error => {})
@ -127,21 +133,13 @@
successAfterEv(userInfo){// successAfterEv(userInfo){//
let ya = this let ya = this
uni.hideToast() 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')); // console.log(uni.getStorageSync('headImg'));
ya.$toolAll.tools.showToast('授权成功','success') ya.$toolAll.tools.showToast('授权成功','success')
ya.$emit('cancleEv',0)
ya.$emit('buttonH',true)
if(ya.url!=''){ if(ya.url!=''){
setTimeout(()=>{uni.navigateTo({url:ya.url})},1000) setTimeout(()=>{uni.navigateTo({url:ya.url})},1000)
} }
ya.$emit('cancleEv',0)
ya.$emit('buttonH',true)
} }
} }
} }

View File

@ -108,7 +108,7 @@
if(!this.jieDuan){ if(!this.jieDuan){
let isAuth = this.$toolAll.tools.returnAuth() let isAuth = this.$toolAll.tools.returnAuth()
if(!isAuth){ if(!isAuth){
uni.navigateTo({url:'/pages/tabbar/cate/cate'}) uni.reLaunch({url:'/pages/tabbar/cate/cate'})
} else this.jieDuan = true } else this.jieDuan = true
} }
break; break;

View File

@ -1,7 +1,7 @@
<template> <template>
<view> <view>
<view v-if="isDot" class="banner-box"> <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"> <swiper-item v-for="(item,index) in bannerList" :key="index">
<view @tap="chooseImg(index)" class="posir"> <view @tap="chooseImg(index)" class="posir">
<image :style="{borderRadius:newRadius+'px',height:newHeight+'px'}" class="img" :src="item.imgSrc" mode="aspectFill"></image> <image :style="{borderRadius:newRadius+'px',height:newHeight+'px'}" class="img" :src="item.imgSrc" mode="aspectFill"></image>

View File

@ -14,7 +14,18 @@
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">用户服务协议</text></view> <view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">用户服务协议</text></view>
</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> </view>
</template> </template>
<script> <script>
@ -25,49 +36,48 @@
publicColor:uni.getStorageSync('publicColor'), publicColor:uni.getStorageSync('publicColor'),
canIGetUserProfile: false, canIGetUserProfile: false,
imgSrc: '/static/public/logo.png',//logo imgSrc: '/static/public/logo.png',//logo
invite_code:'',//() isShowP:false
channel:'',//()
invite_source:'',//[def|link|qr]
isShowT:false,
infoObj:{},
titleList:[],//
imgList:[],//
}; };
}, },
onLoad(options) { onLoad(options) {
if(uni.getStorageSync('showPhone')!='') this.isShowT = uni.getStorageSync('showPhone') // let ya = this;
let ya = this; // // ,
// , // if (options && options.q) {
if (options && options.q) { // let arr = decodeURIComponent(options.q).split('?')[1].split('&')
let arr = decodeURIComponent(options.q).split('?')[1].split('&') // let obj = {}
let obj = {} // arr.forEach(item => {
arr.forEach(item => { // let brr = item.split('=')
let brr = item.split('=') // obj[brr[0]] = brr[1]
obj[brr[0]] = brr[1] // })
}) // // console.log(obj) //
// console.log(obj) // // ya.invite_code = obj.invite_code
ya.invite_code = obj.invite_code // }
}
if (uni.getUserProfile) { if (uni.getUserProfile) {
this.canIGetUserProfile = true; this.canIGetUserProfile = true;
} }
}, },
methods: { methods: {
goInfo(){ refuse(){
uni.setStorageSync('firstInfo',this.infoObj) this.isShowP=false
uni.navigateTo({
url:'/pagesA/nodifyData/nodifyData?whereNum=2'
})
this.isShowT = false
},
quXiao(){
this.$toolAll.tools.showToast('登录成功','success') this.$toolAll.tools.showToast('登录成功','success')
setTimeout(()=>{ uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
uni.reLaunch({ },
url:'/pages/tabbar/pagehome/pagehome' getphonenumber(e){//
}) if(e.detail.errMsg=="getPhoneNumber:ok"){
},1000) this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
this.isShowT = false // 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(){ goXie(){
uni.navigateTo({ uni.navigateTo({
@ -127,9 +137,6 @@
city: ya.userInfo.city,// city: ya.userInfo.city,//
gender: ya.userInfo.gender,// gender: ya.userInfo.gender,//
language:ya.userInfo.language,// language:ya.userInfo.language,//
invite_code:ya.invite_code,//
invite_source:ya.invite_source,//[def|link|qr]
channel:ya.channel,//
is_active:1 is_active:1
} }
this.$requst.post('user/login',params).then(res => { this.$requst.post('user/login',params).then(res => {
@ -141,13 +148,8 @@
uni.setStorageSync('expire',res.data.expire)// uni.setStorageSync('expire',res.data.expire)//
uni.setStorageSync('is_active',res.data.is_active)// uni.setStorageSync('is_active',res.data.is_active)//
uni.setStorageSync('invite_code',res.data.invite_code) uni.setStorageSync('invite_code',res.data.invite_code)
this.isShowT = true uni.hideToast()
this.infoObj = { this.isShowP = true
headimgurl:ya.userInfo.avatarUrl,
nickname:ya.userInfo.nickName,
gender:ya.userInfo.gender,
coding:res.data.coding
}
} }
},error => {}) },error => {})
} }

View File

@ -59,19 +59,6 @@
<!-- 底部弹框 --> <!-- 底部弹框 -->
<!-- <city @choseVal="choseValue" :lotusAddressData="lotusAddressData"></city> --> <!-- <city @choseVal="choseValue" :lotusAddressData="lotusAddressData"></city> -->
<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm" themeColor="#007AFF"></simple-address> <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> <public-customer :nbottom="100"></public-customer>
</view> </view>
@ -123,7 +110,6 @@
newCity:'',// newCity:'',//
newDistrict:'',// newDistrict:'',//
whereCome:0, whereCome:0,
isShowT:true
} }
}, },
onShow() { onShow() {
@ -135,8 +121,6 @@
onLoad(options) { onLoad(options) {
if(options.whereNum==2){ if(options.whereNum==2){
this.whereCome = options.whereNum this.whereCome = options.whereNum
} else {
this.isShowT = false
} }
let chuo = new Date().getTime()// let chuo = new Date().getTime()//
let time = this.$toolAll.tools.timestampToTime(chuo)// XXXX-XX-XX let time = this.$toolAll.tools.timestampToTime(chuo)// XXXX-XX-XX
@ -148,7 +132,6 @@
}, },
}) })
let firstObj = uni.getStorageSync('firstInfo') let firstObj = uni.getStorageSync('firstInfo')
console.log('firstObj',firstObj);
if(firstObj==''){ if(firstObj==''){
let obj = uni.getStorageSync('uinfo') let obj = uni.getStorageSync('uinfo')
if(obj!='') this.uinfo = obj if(obj!='') this.uinfo = obj
@ -168,16 +151,6 @@
} }
}, },
methods: { 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(){ cancleEv(){
uni.setStorageSync('bindPhone',false) uni.setStorageSync('bindPhone',false)
}, },

View File

@ -42,6 +42,19 @@
<empower @buttonH="buttonH" :vision="vision" :isWhere="2" @cancleEv="cancleEv"></empower> <empower @buttonH="buttonH" :vision="vision" :isWhere="2" @cancleEv="cancleEv"></empower>
<!-- 底部客服 --> <!-- 底部客服 -->
<public-customer :nbottom="140"></public-customer> <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> </view>
</template> </template>
@ -65,7 +78,8 @@
haveImg:true, haveImg:true,
detailId:'', detailId:'',
invite_code:'', invite_code:'',
vision:false vision:false,
isShowP:false
} }
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
@ -113,10 +127,30 @@
} }
}, },
methods: { methods: {
buttonH(e){ moveHandle(){//
this.haveImg = e 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 if(e==0) this.vision = false
}, },
backHome(){ backHome(){

View File

@ -135,6 +135,19 @@
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> --> <!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 弹框授权 --> <!-- 弹框授权 -->
<empower @buttonH="buttonH" :vision="vision" :isWhere="2" @cancleEv="cancleEv"></empower> <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>
</view> </view>
</template> </template>
@ -183,7 +196,8 @@
active:'',// active:'',//
// jieDuan:false, // jieDuan:false,
share_id:0, share_id:0,
invite_code:'' invite_code:'',
isShowP:false
} }
}, },
onPageScroll(e) { onPageScroll(e) {
@ -263,6 +277,22 @@
if(options.share_id!=undefined) this.share_id = options.share_id if(options.share_id!=undefined) this.share_id = options.share_id
}, },
methods: { 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){// chooseLike(e){//
// console.log(this.dataList[e].is_collected); // console.log(this.dataList[e].is_collected);
let cateId = '' let cateId = ''
@ -324,7 +354,14 @@
// //
cancleCollectionEV({action:'collect',archive_id:this.xgList[e].id}) 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 if(e==0) this.vision = false
}, },
backHome(){ backHome(){
@ -355,12 +392,6 @@
this.vision = true this.vision = true
} }
}, },
buttonH(e){
this.haveImg = e
},
cancleEv(e){
if(e==0) this.vision = false
},
checkDetail(newId){ checkDetail(newId){
this.$requst.post('archives/detail',{id:newId,share_id:this.share_id}).then(res=>{ this.$requst.post('archives/detail',{id:newId,share_id:this.share_id}).then(res=>{
// console.log('',res); // console.log('',res);
@ -462,7 +493,7 @@
id:item.id, id:item.id,
imgSrc: item.headimg!=null ? item.headimg : '', imgSrc: item.headimg!=null ? item.headimg : '',
name:item.name, name:item.name,
cyear:item.work_time, cyear:parseFloat(item.work_time),
bmen:item.dept_name, bmen:item.dept_name,
zcheng:'主任医师', zcheng:'主任医师',
goodAt:item.diseases, 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