Commit 120832d3 by 李嘉林

接口对接

parent 3b758ca6
......@@ -52,6 +52,22 @@ console.log(process.env,'-----------------config------')
`${process.env.OLSHOP_URL}/user/cancelNewCustomerGiftDialog/` + params
);
},
// 生成唯一码动态码
generatorUniqueCodeByDynamic() {
return requestPOST(`${process.env.OLSHOP_URL}/user/generatorUniqueCodeByDynamic`);
},
// 查询是否有需要挂失的卡
getStaticCode() {
return requestPOST(`${process.env.OLSHOP_URL}/user/getStaticCode`);
},
// 挂失卡
reportTheLoss() {
return requestPOST(`${process.env.OLSHOP_URL}/user/reportTheLoss`);
},
// 扫码核验历史记录
getHistoryByVerifier(data) {
return requestPOST(`${process.env.OLSHOP_URL}/user/getHistoryByVerifier`, data);
},
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/2102bb76-b84b-4165-926e-2f53ff4995fd.png"
></image>
</div>
<div class="info">
<div class="info" v-if="loaded">
<div class="title">用户须知</div>
<div class="text" v-if="!reported">
<p>1.如果您的通行证实体卡遗失了,请尽快提交挂失;</p>
......@@ -30,12 +30,14 @@
</template>
<script type="text/ecmascript-6">
import index from "@/api/index";
export default {
name: "reportTheLoss",
data() {
return {
reported: false, // 已经挂失
confirmLoading: false,
loaded: false,
};
},
components: {},
......@@ -49,23 +51,54 @@ export default {
},
onShow() {
console.log("---onShow");
this.init();
},
methods: {
init() {
index.getStaticCode().then((res) => {
this.loaded = true;
if (res.data.ok == "true" && res.data.data == "true") {
this.reported = false;
} else {
this.reported = true;
}
});
},
confirm() {
this.confirmLoading = true;
wx.showLoading({
title: "挂失中...",
let _this = this;
wx.showModal({
title: "提示",
content: "是否挂失",
confirmColor: "#229df1",
success(res) {
if (res.confirm) {
_this.confirmLoading = true;
wx.showLoading({
title: "挂失中...",
});
index.reportTheLoss().then((res) => {
if (res.data.ok == "true" && res.data.data == "true") {
wx.hideLoading();
wx.showToast({
title: "已挂失",
icon: "success",
duration: 1000,
});
_this.reported = true;
_this.confirmLoading = false;
} else {
wx.showToast({
title: "挂失失败",
icon: "error",
duration: 1000,
});
}
});
} else if (res.cancel) {
console.log("用户点击取消");
}
},
});
setTimeout(() => {
wx.hideLoading();
wx.showToast({
title: "已挂失",
icon: "success",
duration: 1000,
});
this.reported = true;
this.confirmLoading = false;
}, 1000);
},
},
};
......
......@@ -22,20 +22,20 @@
<div class="userImg">
<image
mode="aspectFill"
src="https://img1.baidu.com/it/u=3755297117,609162545&fm=26&fmt=auto"
:src="userInfo.headPortraitUrl"
alt=""
></image>
</div>
<div class="userName">张三</div>
<div class="userWork">党委委员、驻局纪检组书记</div>
<div class="userName">{{ userInfo.realname }}</div>
<div class="userWork">{{ userInfo.identity }}</div>
<div class="qrCode">
<image
mode="aspectFill"
src="https://img1.baidu.com/it/u=3755297117,609162545&fm=26&fmt=auto"
:src="qrCode"
alt=""
></image>
</div>
<div class="time">{{updateTime}}</div>
<div class="time" v-if="updateTime">{{ updateTime }}</div>
</div>
<div class="explain">相约北京系列冬季体育赛事张家口赛区组委会</div>
</div>
......@@ -43,13 +43,17 @@
</template>
<script type="text/ecmascript-6">
import live from "@/api/live";
import index from "@/api/index";
export default {
name: "showPassCheck",
data() {
return {
// 十秒更新一次
updateTime: "",
TimeOut:'',
TimeOut: "",
qrCode: '',
userInfo: {},
};
},
components: {},
......@@ -62,32 +66,67 @@ export default {
console.log("---onLoad");
},
onShow() {
this.updateTime = this.getTime();
this.getQrCode();
this.TimeOut = null;
this.TimeOut = setInterval(() => {
this.updateTime = this.getTime();
}, 1000*10);
this.getQrCode();
}, 1000 * 10);
console.log("---onShow");
this.init();
},
onHide(){
onHide() {
clearInterval(this.TimeOut);
},
onUnload(){
onUnload() {
clearInterval(this.TimeOut);
},
mounted() {},
methods: {
getTime(){
init() {
// wx.showLoading({
// title: "加载中...",
// });
live.getUserInfo().then((res) => {
// wx.hideLoading();
if (res.data.ok == "true") {
this.userInfo = res.data.data;
}
});
},
getQrCode() {
index.generatorUniqueCodeByDynamic().then(res=>{
if(res.data.ok == 'true'){
this.qrCode = res.data.data.uniqueCodePhoto;
this.updateTime = res.data.data.createDatetime;
}
})
},
getTime() {
let year = new Date().getFullYear();
let month = (new Date().getMonth() + 1) < 10 ? '0'+(new Date().getMonth() + 1):(new Date().getMonth() + 1);
let day = new Date().getDate() < 10 ?'0'+new Date().getDate():new Date().getDate();
let hours = new Date().getHours() < 10 ?'0'+new Date().getHours():new Date().getHours();
let minutes = new Date().getMinutes() < 10 ?'0'+new Date().getMinutes():new Date().getMinutes();
let seconds = new Date().getSeconds() < 10 ?'0'+new Date().getSeconds():new Date().getSeconds();
let month =
new Date().getMonth() + 1 < 10
? "0" + (new Date().getMonth() + 1)
: new Date().getMonth() + 1;
let day =
new Date().getDate() < 10
? "0" + new Date().getDate()
: new Date().getDate();
let hours =
new Date().getHours() < 10
? "0" + new Date().getHours()
: new Date().getHours();
let minutes =
new Date().getMinutes() < 10
? "0" + new Date().getMinutes()
: new Date().getMinutes();
let seconds =
new Date().getSeconds() < 10
? "0" + new Date().getSeconds()
: new Date().getSeconds();
let today = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
console.log(today);
return today;
}
},
},
};
</script>
......@@ -99,7 +138,7 @@ export default {
top: 0;
left: 0;
width: 100vw;
img{
img {
width: 100%;
}
}
......
......@@ -12,7 +12,7 @@
name=""
value=""
v-model="checkText"
placeholder="输入人员核验码"
placeholder="输入核验码"
/>
</div>
<div class="checkBtn flex" @click="toCheck">核验</div>
......@@ -77,6 +77,9 @@ export default {
onShow() {
console.log("---onShow");
},
onUnload(){
this.showInfo = false;
},
methods: {
toCheck() {
wx.showLoading({
......
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