整改授权

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() {
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)
}
}
}

View File

@ -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;

View File

@ -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>

View File

@ -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 => {})
}

View File

@ -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)
},

View File

@ -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(){

View File

@ -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