Commit 120832d3 by 李嘉林

接口对接

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