Commit 0b1dff93 authored by ly's avatar ly

更改webview中的挑战

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