Commit 66b7ffab by zeyang

1.增加会员查询

2.修复预览图片BUG
parent 9e7a20a0
......@@ -378,6 +378,10 @@ export default {
//微信认证登录
wxLogin(params){
return request(`${cffpURL}/user/wxLogin`, "POST", params)
},
//查询证书
officialWebsiteDetail(params){
return request(`${cffpURL}/certificate/officialWebsiteDetail`, "POST", params)
}
}
<template>
<view class="ofwebContent">
<view class="ofwebTitle">
CFFP-AIOFP会员查询
</view>
<view class="ofwebWrapper">
<view class="queryBox">
<view class="queryItem">
<view>
<span></span>手机号:
</view>
<view>
<input v-model="queryObj.userTel" style="font-size: 28rpx;" type="number" maxlength="11" placeholder="请输入手机号" placeholder-style="font-size:26rpx">
</view>
</view>
<view class="queryItem">
<view>
<span></span>证书号:
</view>
<view>
<input v-model="queryObj.authenticationCode" style="font-size: 28rpx;" type="text" placeholder="请输入证书编号" placeholder-style="font-size:26rpx">
</view>
</view>
<view @click="c_query" v-if="machineType=='pc'" class="buttonBox">
查询
</view>
</view>
<view v-if="machineType!='pc'" @click="c_query" class="buttonBox">
查询
</view>
<view v-if="memberObj.length>0">
<view class="dataBox" v-for="item in memberObj" >
<view class="dataItem">
<span>姓名:</span>
<view>
{{item.userName}}
</view>
</view>
<view class="dataItem">
<span>证书号:</span>
<view>
{{item.authenticationCode}}
</view>
</view>
<view class="dataItem" v-if="item.cerUrl">
<span>荣誉证书:</span>
<view>
<image @click="previewImage(item)" style="margin-top: 30rpx;" :src="item.cerUrl" mode="widthFix"></image>
</view>
</view>
</view>
</view>
<view class="noData" v-else>
<image src="../static/images/noData.png" mode="widthFix"></image>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import api from "@/api/api";
import common from '../common/common';
import { onLoad } from "@dcloudio/uni-app";
let memberObj:any = ref([]);
let machineType = ref(null);
let queryObj = ref({userTel:null,authenticationCode:null})
const c_query = ()=>{
if(!queryObj.value.authenticationCode && !queryObj.value.userTel){
uni.showToast({
title:'手机号和证书号不能同时为空',
icon:'none',
duration:2000
})
return;
}else if(queryObj.value.userTel && !common.mobileNoValid(queryObj.value.userTel)){
uni.showToast({
title:'请填写正确的手机号',
icon:'none',
duration:2000
})
return;
}
uni.showLoading({
mask:true
})
api.officialWebsiteDetail(queryObj.value).then((res) => {
uni.hideLoading();
if (res['success']) {
memberObj.value=res['data']['list'] || [];
if(memberObj.value.length==0){
uni.showToast({
title:'抱歉,未查询到该会员,请确认手机号或证书号是否正确!',
icon:'none',
duration:2000
})
}
} else {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
}
const previewImage = (item)=>{
// 预览图片
uni.previewImage({
urls: [item.cerUrl],
});
}
onLoad(() => {
const userAgent = navigator.userAgent.toLowerCase();
if (/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(userAgent)) {
// 移动端
machineType.value='phone';
} else {
// pc端
machineType.value='pc';
}
})
</script>
<style lang="scss">
.ofwebContent{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.ofwebTitle{
color: rgba(0, 0, 0, 1);
font-weight: bold;
font-size:40rpx;
padding: 100rpx 0;
}
.ofwebWrapper{
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
.queryBox{
display: flex;
flex-direction: row;
color: rgba(48, 48, 48, 1);
align-items: center;
justify-content: center;
flex-wrap: wrap;
white-space: wrap;
width: 100%;
span{
color: red;
padding: 0 3rpx;
}
.queryItem{
display: flex;
align-items: center;
margin:15rpx 25rpx;
font-size: 34rpx;
view:last-child{
padding:9rpx 10rpx;
border-radius: 5px;
border: 0.5px solid rgba(153, 153, 153, 1);
}
}
}
.buttonBox{
background-color: rgba(92, 46, 222, 1);
color:white;
font-size: 28rpx;
padding: 10rpx 35rpx;
border-radius: 10rpx;
}
.noData{
width: 200px;
margin-top:160rpx;
}
.dataBox{
margin-top:80rpx;
width: 100%;
.dataItem{
margin-top: 20rpx;
display: flex;
justify-content: center;
width: 100%;
span{
display: inline-block;
margin-right: 10rpx;
flex: 0 0 200rpx;
text-align: right;
}
view{
flex: 0 0 350rpx;
}
}
}
}
}
</style>
\ No newline at end of file
......@@ -493,6 +493,15 @@
"navigationBarTitleText": "微信登录"
}
}]
},{
"root": "officialWebsite",
"pages": [{
"path": "memberQuery",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}]
}],
"tabBar": {
"color": "#7A7E83", // tab 上的文字默认颜色
......
......@@ -93,13 +93,13 @@
}
},
onLoad(option) {
console.log(option, 124)
this.status = option.status
this.openForm.signupId = option.userSignupId
this.getquerySignUpInfo()
this.geterpInitialize();
},
onShow() {
this.geterpInitialize()
},
onBackPress() {
uni.hideLoading();
......@@ -120,12 +120,15 @@
let UserSignUpInfoQueryRequestVO = {
userSignUpId:this.openForm.signupId
}
let res = await api.querySignUpInfo(UserSignUpInfoQueryRequestVO)
console.log(res, 74274)
this.openForm = res.data
this.openForm.userTel = res.data.userTel? res.data.userTel:uni.getStorageSync('user_mobile')
console.log(this.openForm.userTel)
this.openForm.signupId = res.data.id
let res = await api.querySignUpInfo(UserSignUpInfoQueryRequestVO);
this.openForm = res.data;
this.openForm.userTel = res.data.userTel? res.data.userTel:uni.getStorageSync('user_mobile');
this.openForm.signupId = res.data.id;
for(let i =0;i<this.erplizeList.length;i++){
if(this.erplizeList[i].id==this.openForm.userIdType){
this.index=i;
}
}
},
getBack(){
uni.navigateBack(1)
......@@ -137,9 +140,9 @@
},
// 获取证件类型
async geterpInitialize() {
let res = await api.erpInitialize()
this.erplizeList = res.data.idTypes
console.log(this.erplizeList, 444)
let res = await api.erpInitialize();
this.erplizeList = res.data.idTypes;
this.getquerySignUpInfo();
},
bindPickerChange(e, storage) {
this.openForm.userIdType = storage[e.detail.value].id
......
......@@ -125,6 +125,9 @@
},
// 预览图片
previewImg(e){
if(!e.cerUrl){
return;
}
// 预览图片
uni.previewImage({
urls:[e.cerUrl],
......
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