Browse Source

轮询网络判断(白屏)

master
zhengshuiqi 3 years ago
parent
commit
3ee7795d29
  1. 1
      App.vue
  2. 0
      common/base.js
  3. 4
      main.js
  4. 2
      manifest.json
  5. 2
      pages/account/index.vue
  6. 80
      pages/index/index.vue
  7. 4
      pages/order/confirmation.vue

1
App.vue

@ -94,6 +94,7 @@
onHide: function() { onHide: function() {
// console.log('App Hide') // console.log('App Hide')
}, },
} }
</script> </script>

0
common/base.js

4
main.js

@ -3,6 +3,10 @@ import store from '@/store/store.js'
import ios from '@/ios/index.js' import ios from '@/ios/index.js'
// #ifndef VUE3 // #ifndef VUE3
import Vue from 'vue' import Vue from 'vue'
Vue.prototype.$onLaunched = new Promise(resolve => {
Vue.prototype.$isResolve = resolve
})
Vue.config.productionTip = false Vue.config.productionTip = false
App.mpType = 'app' App.mpType = 'app'
const app = new Vue({ const app = new Vue({

2
manifest.json

@ -112,7 +112,7 @@
"xxhdpi" : "unpackage/res/icons/dope2.png" "xxhdpi" : "unpackage/res/icons/dope2.png"
}, },
"useOriginalMsgbox" : false, "useOriginalMsgbox" : false,
"iosStyle" : "common", "iosStyle" : "default",
"ios" : { "ios" : {
"iphone" : { "iphone" : {
"retina47" : "unpackage/res/icons/dope2.png", "retina47" : "unpackage/res/icons/dope2.png",

2
pages/account/index.vue

@ -535,7 +535,7 @@
align-items: center; align-items: center;
position: absolute; position: absolute;
width: 100%; width: 100%;
top: 13.5%; top: 15.5%;
// left: 15%; // left: 15%;
// z-index: 1111; // z-index: 1111;

80
pages/index/index.vue

@ -157,21 +157,50 @@
}, 2000) }, 2000)
}, },
onReady() { onReady() {
//
// typee = 2
//(IOS) //(IOS)
uni.getNetworkType({ let that = this;
success: function (res) { let s = 0;
console.log(res.networkType);// wifi2g3g4gethernetunknownnone let time = setInterval(()=>{
if(res.networkType === "none"){ console.log('6666')
uni.getNetworkType({
this.typee = 1; success:(res)=>{
console.log("当前无网络",this.typee); console.log(res.networkType,s);
}else{ if(res.networkType !== 'none'){
this.typee = 2 that.typee = 2;
console.log("有网络",this.typee); clearInterval(time);
} console.log('清楚网络..')
} }
}); }
})
s++;
},1000);
/* uni.getNetworkType({
success: function(res) {
console.log(res.networkType);
// wifi2g3g4gethernetunknownnone
setTimeout(function() {
if (res.networkType === "none") {
that.typee = 1;
console.log("当前无网络", that.typee);
uni.showToast({
title: '网络不佳,请重新打开........',
duration: 20000
});
} else {
that.typee = 2
console.log("有网络", that.typee);
uni.showToast({
title: '网络不佳,请重新打开........',
duration: 2000
});
}
}, 3000)
}
}); */
}, },
onLoad() { onLoad() {
let home = 'HOME' let home = 'HOME'
@ -1134,7 +1163,7 @@
</script> </script>
<template> <template>
<view class="body" :class="isScrollShow?'body_pad':''"> <view v-if="typee == 2" class="body" :class="isScrollShow?'body_pad':''">
<!-- 进入页面部分 --> <!-- 进入页面部分 -->
<view v-show="!open_img || countdownTime2==0"> <view v-show="!open_img || countdownTime2==0">
@ -1344,20 +1373,19 @@
<!-- HOT SELLS 2 --> <!-- HOT SELLS 2 -->
<scroll-view class="spike1 page_padding" scroll-x="true" @change="handlechange" :show-scrollbar="false" <scroll-view class="spike1 page_padding" scroll-x="true" @change="handlechange" :show-scrollbar="false"
:indicator-dots="true" :circular="true" :interval="3000" :duration="1000" :indicator-dots="true" :circular="true" :interval="3000" :duration="1000"
v-if="item.zone_code=='HONLIST2' && item.zone_status=='NORMAL'" :current="mycurrent"> v-if="item.zone_code=='HONLIST2' && item.zone_status=='NORMAL'" :current="mycurrent">
<view class="spike1_item padding_honlist2" v-for="(item1,index1) in item.blocks" <view class="spike1_item padding_honlist2" v-for="(item1,index1) in item.blocks"
:key="item1.block_id"> :key="item1.block_id">
<view :class="['swiper-item',index1==mycurrent ? 'active' : '']" > <view :class="['swiper-item',index1==mycurrent ? 'active' : '']">
<!-- class="item_img"> --> <!-- class="item_img"> -->
<image :src="item1.block_pic" mode="" <image :src="item1.block_pic" mode=""
:style="{width:(item.zone_code=='HONLIST2')?420+'rpx':'',height:item.zone_column+'rpx'}" :style="{width:(item.zone_code=='HONLIST2')?420+'rpx':'',height:item.zone_column+'rpx'}"
@click="imgTo(itesm1)"></image> @click="imgTo(itesm1)"></image>
</view> </view>
</view> </view>
<!-- 轮播图 --> <!-- 轮播图 -->
<<<<<<< HEAD
<!-- <view v-if="item.zone_code=='HONLIST2' && item.zone_status=='NORMAL'" :current="mycurrent"> <!-- <view v-if="item.zone_code=='HONLIST2' && item.zone_status=='NORMAL'" :current="mycurrent">
<swiper v-for="(item1,index1) in item.blocks" :key="item1.block_id" style="height: 600rpx;" previous-margin="140rpx" next-margin="140rpx" @change="handlechange" :current="mycurrent" :indicator-dots="true" :circular="true" :interval="3000" :duration="1000"> <swiper v-for="(item1,index1) in item.blocks" :key="item1.block_id" style="height: 600rpx;" previous-margin="140rpx" next-margin="140rpx" @change="handlechange" :current="mycurrent" :indicator-dots="true" :circular="true" :interval="3000" :duration="1000">
<swiper-item v-for="i,index in 10" :key="i"> <swiper-item v-for="i,index in 10" :key="i">
@ -1365,21 +1393,19 @@
<image :src="item1.block_pic" mode="" <image :src="item1.block_pic" mode=""
:style="{width:(item.zone_code=='HONLIST2')?420+'rpx':'',height:item.zone_column+'rpx'}" :style="{width:(item.zone_code=='HONLIST2')?420+'rpx':'',height:item.zone_column+'rpx'}"
@click="imgTo(itesm1)"></image> @click="imgTo(itesm1)"></image>
=======
<!-- <view> --> <!-- <view> -->
<!-- previous-margin指的是当前图片的左边框距离屏幕最左边的距离 --> <!-- previous-margin指的是当前图片的左边框距离屏幕最左边的距离 -->
<!-- <swiper class="spike1 page_padding" scroll-x="true" :show-scrollbar="false" <!-- <swiper class="spike1 page_padding" scroll-x="true" :show-scrollbar="false"
v-if="item.zone_code=='HONLIST2' && item.zone_status=='NORMAL'" style="height: 600rpx;" v-if="item.zone_code=='HONLIST2' && item.zone_status=='NORMAL'" style="height: 600rpx;"
previous-margin="140rpx" next-margin="140rpx" @change="handlechange" :current="mycurrent" previous-margin="140rpx" next-margin="140rpx" @change="handlechange" :current="mycurrent"
:indicator-dots="true" :circular="true" :interval="3000" :duration="1000"> :indicator-dots="true" :circular="true" :interval="3000" :duration="1000">
<swiper-item v-for="(item1,index1) in item.blocks" :key="item1.block_id"> --> <swiper-item v-for="(item1,index1) in item.blocks" :key="item1.block_id"> -->
<!-- v-for="(item1,index1) in item.blocks" :key="item1.block_id"> --> <!-- v-for="(item1,index1) in item.blocks" :key="item1.block_id"> -->
<!-- v-for="i,index in 10" :key="i" --> <!-- v-for="i,index in 10" :key="i" -->
<!-- <view :class="['swiper-items',index==mycurrent ? 'active' : '']"> <!-- <view :class="['swiper-items',index==mycurrent ? 'active' : '']">
<img :src="item1.block_pic" mode="" <img :src="item1.block_pic" mode=""
:style="{width:(item.zone_code=='HONLIST2')?420+'rpx':'',height:item.zone_column+'rpx'}" :style="{width:(item.zone_code=='HONLIST2')?420+'rpx':'',height:item.zone_column+'rpx'}"
@click="imgTo(item1)"> @click="imgTo(item1)">
>>>>>>> parent of 3509ff0 (样式修改)
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>

4
pages/order/confirmation.vue

@ -426,6 +426,7 @@
console.info(data,'支付') console.info(data,'支付')
console.log(res) console.log(res)
if (res.error == 0) { if (res.error == 0) {
console.log(res.error);
// plus.runtime.openURL(res.data.prepay_data.checkoutnow_url) // plus.runtime.openURL(res.data.prepay_data.checkoutnow_url)
// this.src = res.data.prepay_data.checkoutnow_url // this.src = res.data.prepay_data.checkoutnow_url
uni.navigateTo({ uni.navigateTo({
@ -434,6 +435,7 @@
} }
}) })
} else if (this.pay_index == 1) { } else if (this.pay_index == 1) {
//
data = { data = {
_action: 'payorder', _action: 'payorder',
order_id: id, order_id: id,
@ -443,6 +445,8 @@
defaultRequest2(data).then(res => { defaultRequest2(data).then(res => {
console.info(data,'支付1111') console.info(data,'支付1111')
console.log(res) console.log(res)
console.log(res.error);
if (res.error == 0) { if (res.error == 0) {
// plus.runtime.openURL(res.data.prepay_data.checkoutnow_url) // plus.runtime.openURL(res.data.prepay_data.checkoutnow_url)
// this.src = res.data.prepay_data.checkoutnow_url // this.src = res.data.prepay_data.checkoutnow_url

Loading…
Cancel
Save