Commit 3c5ac780 authored by ly's avatar ly

1

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