Commit 2a453831 authored by caimeng's avatar caimeng

Merge branch 'new-ddh-app' of...

Merge branch 'new-ddh-app' of ssh://gitlab.jqtianxia.cn:2222/zhanhai/uni-app-ddh-shop into new-ddh-app
parents b054c69c 71ef12e5
No preview for this file type
<template>
<view class='my-page'>
<view class='my-top'>
<view class='my-header'>
<image class='header-img' src='http://ddh.yyhock.com/ddhMall/my-icon.png'></image>
<view class='header-des'>
<view class='des-name' v-if="userTel!=''">{{userTel}}</view>
<view class='des-name' v-else @click='goLogin'>注册/登录</view>
<view class='des-text'>多惠花承诺保护您的信息安全</view>
</view>
</view>
<view class="my-contain">
<i class='con-top'></i>
<view class='con-box' v-show='menuList && menuList.length>0'>
<view class="box-line" v-for="item in menuList" @click='goItem(item)' :key="item.id">
<view class='line-item'>
<view class='item-l'>
<image class='l-img' :src='item.iconUrl'></image>
<view class='l-text'>{{item.title}}</view>
</view>
<view class='item-r'></view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
userTel:'',
menuList:[],
mobileNum:''
}
},
onLoad(){
const token=uni.getStorageSync('token')
console.log(token,'token')
if(token==''){
this.userTel=''
this.Go('uni:/pages/login/login')
return false
}else{
this.init()
this.initTel()
}
},
methods: {
init(){
const self=this
self.$request('/client/userIndex','POST').then((res)=>{
const { userInfo,menuList }=res.result
self.userTel=userInfo.cell
self.menuList=JSON.parse(menuList)
})
},
goLogin(){
this.Go('uni:/pages/login/login')
},
initTel(){
const self=this
self.$request('/setting','GET').then(res => {
const { protocol,phone }=res.result
self.mobileNum=phone
}).catch(err=>{
console.log(err,'请求出错')
})
},
goItem(item){
if(item.linkUrl!=''){
console.log('66',item)
this.Go(item.linkUrl)
}else{
console.log('67',this.mobileNum,item)
uni.makePhoneCall({
phoneNumber: this.mobileNum
});
}
}
},
onShow(){
const token=uni.getStorageSync('token')
console.log(token,'token')
if(token==''){
this.userTel=''
this.Go('uni:/pages/login/login')
return false
}else{
this.init()
this.initTel()
}
}
}
</script>
<style src='./index.less' lang="less" scoped></style>
\ No newline at end of file
<template>
<view class='my-page'>
<view class='my-top'>
<view class='my-header'>
<image class='header-img' src='https://ddh.yyhock.com/ddhMall/my-icon.png'></image>
<view class='header-des'>
<view class='des-name' v-if="userTel!=''">{{userTel}}</view>
<view class='des-name' v-else @click='goLogin'>注册/登录</view>
<view class='des-text'>多惠花承诺保护您的信息安全</view>
</view>
</view>
<view class="my-contain">
<i class='con-top'></i>
<view class='con-box' v-show='menuList && menuList.length>0'>
<view class="box-line" v-for="item in menuList" @click='goItem(item)' :key="item.id">
<view class='line-item'>
<view class='item-l'>
<image class='l-img' :src='item.iconUrl'></image>
<view class='l-text'>{{item.title}}</view>
</view>
<view class='item-r'></view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
userTel:'',
menuList:[],
mobileNum:''
}
},
onLoad(){
const token=uni.getStorageSync('token')
console.log(token,'token')
if(token==''){
this.userTel=''
this.Go('uni:/pages/login/login')
return false
}else{
this.init()
this.initTel()
}
},
methods: {
init(){
const self=this
self.$request('/client/userIndex','POST').then((res)=>{
const { userInfo,menuList }=res.result
self.userTel=userInfo.cell
self.menuList=JSON.parse(menuList)
})
},
goLogin(){
this.Go('uni:/pages/login/login')
},
initTel(){
const self=this
self.$request('/setting','GET').then(res => {
const { protocol,phone }=res.result
self.mobileNum=phone
}).catch(err=>{
console.log(err,'请求出错')
})
},
goItem(item){
if(item.linkUrl!=''){
console.log('66',item)
this.Go(item.linkUrl)
}else{
console.log('67',this.mobileNum,item)
uni.makePhoneCall({
phoneNumber: this.mobileNum
});
}
}
},
onShow(){
const token=uni.getStorageSync('token')
console.log(token,'token')
if(token==''){
this.userTel=''
this.Go('uni:/pages/login/login')
return false
}else{
this.init()
this.initTel()
}
}
}
</script>
<style src='./index.less' lang="less" scoped></style>
\ No newline at end of file
...@@ -18,9 +18,9 @@ export default { ...@@ -18,9 +18,9 @@ export default {
plus.screen.lockOrientation("portrait-primary") plus.screen.lockOrientation("portrait-primary")
// 判断用户是否同意用户隐私协议,如果同意协议再获取设备信息等内容 // 判断用户是否同意用户隐私协议,如果同意协议再获取设备信息等内容
const isAgreePrivacy = plus.runtime.isAgreePrivacy(); // const isAgreePrivacy = plus.runtime.isAgreePrivacy();
// 同意了协议 // 同意了协议
if (isAgreePrivacy) { // if (isAgreePrivacy) {
const common = uni.getStorageSync("m-headers") const common = uni.getStorageSync("m-headers")
if (!common && plus.os.name == 'iOS') { if (!common && plus.os.name == 'iOS') {
loadDevice(); loadDevice();
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
loadLocation(); loadLocation();
loadUuid() loadUuid()
} }
} // }
// 当前版本号 // 当前版本号
......
...@@ -7,7 +7,7 @@ const BASE = { ...@@ -7,7 +7,7 @@ const BASE = {
development: { development: {
common: "http://portal.cloudsmake.cn", common: "http://portal.cloudsmake.cn",
event: 'http://118.31.124.88:21111', event: 'http://118.31.124.88:21111',
h5: 'http://192.168.0.23:8080/index.html#/loan' h5: 'http://192.168.0.23:8080/index.html#/'
}, },
stest: { stest: {
common: "http://portal.cloudsmake.cn", common: "http://portal.cloudsmake.cn",
...@@ -38,7 +38,7 @@ let env = process.env.VUE_APP_BASE_NODE_ENV ...@@ -38,7 +38,7 @@ let env = process.env.VUE_APP_BASE_NODE_ENV
*/ */
// #ifdef APP-PLUS // #ifdef APP-PLUS
env = "stest"; env = "development";
// #endif // #endif
const api = { const api = {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "多典花", "name" : "多典花",
"appid" : "__UNI__DE04B13", "appid" : "__UNI__DE04B13",
"description" : "", "description" : "",
"versionName" : "1.0.2", "versionName" : "1.0.3",
"versionCode" : 102, "versionCode" : 104,
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {
......
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
methods: { methods: {
/** 埋点 */ /** 埋点 */
buryingPoint(des, val) { buryingPoint(des, val) {
const mobile = uni.getStorageSync('d-mobile') const mobile = uni.getStorageSync('l-mobile')
const BaseUrl = api.event const BaseUrl = api.event
try { try {
const data = { const data = {
......
...@@ -121,7 +121,13 @@ ...@@ -121,7 +121,13 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/web/contact",
"style": {
"navigationBarTitleText": "通讯录",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/webview/webview", "path": "pages/webview/webview",
"style": { "style": {
...@@ -129,6 +135,13 @@ ...@@ -129,6 +135,13 @@
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{
"path": "pages/websrc/websrc",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/web/web", "path": "pages/web/web",
"style": { "style": {
...@@ -137,6 +150,13 @@ ...@@ -137,6 +150,13 @@
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{
"path": "pages/web/websrc",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/bill/indexs", "path": "pages/bill/indexs",
"style": { "style": {
......
No preview for this file type
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
} }
}, },
onLoad() { onLoad() {
this.buryingPoint('app:Ineed_pageView')
this.init() this.init()
}, },
methods: { methods: {
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
}, },
onLoad() { onLoad() {
this.init() this.init()
this.buryingPoint('app:application_pageView')
}, },
methods: { methods: {
init(){ init(){
......
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
}, },
onLoad() { onLoad() {
this.init() this.init()
this.buryingPoint('app:category_pageView')
}, },
methods: { methods: {
init(){ init(){
......
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
} }
}, },
onLoad() {
this.buryingPoint('app:detailResult_pageView')
},
methods: { methods: {
goBtn(){ goBtn(){
this.Go('uni:/pages/index/index','tab') this.Go('uni:/pages/index/index','tab')
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
</template> </template>
<script> <script>
import { switchShowTabbar, isLogin } from '@/utils/index' import { switchShowTabbar, isLogin,initSettings } from '@/utils/index'
export default { export default {
data() { data() {
return { return {
...@@ -137,6 +137,8 @@ export default { ...@@ -137,6 +137,8 @@ export default {
this.isFirstShow = uni.getStorageSync('isFirstShow') this.isFirstShow = uni.getStorageSync('isFirstShow')
}, },
async onLoad() { async onLoad() {
// console.log(storage.getUserInfo().mobile,'uuuuuu')
await this.initAjax(); await this.initAjax();
await this.getAppVersion() await this.getAppVersion()
}, },
...@@ -144,8 +146,10 @@ export default { ...@@ -144,8 +146,10 @@ export default {
// 首页流量埋点 // 首页流量埋点
this.buryingPoint('app:index_page_view') this.buryingPoint('app:index_page_view')
this.buryingPoint('app:index_pageView')
await this.initAjax(); await this.initAjax();
initSettings()
// 显示隐藏tabBar // 显示隐藏tabBar
switchShowTabbar() switchShowTabbar()
}, },
...@@ -172,8 +176,18 @@ export default { ...@@ -172,8 +176,18 @@ export default {
} }
// 埋点结束 // 埋点结束
if (!isLogin()) this.JumpToLogin() if (!isLogin()) {
else this.Go(item.tager) this.JumpToLogin()
}else {
if(item.tager=='uni:/pages/indexfinance/index,tab'){
console.log(item.tager,'987')
this.Go('uni:/pages/web/web','tab')
}else{
this.Go(item.tager)
}
}
}, },
// 检查版本更新 // 检查版本更新
...@@ -224,10 +238,28 @@ export default { ...@@ -224,10 +238,28 @@ export default {
const self = this const self = this
self.$request('/pawn/index', 'GET').then(res => { self.$request('/pawn/index', 'GET').then(res => {
const { shortcutList, bannerList } = res.result const { shortcutList, bannerList } = res.result
if (shortcutList) {
const showIndex = uni.getStorageSync('showIndex')
console.log(showIndex,'99933showIndex')
const token = uni.getStorageSync('token')
if (shortcutList && typeof(shortcutList)=='string') {
let newArr=[]
let arrOne=[]
if(showIndex==true && token){
self.list = JSON.parse(shortcutList) self.list = JSON.parse(shortcutList)
}else{
newArr=JSON.parse(shortcutList)
newArr.forEach((item ,index)=>{
if(item.tager=='uni:/pages/indexfinance/index,tab'){
newArr.splice(index, 1)
}
})
self.list =newArr
console.log(newArr,'newArr')
}
} }
if (bannerList) { if (bannerList && typeof(bannerList)=='string' ) {
self.bannerList = JSON.parse(bannerList) self.bannerList = JSON.parse(bannerList)
} }
}).catch(err => { }).catch(err => {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<text>我已阅读并同意</text> <text>我已阅读并同意</text>
<uni-link class="link" :href="protocolf.protocolUrl">《注册协议》</uni-link> <uni-link class="link" :href="protocolf.protocolUrl">《注册协议》</uni-link>
<text></text> <text></text>
<uni-link class="link" :href="protocolf.protocolUrl">《隐私政策》</uni-link> <uni-link class="link" :href="protocols.protocolUrl">《隐私政策》</uni-link>
</view> </view>
</view> </view>
</view> </view>
...@@ -50,6 +50,7 @@ export default { ...@@ -50,6 +50,7 @@ export default {
}, },
onLoad() { onLoad() {
this.init() this.init()
this.buryingPoint('app:login_pageView')
}, },
methods: { methods: {
init() { init() {
...@@ -114,6 +115,12 @@ export default { ...@@ -114,6 +115,12 @@ export default {
} }
}).catch(err => { }).catch(err => {
console.log(err, '请求出错') console.log(err, '请求出错')
uni.showToast({
title: err.message,
icon: "none",
duration: 2000
})
}) })
}, },
// 获取验证码倒计时 // 获取验证码倒计时
...@@ -175,12 +182,17 @@ export default { ...@@ -175,12 +182,17 @@ export default {
uni.setStorageSync('deviceId', deviceId) uni.setStorageSync('deviceId', deviceId)
} }
uni.setStorageSync('token', token) uni.setStorageSync('token', token)
uni.setStorageSync('d-mobile', self.mobile) uni.setStorageSync('l-mobile', self.mobile)
self.loginNocheck() self.loginNocheck()
// 设置 // 设置
switchShowTabbar(); switchShowTabbar();
}).catch(err => { }).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000
})
console.log(err, '请求出错') console.log(err, '请求出错')
}) })
}, },
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
this.titleText=options.loanStatus this.titleText=options.loanStatus
this.goodType=2 this.goodType=2
} }
this.buryingPoint('app:lookGoods_pageView')
this.init() this.init()
}, },
methods: { methods: {
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</template> </template>
<script> <script>
import { switchShowTabbar } from '@/utils/index' import { switchShowTabbar, isLogin,initSettings } from '@/utils/index'
export default { export default {
data() { data() {
return { return {
...@@ -64,16 +64,20 @@ export default { ...@@ -64,16 +64,20 @@ export default {
mobileNum: '', mobileNum: '',
menuBar: [], menuBar: [],
serviceCall: '', serviceCall: '',
extMenuBarList: [] extMenuBarList: [],
HUrl:''
} }
}, },
onLoad() { onLoad() {
this.init(); this.init();
this.initPawn()
}, },
async onShow() { onShow() {
this.buryingPoint('app:my_pageView')
// 显示隐藏tabBar
switchShowTabbar()
this.init(); this.init();
this.initPawn()
await switchShowTabbar();
}, },
// 页面下拉刷新 // 页面下拉刷新
async onPullDownRefresh() { async onPullDownRefresh() {
...@@ -99,11 +103,57 @@ export default { ...@@ -99,11 +103,57 @@ export default {
} }
}, },
// 显示隐藏tabBar
switchShowTabbar() {
const token = uni.getStorageSync('token')
if (!token) {
console.log(token, 'tokentab')
uni.setTabBarItem({
index: 1,
visible: false
})
} else {
const self = this
self.$request('/pawn/setting/other/switch/loan', 'GET').then(res => {
const { data } = res.result
if (res.code == 200 && data == true) {
try {
console.log(data, '显示')
uni.setTabBarItem({
index: 1,
text: '贷款',
visible: true,
})
} catch (error) {
console.log(error);
}
} else {
console.log(data, '隐藏')
uni.setTabBarItem({
index: 1,
visible: false
})
}
})
}
},
initPawn(){
const self=this
self.$request('/pawn/setting','GET').then(res => {
const { protocol,phone,h5Url }=res.result
if(h5Url){
self.HUrl=h5Url
console.log(self.HUrl,'setting')
}
}).catch(err=>{
console.log(err,'请求出错')
})
},
// 初始化APP配置页面 // 初始化APP配置页面
initTels() { initTels() {
const self = this const self = this
self.$request('/app/v1/settings', 'GET').then(res => { self.$request('/app/v1/settings', 'GET').then(res => {
const { serviceCall } = res.result const { serviceCall,h5Url } = res.result
self.serviceCall = serviceCall self.serviceCall = serviceCall
}).catch(err => { }).catch(err => {
console.log(err, '请求出错') console.log(err, '请求出错')
...@@ -115,7 +165,13 @@ export default { ...@@ -115,7 +165,13 @@ export default {
const self = this const self = this
self.$request('/app/v1/userIndex', 'GET').then(res => { self.$request('/app/v1/userIndex', 'GET').then(res => {
const { menuBar, user, baseMenuBar, extMenuBarList } = res.result const { menuBar, user, baseMenuBar, extMenuBarList } = res.result
const showIndex = uni.getStorageSync('showIndex')
console.log(showIndex,'myindex')
if(showIndex==true){
self.menuBar = menuBar self.menuBar = menuBar
}else{
self.menuBar =[]
}
self.menuList = baseMenuBar self.menuList = baseMenuBar
self.extMenuBarList = extMenuBarList self.extMenuBarList = extMenuBarList
self.userTel = '' self.userTel = ''
...@@ -126,6 +182,7 @@ export default { ...@@ -126,6 +182,7 @@ export default {
}) })
}, },
goPage(item) { goPage(item) {
console.log(item.title)
switch (item.title) { switch (item.title) {
case "我的浏览": case "我的浏览":
this.buryingPoint('app:my_browsing_history_click') this.buryingPoint('app:my_browsing_history_click')
...@@ -149,15 +206,24 @@ export default { ...@@ -149,15 +206,24 @@ export default {
this.Go('uni:/pages/login/login') this.Go('uni:/pages/login/login')
}, },
goBar(item) { goBar(item) {
console.log(item.linkUrl,'item')
let newPath
switch (item.title) { switch (item.title) {
case "我的还款": case "我的还款":
this.buryingPoint('app:my_repayment_click') this.buryingPoint('app:my_repayment_click')
getApp().globalData.WebUrl = "http://ddang-h5-s.rockstect.cn/index.html#/bill" // const url='http://192.168.0.82:8080/#/'
this.Go('uni:/pages/web/web', 'tab') newPath=this.HUrl+item.linkUrl
uni.navigateTo({
url:`/pages/web/websrc?url=${newPath}`
})
break; break;
case "申请记录": case "申请记录":
this.buryingPoint('app:my_application_record_click') this.buryingPoint('app:my_application_record_click')
this.Go('uni:/pages/web/web?src=http://ddang-h5-s.rockstect.cn/index.html#/loanRecord', 'tab') // const url='http://192.168.0.82:8080/#/loanRecord'
newPath=this.HUrl+item.linkUrl
uni.navigateTo({
url:`/pages/web/websrc?url=${newPath}`
})
break; break;
default: default:
break; break;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
} }
}, },
onLoad() { onLoad() {
this.buryingPoint('app:myneed_pageView')
}, },
methods: { methods: {
needSubmit(){ needSubmit(){
......
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
}, },
onLoad(options) { onLoad(options) {
const token=uni.getStorageSync('token') const token=uni.getStorageSync('token')
this.buryingPoint('app:productDetails_pageView')
this.token=token this.token=token
if(options){ if(options){
const { goodId, }=JSON.parse(options.mydata) const { goodId, }=JSON.parse(options.mydata)
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
if(options){ if(options){
this.proList=JSON.parse(options.mydata) this.proList=JSON.parse(options.mydata)
} }
this.buryingPoint('app:prolist_pageView')
}, },
methods: { methods: {
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
} }
}, },
onLoad() { onLoad() {
console.log('onLoad')
this.buryingPoint('app:recruit_pageView')
}, },
methods: { methods: {
goSubmit(){ goSubmit(){
...@@ -99,6 +100,7 @@ ...@@ -99,6 +100,7 @@
} }
}, },
onShow() { onShow() {
console.log('onshow')
} }
} }
......
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
} }
}, },
onLoad(){
this.buryingPoint('app:recruitResult_pageView')
},
methods: { methods: {
goBtn(){ goBtn(){
this.Go('uni:/pages/index/index','tab') this.Go('uni:/pages/index/index','tab')
......
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
onLoad() { onLoad() {
let self = this; let self = this;
self.init() self.init()
self.buryingPoint('app:setting_pageView')
self.token=uni.getStorageSync('token') self.token=uni.getStorageSync('token')
plus.cache.calculate(size => { plus.cache.calculate(size => {
if (size < 1024) { if (size < 1024) {
...@@ -106,7 +107,9 @@ ...@@ -106,7 +107,9 @@
self.$request('/pawn/setting','GET').then(res => { self.$request('/pawn/setting','GET').then(res => {
const { protocol,phone }=res.result const { protocol,phone }=res.result
console.log(protocol,typeof(protocol),'setting')
if(protocol){ if(protocol){
console.log(typeof(protocol),'8888')
self.protocolList=JSON.parse(protocol) self.protocolList=JSON.parse(protocol)
} }
}).catch(err=>{ }).catch(err=>{
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
</template> </template>
<script> <script>
import { switchShowTabbar, isLogin,initSettings } from '@/utils/index'
export default { export default {
data() { data() {
return { return {
...@@ -138,8 +139,10 @@ ...@@ -138,8 +139,10 @@
} }
}, },
onShow() { onShow() {
this.buryingPoint('app:sort_pageView')
this.init() this.init()
this.initSearch() this.initSearch()
initSettings()
} }
} }
</script> </script>
......
...@@ -27,6 +27,9 @@ export default { ...@@ -27,6 +27,9 @@ export default {
desQuest: '' desQuest: ''
} }
}, },
onLoad() {
this.buryingPoint('app:useFeed_pageView')
},
methods: { methods: {
needSubmit() { needSubmit() {
const content = this.desQuest; const content = this.desQuest;
......
...@@ -4,7 +4,7 @@ import { nativeCommon } from './nativeCommon' ...@@ -4,7 +4,7 @@ import { nativeCommon } from './nativeCommon'
// 通讯录拒绝后弹框 // 通讯录拒绝后弹框
const onPermissionModal = function () { const onPermissionModal = function () {
uni.showModal({ uni.showModal({
title: '"花花有米"想访问您的通讯录', title: '"多典花"想访问您的通讯录',
content: '通过访问您的通讯录信息,添加联系人,提高授信通过率。', content: '通过访问您的通讯录信息,添加联系人,提高授信通过率。',
cancelText: '取消', cancelText: '取消',
confirmText: '去设置', confirmText: '去设置',
...@@ -92,7 +92,7 @@ export const CheckLocationPermission = function (callback) { ...@@ -92,7 +92,7 @@ export const CheckLocationPermission = function (callback) {
function (err) { function (err) {
console.log(err, '走这里了?') console.log(err, '走这里了?')
uni.showModal({ uni.showModal({
title: '"花花有米"想要访问您的位置信息', title: '"多典花"想要访问您的位置信息',
content: content:
'应用为您提供的服务,要访问您的位置信息,需要您提供权限,请允许。', '应用为您提供的服务,要访问您的位置信息,需要您提供权限,请允许。',
success: function (res) { success: function (res) {
...@@ -130,7 +130,7 @@ export const SelectLocation = async function (callback) { ...@@ -130,7 +130,7 @@ export const SelectLocation = async function (callback) {
console.log('未获得授权') console.log('未获得授权')
} else if (rContacts === -1) { } else if (rContacts === -1) {
uni.showModal({ uni.showModal({
title: '"花花有米"想要访问您的位置信息', title: '"多典花"想要访问您的位置信息',
content: content:
'应用为您提供的服务,要访问您的位置信息,需要您提供权限,请允许。', '应用为您提供的服务,要访问您的位置信息,需要您提供权限,请允许。',
success: function (res) { success: function (res) {
......
...@@ -112,7 +112,7 @@ export default { ...@@ -112,7 +112,7 @@ export default {
subNVue.show('slide-in-bottom', 300, () => { subNVue.show('slide-in-bottom', 300, () => {
// 向子窗体传递参数 // 向子窗体传递参数
uni.$emit('loan-from-popup', { uni.$emit('loan-from-popup', {
appName: '花花有米', appName: '多典花',
mobile: storage.getUserInfo().mobile, mobile: storage.getUserInfo().mobile,
}) })
}) })
......
...@@ -48,7 +48,7 @@ export const loadDeviceInfo = async (lat, lng, address) => { ...@@ -48,7 +48,7 @@ export const loadDeviceInfo = async (lat, lng, address) => {
} = result; } = result;
const deviceInfo = { const deviceInfo = {
deviceId: deviceId, //设备指纹ID deviceId: deviceId, //设备指纹ID
appName: "MMYX", //APP实例 appName: "DDH", //APP实例
appSourceId: "1", appSourceId: "1",
device: osName, // 设备类型 device: osName, // 设备类型
deviceName: platform, // 设备命名 deviceName: platform, // 设备命名
...@@ -133,7 +133,7 @@ export const loadNetwork = () => { ...@@ -133,7 +133,7 @@ export const loadNetwork = () => {
// 网络信息存储 // 网络信息存储
uni.setStorage({ uni.setStorage({
key: "m-network-info", key: "m-network-info",
data: res.networkType, data: JSON.stringify(res),
success: function() { success: function() {
console.log("m-network-info存储成功"); console.log("m-network-info存储成功");
}, },
...@@ -206,7 +206,7 @@ export const loadLocation = () => { ...@@ -206,7 +206,7 @@ export const loadLocation = () => {
// 这里应该判断用户 拒绝之后 才弹框 // 这里应该判断用户 拒绝之后 才弹框
uni.showModal({ uni.showModal({
title: '"花花有米"想要访问您的位置信息', title: '"多典花"想要访问您的位置信息',
content: "您手机系统的定位处于关闭状态,会导致您后续的授信不通过,授信需要访问您的位置信息,需要您提供权限,请开启手机的定位服务。", content: "您手机系统的定位处于关闭状态,会导致您后续的授信不通过,授信需要访问您的位置信息,需要您提供权限,请开启手机的定位服务。",
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
......
...@@ -26,7 +26,7 @@ export default { ...@@ -26,7 +26,7 @@ export default {
name: "WEB", name: "WEB",
data() { data() {
return { return {
src: getApp().globalData.WebUrl, src:'',
wv: null, wv: null,
isLogin: token, isLogin: token,
canBack: false, canBack: false,
...@@ -36,6 +36,7 @@ export default { ...@@ -36,6 +36,7 @@ export default {
} }
}, },
deviceStatus: '', deviceStatus: '',
typePage:false,
}; };
}, },
onBackPress(e) { onBackPress(e) {
...@@ -71,11 +72,18 @@ export default { ...@@ -71,11 +72,18 @@ export default {
this.wv && this.wv.evalJS(`callback({ 'action': 'OnShow' })`) this.wv && this.wv.evalJS(`callback({ 'action': 'OnShow' })`)
}, },
async onLoad(option) { async onLoad(option) {
console.log(option,'参数')
const mianH5Url=uni.getStorageSync('mianH5Url')
const that = this const that = this
if (option.src) { if(mianH5Url){
that.src = option.src console.log(mianH5Url,'参数666')
} that.src = mianH5Url
}
// if (option.src) {
// console.log(option.src,'参数555')
// that.src = option.src
// }
uni.getStorage({ uni.getStorage({
key: 'm-device-info', key: 'm-device-info',
success: function (res) { success: function (res) {
...@@ -88,7 +96,7 @@ export default { ...@@ -88,7 +96,7 @@ export default {
// uni.removeStorageSync('hasRefresh') // uni.removeStorageSync('hasRefresh')
}, },
onShow() { onShow() {
console.log('WEB show方法')
if (uni.getStorageSync('canRefreshWeb')) { if (uni.getStorageSync('canRefreshWeb')) {
uni.removeStorageSync('canRefreshWeb') uni.removeStorageSync('canRefreshWeb')
if (this.wv) { if (this.wv) {
...@@ -104,6 +112,9 @@ export default { ...@@ -104,6 +112,9 @@ export default {
} }
} }
} }
let pagearr = getCurrentPages();//获取应用页面栈
let currentPage = pagearr[pagearr.length - 1];//获取当前页面信息
console.log('option:' , currentPage.options)//获取页面传递的信息
}, },
onUnload() { onUnload() {
uni.$off('loadingSubnvue'); //移除监听配置的原生子窗体 uni.$off('loadingSubnvue'); //移除监听配置的原生子窗体
...@@ -185,11 +196,25 @@ export default { ...@@ -185,11 +196,25 @@ export default {
}, },
// 获取用户手机号 // 获取用户手机号
GetUserMobile() { GetUserMobile() {
const self=this
try { try {
this.GetWebView().evalJS(`receiveUserMobile('${storage.getUserInfo().mobile}')`) uni.getStorage({
key: 'l-mobile',
success: function(res) {
console.log(res, '结果')
const mobile = res.data;
self.GetWebView().evalJS("receiveUserMobile('" + mobile + "')")
},
fail: function(err) {
console.log(err, '报错了')
}
})
// const mobileCell = uni.getStorageSync('d-mobile')
// this.GetWebView().evalJS(`receiveUserMobile('${mobileCell}')`)
} catch (err) { } catch (err) {
console.log(err, '什么错') console.log(err, '什么错')
this.toast('获取用户手机号报错') self.toast('获取用户手机号报错')
} }
}, },
// 拨打电话 // 拨打电话
...@@ -209,6 +234,26 @@ export default { ...@@ -209,6 +234,26 @@ export default {
title title
}) })
}, },
//返回方法
GoBack(num){
console.log('wori')
try{
const self=this
uni.navigateBack({
delta:num,
success(res) {
console.log(res,'9877')
self.typePage=true
console.log(self.typePage,'resss')
}
})
}catch(err){
this.toast('返回失败')
console.log(err,'err')
}
},
// Toast 提示框 // Toast 提示框
Toast(config) { Toast(config) {
try { try {
......
This diff is collapsed.
<template>
<view class="page-web">
<web-view ref='webview' :webview-styles="webviewStyles" :src="src"></web-view>
</view>
</template>
<script>
export default {
name: "WEB",
data() {
return {
// src:'http://192.168.0.38:8081/index.html#/middle?type=mieye&',
src:null,
webviewStyles: {
progress: {
color: '#FF4050'
}
},
timer:null,
titleVal:'',
urlWeb:'',
typePage:false,
deviceStatus:'',
viewerUrl:'/hybrid/html/web/viewer.html'
}
},
onLoad(options){
const that=this
// console.log(options,'options')
that.src=decodeURIComponent(options.src)
let pages = getCurrentPages();
let page = pages[pages.length - 1];
let currentWebView = page.$getAppWebview();
// // #ifdef APP-PLUS
// var wv = plus.webview.create('', 'custom-webview', {
// plusrequire: 'none', //禁止远程网页使用plus的API
// 'uni-app': 'none', //不加载uni-app渲染层框架,避免样式冲突
// top: uni.getSystemInfoSync().statusBarHeight + 44 //放置在titleNView下方。
// });
// wv.loadURL(options);//加载url
// let pages = getCurrentPages();//获取当前页面栈的实例
// let currentPage = pages[pages.length - 1]; // 上一页
// var currentWebview = currentPage.$getAppWebview();//获取当前页面的webview对象实例
// currentWebview.append(wv);//Webview窗口中添加子窗口
// // #endif
},
methods: {
},
onShow(){
const currentWebview = this.$scope.$getAppWebview().children()[0];
if(currentWebview){
uni.getStorage({
key:'scanType',
success:function(res){
console.log(res,'二维码,不刷新')
},
fail:function(err){
console.log(err,'刷新')
currentWebview.reload(true);
}
})
}
}
}
</script>
<style lang="less" scoped>
.page-web {
width: 100vw;
height: 100vh;
web-view {
width: 100%;
height: 100%;
}
}
</style>
...@@ -4,5 +4,9 @@ export default { ...@@ -4,5 +4,9 @@ export default {
/* 初始化 */ /* 初始化 */
async initTabBar(data) { async initTabBar(data) {
return request('/pawn/setting/other/switch/loan', 'GET', data); return request('/pawn/setting/other/switch/loan', 'GET', data);
},
/* 初始化h5地址 */
async initSettings(data) {
return request('/pawn/setting', 'GET', data);
} }
} }
iosProfile=/Users/jinzhouhang/work/zhanhai/uni-ddh-app/profile/uni_ddh_prod.mobileprovision iosProfile=/Users/jinzhouhang/work/zhanhai/uni-ddh-app/profile/uni_ddh_test.mobileprovision
ioscertFile=/Users/jinzhouhang/work/zhanhai/uni-ddh-app/profile/ddh-prod.p12 ioscertFile=/Users/jinzhouhang/work/zhanhai/uni-ddh-app/profile/ddh-test.p12
ioscertPassword=ep/Tdjka4Y7WYqDB6/S7dw== ioscertPassword=ep/Tdjka4Y7WYqDB6/S7dw==
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -8,7 +8,7 @@ export function setDevice() { ...@@ -8,7 +8,7 @@ export function setDevice() {
const info = uni.getSystemInfoSync() const info = uni.getSystemInfoSync()
const { appVersion, deviceId, brand, platform, system } = info const { appVersion, deviceId, brand, platform, system } = info
let data = { let data = {
appKey: 'hhym', appKey: 'DDH',
appVersion, // app版本号 appVersion, // app版本号
deviceId, // 设备号 deviceId, // 设备号
deviceBrand: brand, // 品牌名称 deviceBrand: brand, // 品牌名称
......
...@@ -65,19 +65,24 @@ export const initHeaderDevice = function () { ...@@ -65,19 +65,24 @@ export const initHeaderDevice = function () {
let device = {}; let device = {};
if (deviceInfo) { if (deviceInfo) {
device = Object.assign(device, common, JSON.parse(deviceInfo)) device = Object.assign(device, common, JSON.parse(deviceInfo))
} }
if (networkInfo) { if (networkInfo) {
device = Object.assign(device, common, JSON.parse(networkInfo)) device = Object.assign(device, common, JSON.parse(networkInfo))
} }
if (locationInfo) { if (locationInfo) {
console.log(locationInfo,'locationInfo')
device = Object.assign(device, common, JSON.parse(locationInfo)) device = Object.assign(device, common, JSON.parse(locationInfo))
} }
if (loadUuid) { if (loadUuid) {
console.log(loadUuid,'loadUuid')
device = Object.assign(device, common, JSON.parse(loadUuid)) device = Object.assign(device, common, JSON.parse(loadUuid))
} }
if (deviceInfo && networkInfo && loadUuid && locationInfo) { if (deviceInfo && networkInfo && loadUuid && locationInfo) {
const headerDeviceInfo = { const headerDeviceInfo = {
...JSON.parse(deviceInfo), ...JSON.parse(deviceInfo),
...@@ -95,7 +100,7 @@ export const initHeaderDevice = function () { ...@@ -95,7 +100,7 @@ export const initHeaderDevice = function () {
return headerDeviceInfo return headerDeviceInfo
} }
console.log(device,'device33333')
return device return device
} }
...@@ -55,8 +55,12 @@ export const switchShowTabbar = async () => { ...@@ -55,8 +55,12 @@ export const switchShowTabbar = async () => {
}) })
} else { } else {
try { try {
const { success } = await API.initTabBar() const res= await API.initTabBar()
if (success) { console.log(res, 'success4444')
const { data }=res.result
uni.setStorageSync('showIndex',data)
if (data==true) {
uni.setTabBarItem({ uni.setTabBarItem({
index: 1, index: 1,
text: '贷款', text: '贷款',
...@@ -73,7 +77,14 @@ export const switchShowTabbar = async () => { ...@@ -73,7 +77,14 @@ export const switchShowTabbar = async () => {
} }
} }
} }
//获取h5url地址信息
export const initSettings=async()=>{
const res=await API.initSettings()
const {h5Url}=res.result
console.log(h5Url,'h5Url3333')
uni.setStorageSync('mianH5Url',h5Url)
}
// 设备信息 // 设备信息
export const loadDevice = async () => { export const loadDevice = async () => {
convertPromise('getSystemInfo').then(result => { convertPromise('getSystemInfo').then(result => {
......
...@@ -4,11 +4,30 @@ const request = async (url, type, data) => { ...@@ -4,11 +4,30 @@ const request = async (url, type, data) => {
const baseUrl = api.common const baseUrl = api.common
// 这里确保一定是可以获取得到的 // 这里确保一定是可以获取得到的
const headerDevice = uni.getStorageSync('m-header-device') const headerDevice = uni.getStorageSync('m-header-device')
const deviceInfo = uni.getStorageSync('m-device-info')
const tokenF = uni.getStorageSync('tokenFinance')
let rd = null
try{
if (!deviceInfo || tokenF == '' && plus.os.name != 'iOS') {
rd = initHeaderInfo()
} else {
if (headerDevice) {
rd = encodeURIComponent(headerDevice)
} else {
const common = initHeaderDevice()
console.log(common, '日===')
if (common) {
rd = JSON.stringify(common)
}
}
}
}catch(err){
console.log(err,'congzhelizou')
}
let rd = initHeaderInfo()
if (headerDevice) rd = headerDevice
else rd = initHeaderDevice()
rd = JSON.stringify(rd)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const token = uni.getStorageSync('token') const token = uni.getStorageSync('token')
...@@ -44,11 +63,14 @@ const request = async (url, type, data) => { ...@@ -44,11 +63,14 @@ const request = async (url, type, data) => {
} }
}, },
fail: (err) => { fail: (err) => {
const locationInfo = uni.getStorageSync('m-location-info')
if(locationInfo){
uni.showToast({ uni.showToast({
title: err.message ? err.message : '服务器开小差了~', title: err.message ? err.message : '服务器开小差了~',
icon: "none", icon: "none",
duration: 2000 duration: 2000
}) })
}
reject(err) reject(err)
} }
}); });
......
...@@ -27,7 +27,7 @@ export const Jump = function (url, type='navigate') { ...@@ -27,7 +27,7 @@ export const Jump = function (url, type='navigate') {
console.log("跳转到其它APP 或者 小程序 或者其它的内容") console.log("跳转到其它APP 或者 小程序 或者其它的内容")
break; break;
} }
console.log(targetPath,'targetPath')
switch (type) { switch (type) {
case 'redirect': case 'redirect':
uni.redirectTo({ uni.redirectTo({
......
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