Swanky 2 years ago
parent 5a7a95768b
commit 73961300de
  1. 18
      pages/lssjgl/lssjgl.vue

@ -1,8 +1,9 @@
<template> <template>
<view class="sjgl"> <view class="sjgl">
<uni-notice-bar color="#2979FF" background-color="#EAF2FF" <uni-notice-bar color="#2979FF" background-color="#EAF2FF" text="在无网络环境时上报的数据将存储在此处,进入到有网络的环境时进行统一上报。" />
text="在无网络环境时上报的数据将存储在此处,进入到有网络的环境时进行统一上报." />
<uni-notice-bar v-if="networkType==='none'" text="当前无法连接网络,无法进行数据上报。 " />
<view v-for="(item,i) in datas"> <view v-for="(item,i) in datas">
<uni-card style="padding: 0;"> <uni-card style="padding: 0;">
<view style="padding: 10px;"> <view style="padding: 10px;">
@ -24,7 +25,7 @@
<view v-if="datas.length===0" style="text-align: center;color: #666;margin: 24px;"> <view v-if="datas.length===0" style="text-align: center;color: #666;margin: 24px;">
<text>无临时数据</text> <text>无临时数据</text>
</view> </view>
<button v-if="datas.length!==0" class="submit-btn" type="primary" @click="submit" <button v-if="datas.length!==0 && networkType!=='none'" class="submit-btn" type="primary" @click="submit"
:loading="submiting">上报所有数据</button> :loading="submiting">上报所有数据</button>
</view> </view>
</template> </template>
@ -37,7 +38,8 @@
datas: [], datas: [],
submiting: false, submiting: false,
token: '', token: '',
successDatas: [] successDatas: [],
networkType: null
} }
}, },
onLoad() { onLoad() {
@ -48,7 +50,13 @@
}, },
fail(err) {}, fail(err) {},
complete: () => {} complete: () => {}
}) });
uni.getNetworkType({
success: (res) => {
this.networkType = res.networkType;
}
});
}, },
onShow(e) { onShow(e) {
console.log('onshow', e) console.log('onshow', e)

Loading…
Cancel
Save