Browse Source

实名认证

master
luyisha 3 years ago
parent
commit
fc9a390880
  1. 12
      pages/auth/index.vue
  2. 122
      pages/auth/primary.vue
  3. 2
      pages/auth/senior.vue

12
pages/auth/index.vue

@ -2,21 +2,25 @@
<view class="layout-page" :style="themeStyle"> <view class="layout-page" :style="themeStyle">
<v-header :title="$t('auth.a0')" :leftClick="leftClick"></v-header> <v-header :title="$t('auth.a0')" :leftClick="leftClick"></v-header>
<view class="rounded-md overflow-hidden m-lg box-shadow"> <view class="rounded-md overflow-hidden m-lg box-shadow">
<v-link :to="detail.primary_status==0?'/pages/auth/primary':''" class="d-flex align-center p-md border-b link-active "> <v-link :to="detail.primary_status==0 && detail.status!==1?'/pages/auth/primary':''" class="d-flex align-center p-md border-b link-active ">
<view class="flex-fill color-dark fn-lg"> <view class="flex-fill color-dark fn-lg">
{{$t('auth.a1')}} {{$t('auth.a1')}}
</view> </view>
<view class="status" v-if="detail.primary_status==0"> <view class="status" v-if="detail.primary_status==0 && detail.status!==1">
<van-icon class="fn-middle" name="info-o" /> <van-icon class="fn-middle" name="info-o" />
{{$t('auth.a2')}} {{$t('auth.a2')}}
</view> </view>
<view class="status" v-else-if="detail.status==1">
<van-icon class="fn-middle" name="info-o" />
{{$t('auth.a5')}}
</view>
<view class="status color-yellow-a" v-else> <view class="status color-yellow-a" v-else>
<van-icon class="fn-middle" name="passed" /> <van-icon class="fn-middle" name="passed" />
{{$t('auth.a3')}} {{$t('auth.a3')}}
</view> </view>
<van-icon class="m-l-xs" name="arrow" /> <van-icon class="m-l-xs" name="arrow" />
</v-link> </v-link>
<v-link tag="view" :to="detail.status!=2&&detail.status!=1?'/pages/auth/senior':''" class="d-flex align-center p-md border-b link-active"> <v-link v-if="0" tag="view" :to="detail.status!=2&&detail.status!=1?'/pages/auth/senior':''" class="d-flex align-center p-md border-b link-active">
<view class="flex-fill color-dark fn-lg "> <view class="flex-fill color-dark fn-lg ">
{{$t('auth.a4')}} {{$t('auth.a4')}}
</view> </view>
@ -39,7 +43,7 @@
<van-icon class="m-l-xs" name="arrow" /> <van-icon class="m-l-xs" name="arrow" />
</v-link> </v-link>
</view> </view>
<view v-if="detail.status==3" class="m-l-lg color-sell"><van-icon class="m-l-xs" name="info-o" />{{detail.remark}}</view> <view v-if="detail.status==3 && 0" class="m-l-lg color-sell"><van-icon class="m-l-xs" name="info-o" />{{detail.remark}}</view>
</view> </view>
</template> </template>
<script> <script>

122
pages/auth/primary.vue

