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> |
|||
<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 style="background-color: aliceblue;"> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="languageData.me.userType" :rightText="languageData.me.personalAccount" /> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="$t('me.info.nickname')" :rightText="user.fullName" /> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" :title="$t('me.info.registerDate')" :rightText="user.registerTime" /> |
|||
</uni-list> |
|||
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.contact')}}</view> |
|||
<uni-list> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" :title="$t('me.info.phone')" :rightText="user.phone" /> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" :title="$t('me.info.gender')" :rightText="getGender()" /> |
|||
</uni-list> |
|||
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.auth')}}</view> |
|||
<uni-list> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" :title="$t('me.info.reviewStatus')" :rightText="getStatus(user.status)" /> |
|||
<view v-if="user.status === 2"> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="$t('me.info.name')" :rightText="user.name" /> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" :title="$t('me.info.idCard')" :rightText="user.idCardNumber" /> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" :title="$t('me.info.expire')" :rightText="'2030/03/18'" /> |
|||
<uni-list-item v-if="user.userType == '0'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.pAddress')" :rightText="user.addr" /> |
|||
<uni-list-item v-if="user.userType == '1'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.mAddress')" :rightText="user.addr" /> |
|||
</view> |
|||
<view v-else style="margin-top: 10px;"> |
|||
<uni-list-item v-if="user.status == '3'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="languageData.me.failureReason" :rightText="user.failureReason" /> |
|||
<button @click="goAuth(0)" v-show="!['1','2','3'].includes(user.status)" class="submit-btn">{{languageData.me.authImme}}</button> |
|||
<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> |
|||
</uni-list> |
|||
</view> |
|||
<button @click="modifySimple(1)" v-show="user.status === '2' || true" class="submit-btn" style="border-radius: 10px;">{{languageData.settings.confirmMod}}</button> |
|||
<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> |
|||
<InfoItem :ph="languageData.me.personalAccount" :title="languageData.me.userType" |
|||
icon-name="person-filled" :ro="true"></InfoItem> |
|||
<InfoItem v-model="user.fullName" icon-name="person-filled" :title="$t('me.info.nickname')" :ro="!true"> |
|||
</InfoItem> |
|||
<InfoItem :ph="user.registerTime" icon-name="calendar-filled" :title="$t('me.info.registerDate')" |
|||
:ro="true"></InfoItem> |
|||
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.contact')}}</view> |
|||
<uni-list> |
|||
<InfoItem :ph="user.phone" :title="$t('me.info.phone')" |
|||
icon-name="phone-filled" :ro="true"></InfoItem> |
|||
<InfoItem v-model="user.email" :ph="languageData.me.email" :title="languageData.me.email" |
|||
icon-name="email-filled" :ro="false"></InfoItem> |
|||
<InfoItem v-model="user.merchantName" icon-name="location-filled" :title="languageData.functions.BelongingRegion" |
|||
:ro="false"> |
|||
<view @click="addrClick('a')"> |
|||
<u--input style="pointer-events: none;" :value="user.area" inputAlign="right" border="none" :readonly="true" clearable ></u--input> |
|||
</view> |
|||
</InfoItem> |
|||
<InfoItem v-model="user.address" :ph="languageData.me.addrDetail" :title="languageData.functions.detailedAddress" |
|||
icon-name="location-filled" :ro="false"></InfoItem> |
|||
<InfoItem v-show="false" v-model="user.commonContactAddress" :ph="languageData.me.address" |
|||
:title="languageData.me.address" icon-name="location-filled" :ro="false"></InfoItem> |
|||
</uni-list> |
|||
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.auth')}}</view> |
|||
<uni-list> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" |
|||
:title="$t('me.info.reviewStatus')" :rightText="getStatus(user.status)" /> |
|||
<view style="margin-top: 10px;"> |
|||
<uni-list-item v-if="user.status == '3'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" |
|||
:title="languageData.me.failureReason" :rightText="user.failureReason" /> |
|||
<button @click="goAuth(0)" v-show="!['1','2','3'].includes(user.status)" |
|||
class="submit-btn">{{languageData.me.authImme}}</button> |
|||
<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> |
|||
</uni-list> |
|||
</view> |
|||
<button @click="modifySimple()" v-show="['1','2','3'].includes(user.status)" class="submit-btn" |
|||
style="border-radius: 10px;">{{languageData.settings.confirmMod}}</button> |
|||
|
|||
<view v-show="false" 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 v-show="false" |
|||
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> |
|||
<u-picker :show="showAddr" ref="uPicker" |
|||
:columns="addrData.province" |
|||
@confirm="addrConf" @change="addrChg" |
|||
@cancel="addrClose"></u-picker> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<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 { |
|||
data() { |
|||
return { |
|||
imgList:['http://sss', 'http://sss'], |
|||
user: {}, |
|||
roleGroup: "", |
|||
postGroup: "", |
|||
languageData:{} |
|||
} |
|||
}, |
|||
onLoad() { |
|||
this.getUser(); |
|||
this.languageData = this.$languageData; |
|||
}, |
|||
watch:{ |
|||
languageData(){ |
|||
uni.setNavigationBarTitle({ |
|||
title: this.$languageData.navBar.userInfo |
|||
}); |
|||
export default { |
|||
components: { |
|||
InfoItem |
|||
}, |
|||
data() { |
|||
return { |
|||
texts: '0', |
|||
imgList: ['http://sss', 'http://sss'], |
|||
user: {}, |
|||
roleGroup: "", |
|||
postGroup: "", |
|||
languageData: {}, |
|||
addrData:{}, |
|||
showAddr: false, |
|||
} |
|||
}, |
|||
onLoad() { |
|||
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> |
|||
|
|||
<style lang="scss"> |
|||
page { |
|||
background-color: #ffffff; |
|||
} |
|||
.submit-btn { |
|||
width: 100%; |
|||
height: 88rpx; |
|||
line-height: 88rpx; |
|||
background: linear-gradient(135deg, #4B8BFF 0%, #3B7CFF 100%); |
|||
color: #FFFFFF; |
|||
font-size: 16px; |
|||
font-weight: 500; |
|||
border-radius: 44rpx; |
|||
margin-top: 30rpx; |
|||
box-shadow: 0 6rpx 16rpx rgba(59, 124, 255, 0.25); |
|||
transition: all 0.3s ease; |
|||
} |
|||
page { |
|||
background-color: #ffffff; |
|||
} |
|||
|
|||
.submit-btn { |
|||
width: 100%; |
|||
height: 88rpx; |
|||
line-height: 88rpx; |
|||
background: linear-gradient(135deg, #4B8BFF 0%, #3B7CFF 100%); |
|||
color: #FFFFFF; |
|||
font-size: 16px; |
|||
font-weight: 500; |
|||
border-radius: 44rpx; |
|||
margin-top: 30rpx; |
|||
box-shadow: 0 6rpx 16rpx rgba(59, 124, 255, 0.25); |
|||
transition: all 0.3s ease; |
|||
} |
|||
</style> |
@ -1,131 +1,189 @@ |
|||
<template> |
|||
<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> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="this.$languageData.me.accType" :right-text="$languageData.me.merchantAcc" /> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="this.$languageData.me.merchanrName" :rightText="user.merchantName"/> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" :title="$t('me.info.registerDate')" :rightText="user.registerTime" /> |
|||
</uni-list> |
|||
</view> |
|||
<view style="border-radius: 20px; background-color: white; padding:10px; margin-top: 10px;"> |
|||
<view style="font-weight: 500;">{{$t('me.info.contact')}}</view> |
|||
<uni-list> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" :title="$t('me.info.phone')" :rightText="user.phone" /> |
|||
</uni-list> |
|||
</view> |
|||
<view style="border-radius: 20px; background-color: white; padding:10px; margin-top: 10px; padding-bottom: 60rpx;"> |
|||
<view style="font-weight: 500;">{{$t('me.info.auth')}}</view> |
|||
<uni-list> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" :title="$t('me.info.reviewStatus')" :rightText="getStatus(user.status)" /> |
|||
<view v-if="user.status === 2"> |
|||
<!-- <uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" :title="this.$languageData.me.authenticationType" :rightText="'身份证'" /> --> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="$t('me.info.name')" :rightText="user.name" /> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" :title="$t('me.info.idCard')" :rightText="user.idCardNumber" /> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" :title="$t('me.info.expire')" :rightText="'2030/03/18'" /> |
|||
<uni-list-item v-if="user.userType == '0'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.pAddress')" :rightText="user.addr" /> |
|||
<uni-list-item v-if="user.userType == '1'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.mAddress')" :rightText="user.addr" /> |
|||
</view> |
|||
<view v-else style="margin-top: 10px;"> |
|||
<uni-list-item v-if="user.status == '3'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$languageData.me.failRes" :rightText="user.failureReason" /> |
|||
<button @click="goAuth(0)" v-show="!['1','2','3'].includes(user.status)" class="submit-btn">{{$languageData.me.authImme}}</button> |
|||
<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> |
|||
<view class="container-with-elep full-height-with-titile"> |
|||
|
|||
</uni-list> |
|||
<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" |
|||
@click="click" |
|||
></u--image> |
|||
</view> |
|||
<view style="border-radius: 20px; background-color: white; padding:10px;"> |
|||
<view style="font-weight: 500;">{{$t('me.info.basic')}}</view> |
|||
<InfoItem :ph="$languageData.me.merchantAcc" :title="languageData.me.userType" icon-name="person-filled" |
|||
:ro="true"></InfoItem> |
|||
<InfoItem v-model="user.merchantName" icon-name="person-filled" :title="languageData.me.merchanrName" |
|||
:ro="false"> |
|||
</InfoItem> |
|||
<InfoItem :ph="user.registerTime" icon-name="calendar-filled" :title="$t('me.info.registerDate')" |
|||
:ro="true"></InfoItem> |
|||
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.contact')}}</view> |
|||
<uni-list> |
|||
<InfoItem :ph="user.phone" :title="$t('me.info.phone')" |
|||
icon-name="phone-filled" :ro="true"></InfoItem> |
|||
<InfoItem v-model="user.contactPersonPhone" :ph="languageData.me.lePhone" |
|||
:title="languageData.me.lePhone" icon-name="phone-filled" :ro="false"></InfoItem> |
|||
<InfoItem v-model="user.contactPersonEmail" :ph="languageData.me.leMail" :title="languageData.me.leMail" |
|||
icon-name="email-filled" :ro="false"></InfoItem> |
|||
<InfoItem icon-name="location-filled" :title="languageData.me.runArea" |
|||
:ro="false"> |
|||
<view @click="addrClick('a')"> |
|||
<u--input style="pointer-events: none;" :value="user.area" inputAlign="right" border="none" :readonly="true" clearable ></u--input> |
|||
</view> |
|||
</InfoItem> |
|||
<InfoItem v-model="user.address" :ph="languageData.me.addrDetail" :title="languageData.me.addrDetail" |
|||
icon-name="location-filled" :ro="false"></InfoItem> |
|||
</uni-list> |
|||
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.auth')}}</view> |
|||
<uni-list> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" |
|||
:title="$t('me.info.reviewStatus')" :rightText="getStatus(user.status)" /> |
|||
<view style="margin-top: 10px;"> |
|||
<uni-list-item v-if="user.status == '3'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" |
|||
:title="languageData.me.failureReason" :rightText="user.failureReason" /> |
|||
<button @click="goAuth(0)" v-show="!['1','2','3'].includes(user.status)" |
|||
class="submit-btn">{{languageData.me.authImme}}</button> |
|||
<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> |
|||
</uni-list> |
|||
</view> |
|||
</view> |
|||
<button @click="modifySimple(1)" v-show="user.status === '2' || true" class="submit-btn" style="border-radius: 10px;">{{languageData.settings.confirmMod}}</button> |
|||
|
|||
</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> |
|||
</template> |
|||
|
|||
<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 { |
|||
data() { |
|||
return { |
|||
imgList:['http://sss', 'http://sss'], |
|||
user: {}, |
|||
roleGroup: "", |
|||
postGroup: "", |
|||
languageData:{} |
|||
} |
|||
}, |
|||
onLoad() { |
|||
this.getUser(); |
|||
this.languageData = this.$languageData; |
|||
}, |
|||
onNavigationBarButtonTap() { |
|||
this.$tab.navigateTo('/pages/mine/info/merchant/edit') |
|||
}, |
|||
methods: { |
|||
getUser() { |
|||
getMerchantProfile().then(response => { |
|||
this.user = response.data |
|||
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 |
|||
} |
|||
} |
|||
} |
|||
} |
|||
export default { |
|||
components: { |
|||
InfoItem |
|||
}, |
|||
data() { |
|||
return { |
|||
imgList: ['http://sss', 'http://sss'], |
|||
user: {}, |
|||
roleGroup: "", |
|||
postGroup: "", |
|||
languageData: {}, |
|||
showAddr: false, |
|||
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/merchant/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.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> |
|||
|
|||
<style lang="scss"> |
|||
page { |
|||
background-color: #ffffff; |
|||
} |
|||
.submit-btn { |
|||
width: 100%; |
|||
height: 88rpx; |
|||
line-height: 88rpx; |
|||
background: linear-gradient(135deg, #4B8BFF 0%, #3B7CFF 100%); |
|||
color: #FFFFFF; |
|||
font-size: 16px; |
|||
font-weight: 500; |
|||
border-radius: 44rpx; |
|||
margin-top: 30rpx; |
|||
box-shadow: 0 6rpx 16rpx rgba(59, 124, 255, 0.25); |
|||
transition: all 0.3s ease; |
|||
} |
|||
page { |
|||
background-color: #ffffff; |
|||
} |
|||
|
|||
.submit-btn { |
|||
width: 100%; |
|||
height: 88rpx; |
|||
line-height: 88rpx; |
|||
background: linear-gradient(135deg, #4B8BFF 0%, #3B7CFF 100%); |
|||
color: #FFFFFF; |
|||
font-size: 16px; |
|||
font-weight: 500; |
|||
border-radius: 44rpx; |
|||
margin-top: 30rpx; |
|||
box-shadow: 0 6rpx 16rpx rgba(59, 124, 255, 0.25); |
|||
transition: all 0.3s ease; |
|||
} |
|||
</style> |
@ -1,138 +1,190 @@ |
|||
<template> |
|||
<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> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="languageData.me.accType" :right-text="languageData.me.agentAcc" /> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="languageData.me.agentName" :rightText="user.agentName" /> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" :title="$t('me.info.registerDate')" :rightText="user.registerTime" /> |
|||
</uni-list> |
|||
</view> |
|||
<view style="border-radius: 20px; background-color: white; padding:10px; margin-top: 10px;"> |
|||
<view style="font-weight: 500;">{{$t('me.info.basic')}}</view> |
|||
<uni-list> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" :title="$t('me.info.phone')" :rightText="user.phone" /> |
|||
</uni-list> |
|||
</view> |
|||
<view style="border-radius: 20px; background-color: white; padding:10px; margin-top: 10px; padding-bottom: 60rpx;"> |
|||
<view style="font-weight: 500;">{{$t('me.info.auth')}}</view> |
|||
<uni-list> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" :title="$t('me.info.reviewStatus')" :rightText="getStatus(user.status)" /> |
|||
<view v-if="user.status === 2"> |
|||
<!-- // <uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" :title="'认证类型'" :rightText="'身份证'" /> --> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" :title="$t('me.info.name')" :rightText="user.name" /> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" :title="$t('me.info.idCard')" :rightText="user.idCardNumber" /> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" :title="$t('me.info.expire')" :rightText="'2030/03/18'" /> |
|||
<uni-list-item v-if="user.userType == '0'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.pAddress')" :rightText="user.addr" /> |
|||
<uni-list-item v-if="user.userType == '1'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.mAddress')" :rightText="user.addr" /> |
|||
<uni-list-item v-if="user.userType == '2'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="$t('me.info.mAddress')" :rightText="user.addr" /> |
|||
</view> |
|||
<view v-else style="margin-top: 10px;"> |
|||
<uni-list-item v-if="user.status == '3'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" :title="languageData.me.failRes" :rightText="user.failureReason" /> |
|||
<button @click="goAuth(0)" v-show="!['1','2','3'].includes(user.status)" class="submit-btn">{{languageData.me.authImme}}</button> |
|||
<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> |
|||
<button @click="modifySimple(1)" v-show="user.status === '2' || true" class="submit-btn">{{languageData.settings.confirmMod}}</button> |
|||
</view> |
|||
<view class="container-with-elep full-height-with-titile"> |
|||
|
|||
|
|||
</uni-list> |
|||
<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" |
|||
@click="click" |
|||
></u--image> |
|||
</view> |
|||
<view style="border-radius: 20px; background-color: white; padding:10px;"> |
|||
<view style="font-weight: 500;">{{$t('me.info.basic')}}</view> |
|||
<InfoItem :ph="languageData.me.agentAcc" :title="languageData.me.userType" icon-name="person-filled" |
|||
:ro="true"></InfoItem> |
|||
<InfoItem v-model="user.agentName" icon-name="person-filled" :title="languageData.me.agentName" :ro="false"> |
|||
</InfoItem> |
|||
<InfoItem :ph="user.registerTime" icon-name="calendar-filled" :title="$t('me.info.registerDate')" |
|||
:ro="true"></InfoItem> |
|||
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.contact')}}</view> |
|||
<uni-list> |
|||
<InfoItem :ph="user.phone" :title="$t('me.info.phone')" |
|||
icon-name="phone-filled" :ro="true"></InfoItem> |
|||
<InfoItem v-model="user.contactPersonPhone" :ph="languageData.me.lePhone" |
|||
:title="languageData.me.lePhone" icon-name="phone-filled" :ro="false"></InfoItem> |
|||
<InfoItem v-model="user.contactPersonEmail" :ph="languageData.me.leMail" :title="languageData.me.leMail" |
|||
icon-name="email-filled" :ro="false"></InfoItem> |
|||
<InfoItem icon-name="location-filled" :title="languageData.me.runArea" |
|||
:ro="false"> |
|||
<view @click="addrClick('a')"> |
|||
<u--input style="pointer-events: none;" :value="user.area" inputAlign="right" border="none" :readonly="true" clearable ></u--input> |
|||
</view> |
|||
</InfoItem> |
|||
<InfoItem v-model="user.address" :ph="languageData.me.addrDetail" :title="languageData.me.addrDetail" |
|||
icon-name="location-filled" :ro="false"></InfoItem> |
|||
<InfoItem v-show="false" v-model="user.contactAddress" :ph="languageData.me.addrDetail" |
|||
:title="languageData.me.mAddress" icon-name="location-filled" :ro="false"></InfoItem> |
|||
</uni-list> |
|||
<view style="font-weight: 500; margin-top: 20px;">{{$t('me.info.auth')}}</view> |
|||
<uni-list> |
|||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'vip-filled'}" |
|||
:title="$t('me.info.reviewStatus')" :rightText="getStatus(user.status)" /> |
|||
<view style="margin-top: 10px;"> |
|||
<uni-list-item v-if="user.status == '3'" showExtraIcon="true" :extraIcon="{type: 'location-filled'}" |
|||
:title="languageData.me.failureReason" :rightText="user.failureReason" /> |
|||
<button @click="goAuth(0)" v-show="!['1','2','3'].includes(user.status)" |
|||
class="submit-btn">{{languageData.me.authImme}}</button> |
|||
<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> |
|||
</uni-list> |
|||
</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> |
|||
</template> |
|||
|
|||
<script> |
|||
import { getAgentProfile } from "@/api/system/user" |
|||
import { |
|||
getAgentProfile, |
|||
updateAgentProfile |
|||
} from "@/api/system/user" |
|||
import InfoItem from '@/components/auth/InfoItem.vue' |
|||
import { addr } from "@/config/addr"; |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
imgList:['http://sss', 'http://sss'], |
|||
user: {}, |
|||
roleGroup: "", |
|||
postGroup: "", |
|||
languageData:{} |
|||
} |
|||
}, |
|||
onLoad() { |
|||
this.getUser(); |
|||
this.languageData = this.$languageData; |
|||
}, |
|||
watch:{ |
|||
languageData(){ |
|||
uni.setNavigationBarTitle({ |
|||
title: this.$languageData.navBar.userInfo |
|||
}); |
|||
export default { |
|||
components: { |
|||
InfoItem |
|||
}, |
|||
data() { |
|||
return { |
|||
imgList: ['http://sss', 'http://sss'], |
|||
user: {}, |
|||
roleGroup: "", |
|||
postGroup: "", |
|||
languageData: {}, |
|||
showAddr: false, |
|||
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> |
|||
|
|||
<style lang="scss"> |
|||
page { |
|||
background-color: #ffffff; |
|||
} |
|||
.submit-btn { |
|||
width: 100%; |
|||
height: 88rpx; |
|||
line-height: 88rpx; |
|||
background: linear-gradient(135deg, #4B8BFF 0%, #3B7CFF 100%); |
|||
color: #FFFFFF; |
|||
font-size: 16px; |
|||
font-weight: 500; |
|||
border-radius: 44rpx; |
|||
margin-top: 30rpx; |
|||
box-shadow: 0 6rpx 16rpx rgba(59, 124, 255, 0.25); |
|||
transition: all 0.3s ease; |
|||
} |
|||
page { |
|||
background-color: #ffffff; |
|||
} |
|||
|
|||
.submit-btn { |
|||
width: 100%; |
|||
height: 88rpx; |
|||
line-height: 88rpx; |
|||
background: linear-gradient(135deg, #4B8BFF 0%, #3B7CFF 100%); |
|||
color: #FFFFFF; |
|||
font-size: 16px; |
|||
font-weight: 500; |
|||
border-radius: 44rpx; |
|||
margin-top: 30rpx; |
|||
box-shadow: 0 6rpx 16rpx rgba(59, 124, 255, 0.25); |
|||
transition: all 0.3s ease; |
|||
} |
|||
</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