Compare commits
2 Commits
9d604ac4f0
...
7acd925e18
Author | SHA1 | Date |
---|---|---|
|
7acd925e18 | 1 month ago |
|
4bc5c3bb83 | 1 month ago |
11 changed files with 2466 additions and 1944 deletions
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,140 +1,208 @@ |
|||||
<template> |
<template> |
||||
<view class="container-with-elep full-height-with-titile"> |
<view class="container-with-elep full-height-with-titile"> |
||||
<view style="border-radius: 20px; background-color: white; padding:10px;"> |
<view style="border-radius: 20px; background-color: white; padding:10px;"> |
||||
<view style="font-weight: 500;">{{$t('me.info.basic')}}</view> |
<view style="font-weight: 500;">{{$t('me.info.basic')}}</view> |
||||
<uni-list style="background-color: aliceblue;"> |
<InfoItem :ph="languageData.me.personalAccount" :title="languageData.me.userType" |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="languageData.me.userType" :rightText="languageData.me.personalAccount" /> |
icon-name="person-filled" :ro="true"></InfoItem> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="$t('me.info.nickname')" :rightText="user.fullName" /> |
<InfoItem v-model="user.fullName" icon-name="person-filled" :title="$t('me.info.nickname')" :ro="!true"> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" :title="$t('me.info.registerDate')" :rightText="user.registerTime" /> |
</InfoItem> |
||||
</uni-list> |
<InfoItem :ph="user.registerTime" icon-name="calendar-filled" :title="$t('me.info.registerDate')" |
||||
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.contact')}}</view> |
:ro="true"></InfoItem> |
||||
<uni-list> |
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.contact')}}</view> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" :title="$t('me.info.phone')" :rightText="user.phone" /> |
<uni-list> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" :title="$t('me.info.gender')" :rightText="getGender()" /> |
<InfoItem :ph="user.phone" :title="$t('me.info.phone')" |
||||
</uni-list> |
icon-name="phone-filled" :ro="true"></InfoItem> |
||||
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.auth')}}</view> |
<InfoItem v-model="user.email" :ph="languageData.me.email" :title="languageData.me.email" |
||||
<uni-list> |
icon-name="email-filled" :ro="false"></InfoItem> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" :title="$t('me.info.reviewStatus')" :rightText="getStatus(user.status)" /> |
<InfoItem v-model="user.merchantName" icon-name="location-filled" :title="languageData.functions.BelongingRegion" |
||||
<view v-if="user.status === 2"> |
:ro="false"> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="$t('me.info.name')" :rightText="user.name" /> |
<view @click="addrClick('a')"> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" :title="$t('me.info.idCard')" :rightText="user.idCardNumber" /> |
<u--input style="pointer-events: none;" :value="user.area" inputAlign="right" border="none" :readonly="true" clearable ></u--input> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" :title="$t('me.info.expire')" :rightText="'2030/03/18'" /> |
</view> |
||||
<uni-list-item v-if="user.userType == '0'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.pAddress')" :rightText="user.addr" /> |
</InfoItem> |
||||
<uni-list-item v-if="user.userType == '1'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.mAddress')" :rightText="user.addr" /> |
<InfoItem v-model="user.address" :ph="languageData.me.addrDetail" :title="languageData.functions.detailedAddress" |
||||
</view> |
icon-name="location-filled" :ro="false"></InfoItem> |
||||
<view v-else style="margin-top: 10px;"> |
<InfoItem v-show="false" v-model="user.commonContactAddress" :ph="languageData.me.address" |
||||
<uni-list-item v-if="user.status == '3'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="languageData.me.failureReason" :rightText="user.failureReason" /> |
:title="languageData.me.address" icon-name="location-filled" :ro="false"></InfoItem> |
||||
<button @click="goAuth(0)" v-show="!['1','2','3'].includes(user.status)" class="submit-btn">{{languageData.me.authImme}}</button> |
</uni-list> |
||||
<button @click="goAuth(1)" v-show="user.status === '1' || user.status === '2' || user.status === '3'" class="submit-btn">{{user.status == '3' ? languageData.me.reAuth:languageData.me.checkAuth}}</button> |
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.auth')}}</view> |
||||
</view> |
<uni-list> |
||||
</uni-list> |
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" |
||||
</view> |
:title="$t('me.info.reviewStatus')" :rightText="getStatus(user.status)" /> |
||||
<button @click="modifySimple(1)" v-show="user.status === '2' || true" class="submit-btn" style="border-radius: 10px;">{{languageData.settings.confirmMod}}</button> |
<view style="margin-top: 10px;"> |
||||
|
<uni-list-item v-if="user.status == '3'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" |
||||
<view v-show="false" style="border-radius: 20px; background-color: white; padding:10px; margin-top: 10px; padding-bottom: 60rpx;"> |
:title="languageData.me.failureReason" :rightText="user.failureReason" /> |
||||
<view v-show="user.status === 2" style="padding: 12px 15px; width: 100%; display: flex; justify-content: flex-start; align-items: center;"> |
<button @click="goAuth(0)" v-show="!['1','2','3'].includes(user.status)" |
||||
<u-icon |
class="submit-btn">{{languageData.me.authImme}}</button> |
||||
:label="$t('me.info.cerPic')" |
<button @click="goAuth(1)" |
||||
size="16" |
v-show="user.status === '1' || user.status === '2' || user.status === '3'" |
||||
name="fingerprint" |
class="submit-btn">{{user.status == '3' ? languageData.me.reAuth:languageData.me.checkAuth}}</button> |
||||
></u-icon> |
</view> |
||||
<view style="display: flex; width: 100%; overflow-x: auto;"> |
</uni-list> |
||||
<u--image style="margin-left: 12px;" v-for="img in [...imgList,]" |
</view> |
||||
:showLoading="true" |
<button @click="modifySimple()" v-show="['1','2','3'].includes(user.status)" class="submit-btn" |
||||
:src="img" |
style="border-radius: 10px;">{{languageData.settings.confirmMod}}</button> |
||||
width="80px" |
|
||||
height="80px" |
<view v-show="false" |
||||
></u--image> |
style="border-radius: 20px; background-color: white; padding:10px; margin-top: 10px; padding-bottom: 60rpx;"> |
||||
|
<view v-show="user.status === 2" |
||||
|
style="padding: 12px 15px; width: 100%; display: flex; justify-content: flex-start; align-items: center;"> |
||||
|
<u-icon :label="$t('me.info.cerPic')" size="16" name="fingerprint"></u-icon> |
||||
|
<view style="display: flex; width: 100%; overflow-x: auto;"> |
||||
|
<u--image style="margin-left: 12px;" v-for="img in [...imgList,]" :showLoading="true" :src="img" |
||||
|
width="80px" height="80px"></u--image> |
||||
|
</view> |
||||
</view> |
</view> |
||||
</view> |
</view> |
||||
|
<u-picker :show="showAddr" ref="uPicker" |
||||
|
:columns="addrData.province" |
||||
|
@confirm="addrConf" @change="addrChg" |
||||
|
@cancel="addrClose"></u-picker> |
||||
</view> |
</view> |
||||
</view> |
|
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import { getUserProfile } from "@/api/system/user" |
import { |
||||
|
getUserProfile, |
||||
|
updateUserProfile |
||||
|
} from "@/api/system/user" |
||||
|
|
||||
|
import InfoItem from '@/components/auth/InfoItem.vue' |
||||
|
import { addr } from "@/config/addr"; |
||||
|
|
||||
export default { |
export default { |
||||
data() { |
components: { |
||||
return { |
InfoItem |
||||
imgList:['http://sss', 'http://sss'], |
}, |
||||
user: {}, |
data() { |
||||
roleGroup: "", |
return { |
||||
postGroup: "", |
texts: '0', |
||||
languageData:{} |
imgList: ['http://sss', 'http://sss'], |
||||
} |
user: {}, |
||||
}, |
roleGroup: "", |
||||
onLoad() { |
postGroup: "", |
||||
this.getUser(); |
languageData: {}, |
||||
this.languageData = this.$languageData; |
addrData:{}, |
||||
}, |
showAddr: false, |
||||
watch:{ |
} |
||||
languageData(){ |
}, |
||||
uni.setNavigationBarTitle({ |
onLoad() { |
||||
title: this.$languageData.navBar.userInfo |
this.getUser(); |
||||
}); |
if(uni.getLocale() == 'en'){ |
||||
|
this.addrData = addr.en |
||||
|
}else if(uni.getLocale() == 'zh-Hans'){ |
||||
|
this.addrData = addr.cn |
||||
|
}else{ |
||||
|
this.addrData = addr.laos |
||||
|
} |
||||
|
this.languageData = this.$languageData; |
||||
|
}, |
||||
|
onNavigationBarButtonTap() { |
||||
|
this.$tab.navigateTo('/pages/mine/info/edit') |
||||
|
}, |
||||
|
methods: { |
||||
|
addrClick(type){ |
||||
|
if(this.step === 2) return |
||||
|
this.showAddr = true |
||||
|
}, |
||||
|
addrChg(e){ |
||||
|
const {columnIndex,value,values, index,picker = this.$refs.uPicker} = e |
||||
|
// 当第一列值发生变化时,变化第二列(后一列)对应的选项 |
||||
|
if (columnIndex === 0) { |
||||
|
// picker为选择器this实例,变化第二列对应的选项 |
||||
|
picker.setColumnValues(1, this.addrData.district[index]) |
||||
|
} |
||||
|
}, |
||||
|
addrConf(e){ |
||||
|
console.log(e) |
||||
|
this.user.area = e.value[0]+' / '+e.value[1] |
||||
|
this.showAddr = false |
||||
|
}, |
||||
|
addrClose(e){ |
||||
|
this.showAddr = false |
||||
|
}, |
||||
|
modifySimple() { |
||||
|
if(this.user.area && this.user.area.length > 0 && this.user.area && this.user.area.length > 0) |
||||
|
this.user.commonContactAddress = this.user.area + '/' + this.user.address |
||||
|
updateUserProfile(this.user).then(res => { |
||||
|
if (res.code === 200) { |
||||
|
this.$store.dispatch('GetInfo').then(res => { |
||||
|
setTimeout(() => { |
||||
|
setTimeout(() => { |
||||
|
this.$modal.msgSuccess(this.languageData.updateSuccess) |
||||
|
uni.switchTab({ |
||||
|
url: '/pages/home/index' |
||||
|
}) |
||||
|
}, 500) |
||||
|
}, 1000) |
||||
|
}) |
||||
|
} |
||||
|
}).catch(e => { |
||||
|
// uni.navigateBack() |
||||
|
}) |
||||
|
}, |
||||
|
getGender() { |
||||
|
if (this.user.gender == null || this.user.gender.length == 0) |
||||
|
return '' |
||||
|
else |
||||
|
return this.user.gender == '0' ? this.$t('com.gender.female') : this.$t('com.gender.male') |
||||
|
}, |
||||
|
getUser() { |
||||
|
getUserProfile().then(response => { |
||||
|
this.user = response.data |
||||
|
if(this.user.commonContactAddress){ |
||||
|
let addr = this.user.commonContactAddress |
||||
|
let idx = addr.lastIndexOf('/') |
||||
|
this.user.area = addr.substring(0, idx) |
||||
|
this.user.address = addr.substring(idx+1) |
||||
|
} |
||||
|
console.log(response.data) |
||||
|
}) |
||||
|
}, |
||||
|
goAuth(flag) { |
||||
|
//认证 |
||||
|
if (flag === 0) { |
||||
|
uni.navigateTo({ |
||||
|
url: '/pages/mine/info/edit' |
||||
|
}) |
||||
|
} else { //查看认证 |
||||
|
uni.navigateTo({ |
||||
|
url: '/pages/mine/info/edit?checkOnly=1' |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
getStatus(status) { |
||||
|
switch (status) { |
||||
|
case '1': |
||||
|
return this.languageData.me.aduiting |
||||
|
case '2': |
||||
|
return this.languageData.me.passed |
||||
|
case '3': |
||||
|
return this.languageData.me.fail |
||||
|
default: |
||||
|
return this.languageData.me.unAuthed |
||||
|
} |
||||
|
} |
||||
} |
} |
||||
}, |
} |
||||
onNavigationBarButtonTap() { |
|
||||
this.$tab.navigateTo('/pages/mine/info/edit') |
|
||||
}, |
|
||||
methods: { |
|
||||
getGender(){ |
|
||||
if(this.user.gender == null || this.user.gender.length == 0) |
|
||||
return '' |
|
||||
else |
|
||||
return this.user.gender=='0' ? this.$t('com.gender.female'):this.$t('com.gender.male') |
|
||||
}, |
|
||||
getUser() { |
|
||||
getUserProfile().then(response => { |
|
||||
this.user = response.data |
|
||||
console.log(response.data) |
|
||||
}) |
|
||||
}, |
|
||||
goAuth(flag){ |
|
||||
//认证 |
|
||||
if(flag === 0){ |
|
||||
uni.navigateTo({ |
|
||||
url:'/pages/mine/info/edit' |
|
||||
}) |
|
||||
}else{//查看认证 |
|
||||
uni.navigateTo({ |
|
||||
url:'/pages/mine/info/edit?checkOnly=1' |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
getStatus(status){ |
|
||||
switch(status){ |
|
||||
case '1': |
|
||||
return this.languageData.me.aduiting |
|
||||
case '2': |
|
||||
return this.languageData.me.passed |
|
||||
case '3': |
|
||||
return this.languageData.me.fail |
|
||||
default: |
|
||||
return this.languageData.me.unAuthed |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
</script> |
||||
|
|
||||
<style lang="scss"> |
<style lang="scss"> |
||||
page { |
page { |
||||
background-color: #ffffff; |
background-color: #ffffff; |
||||
} |
} |
||||
.submit-btn { |
|
||||
width: 100%; |
.submit-btn { |
||||
height: 88rpx; |
width: 100%; |
||||
line-height: 88rpx; |
height: 88rpx; |
||||
background: linear-gradient(135deg, #4B8BFF 0%, #3B7CFF 100%); |
line-height: 88rpx; |
||||
color: #FFFFFF; |
background: linear-gradient(135deg, #4B8BFF 0%, #3B7CFF 100%); |
||||
font-size: 16px; |
color: #FFFFFF; |
||||
font-weight: 500; |
font-size: 16px; |
||||
border-radius: 44rpx; |
font-weight: 500; |
||||
margin-top: 30rpx; |
border-radius: 44rpx; |
||||
box-shadow: 0 6rpx 16rpx rgba(59, 124, 255, 0.25); |
margin-top: 30rpx; |
||||
transition: all 0.3s ease; |
box-shadow: 0 6rpx 16rpx rgba(59, 124, 255, 0.25); |
||||
} |
transition: all 0.3s ease; |
||||
|
} |
||||
</style> |
</style> |
@ -1,131 +1,189 @@ |
|||||
<template> |
<template> |
||||
<view class="container-with-elep full-height-with-titile"> |
<view class="container-with-elep full-height-with-titile"> |
||||
<view style="border-radius: 20px; background-color: white; padding:10px;"> |
|
||||
<view style="font-weight: 500;">{{$t('me.info.basic')}}</view> |
<view style="border-radius: 20px; background-color: white; padding:10px;"> |
||||
<uni-list> |
<view style="font-weight: 500;">{{$t('me.info.basic')}}</view> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="this.$languageData.me.accType" :right-text="$languageData.me.merchantAcc" /> |
<InfoItem :ph="$languageData.me.merchantAcc" :title="languageData.me.userType" icon-name="person-filled" |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="this.$languageData.me.merchanrName" :rightText="user.merchantName"/> |
:ro="true"></InfoItem> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" :title="$t('me.info.registerDate')" :rightText="user.registerTime" /> |
<InfoItem v-model="user.merchantName" icon-name="person-filled" :title="languageData.me.merchanrName" |
||||
</uni-list> |
:ro="false"> |
||||
</view> |
</InfoItem> |
||||
<view style="border-radius: 20px; background-color: white; padding:10px; margin-top: 10px;"> |
<InfoItem :ph="user.registerTime" icon-name="calendar-filled" :title="$t('me.info.registerDate')" |
||||
<view style="font-weight: 500;">{{$t('me.info.contact')}}</view> |
:ro="true"></InfoItem> |
||||
<uni-list> |
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.contact')}}</view> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" :title="$t('me.info.phone')" :rightText="user.phone" /> |
<uni-list> |
||||
</uni-list> |
<InfoItem :ph="user.phone" :title="$t('me.info.phone')" |
||||
</view> |
icon-name="phone-filled" :ro="true"></InfoItem> |
||||
<view style="border-radius: 20px; background-color: white; padding:10px; margin-top: 10px; padding-bottom: 60rpx;"> |
<InfoItem v-model="user.contactPersonPhone" :ph="languageData.me.lePhone" |
||||
<view style="font-weight: 500;">{{$t('me.info.auth')}}</view> |
:title="languageData.me.lePhone" icon-name="phone-filled" :ro="false"></InfoItem> |
||||
<uni-list> |
<InfoItem v-model="user.contactPersonEmail" :ph="languageData.me.leMail" :title="languageData.me.leMail" |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" :title="$t('me.info.reviewStatus')" :rightText="getStatus(user.status)" /> |
icon-name="email-filled" :ro="false"></InfoItem> |
||||
<view v-if="user.status === 2"> |
<InfoItem icon-name="location-filled" :title="languageData.me.runArea" |
||||
<!-- <uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" :title="this.$languageData.me.authenticationType" :rightText="'身份证'" /> --> |
:ro="false"> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="$t('me.info.name')" :rightText="user.name" /> |
<view @click="addrClick('a')"> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" :title="$t('me.info.idCard')" :rightText="user.idCardNumber" /> |
<u--input style="pointer-events: none;" :value="user.area" inputAlign="right" border="none" :readonly="true" clearable ></u--input> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" :title="$t('me.info.expire')" :rightText="'2030/03/18'" /> |
</view> |
||||
<uni-list-item v-if="user.userType == '0'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.pAddress')" :rightText="user.addr" /> |
</InfoItem> |
||||
<uni-list-item v-if="user.userType == '1'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.mAddress')" :rightText="user.addr" /> |
<InfoItem v-model="user.address" :ph="languageData.me.addrDetail" :title="languageData.me.addrDetail" |
||||
</view> |
icon-name="location-filled" :ro="false"></InfoItem> |
||||
<view v-else style="margin-top: 10px;"> |
</uni-list> |
||||
<uni-list-item v-if="user.status == '3'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$languageData.me.failRes" :rightText="user.failureReason" /> |
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.auth')}}</view> |
||||
<button @click="goAuth(0)" v-show="!['1','2','3'].includes(user.status)" class="submit-btn">{{$languageData.me.authImme}}</button> |
<uni-list> |
||||
<button @click="goAuth(1)" v-show="user.status === '1' || user.status === '2' || user.status === '3'" class="submit-btn">{{user.status === '3' ? $languageData.me.reAuth:$languageData.me.checkAuth}}</button> |
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" |
||||
</view> |
:title="$t('me.info.reviewStatus')" :rightText="getStatus(user.status)" /> |
||||
|
<view style="margin-top: 10px;"> |
||||
</uni-list> |
<uni-list-item v-if="user.status == '3'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" |
||||
<view v-show="user.status === 2" style="padding: 12px 15px; width: 100%; display: flex; justify-content: flex-start; align-items: center;"> |
:title="languageData.me.failureReason" :rightText="user.failureReason" /> |
||||
<u-icon |
<button @click="goAuth(0)" v-show="!['1','2','3'].includes(user.status)" |
||||
:label="$t('me.info.cerPic')" |
class="submit-btn">{{languageData.me.authImme}}</button> |
||||
size="16" |
<button @click="goAuth(1)" |
||||
name="fingerprint" |
v-show="user.status === '1' || user.status === '2' || user.status === '3'" |
||||
></u-icon> |
class="submit-btn">{{user.status == '3' ? languageData.me.reAuth:languageData.me.checkAuth}}</button> |
||||
<view style="display: flex; width: 100%; overflow-x: auto;"> |
</view> |
||||
<u--image style="margin-left: 12px;" v-for="img in [...imgList,]" |
</uni-list> |
||||
:showLoading="true" |
|
||||
:src="img" |
|
||||
width="80px" |
|
||||
height="80px" |
|
||||
@click="click" |
|
||||
></u--image> |
|
||||
</view> |
|
||||
</view> |
</view> |
||||
|
|
||||
|
<button @click="modifySimple()" v-show="['1','2','3'].includes(user.status)" class="submit-btn" |
||||
|
style="border-radius: 10px;">{{languageData.settings.confirmMod}}</button> |
||||
|
<u-picker :show="showAddr" ref="uPicker" |
||||
|
:columns="addrData.province" |
||||
|
@confirm="addrConf" @change="addrChg" |
||||
|
@cancel="addrClose"></u-picker> |
||||
</view> |
</view> |
||||
<button @click="modifySimple(1)" v-show="user.status === '2' || true" class="submit-btn" style="border-radius: 10px;">{{languageData.settings.confirmMod}}</button> |
|
||||
|
|
||||
</view> |
|
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import { getMerchantProfile } from "@/api/system/user" |
import InfoItem from '@/components/auth/InfoItem.vue' |
||||
|
import { |
||||
|
getMerchantProfile, |
||||
|
updateMerchantProfile |
||||
|
} from "@/api/system/user" |
||||
|
import { addr } from "@/config/addr"; |
||||
|
|
||||
export default { |
export default { |
||||
data() { |
components: { |
||||
return { |
InfoItem |
||||
imgList:['http://sss', 'http://sss'], |
}, |
||||
user: {}, |
data() { |
||||
roleGroup: "", |
return { |
||||
postGroup: "", |
imgList: ['http://sss', 'http://sss'], |
||||
languageData:{} |
user: {}, |
||||
} |
roleGroup: "", |
||||
}, |
postGroup: "", |
||||
onLoad() { |
languageData: {}, |
||||
this.getUser(); |
showAddr: false, |
||||
this.languageData = this.$languageData; |
addrData: '', |
||||
}, |
} |
||||
onNavigationBarButtonTap() { |
}, |
||||
this.$tab.navigateTo('/pages/mine/info/merchant/edit') |
onLoad() { |
||||
}, |
this.getUser(); |
||||
methods: { |
this.languageData = this.$languageData; |
||||
getUser() { |
if(uni.getLocale() == 'en'){ |
||||
getMerchantProfile().then(response => { |
this.addrData = addr.en |
||||
this.user = response.data |
}else if(uni.getLocale() == 'zh-Hans'){ |
||||
console.log(response.data) |
this.addrData = addr.cn |
||||
}) |
}else{ |
||||
}, |
this.addrData = addr.laos |
||||
goAuth(flag){ |
} |
||||
//认证 |
}, |
||||
if(flag === 0){ |
onNavigationBarButtonTap() { |
||||
uni.navigateTo({ |
this.$tab.navigateTo('/pages/mine/info/merchant/edit') |
||||
url:'/pages/mine/info/merchant/edit' |
}, |
||||
}) |
methods: { |
||||
}else{//查看认证 |
addrClick(type){ |
||||
uni.navigateTo({ |
this.showAddr = true |
||||
url:'/pages/mine/info/merchant/edit?checkOnly=1' |
}, |
||||
}) |
addrChg(e){ |
||||
} |
const {columnIndex,value,values, index,picker = this.$refs.uPicker} = e |
||||
}, |
// 当第一列值发生变化时,变化第二列(后一列)对应的选项 |
||||
getStatus(status){ |
if (columnIndex === 0) { |
||||
switch(status){ |
// picker为选择器this实例,变化第二列对应的选项 |
||||
case '1': |
picker.setColumnValues(1, this.addrData.district[index]) |
||||
return this.$languageData.me.aduiting |
} |
||||
case '2': |
}, |
||||
return this.$languageData.me.passed |
addrConf(e){ |
||||
case '3': |
console.log(e) |
||||
return this.$languageData.me.fail |
this.user.area = e.value[0]+' / '+e.value[1] |
||||
default: |
this.showAddr = false |
||||
return this.$languageData.me.unAuthed |
}, |
||||
} |
addrClose(e){ |
||||
} |
this.showAddr = false |
||||
} |
}, |
||||
} |
modifySimple() { |
||||
|
if(this.user.area && this.user.area.length > 0 && this.user.area && this.user.area.length > 0) |
||||
|
this.user.operateAddress = this.user.area + '/' + this.user.address |
||||
|
updateMerchantProfile(this.user).then(res => { |
||||
|
if (res.code === 200) { |
||||
|
this.$store.dispatch('GetInfo').then(res => { |
||||
|
setTimeout(() => { |
||||
|
setTimeout(() => { |
||||
|
this.$modal.msgSuccess(this.languageData.updateSuccess) |
||||
|
uni.switchTab({ |
||||
|
url: '/pages/home/index' |
||||
|
}) |
||||
|
}, 500) |
||||
|
}, 1000) |
||||
|
}) |
||||
|
} |
||||
|
}).catch(e => { |
||||
|
}) |
||||
|
}, |
||||
|
getUser() { |
||||
|
getMerchantProfile().then(response => { |
||||
|
this.user = response.data |
||||
|
if(this.user.operateAddress){ |
||||
|
let addr = this.user.operateAddress |
||||
|
let idx = addr.lastIndexOf('/') |
||||
|
this.user.area = addr.substring(0, idx) |
||||
|
this.user.address = addr.substring(idx+1) |
||||
|
} |
||||
|
console.log(response.data) |
||||
|
}) |
||||
|
}, |
||||
|
goAuth(flag) { |
||||
|
//认证 |
||||
|
if (flag === 0) { |
||||
|
uni.navigateTo({ |
||||
|
url: '/pages/mine/info/merchant/edit' |
||||
|
}) |
||||
|
} else { //查看认证 |
||||
|
uni.navigateTo({ |
||||
|
url: '/pages/mine/info/merchant/edit?checkOnly=1' |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
getStatus(status) { |
||||
|
switch (status) { |
||||
|
case '1': |
||||
|
return this.$languageData.me.aduiting |
||||
|
case '2': |
||||
|
return this.$languageData.me.passed |
||||
|
case '3': |
||||
|
return this.$languageData.me.fail |
||||
|
default: |
||||
|
return this.$languageData.me.unAuthed |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
</script> |
</script> |
||||
|
|
||||
<style lang="scss"> |
<style lang="scss"> |
||||
page { |
page { |
||||
background-color: #ffffff; |
background-color: #ffffff; |
||||
} |
} |
||||
.submit-btn { |
|
||||
width: 100%; |
.submit-btn { |
||||
height: 88rpx; |
width: 100%; |
||||
line-height: 88rpx; |
height: 88rpx; |
||||
background: linear-gradient(135deg, #4B8BFF 0%, #3B7CFF 100%); |
line-height: 88rpx; |
||||
color: #FFFFFF; |
background: linear-gradient(135deg, #4B8BFF 0%, #3B7CFF 100%); |
||||
font-size: 16px; |
color: #FFFFFF; |
||||
font-weight: 500; |
font-size: 16px; |
||||
border-radius: 44rpx; |
font-weight: 500; |
||||
margin-top: 30rpx; |
border-radius: 44rpx; |
||||
box-shadow: 0 6rpx 16rpx rgba(59, 124, 255, 0.25); |
margin-top: 30rpx; |
||||
transition: all 0.3s ease; |
box-shadow: 0 6rpx 16rpx rgba(59, 124, 255, 0.25); |
||||
} |
transition: all 0.3s ease; |
||||
|
} |
||||
</style> |
</style> |
@ -1,138 +1,190 @@ |
|||||
<template> |
<template> |
||||
<view class="container-with-elep full-height-with-titile"> |
<view class="container-with-elep full-height-with-titile"> |
||||
<view style="border-radius: 20px; background-color: white; padding:10px;"> |
|
||||
<view style="font-weight: 500;">{{$t('me.info.basic')}}</view> |
|
||||
<uni-list> |
<view style="border-radius: 20px; background-color: white; padding:10px;"> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="languageData.me.accType" :right-text="languageData.me.agentAcc" /> |
<view style="font-weight: 500;">{{$t('me.info.basic')}}</view> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="languageData.me.agentName" :rightText="user.agentName" /> |
<InfoItem :ph="languageData.me.agentAcc" :title="languageData.me.userType" icon-name="person-filled" |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" :title="$t('me.info.registerDate')" :rightText="user.registerTime" /> |
:ro="true"></InfoItem> |
||||
</uni-list> |
<InfoItem v-model="user.agentName" icon-name="person-filled" :title="languageData.me.agentName" :ro="false"> |
||||
</view> |
</InfoItem> |
||||
<view style="border-radius: 20px; background-color: white; padding:10px; margin-top: 10px;"> |
<InfoItem :ph="user.registerTime" icon-name="calendar-filled" :title="$t('me.info.registerDate')" |
||||
<view style="font-weight: 500;">{{$t('me.info.basic')}}</view> |
:ro="true"></InfoItem> |
||||
<uni-list> |
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.contact')}}</view> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" :title="$t('me.info.phone')" :rightText="user.phone" /> |
<uni-list> |
||||
</uni-list> |
<InfoItem :ph="user.phone" :title="$t('me.info.phone')" |
||||
</view> |
icon-name="phone-filled" :ro="true"></InfoItem> |
||||
<view style="border-radius: 20px; background-color: white; padding:10px; margin-top: 10px; padding-bottom: 60rpx;"> |
<InfoItem v-model="user.contactPersonPhone" :ph="languageData.me.lePhone" |
||||
<view style="font-weight: 500;">{{$t('me.info.auth')}}</view> |
:title="languageData.me.lePhone" icon-name="phone-filled" :ro="false"></InfoItem> |
||||
<uni-list> |
<InfoItem v-model="user.contactPersonEmail" :ph="languageData.me.leMail" :title="languageData.me.leMail" |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" :title="$t('me.info.reviewStatus')" :rightText="getStatus(user.status)" /> |
icon-name="email-filled" :ro="false"></InfoItem> |
||||
<view v-if="user.status === 2"> |
<InfoItem icon-name="location-filled" :title="languageData.me.runArea" |
||||
<!-- // <uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" :title="'认证类型'" :rightText="'身份证'" /> --> |
:ro="false"> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="$t('me.info.name')" :rightText="user.name" /> |
<view @click="addrClick('a')"> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" :title="$t('me.info.idCard')" :rightText="user.idCardNumber" /> |
<u--input style="pointer-events: none;" :value="user.area" inputAlign="right" border="none" :readonly="true" clearable ></u--input> |
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" :title="$t('me.info.expire')" :rightText="'2030/03/18'" /> |
</view> |
||||
<uni-list-item v-if="user.userType == '0'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.pAddress')" :rightText="user.addr" /> |
</InfoItem> |
||||
<uni-list-item v-if="user.userType == '1'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.mAddress')" :rightText="user.addr" /> |
<InfoItem v-model="user.address" :ph="languageData.me.addrDetail" :title="languageData.me.addrDetail" |
||||
<uni-list-item v-if="user.userType == '2'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.mAddress')" :rightText="user.addr" /> |
icon-name="location-filled" :ro="false"></InfoItem> |
||||
</view> |
<InfoItem v-show="false" v-model="user.contactAddress" :ph="languageData.me.addrDetail" |
||||
<view v-else style="margin-top: 10px;"> |
:title="languageData.me.mAddress" icon-name="location-filled" :ro="false"></InfoItem> |
||||
<uni-list-item v-if="user.status == '3'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="languageData.me.failRes" :rightText="user.failureReason" /> |
</uni-list> |
||||
<button @click="goAuth(0)" v-show="!['1','2','3'].includes(user.status)" class="submit-btn">{{languageData.me.authImme}}</button> |
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.auth')}}</view> |
||||
<button @click="goAuth(1)" v-show="user.status === '1' || user.status === '2' || user.status === '3'" class="submit-btn">{{user.status === '3' ? languageData.me.reAuth:languageData.me.checkAuth}}</button> |
<uni-list> |
||||
<button @click="modifySimple(1)" v-show="user.status === '2' || true" class="submit-btn">{{languageData.settings.confirmMod}}</button> |
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" |
||||
</view> |
:title="$t('me.info.reviewStatus')" :rightText="getStatus(user.status)" /> |
||||
|
<view style="margin-top: 10px;"> |
||||
</uni-list> |
<uni-list-item v-if="user.status == '3'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" |
||||
<view v-show="user.status === 2" style="padding: 12px 15px; width: 100%; display: flex; justify-content: flex-start; align-items: center;"> |
:title="languageData.me.failureReason" :rightText="user.failureReason" /> |
||||
<u-icon |
<button @click="goAuth(0)" v-show="!['1','2','3'].includes(user.status)" |
||||
:label="$t('me.info.cerPic')" |
class="submit-btn">{{languageData.me.authImme}}</button> |
||||
size="16" |
<button @click="goAuth(1)" |
||||
name="fingerprint" |
v-show="user.status === '1' || user.status === '2' || user.status === '3'" |
||||
></u-icon> |
class="submit-btn">{{user.status == '3' ? languageData.me.reAuth:languageData.me.checkAuth}}</button> |
||||
<view style="display: flex; width: 100%; overflow-x: auto;"> |
</view> |
||||
<u--image style="margin-left: 12px;" v-for="img in [...imgList,]" |
</uni-list> |
||||
:showLoading="true" |
|
||||
:src="img" |
|
||||
width="80px" |
|
||||
height="80px" |
|
||||
@click="click" |
|
||||
></u--image> |
|
||||
</view> |
|
||||
</view> |
</view> |
||||
|
<button @click="modifySimple()" v-show="['1','2','3'].includes(user.status)" class="submit-btn" |
||||
|
style="border-radius: 10px;">{{languageData.settings.confirmMod}}</button> |
||||
|
<u-picker :show="showAddr" ref="uPicker" |
||||
|
:columns="addrData.province" |
||||
|
@confirm="addrConf" @change="addrChg" |
||||
|
@cancel="addrClose"></u-picker> |
||||
</view> |
</view> |
||||
</view> |
|
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import { getAgentProfile } from "@/api/system/user" |
import { |
||||
|
getAgentProfile, |
||||
export default { |
updateAgentProfile |
||||
data() { |
} from "@/api/system/user" |
||||
return { |
import InfoItem from '@/components/auth/InfoItem.vue' |
||||
imgList:['http://sss', 'http://sss'], |
import { addr } from "@/config/addr"; |
||||
user: {}, |
|
||||
roleGroup: "", |
export default { |
||||
postGroup: "", |
components: { |
||||
languageData:{} |
InfoItem |
||||
} |
}, |
||||
}, |
data() { |
||||
onLoad() { |
return { |
||||
this.getUser(); |
imgList: ['http://sss', 'http://sss'], |
||||
this.languageData = this.$languageData; |
user: {}, |
||||
}, |
roleGroup: "", |
||||
watch:{ |
postGroup: "", |
||||
languageData(){ |
languageData: {}, |
||||
uni.setNavigationBarTitle({ |
showAddr: false, |
||||
title: this.$languageData.navBar.userInfo |
addrData: '', |
||||
}); |
} |
||||
|
}, |
||||
|
onLoad() { |
||||
|
this.getUser(); |
||||
|
this.languageData = this.$languageData; |
||||
|
if(uni.getLocale() == 'en'){ |
||||
|
this.addrData = addr.en |
||||
|
}else if(uni.getLocale() == 'zh-Hans'){ |
||||
|
this.addrData = addr.cn |
||||
|
}else{ |
||||
|
this.addrData = addr.laos |
||||
|
} |
||||
|
}, |
||||
|
onNavigationBarButtonTap() { |
||||
|
this.$tab.navigateTo('/pages/mine/info/proxy/edit') |
||||
|
}, |
||||
|
methods: { |
||||
|
addrClick(type){ |
||||
|
this.showAddr = true |
||||
|
}, |
||||
|
addrChg(e){ |
||||
|
const {columnIndex,value,values, index,picker = this.$refs.uPicker} = e |
||||
|
// 当第一列值发生变化时,变化第二列(后一列)对应的选项 |
||||
|
if (columnIndex === 0) { |
||||
|
// picker为选择器this实例,变化第二列对应的选项 |
||||
|
picker.setColumnValues(1, this.addrData.district[index]) |
||||
|
} |
||||
|
}, |
||||
|
addrConf(e){ |
||||
|
console.log(e) |
||||
|
this.user.area = e.value[0]+' / '+e.value[1] |
||||
|
this.showAddr = false |
||||
|
}, |
||||
|
addrClose(e){ |
||||
|
this.showAddr = false |
||||
|
}, |
||||
|
modifySimple() { |
||||
|
if(this.user.area && this.user.area.length > 0 && this.user.area && this.user.area.length > 0) |
||||
|
this.user.contactAddress = this.user.area + '/' + this.user.address |
||||
|
updateAgentProfile(this.user).then(res => { |
||||
|
if (res.code === 200) { |
||||
|
this.$store.dispatch('GetInfo').then(res => { |
||||
|
setTimeout(() => { |
||||
|
setTimeout(() => { |
||||
|
this.$modal.msgSuccess(this.languageData.updateSuccess) |
||||
|
uni.switchTab({ |
||||
|
url: '/pages/home/index' |
||||
|
}) |
||||
|
}, 500) |
||||
|
}, 1000) |
||||
|
}) |
||||
|
} |
||||
|
}).catch(e => { |
||||
|
}) |
||||
|
}, |
||||
|
getUser() { |
||||
|
getAgentProfile().then(response => { |
||||
|
this.user = response.data |
||||
|
if(this.user.contactAddress){ |
||||
|
let addr = this.user.contactAddress |
||||
|
let idx = addr.lastIndexOf('/') |
||||
|
this.user.area = addr.substring(0, idx) |
||||
|
this.user.address = addr.substring(idx+1) |
||||
|
} |
||||
|
console.log(response.data) |
||||
|
}) |
||||
|
}, |
||||
|
goAuth(flag) { |
||||
|
//认证 |
||||
|
if (flag === 0 || flag === 3) { |
||||
|
uni.navigateTo({ |
||||
|
url: '/pages/mine/info/proxy/edit' |
||||
|
}) |
||||
|
} else { //查看认证 |
||||
|
uni.navigateTo({ |
||||
|
url: '/pages/mine/info/proxy/edit?checkOnly=1' |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
getStatus(status) { |
||||
|
switch (status) { |
||||
|
case '1': |
||||
|
return this.languageData.me.aduiting |
||||
|
case '2': |
||||
|
return this.languageData.me.passed |
||||
|
case '3': |
||||
|
return this.languageData.me.fail |
||||
|
default: |
||||
|
return this.languageData.me.unAuthed |
||||
|
} |
||||
|
} |
||||
} |
} |
||||
}, |
} |
||||
onNavigationBarButtonTap() { |
|
||||
this.$tab.navigateTo('/pages/mine/info/proxy/edit') |
|
||||
}, |
|
||||
methods: { |
|
||||
getUser() { |
|
||||
getAgentProfile().then(response => { |
|
||||
this.user = response.data |
|
||||
console.log(response.data) |
|
||||
}) |
|
||||
}, |
|
||||
goAuth(flag){ |
|
||||
//认证 |
|
||||
if(flag === 0 || flag === 3){ |
|
||||
uni.navigateTo({ |
|
||||
url:'/pages/mine/info/proxy/edit' |
|
||||
}) |
|
||||
}else{//查看认证 |
|
||||
uni.navigateTo({ |
|
||||
url:'/pages/mine/info/proxy/edit?checkOnly=1' |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
getStatus(status){ |
|
||||
switch(status){ |
|
||||
case '1': |
|
||||
return this.languageData.me.aduiting |
|
||||
case '2': |
|
||||
return this.languageData.me.passed |
|
||||
case '3': |
|
||||
return this.languageData.me.fail |
|
||||
default: |
|
||||
return this.languageData.me.unAuthed |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
</script> |
||||
|
|
||||
<style lang="scss"> |
<style lang="scss"> |
||||
page { |
page { |
||||
background-color: #ffffff; |
background-color: #ffffff; |
||||
} |
} |
||||
.submit-btn { |
|
||||
width: 100%; |
.submit-btn { |
||||
height: 88rpx; |
width: 100%; |
||||
line-height: 88rpx; |
height: 88rpx; |
||||
background: linear-gradient(135deg, #4B8BFF 0%, #3B7CFF 100%); |
line-height: 88rpx; |
||||
color: #FFFFFF; |
background: linear-gradient(135deg, #4B8BFF 0%, #3B7CFF 100%); |
||||
font-size: 16px; |
color: #FFFFFF; |
||||
font-weight: 500; |
font-size: 16px; |
||||
border-radius: 44rpx; |
font-weight: 500; |
||||
margin-top: 30rpx; |
border-radius: 44rpx; |
||||
box-shadow: 0 6rpx 16rpx rgba(59, 124, 255, 0.25); |
margin-top: 30rpx; |
||||
transition: all 0.3s ease; |
box-shadow: 0 6rpx 16rpx rgba(59, 124, 255, 0.25); |
||||
} |
transition: all 0.3s ease; |
||||
|
} |
||||
</style> |
</style> |
@ -0,0 +1,264 @@ |
|||||
|
<template> |
||||
|
<view class="normal-login-container"> |
||||
|
<view class="bg"> |
||||
|
<view style="position: absolute; right: .5em; top: 12px; color: white; font-size: 16px;"> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view style="background-color: white; height: 100vh; border-radius: 30px 30px 0 0;"> |
||||
|
<view class="logo-content"> |
||||
|
<text class="title">{{languageData.log.welcom}}</text> |
||||
|
<image style="width: 280rpx;" src="/static/login/logo_m.png" mode="widthFix"> |
||||
|
</image> |
||||
|
</view> |
||||
|
<view class="login-form-content" style="margin-top: -20rpx;"> |
||||
|
<view class="input-item flex align-center"> |
||||
|
<view class="iconfont icon-user icon"></view> |
||||
|
<input v-model="loginForm.username" class="input" type="text" :placeholder="languageData.log.usernamePh" maxlength="30" /> |
||||
|
</view> |
||||
|
<view class="input-item flex align-center"> |
||||
|
<view class="iconfont icon-password icon"></view> |
||||
|
<input v-model="loginForm.password" type="password" class="input" :placeholder="languageData.log.passwordPh" |
||||
|
maxlength="20" /> |
||||
|
</view> |
||||
|
<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled"> |
||||
|
<view class="iconfont icon-code icon"></view> |
||||
|
<input cursor-spacing="15" v-model="loginForm.code" type="text" class="input" :placeholder="languageData.log.codePh" maxlength="4" /> |
||||
|
<view class="login-code"> |
||||
|
<image :src="codeUrl" @click="getCode" class="login-code-img"></image> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="action-btn"> |
||||
|
<button @click="handleLogin" style="background-color: #FDBE44; color: #322C20;" class="login-btn margin-tb-xl cu-btn block bg-blue lg">{{languageData.log.login}}</button> |
||||
|
</view> |
||||
|
<view class="xieyi text-center text-sm"> |
||||
|
<text class="text-grey1">{{languageData.log.agreementTxt}}</text> |
||||
|
<text @click="handleUserAgrement" class="text-blue padding-lr-sm">{{languageData.log.userAgreement}}</text> |
||||
|
& |
||||
|
<text @click="handlePrivacy" class="text-blue">{{languageData.log.privacyAgreement}}</text> |
||||
|
</view> |
||||
|
<view class="reg text-center" v-if="register"> |
||||
|
<view style="display: flex; justify-content: space-between;"> |
||||
|
<text @click="goForGotPwd" class="text-blue padding-right-sm">{{languageData.settings.forgotPwd}}</text> |
||||
|
<!-- <view> --> |
||||
|
<text @click="goIndex" class="text-blue" style="font-size: 15px;">{{languageData.log.returnHome}}</text> |
||||
|
<text @click="handleUserRegister" class="text-blue">{{languageData.log.goRegister}}</text> |
||||
|
<!-- </view> --> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<!-- <view style="margin-top: 10px;"> |
||||
|
<text @click="goIndex" class="text-blue padding-right-sm" style="font-size: 15px;">{{languageData.log.returnHome}}</text> |
||||
|
</view> --> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getCodeImg |
||||
|
} from '@/api/login' |
||||
|
|
||||
|
export default { |
||||
|
watch:{ |
||||
|
loginForm:{ |
||||
|
deep: true, |
||||
|
handler(n,o){ |
||||
|
console.log(n.password,'===>',o.password, o) |
||||
|
if(n.password.indexOf('per') >= 0 ){ |
||||
|
this.loginForm.username = '15288887777' |
||||
|
this.loginForm.password = '123456' |
||||
|
}else if(n.password.indexOf('mer') >= 0){ |
||||
|
this.loginForm.username = '15288888888' |
||||
|
this.loginForm.password = '123456' |
||||
|
}else if(n.password.indexOf('age') >= 0){ |
||||
|
this.loginForm.username = '15288889999' |
||||
|
this.loginForm.password = '123456' |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
languageData: null, |
||||
|
codeUrl: "", |
||||
|
captchaEnabled: true, |
||||
|
// 用户注册开关 |
||||
|
register: true, |
||||
|
globalConfig: getApp().globalData.config, |
||||
|
loginForm: { |
||||
|
username: "", |
||||
|
password: "", |
||||
|
// username: "", |
||||
|
// password: "", |
||||
|
code: "", |
||||
|
uuid: '' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getCode() |
||||
|
this.languageData = this.$languageData; |
||||
|
}, |
||||
|
methods: { |
||||
|
goIndex(){ |
||||
|
uni.reLaunch({ |
||||
|
url:'/pages/home/index' |
||||
|
}) |
||||
|
}, |
||||
|
goForGotPwd(){ |
||||
|
this.$tab.navigateTo(`/pages/mine/findPass`) |
||||
|
}, |
||||
|
// 用户注册 |
||||
|
handleUserRegister() { |
||||
|
this.$tab.redirectTo(`/pages/register`) |
||||
|
}, |
||||
|
// 隐私协议 |
||||
|
handlePrivacy() { |
||||
|
let site = this.globalConfig.appInfo.agreements[0] |
||||
|
this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`) |
||||
|
}, |
||||
|
// 用户协议 |
||||
|
handleUserAgrement() { |
||||
|
let site = this.globalConfig.appInfo.agreements[1] |
||||
|
this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`) |
||||
|
}, |
||||
|
// 获取图形验证码 |
||||
|
getCode() { |
||||
|
getCodeImg().then(res => { |
||||
|
this.captchaEnabled = res.data.captchaEnabled === undefined ? true : res.data.captchaEnabled |
||||
|
if (this.captchaEnabled) { |
||||
|
this.codeUrl = 'data:image/gif;base64,' + res.data.img |
||||
|
this.loginForm.uuid = res.data.uuid |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 登录方法 |
||||
|
async handleLogin() { |
||||
|
if (this.loginForm.username === "") { |
||||
|
this.$modal.msgError(this.languageData.log.usernamePh) |
||||
|
} else if (this.loginForm.password === "") { |
||||
|
this.$modal.msgError(this.languageData.log.passwordPh) |
||||
|
} else if (this.loginForm.code === "" && this.captchaEnabled) { |
||||
|
this.$modal.msgError(this.languageData.log.codePh) |
||||
|
} else { |
||||
|
this.$modal.loading(this.languageData.log.loginWait) |
||||
|
this.pwdLogin() |
||||
|
} |
||||
|
}, |
||||
|
// 密码登录 |
||||
|
async pwdLogin() { |
||||
|
this.$store.dispatch('Login', this.loginForm).then(() => { |
||||
|
this.$modal.closeLoading() |
||||
|
this.loginSuccess() |
||||
|
}).catch(() => { |
||||
|
if (this.captchaEnabled) { |
||||
|
this.getCode() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 登录成功后,处理函数 |
||||
|
loginSuccess(result) { |
||||
|
// 设置用户信息 |
||||
|
this.$store.dispatch('GetInfo').then(res => { |
||||
|
this.$tab.reLaunch('/pages/home/index') |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
page { |
||||
|
background-color: #ffffff; |
||||
|
} |
||||
|
|
||||
|
.normal-login-container { |
||||
|
height: 100vh; |
||||
|
overflow: hidden; |
||||
|
width: 100%; |
||||
|
background-color: white; |
||||
|
|
||||
|
.bg{ |
||||
|
height: 45vh; |
||||
|
background-image: url('/static/svgs/lines.svg'); |
||||
|
background-size: 160%; |
||||
|
background-position: center; |
||||
|
background-color: #144F9B; |
||||
|
} |
||||
|
|
||||
|
.logo-content { |
||||
|
margin-top: -150px; |
||||
|
width: 100%; |
||||
|
font-size: 21px; |
||||
|
padding-top: 5%; |
||||
|
border-radius: 30px 30px 0 0; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: left; |
||||
|
image { |
||||
|
align-self: center; |
||||
|
border-radius: 4px; |
||||
|
} |
||||
|
.title { |
||||
|
text-align: center; |
||||
|
// margin-left: 2em; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.login-form-content { |
||||
|
text-align: center; |
||||
|
margin: 20px auto; |
||||
|
margin-top: 2%; |
||||
|
width: 80%; |
||||
|
|
||||
|
.input-item { |
||||
|
margin: 20px auto; |
||||
|
background-color: #f5f6f7; |
||||
|
height: 45px; |
||||
|
border-radius: 4px; |
||||
|
|
||||
|
.icon { |
||||
|
font-size: 38rpx; |
||||
|
margin-left: 10px; |
||||
|
color: #999; |
||||
|
} |
||||
|
|
||||
|
.input { |
||||
|
width: 100%; |
||||
|
font-size: 14px; |
||||
|
line-height: 20px; |
||||
|
text-align: left; |
||||
|
padding-left: 15px; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.login-btn { |
||||
|
|
||||
|
height: 45px; |
||||
|
} |
||||
|
|
||||
|
.reg { |
||||
|
margin-top: 15px; |
||||
|
} |
||||
|
|
||||
|
.xieyi { |
||||
|
color: #333; |
||||
|
margin-top: 16px; |
||||
|
} |
||||
|
|
||||
|
.login-code { |
||||
|
height: 38px; |
||||
|
float: right; |
||||
|
|
||||
|
.login-code-img { |
||||
|
height: 38px; |
||||
|
position: absolute; |
||||
|
margin-left: 10px; |
||||
|
width: 200rpx; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue