Commit 8179316a authored by ly's avatar ly

获取设备信息

parent a6afa57e
......@@ -4,8 +4,22 @@
import { SelectLocation } from "./utils/authPerission";
export default {
onLaunch: function() {
const common = uni.getStorageSync("m-headers")
if (!common) {
const common = uni.getStorageSync("m-header-device")
let versionNumber
plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo){
if(wgtinfo.version){
versionNumber = wgtinfo.version;
}else{
versionNumber = plus.runtime.version;
}
uni.setStorageSync('version',versionNumber)
})
console.log(plus.os.name,'8')
if (!common && plus.os.name=='iOS') {
console.log(plus.os.name,'9')
this.loadDevice();
this.loadNetwork();
this.loadLocation();
......@@ -19,194 +33,203 @@
methods:{
//版本检查
checkVersion(){
const self=this
// let realVersion = '109';//这里是热更新的版本号,依次累加,(后端要比这里的版本号大)
plus.runtime.getProperty(plus.runtime.appid,function(widgetInfo){
let currentVersion = widgetInfo.version.replace(/\./g, ""); //获取当前版本号
self.$request('/app/v1/checkVersions','GET').then(res=>{
const { versionInfo }=res.result
const { version,updateUrl,updateMsg,update,forceUpdate}=versionInfo
if(update==true && currentVersion<version){
console.log(version,'checkversion')
if(forceUpdate==false){
console.log('更新1')
//可以关闭弹窗,更新
self.updateShut(updateUrl,updateMsg)
}else{
//不可关闭弹窗强制更新
console.log('更新2')
self.updatePackage(updateUrl,updateMsg)
const self=this
// let realVersion = '109';//这里是热更新的版本号,依次累加,(后端要比这里的版本号大)
plus.runtime.getProperty(plus.runtime.appid,function(widgetInfo){
let currentVersion = widgetInfo.version.replace(/\./g, ""); //获取当前版本号
self.$request('/app/v1/checkVersions','GET').then(res=>{
console.log(res,'appvue')
const { versionInfo }=res.result
const { version,updateUrl,updateMsg,update,forceUpdate}=versionInfo
if(update==true && currentVersion<version){
console.log(version,'checkversion')
if(forceUpdate==false){
console.log('更新1')
//可以关闭弹窗,更新
self.updateShut(updateUrl,updateMsg)
}else{
//不可关闭弹窗强制更新
console.log('更新2')
self.updatePackage(updateUrl,updateMsg)
}
}
}
})
})
})
},
//可关闭更新
updateShut(updateUrl,updateMsg){
// plus.runtime.quit(); 退出应用
uni.showModal({
//提醒用户更新
title: "版本更新",
content: updateMsg,
confirmText:'立即更新',
cancelText: '取消',
success: (rese) => {
if(rese.confirm){
// uni.getSystemInfoSync().platform
console.log(plus.os.name,'ios')
if(uni.getSystemInfoSync().platform==='ios'){
console.log('ios')
plus.runtime.openURL(updateUrl)
}else{
console.log('android')
plus.runtime.openURL(updateUrl); // 调用手机端的浏览器 进行下载
// plus.runtime.quit(); 退出应用
uni.showModal({
//提醒用户更新
title: "版本更新",
content: updateMsg,
confirmText:'立即更新',
cancelText: '取消',
success: (rese) => {
if(rese.confirm){
// uni.getSystemInfoSync().platform
console.log(plus.os.name,'ios')
if(uni.getSystemInfoSync().platform==='ios'){
console.log('ios')
plus.runtime.openURL(updateUrl)
}else{
console.log('android')
plus.runtime.openURL(updateUrl); // 调用手机端的浏览器 进行下载
}
}
}
}
})
})
},
//强制更新app
updatePackage(updateUrl,updateMsg){
// plus.runtime.quit(); 退出应用
uni.showModal({
//提醒用户更新
title: "版本更新",
showCancel: false, // 将取消按钮隐藏
content: updateMsg,
buttonText: '立即更新',
success: (rese) => {
if(rese.confirm){
// uni.getSystemInfoSync().platform
console.log(plus.os.name,'ios')
if(uni.getSystemInfoSync().platform==='ios'){
console.log('ios')
plus.runtime.openURL(updateUrl)
}else{
console.log('android')
plus.runtime.openURL(updateUrl); // 调用手机端的浏览器 进行下载
// plus.runtime.quit(); 退出应用
uni.showModal({
//提醒用户更新
title: "版本更新",
showCancel: false, // 将取消按钮隐藏
content: updateMsg,
buttonText: '立即更新',
success: (rese) => {
if(rese.confirm){
// uni.getSystemInfoSync().platform
console.log(plus.os.name,'ios')
if(uni.getSystemInfoSync().platform==='ios'){
console.log('ios')
plus.runtime.openURL(updateUrl)
}else{
console.log('android')
plus.runtime.openURL(updateUrl); // 调用手机端的浏览器 进行下载
}
}
}
}
})
})
},
// 获取common当中的设备信息
loadDevice: function() {
const that = this
convertPromise('getSystemInfo').then(result => {
const deviceInfo = {
// token:uuidObtain,
deviceType: result.deviceType,
appName: result.appName,
deviceId: result.deviceId,
device: result.osName,
deviceName: result.platform,
appVersion: result.appWgtVersion,
osVersion: result.osVersion ? result.osVersion : result.system,
mobileType: result.model,
screenHeight: result.screenHeight,
screenWidth: result.screenWidth,
resolution: result.windowWidth + '*' + result.screenHeight
};
// 本地存储
uni.setStorage({
key: 'm-device-info',
data: JSON.stringify(deviceInfo),
success: function() {
console.log('m-device-info存储成功');
}
});
}).catch(err => {
//that.toast('获取设备信息失败')
uni.showModal({
title: '"多典花"想访问您的设备信息',
content: '通过访问您的设备信息,提高您授信通过率。',
showCancel: false,
confirmText: '去设置',
success: function(res) {
if (res.confirm) {
Permission.gotoAppPermissionSetting()
}
}
});
})
},
// 获取common当中的网络信息
loadNetwork: function() {
const that = this;
convertPromise('getNetworkType').then(result => {
const networkInfo = {
networkStatus: result.networkType
};
// 网络信息存储
uni.setStorage({
key: 'm-network-info',
data: JSON.stringify(networkInfo),
success: function() {
console.log('m-network-info存储成功');
}
});
}).catch(err => {
that.toast('获取网络信息失败')
})
},
//获取uuid
loadUuid: function() {
// plus.device.uuid
plus.device.getInfo({
success: function(e) {
const deviceInfo = {
token: e.uuid,
};
uni.setStorage({
key: 'm-load-udid',
data: JSON.stringify(deviceInfo),
success: function() {
console.log('uuid存储成功');
}
})
const that = this
convertPromise('getSystemInfo').then(result => {
const deviceInfo = {
// token:uuidObtain, result.appName
deviceType: result.deviceType,
appName: 'DDH',
deviceId: result.deviceId,
device: result.osName,
deviceName: result.platform,
appVersion: result.appWgtVersion,
osVersion: result.osVersion ? result.osVersion : result.system,
mobileType: result.model,
screenHeight: result.screenHeight,
screenWidth: result.screenWidth,
resolution: result.windowWidth + '*' + result.screenHeight,
appSourceId: "1"
};
// 本地存储
uni.setStorage({
key: 'm-device-info',
data: JSON.stringify(deviceInfo),
success: function() {
console.log('m-device-info存储成功');
}
});
}).catch(err => {
//that.toast('获取设备信息失败')
uni.showModal({
title: '"多典花"想访问您的设备信息',
content: '通过访问您的设备信息,提高您授信通过率。',
showCancel: false,
confirmText: '去设置',
success: function(res) {
if (res.confirm) {
Permission.gotoAppPermissionSetting()
}
}
});
})
},
fail: function(e) {
console.log('getDeviceInfo failed: ' + JSON.stringify(e));
}
});
},
// 获取common当中的位置信息
loadLocation: function() {
const that = this;
// 苹果测试手机如果没有插入手机卡,获取定位之后会解析失败,报错
SelectLocation(() => {
convertPromise('getLocation', {
type: 'wgs84',
geocode: true
}).then(result => {
const locationInfo = {
lat: String(result.latitude),
lng: String(result.longitude)
};
uni.setStorage({
key: 'm-location-info',
data: JSON.stringify(locationInfo),
success: function() {
console.log('m-location-info存储成功');
}
});
}).catch(err => {
console.log(err, '错误了')
// that.toast('获取位置信息失败')
// 获取common当中的网络信息
loadNetwork: function() {
const that = this;
convertPromise('getNetworkType').then(result => {
const networkInfo = {
networkStatus: result.networkType
};
// 网络信息存储
uni.setStorage({
key: 'm-network-info',
data: JSON.stringify(networkInfo),
success: function() {
console.log('m-network-info存储成功');
}
});
}).catch(err => {
that.toast('获取网络信息失败')
})
},
//获取uuid
loadUuid: function() {
// plus.device.uuid
plus.device.getInfo({
success: function(e) {
const deviceInfo = {
token: e.uuid,
};
uni.setStorage({
key: 'm-load-udid',
data: JSON.stringify(deviceInfo),
success: function() {
console.log('uuid存储成功');
}
})
},
fail: function(e) {
console.log('getDeviceInfo failed: ' + JSON.stringify(e));
}
});
},
// 获取common当中的位置信息
loadLocation: function() {
const that = this;
// 苹果测试手机如果没有插入手机卡,获取定位之后会解析失败,报错
SelectLocation(() => {
convertPromise('getLocation', {
type: 'wgs84',
geocode: true
}).then(result => {
const locationInfo = {
lat: String(result.latitude),
lng: String(result.longitude)
};
uni.setStorage({
key: 'm-location-info',
data: JSON.stringify(locationInfo),
success: function() {
console.log('m-location-info存储成功');
}
});
}).catch(err => {
console.log(err, '错误了')
// that.toast('获取位置信息失败')
})
})
})
}
},
onShow: function() {
this.checkVersion()
this.checkVersion()
const common = uni.getStorageSync("m-header-device")
if (!common && plus.os.name=='iOS') {
console.log(plus.os.name,'9')
this.loadDevice();
this.loadNetwork();
this.loadLocation();
this.loadUuid()
}
},
onHide: function() {
......
......@@ -29,7 +29,7 @@
},
// 地址控件改变控件
columnchange(d) {
this.updateSelectIndex(d.detail.column, d.detail.value) // 更新选择索引
.updateSourceDate() // 更新源数据
.updateAddressDate() // 更新结果数据
......@@ -100,7 +100,8 @@
/**
* 点击确定
* */
bindPickerChange(e) {
bindPickerChange(e) {
console.log(e.target.value,'change')
this.$emit('change', {
index: selectCode,
data: selectVal
......
......@@ -14,7 +14,7 @@ const BASE = {
baseUrl: "https://dell-buyer-l.meimeiyouxin.com",
},
prod: {
baseUrl: "https://dell-buyer.meimeiyouxin.com",
baseUrl: "https://api.yyhock.com",
}
}
let env = process.env.VUE_APP_BASE_NODE_ENV
......
......@@ -175,7 +175,7 @@
// }else{
// self.getOss(tempFilePaths,type)
// }
uni.setStorageSync('authVals','1')
self.getOss(tempFilePaths,type)
},
fail: (err) => {
......
......@@ -607,6 +607,7 @@
this.showmarriage=true
},
changeLive(data) {
console.log(data,'现居城市')
this.liveCity = data.data.join('')
this.liveCode=data.index.join(',')
},
......@@ -622,9 +623,10 @@
this.cityAddress=e.detail.value
},
changeWork(data) {
console.log(data,'工作城市')
this.workCity = data.data.join('')
this.workCode=data.index.join(',')
// console.log(data)
},
workChange(e){
this.workAddress=e.target.value
......
......@@ -50,7 +50,8 @@
</template>
<script>
import moment from "moment";
import moment from "moment";
import {loadDevice,loadNetwork,loadUuid,loadLocation} from '../../utils/deviceInfo.js'
export default {
data() {
return {
......@@ -59,8 +60,19 @@
billList:[],
}
},
onLoad() {
this.init()
onLoad() {
const token=uni.getStorageSync('token')
const common = uni.getStorageSync("m-header-device")
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.init()
}else{
this.init()
}
},
methods: {
init(){
......@@ -105,7 +117,18 @@
},
onShow() {
this.init()
const token=uni.getStorageSync('token')
const common = uni.getStorageSync("m-header-device")
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.init()
}else{
this.init()
}
}
}
</script>
......
......@@ -72,6 +72,7 @@
</template>
<script>
import {loadDevice,loadNetwork,loadUuid,loadLocation} from '../../utils/deviceInfo.js'
export default {
data() {
return {
......@@ -121,15 +122,22 @@
},
onLoad() {
const token=uni.getStorageSync('token')
const common = uni.getStorageSync("m-header-device")
this.token=token
// 获取头部的高度
// const query = uni.createSelectorQuery().in(this);
// query.select('.i-header').boundingClientRect(data => {
// console.log(data.height,'98767')
// this.headerHeight = data.height;
// }).exec();
this.init()
this.searchGood()
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.init()
this.searchGood()
}else{
this.init()
this.searchGood()
}
},
methods:{
init(){
......@@ -234,9 +242,8 @@
"size":pageSize,
"sort":sort
}
console.log(params,'查询商品')
self.$request('/pawn/category/getGoodsPage','POST',params).then(res => {
console.log(res,'查询商品')
const {current,total,size,records }=res.result
const hasNextPage=total-self.pageSize*self.pageNum>0?true:false //是否有下一页
if(self.loadFlag){
......@@ -274,9 +281,22 @@
},
onShow() {
const token=uni.getStorageSync('token')
const common = uni.getStorageSync("m-header-device")
this.token=token
this.init()
this.searchGood()
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.init()
this.searchGood()
}else{
this.init()
this.searchGood()
}
}
}
</script>
......
......@@ -56,7 +56,8 @@
<script>
//1、使用插件
import moduleCard from '../../components/moduleCard/index.vue'
import moduleCard from '../../components/moduleCard/index.vue'
import {loadDevice,loadNetwork,loadUuid,loadLocation} from '../../utils/deviceInfo.js'
export default {
//2、使用插件
components:{
......@@ -73,25 +74,24 @@
}
},
onLoad() {
this.init()
const token=uni.getStorageSync('token')
const common = uni.getStorageSync("m-header-device")
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.init()
}else{
this.init()
}
},
onPullDownRefresh(){
console.log('shuaixin')
this.init()
uni.stopPullDownRefresh();
},
// onReady() {
// const isAgree = uni.getStorageSync('m-agreement')
// if (!isAgree) {
// console.log(isAgree,'isAgree')
// uni.navigateTo({
// url: '/pages/agreement/index'
// })
// }
// },
},
methods: {
refushMy(){
console.log('emit2')
......@@ -141,8 +141,19 @@
}
},
onShow(){
this.init()
// this.initMy()
const token=uni.getStorageSync('token')
const common = uni.getStorageSync("m-header-device")
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.init()
}else{
this.init()
}
}
}
</script>
......
......@@ -56,6 +56,7 @@
</template>
<script>
import {loadDevice,loadNetwork,loadUuid,loadLocation} from '../../utils/deviceInfo.js'
export default {
data() {
return {
......@@ -69,15 +70,22 @@
},
onLoad(){
const token=uni.getStorageSync('token')
console.log(token,'token')
if(token==''){
this.userTel=''
this.Go('uni:/pages/login/login')
return false
const common = uni.getStorageSync("m-header-device")
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.initMy()
this.initTels()
}else{
if(token==''){
this.userTel=''
this.Go('uni:/pages/login/login')
return false
}
this.initMy()
this.initTels()
}
},
......@@ -158,12 +166,20 @@
},
onShow(){
const token=uni.getStorageSync('token')
console.log(token,'token')
if(token==''){
this.userTel=''
this.Go('uni:/pages/login/login')
return false
const common = uni.getStorageSync("m-header-device")
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.initMy()
this.initTels()
}else{
if(token==''){
this.userTel=''
this.Go('uni:/pages/login/login')
return false
}
this.initMy()
this.initTels()
}
......
.single-pages{
width: 100%;
height: 100vh;
min-height: 1634rpx;
min-height: 100vh;
background: #F7FAFF;
.single-header{
padding:15rpx 0 15rpx 30rpx;
......@@ -13,7 +13,7 @@
line-height: 33rpx;
}
.single-boxs{
margin-bottom:220rpx;
padding-bottom:90rpx;
.single-main{
margin: 0 30rpx;
height: 120rpx;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -15676,7 +15676,7 @@ if(false) {}
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../../Applications/HBuilderX 2.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/runtime/api.js */ 10);
exports = ___CSS_LOADER_API_IMPORT___(false);
// Module
exports.push([module.i, ".single-pages[data-v-6e8e9fbe] {\n width: 100%;\n height: 100vh;\n min-height: 1634rpx;\n background: #F7FAFF;\n}\n.single-pages .single-header[data-v-6e8e9fbe] {\n padding: 15rpx 0 15rpx 30rpx;\n height: 33rpx;\n font-size: 24rpx;\n font-family: PingFangSC-Medium, PingFang SC;\n font-weight: 500;\n color: #2263E6;\n line-height: 33rpx;\n}\n.single-pages .single-boxs[data-v-6e8e9fbe] {\n margin-bottom: 220rpx;\n}\n.single-pages .single-boxs .single-main[data-v-6e8e9fbe] {\n margin: 0 30rpx;\n height: 120rpx;\n background: #FFFFFF;\n border-radius: 10rpx;\n}\n.single-pages .single-boxs .single-main .mian-cont[data-v-6e8e9fbe] {\n margin: 0 16rpx 0 30rpx;\n height: 120rpx;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-bottom: 1rpx solid #E9E9E9;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-left[data-v-6e8e9fbe] {\n display: flex;\n font-family: PingFangSC, PingFang SC;\n font-weight: 400;\n text-align: left;\n font-style: normal;\n line-height: 45rpx;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-left .left-period[data-v-6e8e9fbe] {\n font-size: 32rpx;\n color: #333333;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-left .left-text[data-v-6e8e9fbe] {\n padding-left: 12rpx;\n font-size: 24rpx;\n color: #FF4248;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-left .left-text-ben[data-v-6e8e9fbe] {\n padding-left: 12rpx;\n font-size: 24rpx;\n color: #2263E6;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-left .left-text-Unexpired[data-v-6e8e9fbe] {\n padding-left: 12rpx;\n font-size: 24rpx;\n color: #999999;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-right[data-v-6e8e9fbe] {\n display: flex;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-right .right-num[data-v-6e8e9fbe] {\n padding-right: 26rpx;\n font-family: DIN, DIN;\n font-weight: bold;\n font-size: 36rpx;\n color: #212121;\n line-height: 44rpx;\n text-align: right;\n font-style: normal;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-right .right-icon[data-v-6e8e9fbe] {\n width: 48rpx;\n height: 48rpx;\n background: url('http://ddh.yyhock.com/appStatic/repay-null.png') 0 0 no-repeat;\n background-size: 100%;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-right .right-icon-click[data-v-6e8e9fbe] {\n width: 48rpx;\n height: 48rpx;\n background: url('http://ddh.yyhock.com/appStatic/repay-click.png') 0 0 no-repeat;\n background-size: 100%;\n}\n.single-pages .single-boxs .single-main-ben[data-v-6e8e9fbe] {\n margin: 24rpx 30rpx;\n height: 120rpx;\n background: #FFFFFF;\n box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(232, 232, 232, 0.49);\n border-radius: 10rpx;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont[data-v-6e8e9fbe] {\n margin: 0 16rpx 0 30rpx;\n height: 120rpx;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-bottom: 1rpx solid #E9E9E9;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-left[data-v-6e8e9fbe] {\n display: flex;\n font-family: PingFangSC, PingFang SC;\n font-weight: 400;\n text-align: left;\n font-style: normal;\n line-height: 45rpx;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-left .left-period[data-v-6e8e9fbe] {\n font-size: 32rpx;\n color: #333333;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-left .left-text[data-v-6e8e9fbe] {\n padding-left: 12rpx;\n font-size: 24rpx;\n color: #FF4248;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-left .left-text-ben[data-v-6e8e9fbe] {\n padding-left: 12rpx;\n font-size: 24rpx;\n color: #2263E6;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-left .left-text-Unexpired[data-v-6e8e9fbe] {\n padding-left: 12rpx;\n font-size: 24rpx;\n color: #999999;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-right[data-v-6e8e9fbe] {\n display: flex;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-right .right-num[data-v-6e8e9fbe] {\n padding-right: 26rpx;\n font-family: DIN, DIN;\n font-weight: bold;\n font-size: 36rpx;\n color: #212121;\n line-height: 44rpx;\n text-align: right;\n font-style: normal;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-right .right-icon[data-v-6e8e9fbe] {\n width: 48rpx;\n height: 48rpx;\n background: url('http://ddh.yyhock.com/appStatic/repay-null.png') 0 0 no-repeat;\n background-size: 100%;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-right .right-icon-click[data-v-6e8e9fbe] {\n width: 48rpx;\n height: 48rpx;\n background: url('http://ddh.yyhock.com/appStatic/repay-click.png') 0 0 no-repeat;\n background-size: 100%;\n}\n.single-pages .single-footer[data-v-6e8e9fbe] {\n display: flex;\n align-items: center;\n position: fixed;\n bottom: 0;\n}\n.single-pages .single-footer .single-footer-left[data-v-6e8e9fbe] {\n width: 470rpx;\n height: 96rpx;\n background: #FFFFFF;\n display: flex;\n}\n.single-pages .single-footer .single-footer-left .left-text[data-v-6e8e9fbe] {\n margin-left: 30rpx;\n font-family: PingFangSC, PingFang SC;\n font-weight: 500;\n font-size: 28rpx;\n color: #999999;\n line-height: 96rpx;\n text-align: center;\n font-style: normal;\n}\n.single-pages .single-footer .single-footer-left .left-money[data-v-6e8e9fbe] {\n padding-left: 16rpx;\n font-family: DIN, DIN;\n font-weight: bold;\n font-size: 44rpx;\n color: #2263E6;\n line-height: 96rpx;\n text-align: center;\n font-style: normal;\n}\n.single-pages .single-footer .single-footer-right[data-v-6e8e9fbe] {\n width: 280rpx;\n height: 96rpx;\n background: #2263E6;\n font-family: PingFangSC, PingFang SC;\n font-weight: 500;\n font-size: 36rpx;\n color: #FFFFFF;\n line-height: 96rpx;\n text-align: center;\n font-style: normal;\n}\n", ""]);
exports.push([module.i, ".single-pages[data-v-6e8e9fbe] {\n width: 100%;\n height: 100vh;\n min-height: 100vh;\n background: #F7FAFF;\n}\n.single-pages .single-header[data-v-6e8e9fbe] {\n padding: 15rpx 0 15rpx 30rpx;\n height: 33rpx;\n font-size: 24rpx;\n font-family: PingFangSC-Medium, PingFang SC;\n font-weight: 500;\n color: #2263E6;\n line-height: 33rpx;\n}\n.single-pages .single-boxs[data-v-6e8e9fbe] {\n padding-bottom: 90rpx;\n}\n.single-pages .single-boxs .single-main[data-v-6e8e9fbe] {\n margin: 0 30rpx;\n height: 120rpx;\n background: #FFFFFF;\n border-radius: 10rpx;\n}\n.single-pages .single-boxs .single-main .mian-cont[data-v-6e8e9fbe] {\n margin: 0 16rpx 0 30rpx;\n height: 120rpx;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-bottom: 1rpx solid #E9E9E9;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-left[data-v-6e8e9fbe] {\n display: flex;\n font-family: PingFangSC, PingFang SC;\n font-weight: 400;\n text-align: left;\n font-style: normal;\n line-height: 45rpx;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-left .left-period[data-v-6e8e9fbe] {\n font-size: 32rpx;\n color: #333333;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-left .left-text[data-v-6e8e9fbe] {\n padding-left: 12rpx;\n font-size: 24rpx;\n color: #FF4248;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-left .left-text-ben[data-v-6e8e9fbe] {\n padding-left: 12rpx;\n font-size: 24rpx;\n color: #2263E6;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-left .left-text-Unexpired[data-v-6e8e9fbe] {\n padding-left: 12rpx;\n font-size: 24rpx;\n color: #999999;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-right[data-v-6e8e9fbe] {\n display: flex;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-right .right-num[data-v-6e8e9fbe] {\n padding-right: 26rpx;\n font-family: DIN, DIN;\n font-weight: bold;\n font-size: 36rpx;\n color: #212121;\n line-height: 44rpx;\n text-align: right;\n font-style: normal;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-right .right-icon[data-v-6e8e9fbe] {\n width: 48rpx;\n height: 48rpx;\n background: url('http://ddh.yyhock.com/appStatic/repay-null.png') 0 0 no-repeat;\n background-size: 100%;\n}\n.single-pages .single-boxs .single-main .mian-cont .cont-right .right-icon-click[data-v-6e8e9fbe] {\n width: 48rpx;\n height: 48rpx;\n background: url('http://ddh.yyhock.com/appStatic/repay-click.png') 0 0 no-repeat;\n background-size: 100%;\n}\n.single-pages .single-boxs .single-main-ben[data-v-6e8e9fbe] {\n margin: 24rpx 30rpx;\n height: 120rpx;\n background: #FFFFFF;\n box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(232, 232, 232, 0.49);\n border-radius: 10rpx;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont[data-v-6e8e9fbe] {\n margin: 0 16rpx 0 30rpx;\n height: 120rpx;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-bottom: 1rpx solid #E9E9E9;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-left[data-v-6e8e9fbe] {\n display: flex;\n font-family: PingFangSC, PingFang SC;\n font-weight: 400;\n text-align: left;\n font-style: normal;\n line-height: 45rpx;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-left .left-period[data-v-6e8e9fbe] {\n font-size: 32rpx;\n color: #333333;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-left .left-text[data-v-6e8e9fbe] {\n padding-left: 12rpx;\n font-size: 24rpx;\n color: #FF4248;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-left .left-text-ben[data-v-6e8e9fbe] {\n padding-left: 12rpx;\n font-size: 24rpx;\n color: #2263E6;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-left .left-text-Unexpired[data-v-6e8e9fbe] {\n padding-left: 12rpx;\n font-size: 24rpx;\n color: #999999;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-right[data-v-6e8e9fbe] {\n display: flex;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-right .right-num[data-v-6e8e9fbe] {\n padding-right: 26rpx;\n font-family: DIN, DIN;\n font-weight: bold;\n font-size: 36rpx;\n color: #212121;\n line-height: 44rpx;\n text-align: right;\n font-style: normal;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-right .right-icon[data-v-6e8e9fbe] {\n width: 48rpx;\n height: 48rpx;\n background: url('http://ddh.yyhock.com/appStatic/repay-null.png') 0 0 no-repeat;\n background-size: 100%;\n}\n.single-pages .single-boxs .single-main-ben .mian-cont .cont-right .right-icon-click[data-v-6e8e9fbe] {\n width: 48rpx;\n height: 48rpx;\n background: url('http://ddh.yyhock.com/appStatic/repay-click.png') 0 0 no-repeat;\n background-size: 100%;\n}\n.single-pages .single-footer[data-v-6e8e9fbe] {\n display: flex;\n align-items: center;\n position: fixed;\n bottom: 0;\n}\n.single-pages .single-footer .single-footer-left[data-v-6e8e9fbe] {\n width: 470rpx;\n height: 96rpx;\n background: #FFFFFF;\n display: flex;\n}\n.single-pages .single-footer .single-footer-left .left-text[data-v-6e8e9fbe] {\n margin-left: 30rpx;\n font-family: PingFangSC, PingFang SC;\n font-weight: 500;\n font-size: 28rpx;\n color: #999999;\n line-height: 96rpx;\n text-align: center;\n font-style: normal;\n}\n.single-pages .single-footer .single-footer-left .left-money[data-v-6e8e9fbe] {\n padding-left: 16rpx;\n font-family: DIN, DIN;\n font-weight: bold;\n font-size: 44rpx;\n color: #2263E6;\n line-height: 96rpx;\n text-align: center;\n font-style: normal;\n}\n.single-pages .single-footer .single-footer-right[data-v-6e8e9fbe] {\n width: 280rpx;\n height: 96rpx;\n background: #2263E6;\n font-family: PingFangSC, PingFang SC;\n font-weight: 500;\n font-size: 36rpx;\n color: #FFFFFF;\n line-height: 96rpx;\n text-align: center;\n font-style: normal;\n}\n", ""]);
// Exports
module.exports = exports;
......@@ -17510,7 +17510,7 @@ if(false) {}
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../Applications/HBuilderX 2.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/runtime/api.js */ 10);
exports = ___CSS_LOADER_API_IMPORT___(false);
// Module
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/*每个页面公共css */\n", ""]);
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/*每个页面公共css */\n", ""]);
// Exports
module.exports = exports;
/*
* URL分为3中类型
* 1. 以uni://开头的地址是uni-app原生的页面
* 2. 以http或者https开头的地址是H5
* 3. 跳转到其它APP的地址
* */
import { convertPromise } from '../utils/header.js'
import Permission from '../js_sdk/wa-permission/permission.js'
import { SelectLocation } from "../utils/authPerission.js";
// 获取common当中的设备信息
export const loadDevice=function() {
const that = this
convertPromise('getSystemInfo').then(result => {
const deviceInfo = {
// token:uuidObtain, result.appName
deviceType: result.deviceType,
appName: 'DDH',
deviceId: result.deviceId,
device: result.osName,
deviceName: result.platform,
appVersion: result.appWgtVersion,
osVersion: result.osVersion ? result.osVersion : result.system,
mobileType: result.model,
screenHeight: result.screenHeight,
screenWidth: result.screenWidth,
resolution: result.windowWidth + '*' + result.screenHeight,
appSourceId: "1"
};
// 本地存储
uni.setStorage({
key: 'm-device-info',
data: JSON.stringify(deviceInfo),
success: function() {
console.log('m-device-info存储成功');
}
});
}).catch(err => {
//that.toast('获取设备信息失败')
uni.showModal({
title: '"多典花"想访问您的设备信息',
content: '通过访问您的设备信息,提高您授信通过率。',
showCancel: false,
confirmText: '去设置',
success: function(res) {
if (res.confirm) {
Permission.gotoAppPermissionSetting()
}
}
});
})
}
// 获取common当中的网络信息
export const loadNetwork=function() {
const that = this;
convertPromise('getNetworkType').then(result => {
const networkInfo = {
networkStatus: result.networkType
};
// 网络信息存储
uni.setStorage({
key: 'm-network-info',
data: JSON.stringify(networkInfo),
success: function() {
console.log('m-network-info存储成功');
}
});
}).catch(err => {
that.toast('获取网络信息失败')
})
}
// 获取common当中的网络信息
export const loadUuid=function() {
plus.device.getInfo({
success: function(e) {
const deviceInfo = {
token: e.uuid,
};
uni.setStorage({
key: 'm-load-udid',
data: JSON.stringify(deviceInfo),
success: function() {
console.log('uuid存储成功');
}
})
},
fail: function(e) {
console.log('getDeviceInfo failed: ' + JSON.stringify(e));
}
});
}
// 获取common当中的网络信息
export const loadLocation=function() {
const that = this;
// 苹果测试手机如果没有插入手机卡,获取定位之后会解析失败,报错
SelectLocation(() => {
convertPromise('getLocation', {
type: 'wgs84',
geocode: true
}).then(result => {
const locationInfo = {
lat: String(result.latitude),
lng: String(result.longitude)
};
uni.setStorage({
key: 'm-location-info',
data: JSON.stringify(locationInfo),
success: function() {
console.log('m-location-info存储成功');
}
});
}).catch(err => {
console.log(err, '错误了')
// that.toast('获取位置信息失败')
})
})
}
export default {
loadDevice,
loadNetwork,
loadUuid,
loadLocation
}
......@@ -33,24 +33,6 @@ export const initHeaderInfo = function (){
}
// 初始化请求头的device参数信息
export const initHeaderDevice = function () {
const common = {
appName: 'DDH',
appSourceId: "1",
token: "c695fa285b9dc46a", // 设备令牌(device_token) 设备udid
device:'',//设备是安卓还是ios
appVersion:'',//版本号
idfa: "", // IOS设备则为:IDFA 广告标识
imei: "", //安卓设备为:imei
mac: "", // mac
wifiMac: "", // wifimac
clientIp: "",
carrierOperator: 'OperatorName', //运营商
pushType: "1", //设备push接入类型(1. 小米PUSH,2. 极光PUSH)
electricQuantity: "", //电量
totalStorage: "", //存储总空间
availableStorage: "" //可用存储空间
};
console.log(common,'common')
const deviceInfo = uni.getStorageSync('m-device-info')
const networkInfo = uni.getStorageSync('m-network-info')
const locationInfo = uni.getStorageSync('m-location-info')
......@@ -58,27 +40,26 @@ export const initHeaderDevice = function () {
let device = {};
if (deviceInfo) {
device = Object.assign(device, common, JSON.parse(deviceInfo))
device = Object.assign(device, JSON.parse(deviceInfo))
}
if (networkInfo) {
device = Object.assign(device, common, JSON.parse(networkInfo))
device = Object.assign(device, JSON.parse(networkInfo))
}
if (locationInfo) {
device = Object.assign(device, common, JSON.parse(locationInfo))
device = Object.assign(device, JSON.parse(locationInfo))
}
if(loadUuid){
device = Object.assign(device, common, JSON.parse(loadUuid))
device = Object.assign(device, JSON.parse(loadUuid))
}
if (deviceInfo && networkInfo && loadUuid) {
const headerDeviceInfo = {
if (deviceInfo && networkInfo && locationInfo && loadUuid) {
let headerDeviceInfo = {
...JSON.parse(deviceInfo),
...JSON.parse(networkInfo),
...JSON.parse(locationInfo),
...JSON.parse(loadUuid),
...common
}
// 存储所有请求的头部信息
uni.setStorage({
key: 'm-header-device',
......
import {initHeaderDevice} from './header.js'
import {initHeaderDevice,initHeaderInfo} from './header.js'
import api from '../config/api.js'
const request=async(url,type,data)=>{
// const baseUrl='http://portal.cloudsmake.cn' //测试
// const baseUrl='https://api.yyhock.com'//线上
const baseUrl=api.baseUrl
// 这里确保一定是可以获取得到的
console.log(baseUrl,'rd3333')
const headerDevice = uni.getStorageSync('m-header-device')
let rd = null;
if (headerDevice) {
rd = headerDevice
} else {
const common = initHeaderDevice()
rd = JSON.stringify(common)
const versionNew=uni.getStorageSync('version')
// 根据当前时间戳生成一个随机整数
var randomNum = new Date().getTime();
let rd
const tokenF=uni.getStorageSync('tokenFinance')
if(tokenF=='' && plus.os.name!='iOS'){
rd=initHeaderInfo()
}else{
if (headerDevice) {
rd = headerDevice
}else{
const common = initHeaderDevice()
rd = JSON.stringify(common)
// console.log(rd,'rd3333')
}
}
return new Promise((resolve,reject)=>{
const token=uni.getStorageSync('token')
const tokenFinance=uni.getStorageSync('tokenFinance')
console.log(token,'token')
console.log(tokenFinance,'tokenFinance')
uni.request({
url: baseUrl+url,
method:type,
......
......@@ -5,7 +5,6 @@
* 3. 跳转到其它APP的地址
* */
export const Jump = function (url, type='navigate') {
console.log(url,type,'路径1')
if (!url) return;
......@@ -58,6 +57,8 @@ export const Jump = function (url, type='navigate') {
}
export default {
Jump
Jump,
}
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