Commit 0b1dff93 authored by ly's avatar ly

更改webview中的挑战

parent 548ca3fa
......@@ -3,7 +3,7 @@
"appid" : "__UNI__DE04B13",
"description" : "",
"versionName" : "1.0.1",
"versionCode" : 123,
"versionCode" : 124,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
......
......@@ -135,13 +135,29 @@
const self=this
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
sizeType: ['original','compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album','camera'], //从相册选择
success: function(res) {
console.log(res,'rrr')
for(let i=0; i<res.tempFilePaths.length;i++){
self.getOss(res.tempFilePaths[i],type)
}
console.log(res.tempFiles[0].size,'rrr')
const tempFilePaths=res.tempFilePaths[0]
const fileSize=res.tempFiles[0].size
if(fileSize > (5 * 1024 * 1024)){
uni.compressImage({
src:tempFilePaths,
quality:80,
success:(ress) =>{
console.log(ress,'90')
self.getOss(ress.tempFilePath,type)
}
})
}else{
self.getOss(tempFilePaths,type)
}
// for(let i=0; i<res.tempFilePaths.length;i++){
// self.getOss(res.tempFilePaths[i],type)
// }
}
})
},
......
......@@ -190,6 +190,7 @@
self.$request('/app/v1/loginNoCheck','POST',params).then(res => {
console.log(res,'loginNoCheck');
const {deviceId,token }=res.result
uni.setStorageSync('mobileCall',self.mobile)
uni.setStorageSync('deviceId',deviceId)
uni.setStorageSync('tokenFinance',token)
}).catch(err=>{
......
......@@ -75,22 +75,14 @@
this.Go('uni:/pages/login/login')
return false
}else{
this.init()
this.initMy()
this.initTels()
}
},
methods: {
init(){
const self=this
self.$request('/pawn/client/userIndex','POST').then((res)=>{
const { userInfo,menuList }=res.result
console.log(res.result,'9999')
self.userTel=userInfo.cell
self.menuList=JSON.parse(menuList)
})
},
initTels(){
const self=this
self.$request('/app/v1/settings','GET').then(res => {
......@@ -107,7 +99,7 @@
console.log(res,'userIndex');
const { menuBar ,user,baseMenuBar,extMenuBarList}=res.result
self.menuBar=menuBar
self.baseMenuBar=baseMenuBar
self.menuList=baseMenuBar
self.extMenuBarList=extMenuBarList
if(user.cell){
self.userTel=user.cell
......@@ -120,7 +112,9 @@
})
},
goPage(item){
this.Go('http://192.168.0.65:8080/#/loan')
// const mobileCall=uni.getStorageSync('mobileCall')
// const newurl='http://192.168.0.23:8080/#/loan'
this.Go('http://192.168.0.23:8080/#/loan')
// this.Go(item.linkUrl)
},
goLogin(){
......@@ -138,17 +132,6 @@
}
},
// initTel(){
// const self=this
// self.$request('/pawn/setting','GET').then(res => {
// const { protocol,phone }=res.result
// self.mobileNum=phone
// }).catch(err=>{
// console.log(err,'请求出错')
// })
// },
goTel(){
uni.makePhoneCall({
......@@ -178,9 +161,7 @@
this.Go('uni:/pages/login/login')
return false
}else{
this.init()
this.initMy()
// this.initTel()
this.initTels()
}
......
......@@ -30,11 +30,10 @@
}
},
async onLoad(options) {
const that = this
const mobileCall=uni.getStorageSync('mobileCall')
if(options.url){
that.src=options.url
that.src=`${options.url}?cellPhone=${mobileCall}`
}
uni.getStorage({
key: 'm-device-info',
......@@ -393,6 +392,16 @@
}
},
GetTokens(){
const that=this
try{
const ress=uni.getStorageSync('tokenFinance')
console.log(ress,'resstoken')
that.GetWebView().evalJS("receiveTokens('" + ress + "')")
}catch(err){
console.log(err,'token信息')
}
},
GetToken(){
const that=this
try{
......@@ -614,8 +623,9 @@
let pages = getCurrentPages();
let page = pages[pages.length - 1];
const {url} = page.options
this.url=url
console.log(url,'diz ')
const mobileCall=uni.getStorageSync('mobileCall')
this.src=`${url}?cellPhone=${mobileCall}`
// if (url.indexOf('?') !== -1) {
// const newUrl = url.split('?')
// const newArrr = newUrl[1].split('=')
......
......@@ -30,9 +30,9 @@
},
onLoad(options){
const that = this
const mobileCall=uni.getStorageSync('mobileCall')
if(options.url){
that.src=options.url
that.src=`${options.url}?cellPhone=${mobileCall}`
}
uni.getStorage({
key: 'm-device-info',
......@@ -347,6 +347,16 @@
}
},
GetTokens(){
const that=this
try{
const ress=uni.getStorageSync('tokenFinance')
console.log(ress,'resstoken')
that.GetWebView().evalJS("receiveTokens('" + ress + "')")
}catch(err){
console.log(err,'token信息')
}
},
GetToken(){
const that=this
try{
......@@ -574,7 +584,8 @@
let pages = getCurrentPages();
let page = pages[pages.length - 1];
const {url} = page.options
this.url=url
const mobileCall=uni.getStorageSync('mobileCall')
this.src=`${url}?cellPhone=${mobileCall}`
}
}
</script>
......
forceInstall
\ No newline at end of file
This diff is collapsed.
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