From 17d7043f10d55429db919238fe639bff1b51ec0e Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期五, 07 二月 2025 15:59:37 +0800
Subject: [PATCH] Merge branch '2.0.1' of http://139.186.142.91:10010/r/productDev/funingyunwei into 2.0.1
---
h5/pages/polling/task.vue | 58 ++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 48 insertions(+), 10 deletions(-)
diff --git a/h5/pages/polling/task.vue b/h5/pages/polling/task.vue
index 8298402..0fcaf6b 100644
--- a/h5/pages/polling/task.vue
+++ b/h5/pages/polling/task.vue
@@ -44,18 +44,25 @@
<view class="line" @click="itemClick(item)">鎵ц鏃堕棿锛歿{ item.startDate.slice(11, 16) }} 鑷� {{ item.endDate.slice(11, 16) }}</view>
<view class="line">
<view @click="itemClick(item)">瀹屾垚鎯呭喌锛歿{item.finishNum || 0}}/{{item.patrolNum}}</view>
- <view v-if="param.queryStatus == '0,1'" class="btn" @click="openSc(item)">
+ <view v-if="param.queryStatus == '0,1' && item.flag && (item.status == 0 || item.status == 1 || item.status == 2)" class="btn" @click="openSc(item)">
<image src="@/static/side/ic_saoma@2x.png" class="saoma" mode=""></image>
<view>鎵爜宸℃</view>
</view>
</view>
</view>
</view>
+ <view v-if="list.length == 0" class="empty_wrap">
+ <image src="@/static/empty.png" mode=""></image>
+ <view class="">鏆傛棤鏁版嵁</view>
+ </view>
</view>
</scroll-view>
<!-- -->
-
+ <!-- -->
+ <view class="reader-box" @click="stopScan" v-if="isScaning">
+ <view class="reader" id="reader"></view>
+ </view>
</view>
</template>
@@ -87,15 +94,16 @@
},
html5Qrcode: null,
isScaning: false,
- activeItem: {}
+ // activeItem: {}
};
},
- onLoad() {
+ onShow() {
+ this.page = 1
+ this.list = []
this.getList()
},
methods: {
openSc(item) {
- this.activeItem = item
this.isScaning = true;
Html5Qrcode.getCameras().then((devices) => {
if (devices && devices.length) {
@@ -109,13 +117,19 @@
},
(decodeText, decodeResult) => {
if (decodeText) { //杩欓噷decodeText灏辨槸閫氳繃鎵弿浜岀淮鐮佸緱鍒扮殑鍐呭
+ const index = decodeText.indexOf('ywid')
+ let pointCode = decodeText.slice(index + 5)
this.stopScan(); //鍏抽棴鎵爜鍔熻兘
getPointRecordByCode({
taskId: item.id,
- pointCode: decodeText
+ pointCode
}).then(ress=> {
if(ress.data){
-
+ uni.navigateTo({
+ url: '/pages/polling/point?id=' + ress.data.id
+ })
+ }else{
+ this.showToast('鏈尮閰嶅埌宸℃鐐�,璇烽噸鏂版壂鎻�')
}
})
}
@@ -178,7 +192,11 @@
page,
capacity: 10
}).then(res => {
- this.list = [...this.list, ...res.data.records]
+ this.list = [...this.list, ...res.data.records]
+ this.list.forEach(item => {
+ let time = new Date(item.startDate).getTime()
+ item.flag = new Date().getTime() > time
+ })
this.total = res.data.total
})
}
@@ -266,10 +284,11 @@
}
.scroll_Y {
- height: calc(100vh - 230rpx);
+ height: calc(100vh - 130rpx);
}
- .list {
+ .list {
+
.item {
display: flex;
// height: 290rpx;
@@ -349,4 +368,23 @@
}
}
}
+
+ .reader-box {
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background-color: rgba(0, 0, 0, 0.5);
+ }
+
+ .reader {
+ width: 100%;
+ // width: 540rpx;
+ // height: 540rpx;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.3