Commit cab3cadd authored by ly's avatar ly

授权弹窗

parent cd956f98
......@@ -12,6 +12,7 @@
</template>
<script>
export default {
name:"moduleCard",
props:{
......
......@@ -64,7 +64,7 @@
import {UploadFile} from "../../utils/upload.js"
import Permission from '@/js_sdk/wa-permission/permission'
import { pathToBase64, base64ToPath } from 'image-tools'
import {loadDevice,loadNetwork,loadUuid,loadLocation} from '../../utils/deviceInfo.js'
export default {
data() {
return {
......@@ -110,6 +110,13 @@
}
},
onLoad() {
const common = uni.getStorageSync("m-header-device")
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
}
},
methods: {
......
......@@ -24,7 +24,9 @@
<view class='line-main'>
<label class='main-lab'>学历</label>
<view class='main-right'>
<input class='line-right-input' placeholder="请选择学历" disabled="true" placeholder-style="color:#9E9E9E" :value='educationVal'/>
<view class='line-right-input' v-if="educationVal==''">请选择学历</view>
<view v-else class='line-right-input'>{{educationVal}}</view>
<!-- <input class='line-right-input' placeholder="请选择学历" placeholder-style="color:#9E9E9E" :value='educationVal'/> -->
<i class='r-icon'></i>
</view>
......@@ -35,7 +37,9 @@
<view class='line-main'>
<label class='main-lab'>个人月收入</label>
<view class='main-right'>
<input class='line-right-input' placeholder="请选择月收入" disabled="true" placeholder-style="color:#9E9E9E" :value='columnVal'/>
<view class='line-right-input' v-if="columnVal==''">请选择月收入</view>
<view v-else class='line-right-input'>{{columnVal}}</view>
<!-- <input class='line-right-input' placeholder="请选择月收入" disabled placeholder-style="color:#9E9E9E" :value='columnVal'/> -->
<i class='r-icon'></i>
</view>
......@@ -46,7 +50,9 @@
<view class='line-main'>
<label class='main-lab'>婚姻状况</label>
<view class='main-rights'>
<input class='line-right-input' placeholder="请选择婚姻状况" disabled="true" placeholder-style="color:#9E9E9E" :value='marriageVal'/>
<view v-if="marriageVal==''" class='line-right-input' >请选择婚姻状况</view>
<view v-else class='line-right-input'>{{marriageVal}}</view>
<!-- <input class='line-right-input' placeholder="请选择婚姻状况" disabled="true" placeholder-style="color:#9E9E9E" :value='marriageVal'/> -->
<i class='r-icon'></i>
</view>
......@@ -147,7 +153,9 @@
<view class='line-main'>
<label class='main-lab'>关系</label>
<view class='main-right'>
<input class='line-right-input' placeholder="请选择与您的关系" disabled="true" placeholder-style="color:#9E9E9E" :value="relationVal"/>
<view v-if="relationVal==''" class='line-right-input' >请选择与您的关系</view>
<view v-else class='line-right-input'>{{relationVal}}</view>
<!-- <input class='line-right-input' placeholder="请选择与您的关系" disabled="true" placeholder-style="color:#9E9E9E" :value="relationVal"/> -->
<i class='r-icon'></i>
</view>
......@@ -189,7 +197,9 @@
<view class='line-main'>
<label class='main-lab'>关系</label>
<view class='main-right'>
<input class='line-right-input' placeholder="请选择与您的关系" disabled="true" placeholder-style="color:#9E9E9E" :value="relationVals"/>
<view v-if="relationVals==''" class='line-right-input' >请选择与您的关系</view>
<view v-else class='line-right-input'>{{relationVals}}</view>
<!-- <input class='line-right-input' placeholder="请选择与您的关系" disabled="true" placeholder-style="color:#9E9E9E" :value="relationVals"/> -->
<i class='r-icon'></i>
</view>
......@@ -453,12 +463,12 @@
self.$request('/app/v1/checkProductList','POST').then(res => {
console.log(res,'checkProductList')
const {jumpUrl}=res.result
console.log(jumpUrl,'jumpUrl')
console.log(jumpUrl,'jumpUrl8')
const indexs=jumpUrl.indexOf(":")
if(indexs!==-1){
const schema = jumpUrl.substring(0, indexs)
if(schema=='uni'){
this.Go(jumpUrl)
this.Go('uni:/pages/indexfinance/index','tab')
}else{
uni.navigateTo({
url:`/pages/websrc/websrc?url=${jumpUrl}`
......
......@@ -17,7 +17,7 @@
<image class='l-icon' :src='item.appLogo'></image>
<view class='l-name'>{{item.appName}}</view>
</view>
<view class='top-time'>借款日:{{item.gmtCreated}}</view>
<!-- <view class='top-time'>借款日:{{item.gmtCreated}}</view> -->
<view class='top-des'>{{item.loanStatusStr}}</view>
</view>
<view class='main-s'>
......@@ -118,16 +118,16 @@
},
onShow() {
const token=uni.getStorageSync('token')
const common = uni.getStorageSync("m-header-device")
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.init()
}else{
// const common = uni.getStorageSync("m-header-device")
// if(!common && plus.os.name!='iOS' && token){
// loadDevice()
// loadNetwork()
// loadUuid()
// loadLocation()
// this.init()
// }else{
this.init()
}
// }
}
}
......
......@@ -24,6 +24,7 @@
</template>
<script>
import Permission from "../../js_sdk/wa-permission/permission.js";
import { pathToBase64,base64ToPath} from 'image-tools'
const LF = uni.requireNativePlugin('AThree-LFv2')
export default {
......@@ -40,10 +41,12 @@
}
},
onLoad() {
this.checkPermission()
this.faceToken()
this.initUser()
this.checkPermission()
// this.requestPermission()
},
methods: {
//获取个人信息
initUser(){
......@@ -89,9 +92,38 @@
})
},
checkPermission(){
// 在需要请求权限的地方调用此函数
// requestPermission() {
// return new Promise((resolve, reject) => {
// // 判断是否已经有了权限
// if (uni.getSystemInfoSync().platform === 'android' && uni.canIUse('android.permission.READ_EXTERNAL_STORAGE')) {
// // 判断是否需要请求权限
// plus.android.requestPermissions(
// [plus.android.PERMISSION_READ, plus.android.PERMISSION_WRITE],
// function(e) {
// // 权限请求成功
// if (e.denyList.length === 0) {
// resolve('授权成功');
// } else {
// reject('用户拒绝授权');
// }
// },
// function(e) {
// // 权限请求失败
// reject('授权失败');
// }
// );
// } else {
// // 平台不是Android或不支持此API
// reject('不支持授权');
// }
// });
// },
async checkPermission(){
// 判断是否是Android设备
if (plus.os.name.toLowerCase() === 'android') {
// 获取Context对象
var Context = plus.android.importClass('android.content.Context');
// 获取Activity对象
......@@ -102,43 +134,69 @@
var Manifest = plus.android.importClass('android.Manifest');
// 获取permission对象
var permission = Manifest.permission;
// 判断是否已有权限
if (Activity.checkSelfPermission(permission.READ_EXTERNAL_STORAGE) !== PackageManager.PERMISSION_GRANTED ||
Activity.checkSelfPermission(permission.WRITE_EXTERNAL_STORAGE) !== PackageManager.PERMISSION_GRANTED) {
// 没有权限,请求权限
Activity.requestPermissions(
[permission.READ_EXTERNAL_STORAGE, permission.WRITE_EXTERNAL_STORAGE],
1 // 请求码
);
}
const rContacts=await Activity.checkSelfPermission('permission.READ_EXTERNAL_STORAGE')
const fileFlag=await Activity.checkSelfPermission('WRITE_EXTERNAL_STORAGE')
console.log(rContacts,fileFlag,'33')
let strStatus
if(rContacts==-1){
// 没有权限,请求权限
Activity.requestPermissions(
[permission.READ_EXTERNAL_STORAGE, permission.WRITE_EXTERNAL_STORAGE],
1 ,// 请求码
);
}else if(rContacts===0){
console.log('未获取权限')
}else{
console.log('授权成共')
}
}
},
goFace(){
const self = this
const {bizToken, requestId} = self
LF.Face_UP({
token:bizToken,
requestId
}, (res) => {
console.log(res, '检测结果')
if (res.code === 1000) {
let {image, code} = res
const faceImage = image.replace(/\n/g, '')
self.UploadFaceImg(`data:image/png;base64,${faceImage}`);
} else {
uni.showLoading({
title: "人脸检测异常",
mask: true,
duration: 2000
})
}
})
const faceVals=uni.getStorageSync('faceVals')
console.log(faceVals,'活体按钮点击')
if(faceVals!=1 && plus.os.name.toLowerCase() === 'android'){
uni.showModal({
title: '"多典花"想访问您的读写权限',
content: '应用为您提供的服务,要访问您的读写权限,需要您提供权限,请允许。',
cancelText: '取消',
confirmText: '去设置',
success: function (res) {
if (res.confirm) {
Permission.gotoAppPermissionSetting()
}
}
});
// return false
}
LF.Face_UP({
token:bizToken,
requestId
}, (res) => {
console.log(res, '检测结果')
if (res.code === 1000) {
let {image, code} = res
const faceImage = image.replace(/\n/g, '')
uni.setStorageSync('faceVals','1')
self.UploadFaceImg(`data:image/png;base64,${faceImage}`);
} else {
uni.setStorageSync('faceVals','1')
uni.showLoading({
title: "人脸检测异常",
mask: true,
duration: 2000
})
}
})
},
UploadFaceImg(img){
const self = this
......@@ -218,7 +276,7 @@
uni.showToast({
icon:"success",
title:authResult.message,
duration: 2000
duration: 500
})
uni.redirectTo({
url:'/pages/baseInfo/baseInfo'
......@@ -236,6 +294,9 @@
console.log(err,'请求出错')
})
}
},
onShow() {
// this.checkPermission()
}
}
</script>
......
......@@ -283,31 +283,17 @@
const token=uni.getStorageSync('token')
const common = uni.getStorageSync("m-header-device")
this.token=token
if(!common && plus.os.name!='iOS' && token){
// const authLocation=uni.getStorageSync('authLocation')
// if(authLocation){
// console.log('888')
// uni.showToast({
// title: '请允许地理位置信息',
// icon: "none",
// duration: 2000
// })
// return false
// }else{
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.init()
this.searchGood()
// }
}else{
// if(!common && plus.os.name!='iOS' && token){
// loadDevice()
// loadNetwork()
// loadUuid()
// loadLocation()
// this.init()
// this.searchGood()
// }else{
this.init()
this.searchGood()
}
// }
}
......
......@@ -144,13 +144,13 @@
console.log('onShow2x')
this.init()
const token=uni.getStorageSync('tokenFinance')
const common = uni.getStorageSync("m-header-device")
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
}
// const common = uni.getStorageSync("m-header-device")
// if(!common && plus.os.name!='iOS' && token){
// loadDevice()
// loadNetwork()
// loadUuid()
// loadLocation()
// }
}
}
......
......@@ -121,12 +121,12 @@
},
goPage(item){
// const mobileCall=uni.getStorageSync('mobileCall')
const newurl='http://192.168.0.23:8080/#/loan'
// const newurl='http://192.168.0.23:8080/#/loan'
// this.Go('http://192.168.0.23:8080/#/loanMulti')
uni.navigateTo({
url:`/pages/websrc/websrc?url=${newurl}`
})
// this.Go(item.linkUrl)
// uni.navigateTo({
// url:`/pages/websrc/websrc?url=${newurl}`
// })
this.Go(item.linkUrl)
},
goLogin(){
this.Go('uni:/pages/login/login')
......@@ -167,14 +167,14 @@
onShow(){
const token=uni.getStorageSync('token')
const common = uni.getStorageSync("m-header-device")
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.initMy()
this.initTels()
}else{
// if(!common && plus.os.name!='iOS' && token){
// loadDevice()
// loadNetwork()
// loadUuid()
// loadLocation()
// this.initMy()
// this.initTels()
// }else{
if(token==''){
this.userTel=''
this.Go('uni:/pages/login/login')
......@@ -182,7 +182,7 @@
}
this.initMy()
this.initTels()
}
// }
}
}
......
{"dir":"/Users/seaman/srv/bdserver.dcloud.net.cn/service/storage/app/package/IOS/queue/492a8dd0-6e8b-11ef-af6c-15f760036ffb/wgtRoot/__UNI__DE04B13/"}
\ No newline at end of file
{"dir":"/Users/seaman/srv/bdserver.dcloud.net.cn/service/storage/app/package/IOS/queue/eaed3ee0-7262-11ef-8b8e-959d05b8c4f4/wgtRoot/__UNI__DE04B13/"}
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment