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() {
// console.log('App Hide')
},
}
</script>

0
common/base.js

4
main.js

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

2
manifest.json

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

2
pages/account/index.vue

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

80
pages/index/index.vue

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

4
pages/order/confirmation.vue

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

Loading…
Cancel
Save