@ -2,7 +2,7 @@
<v-page style="height:auto!important;min-height: 100%!important;"> <v-page style="height:auto!important;min-height: 100%!important;">
<v-header :title="$t('auth.a1')"></v-header> <v-header :title="$t('auth.a1')"></v-header>
<main class=" m-lg bg-panel-3 rounded-md p-x-md box-shadow"> <main class=" m-lg bg-panel-3 rounded-md p-x-md box-shadow">
<view class="form-item border-b p-md m-b-md"> <view class="form-item border-b p-md m-b-md" v-if="1==='国籍'">
<view class="label m-b-xs">{{$t('auth.a7')}}</view> <view class="label m-b-xs">{{$t('auth.a7')}}</view>
<view class="input color-light" > <view class="input color-light" >
<v-picker :value="form.country_id" @change="selectCountry" :list="countryList" range-value="id" range-label="name"> <v-picker :value="form.country_id" @change="selectCountry" :list="countryList" range-value="id" range-label="name">
@ -20,43 +20,73 @@
<v-input v-model="form.realname" :placeholder="$t('auth.b0')"></v-input> <v-input v-model="form.realname" :placeholder="$t('auth.b0')"></v-input>
</view> </view>
</view> </view>
<view class="form-item border-b p-md m-b-md"> <view class="form-item border-b p-md m-b-md" v-if="1==='出生日期'">
<view class="label m-b-xs">{{$t('auth.c5')}}</view> <view class="label m-b-xs">{{$t('auth.c5')}}</view>
<view class="input color-light"> <view class="input color-light">
<uni-datetime-picker type="date" :placeholder="$t('auth.d4')" :clear-icon="false" v-model="form.birthday" @maskClick="maskClick" /> <uni-datetime-picker type="date" :placeholder="$t('auth.d4')" :clear-icon="false" v-model="form.birthday" @maskClick="maskClick" />
</view> </view>
</view> </view>
<view class="form-item border-b p-md m-b-md"> <view class="form-item border-b p-md m-b-md">
<view class="label m-b-xs">{{$t('auth.c6')}}</view> <view class="label m-b-xs">{{$t('auth.c6')}}</view>
<view class="input color-light"> <view class="input color-light">
<uni-data-select <uni-data-select
:placeholder="$t('auth.d5')" :placeholder="$t('auth.d5')"
v-model="form.identification_type" v-model="form.identification_type"
:localdata="id_range" :localdata="id_range"
@change="changeID" @change="changeID"
></uni-data-select> ></uni-data-select>
</view> </view>
</view> </view>
<view class="form-item border-b p-md m-b-md"> <view class="form-item border-b p-md m-b-md">
<view class="label m-b-xs">{{$t('auth.b1')}}</view> <view class="label m-b-xs">{{$t('auth.b1')}}</view>
<view class="input color-light"> <view class="input color-light">
<v-input v-model="form.id_card" :placeholder="$t('auth.b2')"></v-input> <v-input v-model="form.id_card" :placeholder="$t('auth.b2')"></v-input>
</view> </view>
</view> </view>
<view class="form-item border-b p-md m-b-md"> <view class="form-item border-b p-md m-b-md" v-if="1==='地址'">
<view class="label m-b-xs">{{$t('auth.c7')}}</view> <view class="label m-b-xs">{{$t('auth.c7')}}</view>
<view class="input color-light"> <view class="input color-light">
<v-input v-model="form.address" :placeholder="$t('auth.c8')"></v-input> <v-input v-model="form.address" :placeholder="$t('auth.c8')"></v-input>
</view> </view>
</view> </view>
<view class="form-item border-b p-md m-b-md"> <view class="form-item border-b p-md m-b-md" v-if="1==='电话'">
<view class="label m-b-xs">{{$t('auth.c9')}}</view> <view class="label m-b-xs">{{$t('auth.c9')}}</view>
<view class="input color-light"> <view class="input color-light">
<v-input v-model="form.phone" :placeholder="$t('auth.d0')"></v-input> <v-input v-model="form.phone" :placeholder="$t('auth.d0')"></v-input>
</view> </view>
</view> </view>
<view class="p-md "> <div class="form-item border-b p-md m-b-md">
<v-button block type="blue" class="w-max rounded-md" ref="btn" @click="primaryAuth">{{$t('auth.b3')}}</v-button> <div class="color-light p-b-xs">{{$t('auth.b5')}}</div>
<div class="d-flex justify-between m-t-md ">
<div class="examples m-r-xs bg-panel-3 p-md rounded-sm box-shadow">
<img src="static/img/fill6.png" />
</div>
<div
@click="getFile('front_img')"
class="upload-box d-flex justify-center align-center rounded-sm bg-panel-3 box-shadow"
>
<van-icon v-if="!form.front_img" class="color-light fn-30" name="photograph" />
<img v-else :src="form.front_img" alt />
</div>
</div>
</div>
<div class="form-item p-md m-b-md">
<div class="color-light p-b-xs">{{$t('auth.b6')}}</div>
<div class="d-flex justify-between m-t-md">
<div class="examples m-r-xs bg-panel-3 p-md rounded-sm box-shadow">
<img src="static/img/fill7.png" />
</div>
<div
@click="getFile('back_img')"
class="upload-box d-flex justify-center align-center rounded-sm bg-panel-3 box-shadow"
>
<van-icon v-if="!form.back_img" class="color-light fn-30" name="photograph" />
<img v-else :src="form.back_img" alt />
</div>
</div>
</div>
<view class="p-md ">
<v-button block type="yellow2" class="w-max rounded-md" ref="btn" @click="primaryAuth">{{$t('auth.b3')}}</v-button>
</view> </view>
</main> </main>
@ -76,16 +106,18 @@ export default {
form: { form: {
id_card: "", id_card: "",
realname: "", realname: "",
birthday: "", birthday: "",
identification_type: "", identification_type: "",
country_id: "", country_id: "",
country_code: "", country_code: "",
area_code: "", area_code: "",
address: "", address: "",
phone: "" phone: "",
front_img: "",
back_img: ""
}, },
id_range: [{ value: 0, text: this.$t('auth.d1') },{ value: 1, text: this.$t('auth.d2') },{ value: 2, text: this.$t('auth.d3') }], id_range: [{ value: 0, text: this.$t('auth.d1') },{ value: 1, text: this.$t('auth.d2') },{ value: 2, text: this.$t('auth.d3') }],
}; };
}, },
computed: { computed: {
activeCountry() { activeCountry() {
@ -116,6 +148,19 @@ export default {
selectCountry(value) { selectCountry(value) {
this.form.country_id = value this.form.country_id = value
}, },
getFile(name) {
console.log(name)
this.$getFile({count:9}).then((res) => {
this.upLoadImg(res, name);
})
},
//
upLoadImg(chooseImageRes, name) {
Member.uploadImage(chooseImageRes).then((res) => {
this.form[name] = res.data.url;
this.$toast.success(this.$t('auth.c1'));
});
},
// //
primaryAuth() { primaryAuth() {
let data = this.form; let data = this.form;
@ -123,8 +168,8 @@ export default {
Profile.primaryAuth(data,{btn:this.$refs.btn}).then(() => { Profile.primaryAuth(data,{btn:this.$refs.btn}).then(() => {
this.$toast.success(this.$t('auth.b4')); this.$toast.success(this.$t('auth.b4'));
setTimeout(()=>{ setTimeout(()=>{
this.$back(); this.$back();
}, 1500) }, 1500)
}).catch(()=>{}); }).catch(()=>{});
}, },
changeID(e){ changeID(e){
@ -153,7 +198,8 @@ export default {
// color: grey; // color: grey;
} }
/deep/.uni-select__selector{ /deep/.uni-select__selector{
background-color: $panel-3; // background-color: $panel-3;
background-color: #fff;
} }
/deep/.uni-select__input-text{ /deep/.uni-select__input-text{
color: $plain; color: $plain;
@ -195,4 +241,26 @@ export default {
border-top: 1px solid #c9c9c9; border-top: 1px solid #c9c9c9;
border-bottom: 1px solid #c9c9c9; border-bottom: 1px solid #c9c9c9;
} }
.examples {
width: 130px;
height: 80px;
display: flex;
align-items: center;
box-sizing: border-box;
border: 1px solid #cbcbcb;
img {
width: 100%;
}
}
.upload-box {
width: 130px;
height: 80px;
border: 1px solid #cbcbcb;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
</style> </style>

2
pages/auth/senior.vue

@ -26,7 +26,7 @@
<div <div
@click="getFile('back_img')" @click="getFile('back_img')"
class="upload-box d-flex justify-center align-center rounded-sm bg-panel-3 box-shadow" class="upload-box d-flex justify-center align-center rounded-sm bg-panel-3 box-shadow"
> >
<van-icon v-if="!form.back_img" class="color-light fn-30" name="photograph" /> <van-icon v-if="!form.back_img" class="color-light fn-30" name="photograph" />
<img v-else :src="form.back_img" alt /> <img v-else :src="form.back_img" alt />
</div> </div>

Loading…
Cancel
Save