Commit 0ac8afa9 authored by ly's avatar ly

多典花启动页

parent 174d6b2c
No preview for this file type
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
"default" : { "default" : {
"launchtype" : "local" "launchtype" : "local"
}, },
"h5" : {
"launchtype" : "local"
},
"provider" : "aliyun",
"type" : "uniCloud" "type" : "uniCloud"
}, },
{ {
......
...@@ -8,7 +8,6 @@ export default { ...@@ -8,7 +8,6 @@ export default {
APP: null APP: null
}, },
onLaunch: function () { onLaunch: function () {
console.log('764')
// 手机型号 // 手机型号
uni.getSystemInfo({ uni.getSystemInfo({
success: function (res) { success: function (res) {
...@@ -26,9 +25,9 @@ export default { ...@@ -26,9 +25,9 @@ export default {
// 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(); loadNetwork()
loadNetwork(); loadDevice()
loadLocation(); loadLocation()
loadUuid() loadUuid()
} }
// } // }
...@@ -51,9 +50,7 @@ export default { ...@@ -51,9 +50,7 @@ export default {
switchShowTabbar() switchShowTabbar()
}, },
async onShow() { async onShow() {
await this.initLoanSetting(); // await initSettings()
await this.initSetting()
await initSettings()
}, },
/** 切换到后台 */ /** 切换到后台 */
...@@ -61,49 +58,7 @@ export default { ...@@ -61,49 +58,7 @@ export default {
uni.setStorageSync('canRefreshWeb', 'YES') uni.setStorageSync('canRefreshWeb', 'YES')
}, },
methods: { methods: {
// 初始化APP配置
async initSetting() {
try {
/**
* protocolList,
* ossBasePath,
* ossBucket,
* domainConfig,
* appAudited,
* pushType,
* h5Url,
* tabList,
* faceUrl,
* serviceCall,
* ocrChannel,
* privacyPolicyAgreed
*/
const { success, result } = await this.$request('/app/v1/settings', 'GET');
if (success) {
this.globalData.APP = result
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
uni.setStorageSync('H5-SETTING', JSON.stringify(result))
}
} catch (err) {
console.log(err, '初始化贷超配置报错')
}
}
} }
} }
</script> </script>
......
...@@ -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 = "prod"; env = "development";
// #endif // #endif
const api = { const api = {
......
{ {
"pages": [ "pages": [
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/starPage/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": ""
}
},
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
...@@ -17,6 +24,7 @@ ...@@ -17,6 +24,7 @@
"navigationBarTitleText": "款式" "navigationBarTitleText": "款式"
} }
}, },
{ {
"path": "pages/my/index", "path": "pages/my/index",
"style": { "style": {
...@@ -210,8 +218,9 @@ ...@@ -210,8 +218,9 @@
"popGesture": "none" "popGesture": "none"
} }
} }
} },
,{
{
"path": "uni_modules/uni-frv-external/pages/common/webview/webview", "path": "uni_modules/uni-frv-external/pages/common/webview/webview",
"style": { "style": {
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</template> </template>
<script> <script>
import { ininIndex,initApp,initSettings } from '@/utils/index'
export default { export default {
name: "Agreement", name: "Agreement",
data() { data() {
...@@ -45,11 +45,14 @@ export default { ...@@ -45,11 +45,14 @@ export default {
protocolf: { protocolf: {
"protocolName": "用户服务协议", "protocolName": "用户服务协议",
"protocolUrl": "https://ddh.yyhock.com/appStatic/protocol/dd-user.html" "protocolUrl": "https://ddh.yyhock.com/appStatic/protocol/dd-user.html"
}, }
} }
}, },
onLoad() { async onLoad() {
this.init() await ininIndex()
await initApp()
await initSettings()
await this.init()
}, },
methods: { methods: {
// 拒绝授权 // 拒绝授权
...@@ -68,9 +71,13 @@ export default { ...@@ -68,9 +71,13 @@ export default {
data: 'true', data: 'true',
success: function () { success: function () {
console.log('m-agreement缓存成功') console.log('m-agreement缓存成功')
uni.navigateBack({ uni.setStorageSync('appStart', true)
delta: 1 uni.switchTab({
url:"/pages/index/index"
}) })
// uni.navigateBack({
// delta: 1
// })
} }
}) })
...@@ -137,8 +144,11 @@ export default { ...@@ -137,8 +144,11 @@ export default {
}) })
} }
}, },
onShow() { async onShow() {
this.init() await this.init()
await ininIndex()
await initApp()
await initSettings()
} }
} }
</script> </script>
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
</template> </template>
<script> <script>
import { switchShowTabbar, isLogin,initSettings } from '@/utils/index' import { switchShowTabbar, isLogin,initSettings,ininIndex } from '@/utils/index'
export default { export default {
data() { data() {
return { return {
...@@ -127,27 +127,25 @@ export default { ...@@ -127,27 +127,25 @@ export default {
} }
}, },
onReady() { onReady() {
const systemInfo = uni.getSystemInfoSync(); // const systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform === 'ios') { // if (systemInfo.platform === 'ios') {
const isAgree = uni.getStorageSync('m-agreement') // const isAgree = uni.getStorageSync('m-agreement')
if (!isAgree) { // if (!isAgree) {
this.Go('uni:/pages/agreement/index') // this.Go('uni:/pages/agreement/index')
} // }
} // }
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()
await initSettings()
}, },
async onShow() { async onShow() {
ininIndex()
// 显示隐藏tabBar // 显示隐藏tabBar
switchShowTabbar() switchShowTabbar()
// initSettings()
// 首页流量埋点 // 首页流量埋点
this.buryingPoint('app:index_page_view') this.buryingPoint('app:index_page_view')
await this.initAjax(); await this.initAjax();
console.log(this.generateRandomString(),'97666') console.log(this.generateRandomString(),'97666')
...@@ -242,8 +240,10 @@ export default { ...@@ -242,8 +240,10 @@ export default {
}, },
init() { init() {
const self = this const self = this
self.$request('/pawn/index', 'GET').then(res => { const {shortcutList,bannerList}=uni.getStorageSync('dataIndex')
const { shortcutList, bannerList } = res.result
// self.$request('/pawn/index', 'GET').then(res => {
// const { shortcutList, bannerList } = res.result
const showIndex = uni.getStorageSync('showIndex') const showIndex = uni.getStorageSync('showIndex')
const token = uni.getStorageSync('token') const token = uni.getStorageSync('token')
if (shortcutList && typeof (shortcutList) == 'string') { if (shortcutList && typeof (shortcutList) == 'string') {
...@@ -263,9 +263,9 @@ export default { ...@@ -263,9 +263,9 @@ export default {
if (bannerList && typeof (bannerList) == 'string') { if (bannerList && typeof (bannerList) == 'string') {
self.bannerList = JSON.parse(bannerList) self.bannerList = JSON.parse(bannerList)
} }
}).catch(err => { // }).catch(err => {
console.log(err, '请求出错') // console.log(err, '请求出错')
}) // })
}, },
goDetail(item) { goDetail(item) {
......
...@@ -54,23 +54,9 @@ export default { ...@@ -54,23 +54,9 @@ export default {
}, },
methods: { methods: {
async 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) => {
// 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) => { protocolList.map((item) => {
if (item.protocolName == '隐私协议') { if (item.protocolName == '隐私协议') {
this.protocols = item this.protocols = item
...@@ -78,10 +64,6 @@ export default { ...@@ -78,10 +64,6 @@ export default {
this.protocolf = item this.protocolf = item
} }
}) })
uni.setStorageSync('APP-SETTING', JSON.stringify(result))
}
} catch (err) {
console.log(err, '初始化APP配置报错')
} }
}, },
btnIcon() { btnIcon() {
......
...@@ -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,24 +79,19 @@ export default { ...@@ -79,24 +79,19 @@ export default {
menuList: [], menuList: [],
mobileNum: '', mobileNum: '',
menuBar: [], menuBar: [],
// serviceCall: APP.serviceCall, serviceCall:APP.serviceCall,
serviceCall: '', serviceCall: '',
extMenuBarList: [], extMenuBarList: [],
hFUrl:'' 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')
}, },
...@@ -143,39 +138,6 @@ export default { ...@@ -143,39 +138,6 @@ 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) {
...@@ -207,8 +169,8 @@ export default { ...@@ -207,8 +169,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 //app.vue中的全局写法 newPath = H5.h5Url + item.linkUrl //app.vue中的全局写法
newPath =this.hFUrl+ item.linkUrl // newPath =this.hFUrl+ item.linkUrl
uni.navigateTo({ uni.navigateTo({
url: `/pages/web/websrc?url=${newPath}` url: `/pages/web/websrc?url=${newPath}`
}) })
...@@ -216,8 +178,8 @@ export default { ...@@ -216,8 +178,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 // newPath =this.hFUrl+ item.linkUrl
uni.navigateTo({ uni.navigateTo({
url: `/pages/web/websrc?url=${newPath}` url: `/pages/web/websrc?url=${newPath}`
}) })
...@@ -227,7 +189,6 @@ export default { ...@@ -227,7 +189,6 @@ export default {
} }
}, },
goTel() { goTel() {
// 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')
...@@ -251,7 +212,7 @@ export default { ...@@ -251,7 +212,7 @@ export default {
goPhone() { goPhone() {
uni.setStorageSync('telPhone', '1') uni.setStorageSync('telPhone', '1')
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: this.serviceCall //仅为示例 phoneNumber:APP.serviceCall//仅为示例
}); });
}, },
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- 左侧分类 --> <!-- 左侧分类 -->
<view class="leftTab"> <view class="leftTab">
<scroll-view scroll-y="true" class="tabBox"> <scroll-view scroll-y="true" class="tabBox">
<block v-for="(item,index) in tabList" :key="item.id"> <block v-for="item in tabList" :key="item.id">
<view class="tabItem" :class="tabCurrent == item.id ?'tabActive':''" @click="changeTab(item.id)"> <view class="tabItem" :class="tabCurrent == item.id ?'tabActive':''" @click="changeTab(item.id)">
{{item.categoryName}} {{item.categoryName}}
</view> </view>
...@@ -63,7 +63,6 @@ ...@@ -63,7 +63,6 @@
const self=this const self=this
self.$request('/pawn/category/getCategoryList','POST').then((res)=>{ self.$request('/pawn/category/getCategoryList','POST').then((res)=>{
self.tabList=res.result self.tabList=res.result
console.log(res,'9766')
}) })
}, },
initSearch(){ initSearch(){
...@@ -102,7 +101,7 @@ ...@@ -102,7 +101,7 @@
}) })
}, },
changeTab(index) { changeTab(index) {
console.log(index,'indexhyyy')
this.tabCurrent = index this.tabCurrent = index
// this.categoryId=index // this.categoryId=index
this.pageNum=1 this.pageNum=1
...@@ -142,7 +141,8 @@ ...@@ -142,7 +141,8 @@
this.buryingPoint('app:sort_pageView') this.buryingPoint('app:sort_pageView')
this.init() this.init()
this.initSearch() this.initSearch()
initSettings() switchShowTabbar()
} }
} }
</script> </script>
......
.stat-page{
width: 100%;
height: 100vh;
background: url('../../static/img/star-page.png') 0 0 no-repeat;
background-size: 100% 100vh;
.start-btn{
position: fixed;
bottom:290rpx;
margin:0 94rpx;
width: 561rpx;
height: 93rpx;
background: #2263E6;
box-shadow: 0rpx 4rpx 15rpx 0rpx rgba(116,178,251,0.5);
border-radius: 47rpx;
font-family: PingFangSC, PingFang SC;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
line-height: 93rpx;
letter-spacing: 5rpx;
text-align: center;
font-style: normal;
}
}
\ No newline at end of file
<template>
<view class='stat-page'>
<view class='start-btn' @click='goStart'>立即启动</view>
</view>
</template>
<script>
import { ininIndex,initSettings,initApp } from '@/utils/index'
import config from '@/config/api'
import API from '@/server/common'
export default {
data() {
return {
}
},
onReady() {
const appStart = uni.getStorageSync('appStart')
console.log(appStart,'appStart')
if(appStart==true){
uni.switchTab({
url:"/pages/index/index"
})
}
},
async onLoad() {
await ininIndex()
await initSettings()
await initApp()
},
methods: {
goStart(){
const systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform === 'ios') {
const isAgree = uni.getStorageSync('m-agreement')
if (!isAgree) {
this.Go('uni:/pages/agreement/index')
}
}else{
uni.setStorageSync('appStart', true)
uni.switchTab({
url:"/pages/index/index"
})
}
}
},
async onShow() {
await ininIndex()
await initSettings()
await initApp()
}
}
</script>
<style src="./index.less" lang="less" scoped></style>
\ No newline at end of file
...@@ -12,7 +12,7 @@ import Permission from '@/js_sdk/wa-permission/permission' //权限工具类 ...@@ -12,7 +12,7 @@ import Permission from '@/js_sdk/wa-permission/permission' //权限工具类
const LF = uni.requireNativePlugin('AThree-LFv2') const LF = uni.requireNativePlugin('AThree-LFv2')
let reloadTimeOut = null let reloadTimeOut = null
let token = uni.getStorageSync('token') let token = uni.getStorageSync('token')
const H5 = JSON.parse(uni.getStorageSync('H5-SETTING'));
export default { export default {
name: "WEB", name: "WEB",
data() { data() {
...@@ -65,17 +65,15 @@ export default { ...@@ -65,17 +65,15 @@ export default {
this.wv && this.wv.evalJS(`callback({ 'action': 'OnShow' })`) this.wv && this.wv.evalJS(`callback({ 'action': 'OnShow' })`)
}, },
async onLoad(option) { async onLoad(option) {
const mianH5Url = uni.getStorageSync('mianH5Url') // const mianH5Url = uni.getStorageSync('mianH5Url')
console.log('333')
const that = this const that = this
console.log(H5.h5Url, '参数666')
if (option.src) { if (option.src) {
console.log(option.src, '参数555') console.log(option.src, '参数555')
that.src = option.src that.src = option.src
} else if (mianH5Url) { } else if (H5.h5Url) {
console.log(mianH5Url, '参数666') console.log(H5.h5Url, '参数666')
that.src = mianH5Url that.src = H5.h5Url
} }
uni.getStorage({ uni.getStorage({
......
...@@ -8,5 +8,13 @@ export default { ...@@ -8,5 +8,13 @@ export default {
/* 初始化h5地址 */ /* 初始化h5地址 */
async initSettings(data) { async initSettings(data) {
return request('/pawn/setting', 'GET', data); return request('/pawn/setting', 'GET', data);
} },
/* 初始化settings获取手机号 */
async initApp(data) {
return request('/app/v1/settings', 'GET', data);
},
/* 初始化首页 */
async initIndex(data) {
return request('/pawn/index', 'GET', data);
},
} }
No preview for this file type
No preview for this file type
This diff is collapsed.
...@@ -3,6 +3,7 @@ import { convertPromise } from './header.js' ...@@ -3,6 +3,7 @@ import { convertPromise } from './header.js'
import Permission from '@/js_sdk/wa-permission/permission' import Permission from '@/js_sdk/wa-permission/permission'
import { SelectLocation } from "./authPerission"; import { SelectLocation } from "./authPerission";
import API from '@/server/common' import API from '@/server/common'
import config from '@/config/api'
...@@ -78,10 +79,52 @@ export const switchShowTabbar = async () => { ...@@ -78,10 +79,52 @@ export const switchShowTabbar = async () => {
} }
//获取h5url地址信息 //获取h5url地址信息
export const initSettings=async()=>{ export const initSettings=async()=>{
// try{
// const res=await API.initSettings()
// const {h5Url}=res.result
// uni.setStorageSync('mianH5Url',h5Url)
// }catch(err){
// console.log(err,'初始化')
// }
const globalData={
WebUrl: config['h5'],
H5: null,
APP: null
}
try {
const { success, result } = await API.initSettings()
if (success) {
globalData.H5 = result
uni.setStorageSync('H5-SETTING', JSON.stringify(result))
}
} catch (err) {
console.log(err, '初始化贷超配置报错')
}
}
//获取客服电话贷超
export const initApp=async()=>{
const globalData={
WebUrl: config['h5'],
H5: null,
APP: null
}
try {
const { success, result } = await API.initApp()
if (success) {
console.log(result,'dddd')
globalData.APP = result
uni.setStorageSync('APP-SETTING', JSON.stringify(result))
}
} catch (err) {
console.log(err, '初始化APP配置报错')
}
}
//首页数据
export const ininIndex=async()=>{
try{ try{
const res=await API.initSettings() const res=await API.initIndex()
const {h5Url}=res.result console.log(res,'res')
uni.setStorageSync('mianH5Url',h5Url) uni.setStorageSync('dataIndex',res.result)
}catch(err){ }catch(err){
console.log(err,'初始化') console.log(err,'初始化')
} }
......
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