提交 75bde22a 编写于 作者: DCloud_JSON's avatar DCloud_JSON 提交者: study夏羽

重新整理后第1次提交

上级 c40982b1
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
}; };
}, },
computed: { computed: {
innerText() { innerText() {
if (this.reverseNumber == 0) return this.$t('common.getVerifyCode'); if (this.reverseNumber == 0) return this.$t('common.getVerifyCode');
return this.$t('smsCode.resendVerifyCode')+ '('+this.reverseNumber+'s)'; return this.$t('smsCode.resendVerifyCode')+ '('+this.reverseNumber+'s)';
...@@ -84,77 +85,48 @@ ...@@ -84,77 +85,48 @@
"type": this.codeType "type": this.codeType
}, },
}, },
}).then(({result})=>{ success: ({result}) => {
console.log(result); console.log(result);
if (result.code === 0) { if(result.code===0){
uni.showToast({ uni.showToast({
title: this.$t('smsCode.sendSuccessTip'), title: this.$t('smsCode.sendSuccessTip'),
icon: 'none' icon: 'none'
}); });
this.reverseNumber = Number(this.count); this.reverseNumber = Number(this.count);
this.getCode(); this.getCode();
this.$emit('getCode'); this.$emit('getCode');
} else { }else{
uni.showModal({ uni.showModal({
content: result.msg, content: result.msg,
showCancel: false showCancel: false
}); });
}
} }
return result
}) })
},
// uniCloud.callFunction({ getCode() {
// name:'uni-id-cf', if (this.reverseNumber == 0) {
// data:{ clearTimeout(this.reverseTimer);
// action:'sendSmsCode', this.reverseTimer = null;
// params:{ return;
// "mobile": this.phone, }
// "type": this.codeType this.reverseNumber--;
// }, this.reverseTimer = setTimeout(() => {
// }, this.getCode();
// success: ({result}) => { }, 1000)
// console.log(result);
// if(result.code===0){
// uni.showToast({
// title: this.$t('smsCode.sendSuccessTip'),
// icon: 'none'
// });
// this.reverseNumber = Number(this.count);
// this.getCode();
// this.$emit('getCode');
// }else{
// uni.showModal({
// content: result.msg,
// showCancel: false
// });
// }
// }
// })
},
getCode() {
if (this.reverseNumber == 0) {
clearTimeout(this.reverseTimer);
this.reverseTimer = null;
return;
} }
this.reverseNumber--;
this.reverseTimer = setTimeout(() => {
this.getCode();
}, 1000)
} }
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
view { view{
display: flex; display: flex;
box-sizing: border-box; box-sizing: border-box;
flex-direction: column; flex-direction: column;
} }
/* #endif */
/* #endif */
.short-code-btn { .short-code-btn {
width: 200rpx; width: 200rpx;
height: 85rpx; height: 85rpx;
...@@ -164,12 +136,10 @@ ...@@ -164,12 +136,10 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.inner-text { .inner-text {
font-size: 28rpx; font-size: 28rpx;
color: #AAAAAA; color: #AAAAAA;
} }
.inner-text-active { .inner-text-active {
color: #007aff; color: #007aff;
} }
......
{ {
"name": "统一应用基本项目", "name": "uuuu",
"appid": "请点击重新获取", "appid": "请点击重新获取",
"description": "云端一体应用快速开发模版", "description": "云端一体应用快速开发模版",
"versionName": "1.0.0", "versionName": "1.0.0",
...@@ -8,28 +8,23 @@ ...@@ -8,28 +8,23 @@
"app-plus": { "app-plus": {
"locales": { "locales": {
"en": { "en": {
// 英文 "name": "uni-starter",
"name": "uni-starter", // 应用名称
"android": { "android": {
"strings": { "strings": {
//Android平台自定义字符串
"CustomKey": "CustomValue" "CustomKey": "CustomValue"
} }
}, },
"ios": { "ios": {
"privacyDescription": { "privacyDescription": {
//iOS平台隐私访问描述信息
"NSPhotoLibraryUsageDescription": "access to the user’s photo library(read)" "NSPhotoLibraryUsageDescription": "access to the user’s photo library(read)"
}, },
"infoPlist": { "infoPlist": {
//iOS平台自定义InfoPlist.strings
"CustomKey": "CustomValue" "CustomKey": "CustomValue"
} }
} }
}, },
"zh": { "zh": {
// 中文(简体) "name": "统一应用基本项目"
"name": "统一应用基本项目" // 应用名称
} }
}, },
"privacy": { "privacy": {
...@@ -224,3 +219,4 @@ ...@@ -224,3 +219,4 @@
"_spaceID": "", "_spaceID": "",
"vueVersion": "2" "vueVersion": "2"
} }
...@@ -2,39 +2,39 @@ ...@@ -2,39 +2,39 @@
<view class="warp"> <view class="warp">
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<status-bar /> <status-bar />
<!-- #endif --> <!-- #endif -->
<!-- banner --> <!-- banner -->
<unicloud-db ref="bannerdb" v-slot:default="{data, loading, error, options}" collection="opendb-banner" <unicloud-db ref="bannerdb" v-slot:default="{data, loading, error, options}" collection="opendb-banner"
field="_id,bannerfile,open_url,title" @load="onqueryload"> field="_id,bannerfile,open_url,title" @load="onqueryload">
<!-- 当无banner数据时显示占位图 --> <!-- 当无banner数据时显示占位图 -->
<image v-if="!(loading||data.length)" class="banner-image" src="/static/grid/empty.png" mode="aspectFill" :draggable="false" /> <image v-if="!(loading||data.length)" class="banner-image" src="/static/grid/empty.png" mode="aspectFill" :draggable="false" />
<uni-swiper-dot v-else class="uni-swiper-dot-box" @clickItem="clickItem" :info="data" <uni-swiper-dot v-else class="uni-swiper-dot-box" @clickItem="clickItem" :info="data"
:current="current" field="content"> :current="current" field="content">
<swiper class="swiper-box" @change="changeSwiper" :current="swiperDotIndex"> <swiper class="swiper-box" @change="changeSwiper" :current="swiperDotIndex">
<swiper-item v-for="(item, index) in data" :key="item._id"> <swiper-item v-for="(item, index) in data" :key="item._id">
<view class="swiper-item" @click="clickBannerItem(item)"> <view class="swiper-item" @click="clickBannerItem(item)">
<image class="banner-image" :src="item.bannerfile.url" mode="aspectFill" :draggable="false" /> <image class="banner-image" :src="item.bannerfile.url" mode="aspectFill" :draggable="false" />
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
</uni-swiper-dot> </uni-swiper-dot>
</unicloud-db> </unicloud-db>
<!-- 宫格 -->
<!-- 宫格 -->
<uni-section :title="$t('grid.grid')" style="margin: 0;" type="line"></uni-section> <uni-section :title="$t('grid.grid')" style="margin: 0;" type="line"></uni-section>
<view class="example-body"> <view class="example-body">
<uni-grid class="uni-grid-box" :column="3" :highlight="true" @change="change"> <uni-grid class="uni-grid-box" :column="3" :highlight="true" @change="change">
<template v-for="(item,i) in gridList"> <template v-for="(item,i) in gridList">
<uni-grid-item :index="i" :key="i" <uni-grid-item :index="i" :key="i"
v-if="i<3 || i>2&&i<6&&hasLogin || i>5&&uniIDHasRole('admin')" v-if="i<3 || i>2&&i<6&&hasLogin || i>5&&uniIDHasRole('admin')"
> >
<view class="grid-item-box" style="background-color: #fff;"> <view class="grid-item-box" style="background-color: #fff;">
<image :src="'/static/grid/c'+(i+1)+'.png'" class="image" mode="aspectFill" /> <image :src="'/static/grid/c'+(i+1)+'.png'" class="image" mode="aspectFill" />
<text class="text">{{item}}</text> <text class="text">{{item}}</text>
</view> </view>
</uni-grid-item> </uni-grid-item>
</template> </template>
</uni-grid> </uni-grid>
</view> </view>
...@@ -60,25 +60,24 @@ ...@@ -60,25 +60,24 @@
computed: { computed: {
...mapGetters({ ...mapGetters({
hasLogin: 'user/hasLogin' hasLogin: 'user/hasLogin'
}) })
}, },
onLoad() { onLoad() {
console.log(uni.getStorageSync('uni_id_token'),"00000000000000000000"); console.log(uni.getStorageSync('uni_id_token'),"00000000000000000000");
let gridList = [] let gridList = []
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
gridList.push( this.$t('grid.visibleToAll') ) gridList.push( this.$t('grid.visibleToAll') )
} }
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
gridList.push( this.$t('grid.invisibleToTourists') ) gridList.push( this.$t('grid.invisibleToTourists') )
} }
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
gridList.push( this.$t('grid.adminVisible') ) gridList.push( this.$t('grid.adminVisible') )
} }
this.gridList = gridList this.gridList = gridList
}, },
methods: { methods: {
change(e) { change(e) {
// console.log("e: ",e);
uni.showToast({ uni.showToast({
title:this.$t('grid.clickTip') + " " + `${e.detail.index}` + " " + this.$t('grid.clickTipGrid'), title:this.$t('grid.clickTip') + " " + `${e.detail.index}` + " " + this.$t('grid.clickTipGrid'),
icon: 'none' icon: 'none'
...@@ -87,7 +86,7 @@ ...@@ -87,7 +86,7 @@
/** /**
* banner加载后触发的回调 * banner加载后触发的回调
*/ */
onqueryload(data) { onqueryload(data) {
}, },
changeSwiper(e) { changeSwiper(e) {
this.current = e.detail.current this.current = e.detail.current
...@@ -221,4 +220,4 @@ ...@@ -221,4 +220,4 @@
.uni-input-placeholder { .uni-input-placeholder {
font-size: 28rpx; font-size: 28rpx;
} }
</style> </style>
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
<refreshBox @refresh="refresh" :loading="loading"></refreshBox> <refreshBox @refresh="refresh" :loading="loading"></refreshBox>
<!-- #endif --> <!-- #endif -->
<!-- 列表渲染 --> <!-- 列表渲染 -->
<uni-list-item :to="'/pages/list/detail?id='+item._id+'&title='+item.title" v-for="(item,index) in data" <uni-list-item :to="'/pages/list/detail?id='+item._id+'&title='+item.title" v-for="(item,index) in data"
:key="index"> :key="index">
...@@ -40,9 +39,8 @@ ...@@ -40,9 +39,8 @@
format="yyyy-MM-dd" :threshold="[60000, 2592000000]" /> format="yyyy-MM-dd" :threshold="[60000, 2592000000]" />
</view> </view>
</view> </view>
</template> </template>
</uni-list-item> </uni-list-item>
<!-- 加载状态:上拉加载更多,加载中,没有更多数据了,加载错误 --> <!-- 加载状态:上拉加载更多,加载中,没有更多数据了,加载错误 -->
<uni-list-item> <uni-list-item>
<template v-slot:body> <template v-slot:body>
...@@ -116,8 +114,12 @@ ...@@ -116,8 +114,12 @@
// title:"获取定位中" // title:"获取定位中"
// }); // });
//默认h5端不获取定位 //默认h5端不获取定位
// let location = await gps.getLocation({geocode:true}) // #ifndef H5
// console.log(location); let location = await gps.getLocation({
geocode: true
})
console.log(location);
// #endif
// if(location){ // if(location){
// uni.showToast({ // uni.showToast({
// title: JSON.stringify(location), // title: JSON.stringify(location),
...@@ -150,6 +152,7 @@ ...@@ -150,6 +152,7 @@
// #ifdef APP-NVUE // #ifdef APP-NVUE
this.showRefresh = false this.showRefresh = false
// #endif // #endif
console.log('end'); console.log('end');
}) })
console.log('refresh'); console.log('refresh');
...@@ -240,3 +243,4 @@ ...@@ -240,3 +243,4 @@
/* #endif */ /* #endif */
} }
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="content"> <view class="content">
<!-- 顶部文字 --> <!-- 顶部文字 -->
<text class="tit">{{$t('common.verifyCodePlaceholder')}}</text> <text class="tit">{{$t('common.verifyCodePlaceholder')}}</text>
<text class="tip">{{tipText}}</text> <text class="tip">{{tipText}}</text>
<uni-forms> <uni-forms>
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) --> <!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-easyinput type="number" class="easyinput" :inputBorder="false" <uni-easyinput type="number" class="easyinput" :inputBorder="false"
...@@ -33,13 +33,13 @@ ...@@ -33,13 +33,13 @@
}, },
canSubmit(){ canSubmit(){
return this.code.length==6; return this.code.length==6;
} }
}, },
onLoad({phoneNumber,phoneArea}) { onLoad({phoneNumber,phoneArea}) {
this.phone = phoneNumber; this.phone = phoneNumber;
}, },
onReady() { onReady() {
// this.$refs.sendSmsCode.start(); // this.$refs.sendSmsCode.start();
}, },
methods: { methods: {
async submit(){ //完成并提交 async submit(){ //完成并提交
...@@ -64,27 +64,26 @@ ...@@ -64,27 +64,26 @@
return result return result
}) })
// uniCloud.callFunction({ // uniCloud.callFunction({
// name:'uni-id-cf', // name:'uni-id-cf',
// data:{ // data:{
// action:'loginBySms', // action:'loginBySms',
// params:{ // params:{
// "mobile":this.phone, // "mobile":this.phone,
// "code":this.code // "code":this.code
// }, // },
// }, // },
// success: ({result}) => { // success: ({result}) => {
// if(result.code === 0){ // if(result.code === 0){
// this.loginSuccess(result) // this.loginSuccess(result)
// }else{ // }else{
// uni.showModal({ // uni.showModal({
// content: result.msg, // content: result.msg,
// showCancel: false // showCancel: false
// }); // });
// } // }
// } // }
// }) // })
} }
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="captcha-box" v-if="captchaBase64"> <view class="captcha-box" v-if="captchaBase64">
<image class="captcha-img" @click="createCaptcha" :src="captchaBase64" mode="widthFix"></image> <image class="captcha-img" @click="createCaptcha" :src="captchaBase64" mode="widthFix"></image>
<input type="text" class="input-box captcha" :inputBorder="false" v-model="captcha" :placeholder="$t('pwdLogin.verifyCodePlaceholder')"/> <input type="text" class="input-box captcha" :inputBorder="false" v-model="captcha" :placeholder="$t('pwdLogin.verifyCodePlaceholder')"/>
</view> </view>
<uni-agreements @setAgree="agree = $event"></uni-agreements> <uni-agreements @setAgree="agree = $event"></uni-agreements>
<button class="send-btn" :disabled="!canLogin" :type="canLogin?'primary':'default'" <button class="send-btn" :disabled="!canLogin" :type="canLogin?'primary':'default'"
@click="pwdLogin">{{$t('pwdLogin.login')}}</button> @click="pwdLogin">{{$t('pwdLogin.login')}}</button>
...@@ -98,59 +98,59 @@ ...@@ -98,59 +98,59 @@
} }
return result return result
}) })
// 下边是可以登录 // 下边是可以登录
// uniCloud.callFunction({ // uniCloud.callFunction({
// name:'uni-id-cf', // name:'uni-id-cf',
// data:{ // data:{
// action:'login', // action:'login',
// params:{ // params:{
// "username": this.username, // "username": this.username,
// "password": this.password, // "password": this.password,
// "captcha":this.captcha // "captcha":this.captcha
// }, // },
// }, // },
// success: ({result}) => { // success: ({result}) => {
// console.log(result); // console.log(result);
// if (result.code === 0) { // if (result.code === 0) {
// this.loginSuccess(result) // this.loginSuccess(result)
// } else { // } else {
// if (result.needCaptcha) { // if (result.needCaptcha) {
// uni.showToast({ // uni.showToast({
// title: result.msg, // title: result.msg,
// icon: 'none' // icon: 'none'
// }); // });
// this.createCaptcha() // this.createCaptcha()
// }else{ // }else{
// uni.showModal({ // uni.showModal({
// title: this.$t('common').error, // title: this.$t('common').error,
// content: result.msg, // content: result.msg,
// showCancel: false, // showCancel: false,
// confirmText: this.$t('common').gotIt // confirmText: this.$t('common').gotIt
// }); // });
// } // }
// } // }
// } // }
// }) // })
}, },
createCaptcha(){ createCaptcha(){
uniCloud.callFunction({ uniCloud.callFunction({
name:'uni-id-cf', name:'uni-id-cf',
data:{ data:{
action:'createCaptcha', action:'createCaptcha',
params:{ params:{
scene: "login" scene: "login"
}, },
}, },
success: ({result}) => { success: ({result}) => {
if (result.code === 0) { if (result.code === 0) {
this.captchaBase64 = result.captchaBase64 this.captchaBase64 = result.captchaBase64
}else{ }else{
uni.showModal({ uni.showModal({
content: result.msg, content: result.msg,
showCancel: false showCancel: false
}); });
} }
} }
}) })
}, },
/* 前往注册 */ /* 前往注册 */
......
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
export default { export default {
mixins: [mixin], mixins: [mixin],
data() { data() {
return { return {
lock:false, lock:false,
formData: { formData: {
"phone": "", "phone": "",
'pwd': '', 'pwd': '',
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
} }
} }
}, },
computed: { computed: {
canSubmit() { canSubmit() {
return this.isPhone && this.isPwd && this.isCode; return this.isPhone && this.isPwd && this.isCode;
}, },
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
}, },
onLoad(event) { onLoad(event) {
if (event && event.phoneNumber) { if (event && event.phoneNumber) {
this.formData.phone = event.phoneNumber; this.formData.phone = event.phoneNumber;
this.lock = true this.lock = true
} }
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
...@@ -162,28 +162,28 @@ ...@@ -162,28 +162,28 @@
return result return result
}) })
// uniCloud.callFunction({ // uniCloud.callFunction({
// name:'uni-id-cf', // name:'uni-id-cf',
// data:{ // data:{
// action:'resetPwdBySmsCode', // action:'resetPwdBySmsCode',
// params:{ // params:{
// "mobile": this.formData.phone, // "mobile": this.formData.phone,
// "code": this.formData.code, // "code": this.formData.code,
// "password": this.formData.pwd // "password": this.formData.pwd
// }, // },
// }, // },
// success: ({result}) => { // success: ({result}) => {
// console.log(result); // console.log(result);
// uni.showToast({ // uni.showToast({
// title: result.msg, // title: result.msg,
// icon: 'none' // icon: 'none'
// }); // });
// if (result.code === 0) { // if (result.code === 0) {
// uni.navigateBack() // uni.navigateBack()
// } // }
// } // }
// }) // })
}) })
} }
} }
} }
......
...@@ -43,7 +43,7 @@ import mixin from '../common/login-page.mixin.js'; ...@@ -43,7 +43,7 @@ import mixin from '../common/login-page.mixin.js';
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.$t('register.navigationBarTitle') title: this.$t('register.navigationBarTitle')
}) })
}, },
methods: { methods: {
/** /**
* 触发表单提交 * 触发表单提交
...@@ -90,23 +90,23 @@ import mixin from '../common/login-page.mixin.js'; ...@@ -90,23 +90,23 @@ import mixin from '../common/login-page.mixin.js';
console.log(result); console.log(result);
return result return result
}) })
// uniCloud.callFunction({ // uniCloud.callFunction({
// name:'uni-id-cf', // name:'uni-id-cf',
// data:{ // data:{
// action:'register', // action:'register',
// params, // params,
// }, // },
// success: ({result}) => { // success: ({result}) => {
// console.log(result); // console.log(result);
// if(result.code === 0){ // if(result.code === 0){
// this.loginSuccess(result) // this.loginSuccess(result)
// }else{ // }else{
// uni.showModal({ // uni.showModal({
// content: result.msg, // content: result.msg,
// showCancel: false // showCancel: false
// }); // });
// } // }
// } // }
// }) // })
} }
} }
...@@ -120,8 +120,8 @@ import mixin from '../common/login-page.mixin.js'; ...@@ -120,8 +120,8 @@ import mixin from '../common/login-page.mixin.js';
} }
.send-btn{ .send-btn{
margin-top: 5px; margin-top: 5px;
} }
.uni-container ::v-deep .uni-forms-item__label{ .uni-container ::v-deep .uni-forms-item__label{
width: 15px !important; width: 15px !important;
} }
</style> </style>
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
...mapGetters({ ...mapGetters({
'userInfo': 'user/info', 'userInfo': 'user/info',
'hasLogin': 'user/hasLogin', 'hasLogin': 'user/hasLogin',
}), }),
i18nEnable(){ i18nEnable(){
return getApp().globalData.config.i18n.enable return getApp().globalData.config.i18n.enable
} }
}, },
onLoad() { onLoad() {
......
...@@ -23,26 +23,26 @@ ...@@ -23,26 +23,26 @@
return { return {
currenPhoneArea: '', currenPhoneArea: '',
formData: { formData: {
phone: "", phone:"",
code: "" code:""
} }
} }
}, },
computed: { computed: {
tipText() { tipText() {
return this.$t('common.verifyCodeSend') + `${this.currenPhoneArea} ${this.formData.phone}。` + this.$t( return this.$t('common.verifyCodeSend')+ `${this.currenPhoneArea} ${this.formData.phone}。` + this.$t('common.passwordDigits')
'common.passwordDigits')
}, },
canSubmit() { canSubmit() {
return true //this.isPhone() && this.isCode(); return true//this.isPhone() && this.isCode();
} }
}, },
onLoad(event) { onLoad(event) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.$t('bindMobile.navigationBarTitle') title:this.$t('bindMobile.navigationBarTitle')
}) })
}, },
onReady() {}, onReady() {
},
methods: { methods: {
...mapMutations({ ...mapMutations({
setUserInfo: 'user/login' setUserInfo: 'user/login'
...@@ -116,13 +116,11 @@ ...@@ -116,13 +116,11 @@
padding: 50rpx; padding: 50rpx;
padding-top: 10px; padding-top: 10px;
} }
/* #ifndef APP-NVUE || VUE3 */
/* #ifndef APP-NVUE || VUE3 */
.box /deep/ .uni-easyinput__content { .box /deep/ .uni-easyinput__content {
height: 50px; height: 50px;
} }
/* #endif */
/* #endif */
.input-box { .input-box {
width: 100%; width: 100%;
margin-top: 16px; margin-top: 16px;
...@@ -136,4 +134,4 @@ ...@@ -136,4 +134,4 @@
width: 650rpx; width: 650rpx;
margin-top: 15px; margin-top: 15px;
} }
</style> </style>
...@@ -6,21 +6,21 @@ ...@@ -6,21 +6,21 @@
<view class="item"> <view class="item">
<text>{{$t('userinfo.ProfilePhoto')}}</text> <text>{{$t('userinfo.ProfilePhoto')}}</text>
<cloud-image @click="uploadAvatarImg" v-if="avatar_file" :src="avatar_file.url" width="50px" height="50px"></cloud-image> <cloud-image @click="uploadAvatarImg" v-if="avatar_file" :src="avatar_file.url" width="50px" height="50px"></cloud-image>
<uni-icons @click="uploadAvatarImg" v-else class="chooseAvatar" type="plusempty" size="30" color="#dddddd"></uni-icons> <uni-icons @click="uploadAvatarImg" v-else class="chooseAvatar" type="plusempty" size="30" color="#dddddd"></uni-icons>
</view> </view>
</template> </template>
</uni-list-item> </uni-list-item>
<uni-list-item class="item" @click="setNickname('')" :title="$t('userinfo.nickname')" :rightText="userInfo.nickname||$t('userinfo.notSet')" link> <uni-list-item class="item" @click="setNickname('')" :title="$t('userinfo.nickname')" :rightText="userInfo.nickname||$t('userinfo.notSet')" link>
</uni-list-item> </uni-list-item>
<uni-list-item class="item" @click="bindMobile" :title="$t('userinfo.phoneNumber')" :rightText="userInfo.mobile||$t('userinfo.notSpecified')" link> <uni-list-item class="item" @click="bindMobile" :title="$t('userinfo.phoneNumber')" :rightText="userInfo.mobile||$t('userinfo.notSpecified')" link>
</uni-list-item> </uni-list-item>
</uni-list> </uni-list>
<uni-popup ref="dialog" type="dialog"> <uni-popup ref="dialog" type="dialog">
<uni-popup-dialog mode="input" :value="userInfo.nickname" @confirm="setNickname" :title="$t('userinfo.setNickname')" <uni-popup-dialog mode="input" :value="userInfo.nickname" @confirm="setNickname" :title="$t('userinfo.setNickname')"
:placeholder="$t('userinfo.setNicknamePlaceholder')"> :placeholder="$t('userinfo.setNicknamePlaceholder')">
</uni-popup-dialog> </uni-popup-dialog>
</uni-popup> </uni-popup>
<uni-bindMobileByMpWeixin ref="uni-bindMobileByMpWeixin"></uni-bindMobileByMpWeixin> <uni-bindMobileByMpWeixin ref="uni-bindMobileByMpWeixin"></uni-bindMobileByMpWeixin>
</view> </view>
</template> </template>
<script> <script>
...@@ -43,12 +43,12 @@ ...@@ -43,12 +43,12 @@
}, },
uniToken:'' uniToken:''
} }
}, },
onLoad() { onLoad() {
this.uniToken = uni.getStorageSync('uni_id_token') this.uniToken = uni.getStorageSync('uni_id_token')
console.log("uniToken: ",this.uniToken); console.log("uniToken: ",this.uniToken);
this.univerifyStyle.authButton.title = this.$t('userinfo.bindPhoneNumber') this.univerifyStyle.authButton.title = this.$t('userinfo.bindPhoneNumber')
this.univerifyStyle.otherLoginButton.title = this.$t('userinfo.bindOtherLogin') this.univerifyStyle.otherLoginButton.title = this.$t('userinfo.bindOtherLogin')
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.$t('userinfo.navigationBarTitle') title: this.$t('userinfo.navigationBarTitle')
...@@ -58,17 +58,17 @@ ...@@ -58,17 +58,17 @@
...mapGetters({ ...mapGetters({
userInfo: 'user/info', userInfo: 'user/info',
login: 'user/hasLogin' login: 'user/hasLogin'
}), }),
avatar_file() { avatar_file() {
if (this.userInfo.avatar_file && this.userInfo.avatar_file.url) { if (this.userInfo.avatar_file && this.userInfo.avatar_file.url) {
return this.userInfo.avatar_file return this.userInfo.avatar_file
} }
} }
}, },
methods: { methods: {
...mapMutations({ ...mapMutations({
setUserInfo: 'user/login' setUserInfo: 'user/login'
}), }),
bindMobile() { bindMobile() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.preLogin({ uni.preLogin({
...@@ -80,13 +80,13 @@ ...@@ -80,13 +80,13 @@
this.bindMobileBySmsCode() this.bindMobileBySmsCode()
} }
}) })
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
this.$refs['uni-bindMobileByMpWeixin'].open() this.$refs['uni-bindMobileByMpWeixin'].open()
// #endif // #endif
// #ifdef H5 // #ifdef H5
//...去用验证码绑定 //...去用验证码绑定
this.bindMobileBySmsCode() this.bindMobileBySmsCode()
// #endif // #endif
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
} }
}) })
}, },
bindMobileBySmsCode() { bindMobileBySmsCode() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/ucenter/userinfo/bind-mobile/bind-mobile' url: '/pages/ucenter/userinfo/bind-mobile/bind-mobile'
}) })
...@@ -280,10 +280,10 @@ ...@@ -280,10 +280,10 @@
.chooseAvatar { .chooseAvatar {
border: dotted 1px #ddd; border: dotted 1px #ddd;
border-radius: 10px; border-radius: 10px;
text-align: center; text-align: center;
width: 50px; width: 50px;
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册