Commit 8179316a authored by ly's avatar ly

获取设备信息

parent a6afa57e
...@@ -4,8 +4,22 @@ ...@@ -4,8 +4,22 @@
import { SelectLocation } from "./utils/authPerission"; import { SelectLocation } from "./utils/authPerission";
export default { export default {
onLaunch: function() { onLaunch: function() {
const common = uni.getStorageSync("m-headers") const common = uni.getStorageSync("m-header-device")
if (!common) {
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.loadDevice();
this.loadNetwork(); this.loadNetwork();
this.loadLocation(); this.loadLocation();
...@@ -19,194 +33,203 @@ ...@@ -19,194 +33,203 @@
methods:{ methods:{
//版本检查 //版本检查
checkVersion(){ checkVersion(){
const self=this const self=this
// let realVersion = '109';//这里是热更新的版本号,依次累加,(后端要比这里的版本号大) // let realVersion = '109';//这里是热更新的版本号,依次累加,(后端要比这里的版本号大)
plus.runtime.getProperty(plus.runtime.appid,function(widgetInfo){ plus.runtime.getProperty(plus.runtime.appid,function(widgetInfo){
let currentVersion = widgetInfo.version.replace(/\./g, ""); //获取当前版本号 let currentVersion = widgetInfo.version.replace(/\./g, ""); //获取当前版本号
self.$request('/app/v1/checkVersions','GET').then(res=>{ self.$request('/app/v1/checkVersions','GET').then(res=>{
const { versionInfo }=res.result console.log(res,'appvue')
const { version,updateUrl,updateMsg,update,forceUpdate}=versionInfo const { versionInfo }=res.result
if(update==true && currentVersion<version){ const { version,updateUrl,updateMsg,update,forceUpdate}=versionInfo
console.log(version,'checkversion') if(update==true && currentVersion<version){
if(forceUpdate==false){ console.log(version,'checkversion')
console.log('更新1') if(forceUpdate==false){
//可以关闭弹窗,更新 console.log('更新1')
self.updateShut(updateUrl,updateMsg) //可以关闭弹窗,更新
}else{ self.updateShut(updateUrl,updateMsg)
//不可关闭弹窗强制更新 }else{
console.log('更新2') //不可关闭弹窗强制更新
self.updatePackage(updateUrl,updateMsg) console.log('更新2')
self.updatePackage(updateUrl,updateMsg)
}
} }
})
}
}) })
})
}, },
//可关闭更新 //可关闭更新
updateShut(updateUrl,updateMsg){ updateShut(updateUrl,updateMsg){
// plus.runtime.quit(); 退出应用 // plus.runtime.quit(); 退出应用
uni.showModal({ uni.showModal({
//提醒用户更新 //提醒用户更新
title: "版本更新", title: "版本更新",
content: updateMsg, content: updateMsg,
confirmText:'立即更新', confirmText:'立即更新',
cancelText: '取消', cancelText: '取消',
success: (rese) => { success: (rese) => {
if(rese.confirm){ if(rese.confirm){
// uni.getSystemInfoSync().platform // uni.getSystemInfoSync().platform
console.log(plus.os.name,'ios') console.log(plus.os.name,'ios')
if(uni.getSystemInfoSync().platform==='ios'){ if(uni.getSystemInfoSync().platform==='ios'){
console.log('ios') console.log('ios')
plus.runtime.openURL(updateUrl) plus.runtime.openURL(updateUrl)
}else{ }else{
console.log('android') console.log('android')
plus.runtime.openURL(updateUrl); // 调用手机端的浏览器 进行下载 plus.runtime.openURL(updateUrl); // 调用手机端的浏览器 进行下载
}
} }
} }
} })
})
}, },
//强制更新app //强制更新app
updatePackage(updateUrl,updateMsg){ updatePackage(updateUrl,updateMsg){
// plus.runtime.quit(); 退出应用 // plus.runtime.quit(); 退出应用
uni.showModal({ uni.showModal({
//提醒用户更新 //提醒用户更新
title: "版本更新", title: "版本更新",
showCancel: false, // 将取消按钮隐藏 showCancel: false, // 将取消按钮隐藏
content: updateMsg, content: updateMsg,
buttonText: '立即更新', buttonText: '立即更新',
success: (rese) => { success: (rese) => {
if(rese.confirm){ if(rese.confirm){
// uni.getSystemInfoSync().platform // uni.getSystemInfoSync().platform
console.log(plus.os.name,'ios') console.log(plus.os.name,'ios')
if(uni.getSystemInfoSync().platform==='ios'){ if(uni.getSystemInfoSync().platform==='ios'){
console.log('ios') console.log('ios')
plus.runtime.openURL(updateUrl) plus.runtime.openURL(updateUrl)
}else{ }else{
console.log('android') console.log('android')
plus.runtime.openURL(updateUrl); // 调用手机端的浏览器 进行下载 plus.runtime.openURL(updateUrl); // 调用手机端的浏览器 进行下载
}
} }
} }
} })
})
}, },
// 获取common当中的设备信息 // 获取common当中的设备信息
loadDevice: function() { loadDevice: function() {
const that = this const that = this
convertPromise('getSystemInfo').then(result => { convertPromise('getSystemInfo').then(result => {
const deviceInfo = { const deviceInfo = {
// token:uuidObtain, // token:uuidObtain, result.appName
deviceType: result.deviceType, deviceType: result.deviceType,
appName: result.appName, appName: 'DDH',
deviceId: result.deviceId, deviceId: result.deviceId,
device: result.osName, device: result.osName,
deviceName: result.platform, deviceName: result.platform,
appVersion: result.appWgtVersion, appVersion: result.appWgtVersion,
osVersion: result.osVersion ? result.osVersion : result.system, osVersion: result.osVersion ? result.osVersion : result.system,
mobileType: result.model, mobileType: result.model,
screenHeight: result.screenHeight, screenHeight: result.screenHeight,
screenWidth: result.screenWidth, screenWidth: result.screenWidth,
resolution: result.windowWidth + '*' + result.screenHeight resolution: result.windowWidth + '*' + result.screenHeight,
}; appSourceId: "1"
};
// 本地存储 // 本地存储
uni.setStorage({ uni.setStorage({
key: 'm-device-info', key: 'm-device-info',
data: JSON.stringify(deviceInfo), data: JSON.stringify(deviceInfo),
success: function() { success: function() {
console.log('m-device-info存储成功'); console.log('m-device-info存储成功');
} }
}); });
}).catch(err => { }).catch(err => {
//that.toast('获取设备信息失败') //that.toast('获取设备信息失败')
uni.showModal({ uni.showModal({
title: '"多典花"想访问您的设备信息', title: '"多典花"想访问您的设备信息',
content: '通过访问您的设备信息,提高您授信通过率。', content: '通过访问您的设备信息,提高您授信通过率。',
showCancel: false, showCancel: false,
confirmText: '去设置', confirmText: '去设置',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
Permission.gotoAppPermissionSetting() 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存储成功');
}
})
}, },
fail: function(e) { // 获取common当中的网络信息
console.log('getDeviceInfo failed: ' + JSON.stringify(e)); loadNetwork: function() {
} const that = this;
}); convertPromise('getNetworkType').then(result => {
}, const networkInfo = {
// 获取common当中的位置信息 networkStatus: result.networkType
loadLocation: function() { };
const that = this; // 网络信息存储
// 苹果测试手机如果没有插入手机卡,获取定位之后会解析失败,报错 uni.setStorage({
SelectLocation(() => { key: 'm-network-info',
convertPromise('getLocation', { data: JSON.stringify(networkInfo),
type: 'wgs84', success: function() {
geocode: true console.log('m-network-info存储成功');
}).then(result => { }
const locationInfo = { });
lat: String(result.latitude), }).catch(err => {
lng: String(result.longitude) that.toast('获取网络信息失败')
})
}; },
uni.setStorage({ //获取uuid
key: 'm-location-info', loadUuid: function() {
data: JSON.stringify(locationInfo), // plus.device.uuid
success: function() { plus.device.getInfo({
console.log('m-location-info存储成功'); success: function(e) {
} const deviceInfo = {
}); token: e.uuid,
}).catch(err => { };
console.log(err, '错误了') uni.setStorage({
// that.toast('获取位置信息失败') 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() { 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() { onHide: function() {
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
}, },
// 地址控件改变控件 // 地址控件改变控件
columnchange(d) { columnchange(d) {
this.updateSelectIndex(d.detail.column, d.detail.value) // 更新选择索引 this.updateSelectIndex(d.detail.column, d.detail.value) // 更新选择索引
.updateSourceDate() // 更新源数据 .updateSourceDate() // 更新源数据
.updateAddressDate() // 更新结果数据 .updateAddressDate() // 更新结果数据
...@@ -100,7 +100,8 @@ ...@@ -100,7 +100,8 @@
/** /**
* 点击确定 * 点击确定
* */ * */
bindPickerChange(e) { bindPickerChange(e) {
console.log(e.target.value,'change')
this.$emit('change', { this.$emit('change', {
index: selectCode, index: selectCode,
data: selectVal data: selectVal
......
...@@ -14,7 +14,7 @@ const BASE = { ...@@ -14,7 +14,7 @@ const BASE = {
baseUrl: "https://dell-buyer-l.meimeiyouxin.com", baseUrl: "https://dell-buyer-l.meimeiyouxin.com",
}, },
prod: { prod: {
baseUrl: "https://dell-buyer.meimeiyouxin.com", baseUrl: "https://api.yyhock.com",
} }
} }
let env = process.env.VUE_APP_BASE_NODE_ENV let env = process.env.VUE_APP_BASE_NODE_ENV
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
// }else{ // }else{
// self.getOss(tempFilePaths,type) // self.getOss(tempFilePaths,type)
// } // }
uni.setStorageSync('authVals','1')
self.getOss(tempFilePaths,type) self.getOss(tempFilePaths,type)
}, },
fail: (err) => { fail: (err) => {
......
...@@ -607,6 +607,7 @@ ...@@ -607,6 +607,7 @@
this.showmarriage=true this.showmarriage=true
}, },
changeLive(data) { changeLive(data) {
console.log(data,'现居城市')
this.liveCity = data.data.join('') this.liveCity = data.data.join('')
this.liveCode=data.index.join(',') this.liveCode=data.index.join(',')
}, },
...@@ -622,9 +623,10 @@ ...@@ -622,9 +623,10 @@
this.cityAddress=e.detail.value this.cityAddress=e.detail.value
}, },
changeWork(data) { changeWork(data) {
console.log(data,'工作城市')
this.workCity = data.data.join('') this.workCity = data.data.join('')
this.workCode=data.index.join(',') this.workCode=data.index.join(',')
// console.log(data)
}, },
workChange(e){ workChange(e){
this.workAddress=e.target.value this.workAddress=e.target.value
......
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
</template> </template>
<script> <script>
import moment from "moment"; import moment from "moment";
import {loadDevice,loadNetwork,loadUuid,loadLocation} from '../../utils/deviceInfo.js'
export default { export default {
data() { data() {
return { return {
...@@ -59,8 +60,19 @@ ...@@ -59,8 +60,19 @@
billList:[], billList:[],
} }
}, },
onLoad() { 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()
}
}, },
methods: { methods: {
init(){ init(){
...@@ -105,7 +117,18 @@ ...@@ -105,7 +117,18 @@
}, },
onShow() { 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> </script>
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
</template> </template>
<script> <script>
import {loadDevice,loadNetwork,loadUuid,loadLocation} from '../../utils/deviceInfo.js'
export default { export default {
data() { data() {
return { return {
...@@ -121,15 +122,22 @@ ...@@ -121,15 +122,22 @@
}, },
onLoad() { onLoad() {
const token=uni.getStorageSync('token') const token=uni.getStorageSync('token')
const common = uni.getStorageSync("m-header-device")
this.token=token this.token=token
// 获取头部的高度 if(!common && plus.os.name!='iOS' && token){
// const query = uni.createSelectorQuery().in(this); loadDevice()
// query.select('.i-header').boundingClientRect(data => { loadNetwork()
// console.log(data.height,'98767') loadUuid()
// this.headerHeight = data.height; loadLocation()
// }).exec(); this.init()
this.init() this.searchGood()
this.searchGood()
}else{
this.init()
this.searchGood()
}
}, },
methods:{ methods:{
init(){ init(){
...@@ -234,9 +242,8 @@ ...@@ -234,9 +242,8 @@
"size":pageSize, "size":pageSize,
"sort":sort "sort":sort
} }
console.log(params,'查询商品')
self.$request('/pawn/category/getGoodsPage','POST',params).then(res => { self.$request('/pawn/category/getGoodsPage','POST',params).then(res => {
console.log(res,'查询商品')
const {current,total,size,records }=res.result const {current,total,size,records }=res.result
const hasNextPage=total-self.pageSize*self.pageNum>0?true:false //是否有下一页 const hasNextPage=total-self.pageSize*self.pageNum>0?true:false //是否有下一页
if(self.loadFlag){ if(self.loadFlag){
...@@ -274,9 +281,22 @@ ...@@ -274,9 +281,22 @@
}, },
onShow() { onShow() {
const token=uni.getStorageSync('token') const token=uni.getStorageSync('token')
const common = uni.getStorageSync("m-header-device")
this.token=token this.token=token
this.init() if(!common && plus.os.name!='iOS' && token){
this.searchGood() loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.init()
this.searchGood()
}else{
this.init()
this.searchGood()
}
} }
} }
</script> </script>
......
...@@ -56,7 +56,8 @@ ...@@ -56,7 +56,8 @@
<script> <script>
//1、使用插件 //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 { export default {
//2、使用插件 //2、使用插件
components:{ components:{
...@@ -73,25 +74,24 @@ ...@@ -73,25 +74,24 @@
} }
}, },
onLoad() { onLoad() {
const token=uni.getStorageSync('token')
this.init() const common = uni.getStorageSync("m-header-device")
if(!common && plus.os.name!='iOS' && token){
loadDevice()
loadNetwork()
loadUuid()
loadLocation()
this.init()
}else{
this.init()
}
}, },
onPullDownRefresh(){ onPullDownRefresh(){
console.log('shuaixin') console.log('shuaixin')
this.init() this.init()
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, },
// onReady() {
// const isAgree = uni.getStorageSync('m-agreement')
// if (!isAgree) {
// console.log(isAgree,'isAgree')
// uni.navigateTo({
// url: '/pages/agreement/index'
// })
// }
// },
methods: { methods: {
refushMy(){ refushMy(){
console.log('emit2') console.log('emit2')
...@@ -141,8 +141,19 @@ ...@@ -141,8 +141,19 @@
} }
}, },
onShow(){ 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> </script>
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
</template> </template>
<script> <script>
import {loadDevice,loadNetwork,loadUuid,loadLocation} from '../../utils/deviceInfo.js'
export default { export default {
data() { data() {
return { return {
...@@ -69,15 +70,22 @@ ...@@ -69,15 +70,22 @@
}, },
onLoad(){ onLoad(){
const token=uni.getStorageSync('token') const token=uni.getStorageSync('token')
console.log(token,'token') const common = uni.getStorageSync("m-header-device")
if(token==''){ if(!common && plus.os.name!='iOS' && token){
this.userTel='' loadDevice()
this.Go('uni:/pages/login/login') loadNetwork()
return false loadUuid()
loadLocation()
this.initMy()
this.initTels()
}else{ }else{
if(token==''){
this.userTel=''
this.Go('uni:/pages/login/login')
return false
}
this.initMy() this.initMy()
this.initTels() this.initTels()
} }
}, },
...@@ -158,12 +166,20 @@ ...@@ -158,12 +166,20 @@
}, },
onShow(){ onShow(){
const token=uni.getStorageSync('token') const token=uni.getStorageSync('token')
console.log(token,'token') const common = uni.getStorageSync("m-header-device")
if(token==''){ if(!common && plus.os.name!='iOS' && token){
this.userTel='' loadDevice()
this.Go('uni:/pages/login/login') loadNetwork()
return false loadUuid()
loadLocation()
this.initMy()
this.initTels()
}else{ }else{
if(token==''){
this.userTel=''
this.Go('uni:/pages/login/login')
return false
}
this.initMy() this.initMy()
this.initTels() this.initTels()
} }
......
.single-pages{ .single-pages{
width: 100%; width: 100%;
height: 100vh; height: 100vh;
min-height: 1634rpx; min-height: 100vh;
background: #F7FAFF; background: #F7FAFF;
.single-header{ .single-header{
padding:15rpx 0 15rpx 30rpx; padding:15rpx 0 15rpx 30rpx;
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
line-height: 33rpx; line-height: 33rpx;
} }
.single-boxs{ .single-boxs{
margin-bottom:220rpx; padding-bottom:90rpx;
.single-main{ .single-main{
margin: 0 30rpx; margin: 0 30rpx;
height: 120rpx; 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) {} ...@@ -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); 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); exports = ___CSS_LOADER_API_IMPORT___(false);
// Module // 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 // Exports
module.exports = exports; module.exports = exports;
...@@ -17510,7 +17510,7 @@ if(false) {} ...@@ -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); 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); exports = ___CSS_LOADER_API_IMPORT___(false);
// Module // 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 // Exports
module.exports = 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 (){ ...@@ -33,24 +33,6 @@ export const initHeaderInfo = function (){
} }
// 初始化请求头的device参数信息 // 初始化请求头的device参数信息
export const initHeaderDevice = function () { 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 deviceInfo = uni.getStorageSync('m-device-info')
const networkInfo = uni.getStorageSync('m-network-info') const networkInfo = uni.getStorageSync('m-network-info')
const locationInfo = uni.getStorageSync('m-location-info') const locationInfo = uni.getStorageSync('m-location-info')
...@@ -58,27 +40,26 @@ export const initHeaderDevice = function () { ...@@ -58,27 +40,26 @@ export const initHeaderDevice = function () {
let device = {}; let device = {};
if (deviceInfo) { if (deviceInfo) {
device = Object.assign(device, common, JSON.parse(deviceInfo)) device = Object.assign(device, JSON.parse(deviceInfo))
} }
if (networkInfo) { if (networkInfo) {
device = Object.assign(device, common, JSON.parse(networkInfo)) device = Object.assign(device, JSON.parse(networkInfo))
} }
if (locationInfo) { if (locationInfo) {
device = Object.assign(device, common, JSON.parse(locationInfo)) device = Object.assign(device, JSON.parse(locationInfo))
} }
if(loadUuid){ if(loadUuid){
device = Object.assign(device, common, JSON.parse(loadUuid)) device = Object.assign(device, JSON.parse(loadUuid))
} }
if (deviceInfo && networkInfo && loadUuid) { if (deviceInfo && networkInfo && locationInfo && loadUuid) {
const headerDeviceInfo = { let headerDeviceInfo = {
...JSON.parse(deviceInfo), ...JSON.parse(deviceInfo),
...JSON.parse(networkInfo), ...JSON.parse(networkInfo),
...JSON.parse(locationInfo),
...JSON.parse(loadUuid), ...JSON.parse(loadUuid),
...common
} }
// 存储所有请求的头部信息 // 存储所有请求的头部信息
uni.setStorage({ uni.setStorage({
key: 'm-header-device', key: 'm-header-device',
......
import {initHeaderDevice} from './header.js' import {initHeaderDevice,initHeaderInfo} from './header.js'
import api from '../config/api.js' import api from '../config/api.js'
const request=async(url,type,data)=>{ const request=async(url,type,data)=>{
// const baseUrl='http://portal.cloudsmake.cn' //测试
// const baseUrl='https://api.yyhock.com'//线上
const baseUrl=api.baseUrl const baseUrl=api.baseUrl
// 这里确保一定是可以获取得到的 // 这里确保一定是可以获取得到的
console.log(baseUrl,'rd3333')
const headerDevice = uni.getStorageSync('m-header-device') const headerDevice = uni.getStorageSync('m-header-device')
let rd = null; const versionNew=uni.getStorageSync('version')
if (headerDevice) { // 根据当前时间戳生成一个随机整数
rd = headerDevice var randomNum = new Date().getTime();
} else { let rd
const common = initHeaderDevice() const tokenF=uni.getStorageSync('tokenFinance')
if(tokenF=='' && plus.os.name!='iOS'){
rd = JSON.stringify(common) rd=initHeaderInfo()
}else{
if (headerDevice) {
rd = headerDevice
}else{
const common = initHeaderDevice()
rd = JSON.stringify(common)
// console.log(rd,'rd3333')
}
} }
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
const token=uni.getStorageSync('token') const token=uni.getStorageSync('token')
const tokenFinance=uni.getStorageSync('tokenFinance') const tokenFinance=uni.getStorageSync('tokenFinance')
console.log(token,'token')
console.log(tokenFinance,'tokenFinance')
uni.request({ uni.request({
url: baseUrl+url, url: baseUrl+url,
method:type, method:type,
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* 3. 跳转到其它APP的地址 * 3. 跳转到其它APP的地址
* */ * */
export const Jump = function (url, type='navigate') { export const Jump = function (url, type='navigate') {
console.log(url,type,'路径1') console.log(url,type,'路径1')
if (!url) return; if (!url) return;
...@@ -58,6 +57,8 @@ export const Jump = function (url, type='navigate') { ...@@ -58,6 +57,8 @@ export const Jump = function (url, type='navigate') {
} }
export default { 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