fix idback image bg,fix detail getPageData

master
张 元山 1 week ago
parent bb214ae951
commit 99da79e1cf

@ -1,11 +1,11 @@
<script setup> <script setup>
import { showImagePreview } from 'vant'; import { showImagePreview } from 'vant';
import { ref, computed, watch } from "vue"; import { ref, computed, watch, onBeforeMount } from "vue";
import { useUserStore } from '@/stores/userStore.js' import { useUserStore } from '@/stores/userStore.js'
import { storeToRefs } from "pinia"; import { storeToRefs } from "pinia";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { showToast } from "vant"; import { showToast } from "vant";
import { check_code, save_register_info, send_code, upload_img } from "@/apis/index.js"; import { check_code, save_register_info, send_code, upload_img, check_by_phone } from "@/apis/index.js";
import { areaList } from "@vant/area-data"; import { areaList } from "@vant/area-data";
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
@ -16,6 +16,9 @@ const btnStatus = ref(0)
const isCountingDown = ref(false); const isCountingDown = ref(false);
const countdownInterval = ref(null); const countdownInterval = ref(null);
const code = ref('') const code = ref('')
onBeforeMount(() => {
getPageData()
})
watch(() => code.value, (newVal) => { watch(() => code.value, (newVal) => {
if (newVal.length > 6) { if (newVal.length > 6) {
code.value = newVal.slice(0, 6) code.value = newVal.slice(0, 6)
@ -41,10 +44,20 @@ const saveInfo = async () => {
btnStatus.value = 0 btnStatus.value = 0
if (submitReturnData.value.phoneNum !== temSubmitReturnData.value.phoneNum) { if (submitReturnData.value.phoneNum !== temSubmitReturnData.value.phoneNum) {
router.replace('/title-forward/logon') router.replace('/title-forward/logon')
} else {
getPageData()
} }
temSubmitReturnData.value = submitReturnData.value temSubmitReturnData.value = submitReturnData.value
} }
} }
const getPageData = async () => {
const res = await check_by_phone({
phoneNum: submitReturnData.value.phoneNum
})
if (res.status === 0) {
submitReturnData.value = res.data.data
}
}
const rightClick = async () => { const rightClick = async () => {
if (!/^1[3-9]\d{9}$/.test(submitReturnData.value.phoneNum)) { if (!/^1[3-9]\d{9}$/.test(submitReturnData.value.phoneNum)) {
showToast({ showToast({
@ -66,9 +79,7 @@ const rightClick = async () => {
} }
const res = await check_code(data) const res = await check_code(data)
if (res.status === 0) { if (res.status === 0) {
saveInfo() saveInfo()
} }
} }
const leftClick = () => { const leftClick = () => {

@ -2,6 +2,7 @@
import { scan_id_card, upload_img } from "@/apis/index.js"; import { scan_id_card, upload_img } from "@/apis/index.js";
import { useUserStore } from '@/stores/userStore.js' import { useUserStore } from '@/stores/userStore.js'
import defaultImage1 from '@/assets/images/zu1172@2x.png'; import defaultImage1 from '@/assets/images/zu1172@2x.png';
import defaultImage2 from '@/assets/images/zu1169@2x.png';
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
import { storeToRefs } from "pinia"; import { storeToRefs } from "pinia";
import { ref } from "vue"; import { ref } from "vue";
@ -62,9 +63,11 @@ const cardFace = async (img, num) => {
<div class="wrap1"> <div class="wrap1">
<div class="wrap1_1"> <div class="wrap1_1">
<div class="wrap1_1_1"> <div class="wrap1_1_1">
<img :src="iDCardImage.front || defaultImage1" alt=""> <img :src="iDCardImage.front || defaultImage1"
alt="">
</div> </div>
<div class="wrap1_1_2" v-if="iDCardImage.front"></div> <div class="wrap1_1_2"
v-if="iDCardImage.front">更换</div>
</div> </div>
<div class="wrap1_2">上传身份证人像面</div> <div class="wrap1_2">上传身份证人像面</div>
</div> </div>
@ -75,15 +78,18 @@ const cardFace = async (img, num) => {
<div class="wrap1"> <div class="wrap1">
<div class="wrap1_1"> <div class="wrap1_1">
<div class="wrap1_1_1"> <div class="wrap1_1_1">
<img :src="iDCardImage.back || defaultImage1" alt=""> <img :src="iDCardImage.back || defaultImage2"
alt="">
</div> </div>
<div class="wrap1_1_2" v-if="iDCardImage.back"></div> <div class="wrap1_1_2"
v-if="iDCardImage.back">更换</div>
</div> </div>
<div class="wrap1_2">上传身份证国徽面</div> <div class="wrap1_2">上传身份证国徽面</div>
</div> </div>
</van-uploader> </van-uploader>
</div> </div>
<div class="content4" v-if="iDCardImage.front&&iDCardImage.back"> <div class="content4"
v-if="iDCardImage.front&&iDCardImage.back">
<div class="wrap1"> <div class="wrap1">
<div class="wrap1_1"> <div class="wrap1_1">
<div class="wrap1_1_1">姓名</div> <div class="wrap1_1_1">姓名</div>
@ -111,8 +117,8 @@ const cardFace = async (img, num) => {
</div> </div>
</div> </div>
<div class="content5">*自动识别内容请仔细核对</div> <div class="content5">*自动识别内容请仔细核对</div>
<div class="content6" v-if="iDCardImage.front&&iDCardImage.back&&compareDate(idCardInfo.expirationDate)">{{compareDate(idCardInfo.expirationDate)}}</div> <div class="content6"
v-if="iDCardImage.front&&iDCardImage.back&&compareDate(idCardInfo.expirationDate)">{{compareDate(idCardInfo.expirationDate)}}</div>
</div> </div>
</template> </template>
@ -122,7 +128,7 @@ const cardFace = async (img, num) => {
margin-top: 5px; margin-top: 5px;
width: 100%; width: 100%;
height: 46px; height: 46px;
background-color: #E74747; background-color: #e74747;
color: #fff; color: #fff;
font-size: 12px; font-size: 12px;
display: flex; display: flex;
@ -134,7 +140,7 @@ const cardFace = async (img, num) => {
.content5 { .content5 {
text-align: right; text-align: right;
font-size: 10px; font-size: 10px;
color: #FFFFFF; color: #ffffff;
margin-top: 8px; margin-top: 8px;
} }
@ -155,24 +161,23 @@ const cardFace = async (img, num) => {
.wrap1_1 { .wrap1_1 {
padding-top: 14px; padding-top: 14px;
padding-bottom: 14px; padding-bottom: 14px;
border-bottom: #BBC5E0 solid 1px; border-bottom: #bbc5e0 solid 1px;
display: flex; display: flex;
.wrap1_1_2 { .wrap1_1_2 {
padding-left: 10px; padding-left: 10px;
color: #24437E; color: #24437e;
font-size: 12px; font-size: 12px;
} }
.wrap1_1_1 { .wrap1_1_1 {
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
align-items: center; align-items: center;
border-right: #BBC5E0 solid 1px; border-right: #bbc5e0 solid 1px;
width: 92px; width: 92px;
font-size: 12px; font-size: 12px;
color: #000; color: #000;
padding-left: 10px; padding-left: 10px;
} }
} }
} }
@ -191,7 +196,7 @@ const cardFace = async (img, num) => {
.wrap1_2 { .wrap1_2 {
margin-top: 3px; margin-top: 3px;
color: #2159C4; color: #2159c4;
font-size: 12px; font-size: 12px;
} }
@ -206,7 +211,7 @@ const cardFace = async (img, num) => {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
color: white; color: white;
background-color: #2159C4; background-color: #2159c4;
width: 48px; width: 48px;
height: 32px; height: 32px;
border-radius: 20px; border-radius: 20px;
@ -221,7 +226,6 @@ const cardFace = async (img, num) => {
height: 170px; height: 170px;
} }
} }
} }
} }
} }
@ -241,7 +245,7 @@ const cardFace = async (img, num) => {
.wrap1_2 { .wrap1_2 {
margin-top: 3px; margin-top: 3px;
color: #2159C4; color: #2159c4;
font-size: 12px; font-size: 12px;
} }
@ -256,7 +260,7 @@ const cardFace = async (img, num) => {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
color: white; color: white;
background-color: #2159C4; background-color: #2159c4;
width: 48px; width: 48px;
height: 32px; height: 32px;
border-radius: 20px; border-radius: 20px;
@ -271,7 +275,6 @@ const cardFace = async (img, num) => {
height: 170px; height: 170px;
} }
} }
} }
} }
} }

Loading…
Cancel
Save