|
@@ -60,6 +60,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
+ <view v-else class="noData">
|
|
|
+ <text v-if="status === 0">暂无分享设备</text>
|
|
|
+ <text v-else>暂无分享记录</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -79,21 +83,12 @@ export default {
|
|
|
this.$http
|
|
|
.post("wap/share/queryDevShare", {
|
|
|
userId: uni.getStorageSync("userId"),
|
|
|
- state: null,
|
|
|
+ state: this.status,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
uni.hideLoading();
|
|
|
if (res.data.data) {
|
|
|
this.shareList = res.data.data;
|
|
|
- if (this.shareList && this.status != null) {
|
|
|
- const hasStatusZero = this.shareList.some(
|
|
|
- (item) => item.state === 0
|
|
|
- );
|
|
|
- if (!hasStatusZero) {
|
|
|
- this.state = null;
|
|
|
- this.getShareList();
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -166,6 +161,19 @@ export default {
|
|
|
uni.stopPullDownRefresh();
|
|
|
}, 1000);
|
|
|
},
|
|
|
+ onLoad(options) {
|
|
|
+ const shareType = options.shareType;
|
|
|
+ if (shareType) {
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: shareType === "list" ? "分享记录" : "分享设备",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (shareType === "list") {
|
|
|
+ this.status = null;
|
|
|
+ } else if (shareType === "sure") {
|
|
|
+ this.status = 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -250,5 +258,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .noData {
|
|
|
+ text-align: center;
|
|
|
+ padding: 20rpx;
|
|
|
+ color: #999;
|
|
|
+ font-size: 28rpx;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|