|
@@ -0,0 +1,141 @@
|
|
|
+<template>
|
|
|
+ <ion-page>
|
|
|
+ <ion-content>
|
|
|
+ <ion-content v-if="isShowForm">
|
|
|
+ <form autocomplete="off">
|
|
|
+ <div class="bw-vue-form">
|
|
|
+ <div class="form-title">重新绑定</div>
|
|
|
+ <div class="form-input">
|
|
|
+ <ion-label>姓名</ion-label>
|
|
|
+ <ion-input v-model="dataModel.name" placeholder="请输入姓名"></ion-input>
|
|
|
+ </div>
|
|
|
+ <div class="form-input">
|
|
|
+ <ion-label>身份证号</ion-label>
|
|
|
+ <ion-input v-model="dataModel.identityNumber" placeholder="请输入身份证号"></ion-input>
|
|
|
+ </div>
|
|
|
+ <div class="form-input">
|
|
|
+ <ion-label>OpenID</ion-label>
|
|
|
+ <ion-input readonly v-model="openId"></ion-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ <ion-button style="width: 100%;" @click="subClick">重新绑定</ion-button>
|
|
|
+ </ion-content>
|
|
|
+ <ion-content v-if="!isShowForm" class="qr_content">
|
|
|
+ <div class="user_qrcode"
|
|
|
+ style="height: 100vh;width: 100vw; display: flex; align-items: center; justify-content: center">
|
|
|
+ <div class="qr_item" style="display: flex; justify-content: center;flex-wrap: wrap">
|
|
|
+ <img src="@/assets/icon/wxQrcode.jpg" :style="imgStyle">
|
|
|
+ <br/>
|
|
|
+ <p style="width: 100%; text-align: center">关注公众号</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </ion-content>
|
|
|
+ </ion-content>
|
|
|
+ <ion-alert
|
|
|
+ :is-open="alertingInfo"
|
|
|
+ :header="infoAlterData.title"
|
|
|
+ :message="infoAlterData.message"
|
|
|
+ :buttons="infoAlertButtons"
|
|
|
+ @didDismiss="setInfoAlertOpen(false)"
|
|
|
+ ></ion-alert>
|
|
|
+ <ion-loading
|
|
|
+ :is-open="loadingFirm"
|
|
|
+ message="更新中..."
|
|
|
+ @didDismiss="setInfoLoadingOpen(false)">
|
|
|
+ </ion-loading>
|
|
|
+ </ion-page>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import {onMounted, reactive, ref} from "vue";
|
|
|
+import {getUrlParams} from "@/utils/urlUtils";
|
|
|
+import {onIonViewDidEnter} from "@ionic/vue";
|
|
|
+import {editOpenID} from "@/api/jobUserInfo";
|
|
|
+
|
|
|
+const openId = ref("");
|
|
|
+const urlParams = getUrlParams();
|
|
|
+
|
|
|
+// 信息弹窗内容
|
|
|
+const infoAlterData = reactive({
|
|
|
+ title: "",
|
|
|
+ message: ""
|
|
|
+});
|
|
|
+const alertingInfo = ref(false);
|
|
|
+const loadingFirm = ref(false);
|
|
|
+const infoAlertButtons = [
|
|
|
+ {
|
|
|
+ text: '确定',
|
|
|
+ role: 'confirm',
|
|
|
+ handler: () => {
|
|
|
+ setInfoAlertOpen(false);
|
|
|
+ },
|
|
|
+ },
|
|
|
+];
|
|
|
+const dataModel = reactive({
|
|
|
+ name: "",
|
|
|
+ identityNumber: "",
|
|
|
+ openID: ""
|
|
|
+})
|
|
|
+// 是否显示表单
|
|
|
+const isShowForm = ref(true);
|
|
|
+const imgStyle = ref({
|
|
|
+ width: '0px',
|
|
|
+ height: '0px',
|
|
|
+});
|
|
|
+
|
|
|
+// 按页面大小调整二维码图标大小
|
|
|
+const updateBrowserWidth = () => {
|
|
|
+ const browserWidth = window.innerWidth;
|
|
|
+ imgStyle.value.width = (browserWidth - 30) / 1.5 + 'px';
|
|
|
+ imgStyle.value.height = (browserWidth - 30) / 1.5 + 'px';
|
|
|
+}
|
|
|
+
|
|
|
+// 修改提交
|
|
|
+function subClick() {
|
|
|
+ if (!dataModel.name || !dataModel.identityNumber) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ setInfoLoadingOpen(true);
|
|
|
+ editOpenID({...dataModel, openId: openId.value}).then((result: any) => {
|
|
|
+ infoAlterData.title = '提示';
|
|
|
+ if (result > 0) {
|
|
|
+ infoAlterData.message = '更新成功!';
|
|
|
+ isShowForm.value = false;
|
|
|
+ setInfoAlertOpen(true);
|
|
|
+ } else {
|
|
|
+ infoAlterData.message = '更新失败,请检查姓名与身份证是否正确!';
|
|
|
+ setInfoAlertOpen(true);
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ setInfoLoadingOpen(false);
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 信息弹窗确定事件
|
|
|
+function setInfoAlertOpen(value: boolean) {
|
|
|
+ alertingInfo.value = value;
|
|
|
+}
|
|
|
+
|
|
|
+function setInfoLoadingOpen(value: boolean) {
|
|
|
+ loadingFirm.value = value;
|
|
|
+}
|
|
|
+
|
|
|
+// 设置初始浏览器宽度
|
|
|
+updateBrowserWidth();
|
|
|
+// 监听窗口大小变化
|
|
|
+window.addEventListener('resize', updateBrowserWidth);
|
|
|
+
|
|
|
+onIonViewDidEnter(() => {
|
|
|
+ openId.value = urlParams["openId"];
|
|
|
+});
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ const urlParams = getUrlParams();
|
|
|
+ openId.value = urlParams["openId"];
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|