Browse Source

认证合二为一 资产能进行跳转到个人中心 充币不需要认证 提币需要高级认证

master
liaoxinyu 1 year ago
parent
commit
01c1066066
  1. 6
      api/profile.js
  2. BIN
      assets/img/home/commone.png
  3. BIN
      assets/img/home/user.png
  4. 6
      i18n/lang/en.json
  5. 6
      i18n/lang/zh-TW.json
  6. 3
      pages.json
  7. 47
      pages/assets/draw.vue
  8. 382
      pages/auth/certification.vue
  9. 18
      pages/base/home.vue
  10. 8
      pages/base/index.vue
  11. 34
      pages/base/mine.vue

6
api/profile.js

@ -36,6 +36,12 @@ class Profile {
static topAuth(data) {
return Serve.post(`/user/topAuth`, data);
}
/**
* 初级和高级一起认证
**/
static newAuth(data) {
return Serve.post(`/user/newAuth`, data);
}
/**
* 登录记录

BIN
assets/img/home/commone.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

BIN
assets/img/home/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

6
i18n/lang/en.json

@ -109,7 +109,11 @@
"c5": "your transfer order has been submitted successfully,please wait patiently,and the transfer result will be notified by SMS or e-mail. Please check it carefully. If you have any questions,please contact the customer service in time.",
"c6": "Increase ratio",
"c7": "Current valuation",
"GraphicValidation": "Graphical verification"
"GraphicValidation": "Graphical verification",
"c8": "Withdrawals require real-name authentication",
"c9": "Not real-name authenticated",
"c10": "Passed real-name authentication",
"c11": "Real-name authentication failed"
},
"base": {
"a0": "Title",

6
i18n/lang/zh-TW.json

@ -109,7 +109,11 @@
"c5": "您的劃轉訂單已提交成功,請耐心等待,劃轉結果會以簡訊或郵件的管道通知。請注意查收,如有疑問請及時聯系客服",
"c6": "漲幅比例",
"c7": "當前估值",
"GraphicValidation": "圖形驗證"
"GraphicValidation": "圖形驗證",
"c8": "提幣需要通過實名認證",
"c9": "未實名認證",
"c10": "已通過實名認證",
"c11": "實名認證失敗"
},
"base": {
"a0": "標題",

3
pages.json

@ -176,6 +176,9 @@
{
"path" : "pages/oncs/onservice"
},
{
"path" : "pages/auth/certification"
},
{
"path": "pages/service/index",
"style": {

47
pages/assets/draw.vue

@ -230,6 +230,17 @@
<v-button type="yellow" block class="w-max rounded-md" @click="draw">{{ $t('common.confirm') }}</v-button>
</view>
</van-popup>
<van-popup :show="show" @close="show=false" closeable close-on-popstate>
<view style="padding: 30rpx 60rpx 0px 60rpx;width: 550rpx;">
<view style="text-align: center;color: #fff;margin: 30rpx 0px 50rpx;font-size: 40rpx;">{{$t('common.tips')}}</view>
<view style="text-align: center;color: #fff;margin: 30rpx 0px;">{{$t('common.c8')}}</view>
<view style="display: flex;justify-content: center;margin-bottom: 60rpx;text-align: center;">
<v-button block type="white" class="rounded-md" style="width: 300rpx;margin-top: 20rpx;" ref="btn" @click="toservice">{{$t('base.f2')}}</v-button>
</view>
</view>
</van-popup>
<van-toast id="van-toast"/>
</v-page>
</template>
@ -238,6 +249,7 @@ import coinList from "./coin-list";
import Wallet from "@/api/wallet";
import Member from "@/api/member";
import formData from "@/utils/class/date";
import Profile from "@/api/profile";
export default {
components: {
@ -270,6 +282,8 @@ export default {
tiemr: null,
Graph_che: '',
hideImg: false,
show: false,
status:0,
lang: uni.getStorageSync('language')
};
},
@ -308,6 +322,13 @@ export default {
})
},
methods: {
getAuthInfo() {
Profile.getAuthInfo().then(res => {
// this.detail = res.data
this.status = res.data.status
// this.user_auth_level = res.data.primary_status
})
},
saoma() {
let that = this;
uni.scanCode({
@ -320,6 +341,11 @@ export default {
this.rechargeType = idx;
this.withdrawalBalance();
},
toservice(){
uni.redirectTo({
url: '/pages/auth/certification'
});
},
//
withdrawalBalance() {
let address_type = 1
@ -380,14 +406,18 @@ export default {
this.$toast(this.$t('assets.c2'))
return
}
if(!this.form.password){
this.$toast(this.$t('reg.a9'))
return
}
if (!this.form.emailcode) {
this.$toast(this.$t('safe.a6'))
return
}
if(!this.form.password){
this.$toast(this.$t('reg.a9'))
return
}
if (!this.form.emailcode) {
this.$toast(this.$t('safe.a6'))
return
}
if(this.status!=2){
this.show = true;
return
}
let data = this.withdrawFee
if (data.withdraw_switch == 1) {
this.secondaryShow = true
@ -487,6 +517,7 @@ export default {
},
created() {
this.getWithdrawRecords();
this.getAuthInfo()
// this.gett_gc_code();
},
};

382
pages/auth/certification.vue

@ -0,0 +1,382 @@
<template>
<v-page
style="height:auto!important;min-height: 100%!important;background: none;background-color: #121212 !important;">
<v-header :title="$t('auth.a1')"></v-header>
<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="label m-b-xs">{{$t('auth.a9')}}</view>
<view class="input color-light">
<v-input v-model="form.realname" :placeholder="$t('auth.b0')"></v-input>
</view>
</view>
<!-- 出生日期 -->
<view class="form-item border-b p-md m-b-md">
<view class="label m-b-xs">{{$t('auth.c5')}}</view>
<view class="input color-light">
<uni-datetime-picker type="date" :placeholder="$t('auth.d4')" start="1873-1-01"
:end="new Date().toLocaleDateString()" :clear-icon="false" v-model="form.birthday"
@maskClick="maskClick" />
</view>
</view>
<!-- 证件号类型 -->
<view class="form-item border-b p-md m-b-md">
<view class="label m-b-xs">{{$t('auth.c6')}}</view>
<view class="input color-light">
<uni-data-select :placeholder="$t('auth.d5')" v-model="form.identification_type"
:localdata="id_range" @change="changeID"></uni-data-select>
</view>
</view>
<!-- 证件号 -->
<view class="form-item border-b p-md m-b-md">
<view class="label m-b-xs">{{$t('auth.b1')}}</view>
<view class="input color-light">
<v-input v-model="form.id_card" :placeholder="$t('auth.b2')"></v-input>
</view>
</view>
<!-- 居住地址 -->
<view class="form-item border-b p-md m-b-md">
<view class="label m-b-xs">{{$t('auth.c7')}}</view>
<view class="input color-light">
<v-input v-model="form.address" :placeholder="$t('auth.c8')"></v-input>
</view>
</view>
<!-- 城市 -->
<!-- <view class="form-item border-b p-md m-b-md">
<view class="label m-b-xs">{{$t('auth.d7')}}</view>
<view class="input color-light">
<v-input v-model="form.city" :placeholder="$t('auth.d8')"></v-input>
</view>
</view> -->
<!-- 邮政区号 -->
<!-- <view class="form-item border-b p-md m-b-md">
<view class="label m-b-xs">{{$t('auth.d9')}}</view>
<view class="input color-light">
<v-input v-model="form.postal_code" :placeholder="$t('auth.d10')"></v-input>
</view>
</view> -->
<!-- 国籍区号 -->
<view class="form-item border-b p-md m-b-md">
<view class="label m-b-xs">{{$t('auth.a7')}}</view>
<view class="input color-light">
<v-picker :value="form.country_id" @change="selectCountry" :list="countryList" range-value="id"
range-label="name2">
<v-input disabled :value="activeCountry.name2" :placeholder="$t('auth.a8')">
<template #right>
<van-icon class="color-default" name="arrow" />
</template>
</v-input>
</v-picker>
</view>
</view>
<!-- 电话 -->
<view class="form-item border-b p-md m-b-md">
<view class="label m-b-xs">{{$t('auth.c9')}}</view>
<view class="input color-light">
<v-input v-model="form.phone" :placeholder="$t('auth.d0')"></v-input>
</view>
</view>
<div class="form-item border-b p-md">
<div class="color-light p-b-xs">1{{$t('auth.b5')}}</div>
<div class="d-flex justify-between m-t-md ">
<div class="examples m-r-xs bg-panel-4 p-md rounded-sm">
<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-4">
<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 border-b p-md">
<div class="color-light p-b-xs">2{{$t('auth.b6')}}</div>
<div class="d-flex justify-between m-t-md">
<div class="examples m-r-xs bg-panel-4 p-md rounded-sm">
<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-4">
<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="white" class="w-max rounded-md" ref="btn"
@click="primaryAuth">{{$t('auth.b3')}}</v-button>
</view>
</main>
<van-toast id="van-toast" />
</v-page>
</template>
<script>
import Profile from "@/api/profile";
import Member from "@/api/member";
export default {
data() {
return {
detail: {},
countryList: [],
form: {
// area_code: "",
realname: "",
birthday: "",
identification_type: "",
id_card: "",
address: "",
// city: "",
// postal_code: "",
country_id: "",
phone: "",
country_code: "",
back_img: "",
front_img: "",
},
id_range: [{
value: 0,
text: this.$t('auth.d1')
}, {
value: 1,
text: this.$t('auth.d2')
}, {
value: 2,
text: this.$t('auth.d3')
}],
};
},
computed: {
activeCountry() {
return (
this.countryList.find((item) => item.id == this.form.country_id) || {}
);
},
activeIndex() {
return this.countryList.findIndex((item) => item.id == this.form.country_id)
},
},
methods: {
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'));
});
},
getAuthInfo() {
Profile.getAuthInfo().then((res) => {
this.detail = res.data;
});
},
//
getCountryCode() {
Member.getCountryCode()
.then((res) => {
// console.info(res)
// this.countryList = res.data;
this.countryList = res.data.map(item => {
return {
...item,
name2: '+' + item.country_code + '(' + item.name + ')'
}
});
this.form.country_id = this.countryList[res.data.length - 1].id;
})
.catch(() => {});
},
selectCountry(value) {
this.form.country_id = value
},
//
primaryAuth() {
let data = this.form;
data.country_code = this.activeCountry.country_code;
// console.log(data);
if (!data.realname) {
uni.showToast({
title: this.$t('auth.b0'),
icon: 'none'
})
return;
}
if (!data.birthday) {
uni.showToast({
title: this.$t('auth.d4'),
icon: 'none'
})
return;
}
if (data.identification_type === "") {
uni.showToast({
title: this.$t('auth.d5') + this.$t('auth.c6'),
icon: 'none'
})
return;
}
if (!data.id_card) {
uni.showToast({
title: this.$t('auth.b2'),
icon: 'none'
})
return;
}
if (!data.address) {
uni.showToast({
title: this.$t('auth.c8'),
icon: 'none'
})
return;
}
if (!data.phone) {
uni.showToast({
title: this.$t('auth.d0'),
icon: 'none'
})
return;
}
if (!data.back_img) {
this.$toast(this.$t('auth.c2'));
return;
}
if (!data.front_img) {
this.$toast(this.$t('auth.c3'));
return;
}
Profile.newAuth(data, {btn: this.$refs.btn}).then((res) => {
this.$toast.success(this.$t('auth.b4'));
setTimeout(() => {
this.$back();
}, 1500)
}).catch(() => {});
},
changeID(e) {
// console.log(e);
this.form.identification_type = this.id_range[e].text;
}
},
created() {
this.getAuthInfo();
this.getCountryCode();
},
options: {
styleIsolation: 'shared'
},
};
</script>
<style lang="scss" scoped>
/deep/.uni-date-x--border {
border: none;
}
/deep/.uni-date-x {
background-color: transparent;
color: $plain;
}
/deep/.uni-date__x-input {
padding-left: 0px;
// color: grey;
}
/deep/.uni-select__selector {
// background-color: $panel-3;
background-color: #242424;
}
/deep/.uni-select__input-text {
color: $plain;
}
/deep/.uni-select__input-placeholder {
color: grey;
}
// uni-datetime-picker
.uni-picker-view-indicator,
.uni-picker-view-mask {
background-color: rgba(255, 255, 255, 0.5) !important;
}
// uni-datetime-picker,
/deep/.uni-picker-view-indicator,
/deep/uni-resize-sensor {
background-color: #fff;
}
/deep/.uni-picker-view-mask::before,
uni-picker-view-column::before {
content: '' !important;
width: 100% !important;
height: 34px !important;
background: rgba(255, 255, 255, 0.5) !important;
position: absolute !important;
top: calc(50% - 17px) !important;
border-top: 1px solid #c9c9c9 !important;
border-bottom: 1px solid #c9c9c9 !important;
}
::v-deep.uni-picker-view-mask::before {
content: '';
width: 100%;
height: 34px;
background: rgba(255, 255, 255, 0.5);
position: absolute;
top: calc(50% - 17px);
border-top: 1px solid #c9c9c9;
border-bottom: 1px solid #c9c9c9;
}
>>>.uni-picker-view-mask::before {
content: '';
width: 100%;
height: 34px;
background: rgba(255, 255, 255, 0.5);
position: absolute;
top: calc(50% - 17px);
border-top: 1px solid #c9c9c9;
border-bottom: 1px solid #c9c9c9;
}
.bg-panel-3 {
background-color: #242424;
}
.bg-panel-4 {
background-color: #000;
}
::v-deep uni-input {
border: 1px solid #e5e5e5;
}
.examples {
width: 122px;
height: 70px;
display: flex;
align-items: center;
img {
width: 100%;
}
}
.upload-box {
width: 150px;
height: 100px;
img {
width: 100%;
height: 100%;
// object-fit: cover;
}
}
</style>

18
pages/base/home.vue

@ -447,21 +447,23 @@
<text class="bg-theme-1 color-white p-x-xs p-y-xxs rounded" v-else>{{$t('auth.a3')}}</text>
</v-link>
<v-link class=" p-xs m-xs d-flex justify-between align-center" :to="detail.status!=2?'/pages/auth/index':''" v-if="isLogin">
<!-- <v-link class=" p-xs m-xs d-flex justify-between align-center" :to="detail.status!=2?'/pages/auth/index':''" v-if="isLogin"> -->
<v-link class=" p-xs m-xs d-flex justify-between align-center" v-if="isLogin">
<view style="display: flex;">
<image src="@/assets/img/home/login.png" mode="aspectFit" class="logine"></image>
<image src="@/assets/img/home/Havelogged.png" mode="aspectFit" class="havelogg"></image>
<view style="margin-left: 26rpx;">
<view style="margin-left: 26rpx;display: flex;align-items: center;">
<view class="color-light username">{{username}}</view>
<view class="border_authentication" v-if="detail.status===2">
<!-- <view class="border_authentication" v-if="detail.status===2">
{{$t('auth.a4')}},{{$t('auth.a3')}}
</view>
<view class="border_authentication" v-else-if="detail.primary_status===1">
{{$t("base.f6")}}<!-- {{detail.primary_status_text}} -->
{{$t("base.f6")}}
{{detail.primary_status_text}}
</view>
<view class="border_authentication" v-else>
{{$t('first.a0')}}
</view>
</view> -->
</view>
</view>
<van-icon name="arrow" class="fn-18" />
@ -1105,6 +1107,12 @@
this.personalAssets();
}
},
created() {
if(uni.getStorageSync('show')){
this.personalCenter()
uni.removeStorageSync('show');
}
},
destroyed() {},
};
</script>

8
pages/base/index.vue

@ -159,9 +159,11 @@ export default {
<style lang="scss" scoped>
.footer {
box-shadow: $tab-nav-shadow;
position: relative;
z-index: 5;
background-color: #000;
// position: relative;
// z-index: 5;
background-color: #000;
min-height: 88rpx;
box-sizing: border-box;
}
.router-link-active {

34
pages/base/mine.vue

@ -28,6 +28,9 @@
<van-icon v-else name="closed-eye"/>
</view>
</view>
<view style="background-color: #121212;position: absolute;top: 40rpx;right: 50rpx;" @click="tohome">
<view><image src="@/assets/img/home/user.png" style="width: 40rpx;height: 40rpx;"></image></view>
</view>
<!-- <view class="m-t-md d-flex justify-center fn-center w-max">
<text class="fn-28 w-max">{{ filterMoney(account.total_assets_btc, true) }}</text>
@ -42,13 +45,17 @@
</view>
<view class="m-t-ms p-b-ms w-max" style="display: flex;justify-content: space-between;">
<v-link tag="view" to="/pages/assets/recharge" v-if="user_auth_level==1" @click="getAuthInfo" class="manage_text">
<!-- <v-link tag="view" to="/pages/assets/recharge" v-if="user_auth_level==1" @click="getAuthInfo" class="manage_text">
<img src="@/assets/img/home/Make.png" alt="" class="h-25"/>
<view class="color-light fn-middle fn-ms">{{$t("base.b5")}}</view>
</v-link>
<v-link tag="view" to="/pages/auth/primary" v-if="user_auth_level==0" @click="getAuthInfo" class="manage_text">
<img src="@/assets/img/home/currency.png" alt="" class="h-25"/>
<view class="color-light fn-middle fn-ms">{{$t("base.b5")}}</view>
</v-link> -->
<v-link tag="view" to="/pages/assets/recharge" class="manage_text">
<img src="@/assets/img/home/Make.png" alt="" class="h-25"/>
<view class="color-light fn-middle fn-ms">{{$t("base.b5")}}</view>
</v-link>
<v-link tag="view" to="/pages/assets/draw" class="manage_text">
<img src="@/assets/img/home/currency.png" alt="" class="h-25"/>
@ -110,6 +117,21 @@
</view>
</view> -->
</view>
<view style="background-color: #121212;height: 100rpx;">
<v-link tag="view" :to="{path: status!=2&&status!=1?'/pages/auth/certification':''}"
style="margin: 0rpx 35rpx;display: flex;padding: 0rpx 20rpx;
justify-content: space-between;align-items: center;border-radius: 20rpx;background-color: #abbb62;height: 100%;">
<view style="display: flex;align-items: center;">
<img src="@/assets/img/home/commone.png" alt="" class="h-25"/>
<view class="fn-ms text-center" style="color: #000;margin-left: 20rpx;" v-if="status==0">{{$t('common.c9')}}</view>
<view class="fn-ms text-center" style="color: #000;margin-left: 20rpx;" v-else-if="status==1">{{$t('auth.a5')}}</view>
<view class="fn-ms text-center" style="color: #000;margin-left: 20rpx;" v-else-if="status==2">{{$t('common.c10')}}</view>
<view class="fn-ms text-center" style="color: #000;margin-left: 20rpx;" v-else-if="status==3">{{$t('common.c11')}}</view>
</view>
<view class="" style="color: #000;"> > </view>
</v-link>
</view>
<view class="layout-main" style="background-color: #121212;">
<scroll-view @refresherrefresh="onRefresh" :refresher-enabled="refresherEnabled&&scrollTop<50"
@ -352,6 +374,7 @@ export default {
otc: {},
status: 0,
user_auth_level: 0,
boole:true
};
},
computed: {
@ -374,6 +397,10 @@ export default {
required: false,
type: Boolean
},
tabChange: {
type: Function,
default: null
}
},
watch: {
isShow(n, o) {
@ -393,6 +420,11 @@ export default {
}
},
methods: {
tohome(){
this._router.push("/pages/base/index");
// this.tabChange('home')
uni.setStorageSync('show', this.boole);
},
getAuthInfo() {
Profile.getAuthInfo().then(res => {

Loading…
Cancel
Save