Commit a6b5f40c by 李嘉林

核验历史

parent 655478f4
...@@ -68,6 +68,10 @@ console.log(process.env,'-----------------config------') ...@@ -68,6 +68,10 @@ console.log(process.env,'-----------------config------')
getHistoryByVerifier(data) { getHistoryByVerifier(data) {
return requestPOST(`${process.env.OLSHOP_URL}/user/getHistoryByVerifier`, data); return requestPOST(`${process.env.OLSHOP_URL}/user/getHistoryByVerifier`, data);
}, },
// 扫码核验历史记录
getInfoByUniqueCode(code) {
return requestGET(`${process.env.OLSHOP_URL}/user/getInfoByUniqueCode?code=${code}`);
},
} }
\ No newline at end of file
<template> <template>
<!-- 核验历史 --> <!-- 核验历史 -->
<div class="checkHistory"> <div class="checkHistory">
<div class="list"> <div class="list" v-if="list.length>0">
<div class="item flex" v-for="(item, index) in list" :key="index"> <div class="item flex" v-for="(item, index) in list" :key="index">
<div class="left"> <div class="left">
<p> <p>
<span>核验地点:</span><span>{{ "云顶大酒店" }}</span> <span>核验地点:</span><span>{{ item.verificationPoint }}</span>
</p> </p>
<p class="time"> <p class="time">
<span>核验时间:</span><span>{{ "2021-11-04 09:43:32" }}</span> <span>核验时间:</span><span>{{ item.verificationDatetime }}</span>
</p> </p>
</div> </div>
<div class="checkIcon"> <div class="checkIcon">
<image <image
v-if="index < 6" v-if="item.verificationStatus == 0"
src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/8c56ad03-32c4-46a2-91d0-98272c5c4a8b.png" src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/8c56ad03-32c4-46a2-91d0-98272c5c4a8b.png"
></image> ></image>
<image <image
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
></image> ></image>
</div> </div>
</div> </div>
<div class="noCheck" v-if="loaded && list.length == 0">暂无核验</div>
</div> </div>
<div class="noCheck" v-else-if="loaded && list.length == 0">暂无核验</div>
</div> </div>
</template> </template>
...@@ -52,6 +52,7 @@ export default { ...@@ -52,6 +52,7 @@ export default {
}, },
methods: { methods: {
init() { init() {
this.loaded = false;
wx.showLoading({ wx.showLoading({
title: "加载中...", title: "加载中...",
}); });
...@@ -63,7 +64,7 @@ export default { ...@@ -63,7 +64,7 @@ export default {
index.getHistoryByVerifier(query).then((res) => { index.getHistoryByVerifier(query).then((res) => {
this.loaded = true; this.loaded = true;
wx.hideLoading(); wx.hideLoading();
if (res.data.ok == "ok") { if (res.data.ok == "true") {
this.list = res.data.data; this.list = res.data.data;
} }
}); });
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
alt="" alt=""
></image> ></image>
</div> </div>
<p>张家口市公安局冬奥办</p> <p>{{userInfo.company}}</p>
</div> </div>
<div class="userImg"> <div class="userImg">
<image <image
...@@ -84,11 +84,11 @@ export default { ...@@ -84,11 +84,11 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
init() { init() {
// wx.showLoading({ wx.showLoading({
// title: "加载中...", title: "加载中...",
// }); });
live.getUserInfo().then((res) => { live.getUserInfo().then((res) => {
// wx.hideLoading(); wx.hideLoading();
if (res.data.ok == "true") { if (res.data.ok == "true") {
this.userInfo = res.data.data; this.userInfo = res.data.data;
this.userInfo.headPortraitUrl = DFSImg(this.userInfo.headPortraitUrl); this.userInfo.headPortraitUrl = DFSImg(this.userInfo.headPortraitUrl);
......
...@@ -21,32 +21,33 @@ ...@@ -21,32 +21,33 @@
<div class="userInfo" v-if="showInfo"> <div class="userInfo" v-if="showInfo">
<div class="img"> <div class="img">
<image <image
mode="widthFix" mode="aspectFill"
src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/f96b596d-e1e4-43c1-b707-226ff7d107bd.png" :src="userInfo.handImage"
alt="" alt=""
></image> ></image>
</div> </div>
<div class="cell flex"> <div class="cell flex">
<div class="label">姓名</div> <div class="label">姓名</div>
<div class="val">张三</div> <div class="val">{{userInfo.customerName}}</div>
</div> </div>
<div class="cell flex"> <div class="cell flex">
<div class="label">单位</div> <div class="label">单位</div>
<div class="val">张家口市公安局</div> <div class="val">{{userInfo.company}}</div>
</div> </div>
<div class="cell flex"> <div class="cell flex">
<div class="label">身份</div> <div class="label">身份</div>
<div class="val">工作人员</div> <div class="val">{{userInfo.identity}}</div>
</div> </div>
<div class="cell flex"> <div class="cell flex">
<div class="label">工作地点</div> <div class="label">工作地点</div>
<div class="val">云顶</div> <div class="val">{{userInfo.workArea}}</div>
</div> </div>
<div class="cell flex"> <div class="cell flex">
<div class="label">就餐地点</div> <div class="label">就餐地点</div>
<div class="val">云顶大酒店1层</div> <div class="val">{{userInfo.diningPlace}}</div>
</div> </div>
</div> </div>
<div v-if="loaded && !showInfo" class="noInfo">暂无人员信息</div>
<template v-if="showInfo"> <template v-if="showInfo">
<div class="seat"></div> <div class="seat"></div>
<div class="btm flex"> <div class="btm flex">
...@@ -57,12 +58,16 @@ ...@@ -57,12 +58,16 @@
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import index from "@/api/index"
import { DFSImg } from '@/utils/common.js'
export default { export default {
name: "verification", name: "verification",
data() { data() {
return { return {
checkText: "", checkText: "",
showInfo: false, showInfo: false,
loaded: false,
userInfo: {},
}; };
}, },
components: {}, components: {},
...@@ -77,34 +82,23 @@ export default { ...@@ -77,34 +82,23 @@ export default {
onShow() { onShow() {
console.log("---onShow"); console.log("---onShow");
}, },
onUnload(){ onUnload() {
this.showInfo = false; this.showInfo = false;
}, },
methods: { methods: {
toCheck() { toCheck() {
wx.showLoading({ this.getInfoByUniqueCode();
title: "加载中...",
});
setTimeout(() => {
this.showInfo = true;
wx.hideLoading();
}, 500);
}, },
confirm() { confirm() {
this.scanCode(); this.scanCode();
}, },
scanCode() { scanCode() {
let _this = this; let _this = this;
// 允许从相机和相册扫码
wx.showLoading({
title: "加载中...",
});
wx.scanCode({ wx.scanCode({
success(res) { success(res) {
console.log(res, "---success"); console.log(res, "---success");
_this.checkText = res.result; _this.checkText = res.result;
// 调接口完成改true 暂时为测试 _this.getInfoByUniqueCode();
_this.showInfo = true;
}, },
fail(res) { fail(res) {
wx.showToast({ wx.showToast({
...@@ -112,14 +106,30 @@ export default { ...@@ -112,14 +106,30 @@ export default {
icon: "error", icon: "error",
duration: 1000, duration: 1000,
}); });
console.log(res,'----fail'); console.log(res, "----fail");
}, },
complete(res) { complete(res) {
console.log(res,'----res') console.log(res, "----res");
wx.hideLoading(); wx.hideLoading();
}, },
}); });
}, },
getInfoByUniqueCode() {
wx.showLoading({
title: "加载中...",
});
this.showInfo = false;
this.loaded = false;
index.getInfoByUniqueCode(this.checkText).then((res) => {
wx.hideLoading();
this.loaded = true;
if (res.data.ok == "true" && res.data.data) {
this.userInfo = res.data.data.uniqueScanUserInfoDTO;
this.userInfo.handImage = DFSImg(this.userInfo.handImage);
this.showInfo = true;
}
});
},
}, },
}; };
</script> </script>
...@@ -169,6 +179,7 @@ export default { ...@@ -169,6 +179,7 @@ export default {
width: 104px; width: 104px;
height: 128px; height: 128px;
margin: 10px auto; margin: 10px auto;
overflow: hidden;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -196,6 +207,13 @@ export default { ...@@ -196,6 +207,13 @@ export default {
} }
} }
} }
.noInfo{
text-align: center;
font-size: 14px;
color: #666;
text-align: center;
margin-top: 20px;
}
.seat { .seat {
width: 100%; width: 100%;
height: 60px; height: 60px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment