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