|
@@ -14,38 +14,124 @@
|
|
|
<view class="yanzheng">
|
|
|
<view class="top">
|
|
|
<view class="tex">真实姓名</view>
|
|
|
- <input class="inp" type="text" placeholder="请输入真实姓名" v-model="text" required />
|
|
|
+ <input class="inp" type="text" placeholder="请输入真实姓名" v-model="name" required />
|
|
|
</view>
|
|
|
<view class="top">
|
|
|
- <view class="tex">真实姓名</view>
|
|
|
- <input class="inp" type="text" placeholder="请输入真实姓名" v-model="text" required />
|
|
|
+ <view class="tex">身份证号</view>
|
|
|
+ <input class="inp" type="text" placeholder="请输入身份证号" v-model="num" required />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="sc">
|
|
|
<view class="poto">上传人脸正面照片</view>
|
|
|
- <image class="pto" src="../../users/static/pto.png" mode="scaleToFill"></image>
|
|
|
+ <image class="pto" @click="uploadpic" :src="image||`../../users/static/pto.png`" mode="widthFix"></image>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="btn">
|
|
|
- <button class="bt">立即认证</button>
|
|
|
+ <button class="bt" :class="{loding:uploding}" @click="uploding?'':setCheck()">立即认证</button>
|
|
|
</view>
|
|
|
+ <canvas canvas-id="canvas" v-if="canvasStatus"
|
|
|
+ :style="{width: canvasWidth + 'px', height: canvasHeight + 'px',position: 'absolute',left:'-100000px',top:'-100000px'}"></canvas>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-
|
|
|
+ import {
|
|
|
+ setCheck,
|
|
|
+ getCheckMy
|
|
|
+ } from "@/api/newapi";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- text: ''
|
|
|
+ name: '',
|
|
|
+ num: '',
|
|
|
+ image: '',
|
|
|
+ canvasWidth: "",
|
|
|
+ canvasHeight: "",
|
|
|
+ canvasStatus: false,
|
|
|
+ uploding:false,//是否不允许提交
|
|
|
};
|
|
|
},
|
|
|
- onLoad() {},
|
|
|
+ onLoad() {
|
|
|
+ getCheckMy().then(
|
|
|
+ (res) => {
|
|
|
+ console.log(res)
|
|
|
+ if(res.data){
|
|
|
+ if(res.data.info){
|
|
|
+ if(res.data.info.status==0){
|
|
|
+ this.uploding = true;
|
|
|
+
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '正在审核中',
|
|
|
+ showCancel: false,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if(res.data.info.status==1){
|
|
|
+ this.uploding = true;
|
|
|
+ this.name = res.data.info.real_name;
|
|
|
+ this.num = res.data.info.id_card;
|
|
|
+ this.image = res.data.info.image;
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '审核已通过',
|
|
|
+ showCancel: false,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if(res.data.info.status==-1){
|
|
|
+ this.uploding = true;
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '审核未通过,原因:'+res.data.info.fail_msg,
|
|
|
+ showCancel: false,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
onShow() {
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ setCheck() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '提交中。。。',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+
|
|
|
+ setCheck({
|
|
|
+ real_name: this.name,
|
|
|
+ id_card: this.num,
|
|
|
+ image: this.image
|
|
|
+ }).then((res) => {
|
|
|
+ uni.showToast({
|
|
|
+ title:res.msg,
|
|
|
+ duration:2000
|
|
|
+ })
|
|
|
+ }).catch((err) => {
|
|
|
+ uni.showToast({
|
|
|
+ title: err,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 上传文件
|
|
|
+ *
|
|
|
+ */
|
|
|
+ uploadpic: function() {
|
|
|
+ let that = this;
|
|
|
+ this.canvasStatus = true
|
|
|
+ that.$util.uploadImageChange('upload/image', function(res) {
|
|
|
+ that.image = res.data.url;
|
|
|
+ }, (res) => {
|
|
|
+ this.canvasStatus = false
|
|
|
+ }, (res) => {
|
|
|
+ this.canvasWidth = res.w
|
|
|
+ this.canvasHeight = res.h
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -129,20 +215,24 @@
|
|
|
margin: -100rpx auto 0;
|
|
|
position: relative;
|
|
|
z-index: 2;
|
|
|
+
|
|
|
.top {
|
|
|
display: flex;
|
|
|
justify-content: start;
|
|
|
padding-top: 40rpx;
|
|
|
+
|
|
|
.tex {
|
|
|
size: 50rpx;
|
|
|
padding-left: 25rpx;
|
|
|
padding-top: 5rpx;
|
|
|
}
|
|
|
+
|
|
|
.inp {
|
|
|
padding-left: 25rpx;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.sc {
|
|
|
width: 660rpx;
|
|
|
height: 400rpx;
|
|
@@ -151,20 +241,21 @@
|
|
|
margin-left: 45rpx;
|
|
|
box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
|
|
|
border-radius: 20rpx;
|
|
|
-
|
|
|
+
|
|
|
.poto {
|
|
|
padding-top: 30rpx;
|
|
|
margin-left: 25rpx;
|
|
|
size: 50rpx;
|
|
|
}
|
|
|
+
|
|
|
.pto {
|
|
|
width: 312rpx;
|
|
|
- height: 202rpx;
|
|
|
+ min-height: 202rpx;
|
|
|
margin-left: 175rpx;
|
|
|
margin-top: 60rpx;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.bt {
|
|
|
width: 650rpx;
|
|
|
background: linear-gradient(90deg, #ff8f3b, #ff3107);
|
|
@@ -174,6 +265,8 @@
|
|
|
color: #fff;
|
|
|
height: 80rpx !important;
|
|
|
line-height: 80rpx !important;
|
|
|
+ &.loding{
|
|
|
+ background: #e3e3e3;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
</style>
|