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 {
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")
if (!common && plus.os.name == 'iOS') {
loadDevice();
......@@ -28,7 +28,7 @@ export default {
loadLocation();
loadUuid()
}
}
// }
// 当前版本号
......
......@@ -7,7 +7,7 @@ const BASE = {
development: {
common: "http://portal.cloudsmake.cn",
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: {
common: "http://portal.cloudsmake.cn",
......@@ -38,7 +38,7 @@ let env = process.env.VUE_APP_BASE_NODE_ENV
*/
// #ifdef APP-PLUS
env = "stest";
env = "development";
// #endif
const api = {
......
......@@ -2,8 +2,8 @@
"name" : "多典花",
"appid" : "__UNI__DE04B13",
"description" : "",
"versionName" : "1.0.2",
"versionCode" : 102,
"versionName" : "1.0.3",
"versionCode" : 104,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
......
......@@ -31,7 +31,7 @@ export default {
methods: {
/** 埋点 */
buryingPoint(des, val) {
const mobile = uni.getStorageSync('d-mobile')
const mobile = uni.getStorageSync('l-mobile')
const BaseUrl = api.event
try {
const data = {
......
......@@ -121,7 +121,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/web/contact",
"style": {
"navigationBarTitleText": "通讯录",
"enablePullDownRefresh": false
}
},
{
"path": "pages/webview/webview",
"style": {
......@@ -129,6 +135,13 @@
"navigationBarTitleText": ""
}
},
{
"path": "pages/websrc/websrc",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "pages/web/web",
"style": {
......@@ -137,6 +150,13 @@
"navigationBarTitleText": ""
}
},
{
"path": "pages/web/websrc",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{
"path": "pages/bill/indexs",
"style": {
......
No preview for this file type
......@@ -35,6 +35,7 @@
}
},
onLoad() {
this.buryingPoint('app:Ineed_pageView')
this.init()
},
methods: {
......
......@@ -40,6 +40,7 @@
},
onLoad() {
this.init()
this.buryingPoint('app:application_pageView')
},
methods: {
init(){
......
......@@ -69,6 +69,7 @@
},
onLoad() {
this.init()
this.buryingPoint('app:category_pageView')
},
methods: {
init(){
......
......@@ -18,6 +18,9 @@
}
},
onLoad() {
this.buryingPoint('app:detailResult_pageView')
},
methods: {
goBtn(){
this.Go('uni:/pages/index/index','tab')
......
......@@ -88,7 +88,7 @@
</template>
<script>
import { switchShowTabbar, isLogin } from '@/utils/index'
import { switchShowTabbar, isLogin,initSettings } from '@/utils/index'
export default {
data() {
return {
......@@ -137,15 +137,19 @@ export default {
this.isFirstShow = uni.getStorageSync('isFirstShow')
},
async onLoad() {
// console.log(storage.getUserInfo().mobile,'uuuuuu')
await this.initAjax();
await this.getAppVersion()
},
async onShow() {
// 首页流量埋点
this.buryingPoint('app:index_page_view')
this.buryingPoint('app:index_pageView')
await this.initAjax();
initSettings()
// 显示隐藏tabBar
switchShowTabbar()
},
......@@ -172,8 +176,18 @@ export default {
}
// 埋点结束
if (!isLogin()) this.JumpToLogin()
else this.Go(item.tager)
if (!isLogin()) {
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)
}
}
},
// 检查版本更新
......@@ -188,7 +202,7 @@ export default {
let type;
platform === "android" ? (type = "ANDROID") : (type = "IOS");
self.$request(`/pawn/setting/other/appVersion/${type}`, 'GET').then(res => {
if (res.success == true) {
const response = res.result.data;
if (appVersion < response.versionName) {
......@@ -224,10 +238,28 @@ export default {
const self = this
self.$request('/pawn/index', 'GET').then(res => {
const { shortcutList, bannerList } = res.result
if (shortcutList) {
self.list = JSON.parse(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)
}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)
}
}).catch(err => {
......
......@@ -24,7 +24,7 @@
<text>我已阅读并同意</text>
<uni-link class="link" :href="protocolf.protocolUrl">《注册协议》</uni-link>
<text></text>
<uni-link class="link" :href="protocolf.protocolUrl">《隐私政策》</uni-link>
<uni-link class="link" :href="protocols.protocolUrl">《隐私政策》</uni-link>
</view>
</view>
</view>
......@@ -50,6 +50,7 @@ export default {
},
onLoad() {
this.init()
this.buryingPoint('app:login_pageView')
},
methods: {
init() {
......@@ -114,6 +115,12 @@ export default {
}
}).catch(err => {
console.log(err, '请求出错')
uni.showToast({
title: err.message,
icon: "none",
duration: 2000
})
})
},
// 获取验证码倒计时
......@@ -175,12 +182,17 @@ export default {
uni.setStorageSync('deviceId', deviceId)
}
uni.setStorageSync('token', token)
uni.setStorageSync('d-mobile', self.mobile)
uni.setStorageSync('l-mobile', self.mobile)
self.loginNocheck()
// 设置
switchShowTabbar();
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000
})
console.log(err, '请求出错')
})
},
......
......@@ -71,7 +71,7 @@
this.titleText=options.loanStatus
this.goodType=2
}
this.buryingPoint('app:lookGoods_pageView')
this.init()
},
methods: {
......
......@@ -55,7 +55,7 @@
</template>
<script>
import { switchShowTabbar } from '@/utils/index'
import { switchShowTabbar, isLogin,initSettings } from '@/utils/index'
export default {
data() {
return {
......@@ -64,16 +64,20 @@ export default {
mobileNum: '',
menuBar: [],
serviceCall: '',
extMenuBarList: []
extMenuBarList: [],
HUrl:''
}
},
onLoad() {
this.init();
this.initPawn()
},
async onShow() {
onShow() {
this.buryingPoint('app:my_pageView')
// 显示隐藏tabBar
switchShowTabbar()
this.init();
await switchShowTabbar();
this.initPawn()
},
// 页面下拉刷新
async onPullDownRefresh() {
......@@ -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配置页面
initTels() {
const self = this
self.$request('/app/v1/settings', 'GET').then(res => {
const { serviceCall } = res.result
const { serviceCall,h5Url } = res.result
self.serviceCall = serviceCall
}).catch(err => {
console.log(err, '请求出错')
......@@ -115,7 +165,13 @@ export default {
const self = this
self.$request('/app/v1/userIndex', 'GET').then(res => {
const { menuBar, user, baseMenuBar, extMenuBarList } = res.result
self.menuBar = menuBar
const showIndex = uni.getStorageSync('showIndex')
console.log(showIndex,'myindex')
if(showIndex==true){
self.menuBar = menuBar
}else{
self.menuBar =[]
}
self.menuList = baseMenuBar
self.extMenuBarList = extMenuBarList
self.userTel = ''
......@@ -126,6 +182,7 @@ export default {
})
},
goPage(item) {
console.log(item.title)
switch (item.title) {
case "我的浏览":
this.buryingPoint('app:my_browsing_history_click')
......@@ -149,15 +206,24 @@ export default {
this.Go('uni:/pages/login/login')
},
goBar(item) {
console.log(item.linkUrl,'item')
let newPath
switch (item.title) {
case "我的还款":
this.buryingPoint('app:my_repayment_click')
getApp().globalData.WebUrl = "http://ddang-h5-s.rockstect.cn/index.html#/bill"
this.Go('uni:/pages/web/web', 'tab')
// const url='http://192.168.0.82:8080/#/'
newPath=this.HUrl+item.linkUrl
uni.navigateTo({
url:`/pages/web/websrc?url=${newPath}`
})
break;
case "申请记录":
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;
default:
break;
......
......@@ -33,7 +33,7 @@
}
},
onLoad() {
this.buryingPoint('app:myneed_pageView')
},
methods: {
needSubmit(){
......
......@@ -91,6 +91,7 @@
},
onLoad(options) {
const token=uni.getStorageSync('token')
this.buryingPoint('app:productDetails_pageView')
this.token=token
if(options){
const { goodId, }=JSON.parse(options.mydata)
......
......@@ -21,7 +21,7 @@
if(options){
this.proList=JSON.parse(options.mydata)
}
this.buryingPoint('app:prolist_pageView')
},
methods: {
......
......@@ -31,7 +31,8 @@
}
},
onLoad() {
console.log('onLoad')
this.buryingPoint('app:recruit_pageView')
},
methods: {
goSubmit(){
......@@ -99,6 +100,7 @@
}
},
onShow() {
console.log('onshow')
}
}
......
......@@ -18,6 +18,9 @@
}
},
onLoad(){
this.buryingPoint('app:recruitResult_pageView')
},
methods: {
goBtn(){
this.Go('uni:/pages/index/index','tab')
......
......@@ -80,6 +80,7 @@
onLoad() {
let self = this;
self.init()
self.buryingPoint('app:setting_pageView')
self.token=uni.getStorageSync('token')
plus.cache.calculate(size => {
if (size < 1024) {
......@@ -104,9 +105,11 @@
init(){
const self=this
self.$request('/pawn/setting','GET').then(res => {
const { protocol,phone }=res.result
console.log(protocol,typeof(protocol),'setting')
if(protocol){
console.log(typeof(protocol),'8888')
self.protocolList=JSON.parse(protocol)
}
}).catch(err=>{
......
......@@ -32,6 +32,7 @@
</template>
<script>
import { switchShowTabbar, isLogin,initSettings } from '@/utils/index'
export default {
data() {
return {
......@@ -138,8 +139,10 @@
}
},
onShow() {
this.buryingPoint('app:sort_pageView')
this.init()
this.initSearch()
initSettings()
}
}
</script>
......
......@@ -27,6 +27,9 @@ export default {
desQuest: ''
}
},
onLoad() {
this.buryingPoint('app:useFeed_pageView')
},
methods: {
needSubmit() {
const content = this.desQuest;
......
......@@ -4,7 +4,7 @@ import { nativeCommon } from './nativeCommon'
// 通讯录拒绝后弹框
const onPermissionModal = function () {
uni.showModal({
title: '"花花有米"想访问您的通讯录',
title: '"多典花"想访问您的通讯录',
content: '通过访问您的通讯录信息,添加联系人,提高授信通过率。',
cancelText: '取消',
confirmText: '去设置',
......@@ -92,7 +92,7 @@ export const CheckLocationPermission = function (callback) {
function (err) {
console.log(err, '走这里了?')
uni.showModal({
title: '"花花有米"想要访问您的位置信息',
title: '"多典花"想要访问您的位置信息',
content:
'应用为您提供的服务,要访问您的位置信息,需要您提供权限,请允许。',
success: function (res) {
......@@ -130,7 +130,7 @@ export const SelectLocation = async function (callback) {
console.log('未获得授权')
} else if (rContacts === -1) {
uni.showModal({
title: '"花花有米"想要访问您的位置信息',
title: '"多典花"想要访问您的位置信息',
content:
'应用为您提供的服务,要访问您的位置信息,需要您提供权限,请允许。',
success: function (res) {
......
......@@ -112,7 +112,7 @@ export default {
subNVue.show('slide-in-bottom', 300, () => {
// 向子窗体传递参数
uni.$emit('loan-from-popup', {
appName: '花花有米',
appName: '多典花',
mobile: storage.getUserInfo().mobile,
})
})
......
......@@ -48,7 +48,7 @@ export const loadDeviceInfo = async (lat, lng, address) => {
} = result;
const deviceInfo = {
deviceId: deviceId, //设备指纹ID
appName: "MMYX", //APP实例
appName: "DDH", //APP实例
appSourceId: "1",
device: osName, // 设备类型
deviceName: platform, // 设备命名
......@@ -133,7 +133,7 @@ export const loadNetwork = () => {
// 网络信息存储
uni.setStorage({
key: "m-network-info",
data: res.networkType,
data: JSON.stringify(res),
success: function() {
console.log("m-network-info存储成功");
},
......@@ -206,7 +206,7 @@ export const loadLocation = () => {
// 这里应该判断用户 拒绝之后 才弹框
uni.showModal({
title: '"花花有米"想要访问您的位置信息',
title: '"多典花"想要访问您的位置信息',
content: "您手机系统的定位处于关闭状态,会导致您后续的授信不通过,授信需要访问您的位置信息,需要您提供权限,请开启手机的定位服务。",
success: function(res) {
if (res.confirm) {
......
......@@ -26,7 +26,7 @@ export default {
name: "WEB",
data() {
return {
src: getApp().globalData.WebUrl,
src:'',
wv: null,
isLogin: token,
canBack: false,
......@@ -36,6 +36,7 @@ export default {
}
},
deviceStatus: '',
typePage:false,
};
},
onBackPress(e) {
......@@ -71,11 +72,18 @@ export default {
this.wv && this.wv.evalJS(`callback({ 'action': 'OnShow' })`)
},
async onLoad(option) {
console.log(option,'参数')
const mianH5Url=uni.getStorageSync('mianH5Url')
const that = this
if (option.src) {
that.src = option.src
if(mianH5Url){
console.log(mianH5Url,'参数666')
that.src = mianH5Url
}
// if (option.src) {
// console.log(option.src,'参数555')
// that.src = option.src
// }
uni.getStorage({
key: 'm-device-info',
success: function (res) {
......@@ -88,7 +96,7 @@ export default {
// uni.removeStorageSync('hasRefresh')
},
onShow() {
console.log('WEB show方法')
if (uni.getStorageSync('canRefreshWeb')) {
uni.removeStorageSync('canRefreshWeb')
if (this.wv) {
......@@ -104,6 +112,9 @@ export default {
}
}
}
let pagearr = getCurrentPages();//获取应用页面栈
let currentPage = pagearr[pagearr.length - 1];//获取当前页面信息
console.log('option:' , currentPage.options)//获取页面传递的信息
},
onUnload() {
uni.$off('loadingSubnvue'); //移除监听配置的原生子窗体
......@@ -185,11 +196,25 @@ export default {
},
// 获取用户手机号
GetUserMobile() {
const self=this
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) {
console.log(err, '什么错')
this.toast('获取用户手机号报错')
self.toast('获取用户手机号报错')
}
},
// 拨打电话
......@@ -209,6 +234,26 @@ export default {
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(config) {
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 {
/* 初始化 */
async initTabBar(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
ioscertFile=/Users/jinzhouhang/work/zhanhai/uni-ddh-app/profile/ddh-prod.p12
iosProfile=/Users/jinzhouhang/work/zhanhai/uni-ddh-app/profile/uni_ddh_test.mobileprovision
ioscertFile=/Users/jinzhouhang/work/zhanhai/uni-ddh-app/profile/ddh-test.p12
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() {
const info = uni.getSystemInfoSync()
const { appVersion, deviceId, brand, platform, system } = info
let data = {
appKey: 'hhym',
appKey: 'DDH',
appVersion, // app版本号
deviceId, // 设备号
deviceBrand: brand, // 品牌名称
......
......@@ -65,19 +65,24 @@ export const initHeaderDevice = function () {
let device = {};
if (deviceInfo) {
device = Object.assign(device, common, JSON.parse(deviceInfo))
}
if (networkInfo) {
device = Object.assign(device, common, JSON.parse(networkInfo))
}
if (locationInfo) {
console.log(locationInfo,'locationInfo')
device = Object.assign(device, common, JSON.parse(locationInfo))
}
if (loadUuid) {
console.log(loadUuid,'loadUuid')
device = Object.assign(device, common, JSON.parse(loadUuid))
}
if (deviceInfo && networkInfo && loadUuid && locationInfo) {
const headerDeviceInfo = {
...JSON.parse(deviceInfo),
......@@ -95,7 +100,7 @@ export const initHeaderDevice = function () {
return headerDeviceInfo
}
console.log(device,'device33333')
return device
}
......@@ -55,8 +55,12 @@ export const switchShowTabbar = async () => {
})
} else {
try {
const { success } = await API.initTabBar()
if (success) {
const res= await API.initTabBar()
console.log(res, 'success4444')
const { data }=res.result
uni.setStorageSync('showIndex',data)
if (data==true) {
uni.setTabBarItem({
index: 1,
text: '贷款',
......@@ -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 () => {
convertPromise('getSystemInfo').then(result => {
......
......@@ -4,12 +4,31 @@ const request = async (url, type, data) => {
const baseUrl = api.common
// 这里确保一定是可以获取得到的
const headerDevice = uni.getStorageSync('m-header-device')
let rd = initHeaderInfo()
if (headerDevice) rd = headerDevice
else rd = initHeaderDevice()
rd = JSON.stringify(rd)
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')
}
return new Promise((resolve, reject) => {
const token = uni.getStorageSync('token')
const tokenFinance = uni.getStorageSync('tokenFinance')
......@@ -44,11 +63,14 @@ const request = async (url, type, data) => {
}
},
fail: (err) => {
uni.showToast({
title: err.message ? err.message : '服务器开小差了~',
icon: "none",
duration: 2000
})
const locationInfo = uni.getStorageSync('m-location-info')
if(locationInfo){
uni.showToast({
title: err.message ? err.message : '服务器开小差了~',
icon: "none",
duration: 2000
})
}
reject(err)
}
});
......
......@@ -27,7 +27,7 @@ export const Jump = function (url, type='navigate') {
console.log("跳转到其它APP 或者 小程序 或者其它的内容")
break;
}
console.log(targetPath,'targetPath')
switch (type) {
case 'redirect':
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