Commit 3c5ac780 authored by ly's avatar ly

1

parent 681683d8
No preview for this file type
......@@ -7,7 +7,8 @@ export default {
H5: null,
APP: null
},
onLaunch: function () {
onLaunch: function () {
console.log('764')
// 手机型号
uni.getSystemInfo({
success: function (res) {
......@@ -49,10 +50,11 @@ export default {
/*** tabbar*/
switchShowTabbar()
},
async onShow() {
await this.initLoanSetting();
await this.initSetting()
await initSettings()
async onShow() {
await this.initLoanSetting();
await this.initSetting()
await initSettings()
},
/** 切换到后台 */
onHide() {
......
......@@ -38,7 +38,7 @@ let env = process.env.VUE_APP_BASE_NODE_ENV
*/
// #ifdef APP-PLUS
env = "stest";
env = "prod";
// #endif
const api = {
......
......@@ -2,7 +2,7 @@
"name" : "多典花",
"appid" : "__UNI__DE04B13",
"description" : "",
"versionName" : "1.0.3",
"versionName" : "1.0.4",
"versionCode" : 104,
"transformPx" : false,
/* 5+App特有相关 */
......
......@@ -88,7 +88,7 @@
</template>
<script>
import { switchShowTabbar, isLogin } from '@/utils/index'
import { switchShowTabbar, isLogin,initSettings } from '@/utils/index'
export default {
data() {
return {
......@@ -141,6 +141,7 @@ export default {
// console.log(storage.getUserInfo().mobile,'uuuuuu')
await this.initAjax();
await this.getAppVersion()
await initSettings()
},
async onShow() {
// 显示隐藏tabBar
......
......@@ -53,19 +53,36 @@ export default {
this.buryingPoint('app:login_pageView')
},
methods: {
init() {
const $App_Setting = uni.getStorageSync("APP-SETTING")
if ($App_Setting) {
const { protocolList } = JSON.parse($App_Setting)
protocolList.map((item) => {
if (item.protocolName == '隐私协议') {
this.protocols = item
} else if (item.protocolName == '用户服务协议') {
this.protocolf = item
}
})
async init() {
// const $App_Setting = uni.getStorageSync("APP-SETTING")
// if ($App_Setting) {
// const { protocolList } = JSON.parse($App_Setting)
// protocolList.map((item) => {
// if (item.protocolName == '隐私协议') {
// this.protocols = item
// } else if (item.protocolName == '用户服务协议') {
// this.protocolf = item
// }
// })
// }
try {
const { success, result } = await this.$request('/app/v1/settings', 'GET');
if (success) {
// this.globalData.APP = result
console.log(result,'result333')
const {protocolList}=result
protocolList.map((item) => {
if (item.protocolName == '隐私协议') {
this.protocols = item
} else if (item.protocolName == '用户服务协议') {
this.protocolf = item
}
})
uni.setStorageSync('APP-SETTING', JSON.stringify(result))
}
} catch (err) {
console.log(err, '初始化APP配置报错')
}
},
btnIcon() {
this.clickStatus = !this.clickStatus
......
......@@ -23,7 +23,7 @@
<!-- 金刚栏位 -->
<template v-if="extMenuBarList && extMenuBarList.length">
<template v-if="extMenuBarList && extMenuBarList.length>0">
<view class='my-box-s'>
<view class='s-con'>
<view class='con-item' @click="goPage(item)" v-for="item in extMenuBarList" :key="item.id">
......@@ -36,7 +36,7 @@
<!-- 更多服务 -->
<view v-if="menuList && menuList.length" class="my-contain">
<view v-if="menuList && menuList.length>0" class="my-contain">
<i class='con-top'></i>
<view class='con-box' v-if='menuList && menuList.length > 0'>
<view class="box-line" v-for="item in menuList" @click='goItem(item)' :key="item.id">
......@@ -69,8 +69,8 @@
<script>
import { switchShowTabbar } from '@/utils/index'
const APP = JSON.parse(uni.getStorageSync('APP-SETTING'));
const H5 = JSON.parse(uni.getStorageSync('H5-SETTING'));
// const APP = JSON.parse(uni.getStorageSync('APP-SETTING'));
// const H5 = JSON.parse(uni.getStorageSync('H5-SETTING'));
export default {
data() {
......@@ -79,18 +79,24 @@ export default {
menuList: [],
mobileNum: '',
menuBar: [],
serviceCall: APP.serviceCall,
extMenuBarList: []
// serviceCall: APP.serviceCall,
serviceCall: '',
extMenuBarList: [],
hFUrl:''
}
},
onLoad() {
this.init();
this.initSetting()
this.initLoanSetting()
},
onShow() {
// 显示隐藏tabBar
switchShowTabbar()
this.init();
this.initSetting()
this.initLoanSetting()
// 埋点
this.buryingPoint('app:my_pageView')
},
......@@ -105,8 +111,6 @@ export default {
},
methods: {
toJSON() { },
// 初始化
init() {
const token = uni.getStorageSync('token')
......@@ -139,8 +143,39 @@ export default {
console.log(err, '请求出错')
})
},
// 初始化APP配置
async initSetting() {
try {
const { success, result } = await this.$request('/app/v1/settings', 'GET');
if (success) {
// this.globalData.APP = result
console.log(result,'result333')
this.serviceCall=result.serviceCall
uni.setStorageSync('APP-SETTING', JSON.stringify(result))
}
} catch (err) {
console.log(err, '初始化APP配置报错')
}
},
// 初始化贷超H5配置
async initLoanSetting() {
try {
/**
* h5Url,
* protocol,
* phone
* */
const { success, result } = await this.$request('/pawn/setting', 'GET');
if (success) {
// this.globalData.H5 = result
console.log(result,'result4444')
this.hFUrl=result.h5Url
uni.setStorageSync('H5-SETTING', JSON.stringify(result))
}
} catch (err) {
console.log(err, '初始化贷超配置报错')
}
},
goPage(item) {
console.log(item.title)
switch (item.title) {
......@@ -172,7 +207,8 @@ export default {
case "我的还款":
this.buryingPoint('app:my_repayment_click')
// const url='http://192.168.0.82:8080/#/'
newPath = H5.h5Url + item.linkUrl
// newPath = H5.h5Url + item.linkUrl //app.vue中的全局写法
newPath =this.hFUrl+ item.linkUrl
uni.navigateTo({
url: `/pages/web/websrc?url=${newPath}`
})
......@@ -180,7 +216,8 @@ export default {
case "申请记录":
this.buryingPoint('app:my_application_record_click')
// const url='http://192.168.0.82:8080/#/loanRecord'
newPath = H5.h5Url + item.linkUrl
// newPath = H5.h5Url + item.linkUrl
newPath =this.hFUrl+ item.linkUrl
uni.navigateTo({
url: `/pages/web/websrc?url=${newPath}`
})
......@@ -190,8 +227,7 @@ export default {
}
},
goTel() {
this.buryingPoint('app:my_contact_us_click')
this.handleCall(APP.serviceCall)
// this.handleCall(APP.serviceCall)
const self = this
self.buryingPoint('app:my_contact_us_click')
const telPhone = uni.getStorageSync('telPhone')
......
......@@ -19,10 +19,12 @@ const onPermissionModal = function () {
// 检测通讯录权限
export const CheckContactPermission = function (callback) {
console.log(callback,'callback')
// 获取通讯录对象
plus.contacts.getAddressBook(plus.contacts.ADDRESSBOOK_PHONE, function (addressBook) {
// 查找联系人
addressBook.find(["displayName", "phoneNumbers"], function (contacts) {
console.log(contacts,'contacts')
//此处的缓存是为了解决ios中的相关问题
uni.setStorage({
key: "m-contact",
......
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