进入uniapp
This commit is contained in:
193
im-uniapp/wx/personDetail/QRcode.vue
Normal file
193
im-uniapp/wx/personDetail/QRcode.vue
Normal file
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<view class="bgColor">
|
||||
<watermark></watermark>
|
||||
<view class="QRcode-box">
|
||||
<view class="person-wx" v-if="userInfo">
|
||||
<view class="person-wx-user">
|
||||
<image class="person-wx-avatar" @click="$fc.previewImagesolo(userInfo.portrait)" :src="userInfo.portrait" mode="aspectFill"></image>
|
||||
<view class="person-wx-user-detail">
|
||||
<view class="person-wx-nikename">
|
||||
<text class="text">{{userInfo.nickName}}</text>
|
||||
<view class="wxfont person-wx-nikename-icon" :class="{'nv':userInfo.gender=='0'}" v-if="userInfo.gender=='0'"></view>
|
||||
<view class="wxfont person-wx-nikename-icon" :class="{'nan':userInfo.gender=='1'}" v-if="userInfo.gender=='1'"></view>
|
||||
</view>
|
||||
<text class="person-wx-name">
|
||||
微聊号:{{userInfo.chatNo}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="QRcode-img">
|
||||
<image :src="QRimg" mode="aspectFill" @click="resetQrCode"></image>
|
||||
</view>
|
||||
<view class="QRcode-tips">扫一扫上面的二维码图案,加我微聊</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
QRimg:''
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.$http.request({
|
||||
url: '/my/getQrCode',
|
||||
success: (res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.QRimg=res.data.data
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
computed:{
|
||||
userInfo(){
|
||||
return this.$store.state.userInfo
|
||||
}
|
||||
},
|
||||
onShow(){},
|
||||
methods: {
|
||||
resetQrCode(){
|
||||
this.$http.request({
|
||||
url: '/my/resetQrCode',
|
||||
success: (res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.QRimg=res.data.data
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
switch (e.index) {
|
||||
case 0:
|
||||
uni.showActionSheet({
|
||||
// itemList: ['换个样式', '保存到手机', '扫描二维码', '重置二维码'],
|
||||
itemList: ['重置二维码', '保存到手机'],
|
||||
success: (res)=> {
|
||||
switch (res.tapIndex) {
|
||||
case 0:
|
||||
uni.showLoading({title:'重置中'})
|
||||
this.resetQrCode()
|
||||
break;
|
||||
case 1:
|
||||
// #ifdef APP-PLUS
|
||||
this.$fc.plusSaveBase64Img({base64:this.QRimg})
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
this.$fc.h5SaveBase64Img({base64:this.QRimg})
|
||||
// #endif
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
fail: (res)=> {
|
||||
console.log(res.errMsg);
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* #ifdef APP-PLUS */
|
||||
.bgColor{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #EDEDED;
|
||||
overflow: auto;
|
||||
}
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
page{
|
||||
background: #EDEDED;
|
||||
}
|
||||
/* #endif */
|
||||
.QRcode-box{
|
||||
width: 666rpx;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
padding: 32rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 24rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.QRcode-img{
|
||||
width: 600rpx;
|
||||
height: 600rpx;
|
||||
}
|
||||
.QRcode-img image{width: 100%;height: 100%;}
|
||||
.QRcode-tips{
|
||||
margin-top: 6rpx;
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
.person-wx {
|
||||
width: 100%;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.person-wx-user {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.person-wx-avatar {
|
||||
width: 120rpx;
|
||||
min-width: 120rpx;
|
||||
height: 120rpx;
|
||||
margin-right: 42rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.person-wx-user-detail {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 440rpx;
|
||||
}
|
||||
|
||||
.person-wx-nikename {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
display: flex;flex-direction: row;align-items: center;
|
||||
}
|
||||
.person-wx-nikename .text{
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 480rpx;
|
||||
}
|
||||
.person-wx-name {
|
||||
color: #666;
|
||||
font-size: 28rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
.person-wx-nikename-icon.nan{
|
||||
color: #007AFF;
|
||||
}
|
||||
.person-wx-nikename-icon.nv{
|
||||
color: #FF5A5F;
|
||||
}
|
||||
.person-wx-nikename-icon{
|
||||
margin-right: auto;
|
||||
}
|
||||
</style>
|
||||
130
im-uniapp/wx/personDetail/editAddress.vue
Normal file
130
im-uniapp/wx/personDetail/editAddress.vue
Normal file
@@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<view class="bgColor">
|
||||
<watermark></watermark>
|
||||
<form @submit="subform" class="remarkForm">
|
||||
<view class="remarkForm-item">
|
||||
<zmm-city-picker v-model="city"></zmm-city-picker>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
city:'',
|
||||
// rangeCityarr: [[], []],
|
||||
form:{
|
||||
provinces:'',//省份
|
||||
city:''//城市
|
||||
},
|
||||
list:[{
|
||||
label:'男',
|
||||
value:'1'
|
||||
},{
|
||||
label:'女',
|
||||
value:'0'
|
||||
}]
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.form.userId=e.userId
|
||||
this.city=e.provinces ? e.provinces+','+e.city : '请选择'
|
||||
this.form.provinces=e.provinces
|
||||
this.form.city=e.city
|
||||
},
|
||||
methods: {
|
||||
subform(e) {
|
||||
var rules = {
|
||||
gender: {
|
||||
rules: [{
|
||||
checkType: "required",
|
||||
errorMsg: "请填写内容"
|
||||
}]
|
||||
}
|
||||
};
|
||||
var formData = JSON.parse(JSON.stringify(this.form));
|
||||
var city=this.city.split(',')
|
||||
formData.provinces=city[0]
|
||||
formData.city=city[1]
|
||||
var checkRes = this.$zmmFormCheck.check(formData, rules);
|
||||
if (checkRes) {
|
||||
this.$http.request({
|
||||
url: '/my/editCity',
|
||||
method: 'POST',
|
||||
data:JSON.stringify(formData),
|
||||
success: (res) => {
|
||||
if (res.data.code == 200) {
|
||||
uni.navigateBack({
|
||||
delta:1
|
||||
}).then(()=>{
|
||||
uni.showToast({
|
||||
title:'修改成功',
|
||||
icon:'success'
|
||||
})
|
||||
this.$store.dispatch('get_UserInfo')
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: this.$zmmFormCheck.error,
|
||||
icon: "none",
|
||||
position: 'bottom'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
switch (e.index) {
|
||||
case 0:
|
||||
this.subform()
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* #ifdef APP-PLUS */
|
||||
.bgColor{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #EDEDED;
|
||||
overflow: auto;
|
||||
}
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
page{
|
||||
background: #EDEDED;
|
||||
}
|
||||
/* #endif */
|
||||
.remarkForm{
|
||||
// padding:24rpx 44rpx;
|
||||
display: flex;flex-direction: column;
|
||||
}
|
||||
.remarkForm-item{
|
||||
display: flex;flex-direction: column;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.remarkForm-textarea{
|
||||
width: 100%;
|
||||
line-height: 48rpx;
|
||||
min-height: 240rpx;
|
||||
}
|
||||
.remarkForm-label{font-size: 26rpx;color: #5C5C5C;margin-bottom: 15rpx;}
|
||||
.remarkForm-input{
|
||||
border-radius: 12rpx;
|
||||
background-color: #F7F7F7;
|
||||
height: 110rpx;
|
||||
line-height: 110rpx;
|
||||
padding:0 34rpx;
|
||||
}
|
||||
</style>
|
||||
123
im-uniapp/wx/personDetail/editGender.vue
Normal file
123
im-uniapp/wx/personDetail/editGender.vue
Normal file
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<view class="bgColor">
|
||||
<watermark></watermark>
|
||||
<form @submit="subform" class="remarkForm">
|
||||
<view class="remarkForm-item">
|
||||
<zmm-radio-group :range="list" v-model="form.gender"></zmm-radio-group>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form:{
|
||||
gender:'',
|
||||
userId:''
|
||||
},
|
||||
list:[{
|
||||
label:'男',
|
||||
value:'1'
|
||||
},{
|
||||
label:'女',
|
||||
value:'2'
|
||||
}]
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.form.userId=e.userId
|
||||
this.form.gender=e.gender
|
||||
},
|
||||
methods: {
|
||||
subform(e) {
|
||||
var rules = {
|
||||
gender: {
|
||||
rules: [{
|
||||
checkType: "required",
|
||||
errorMsg: "请填写内容"
|
||||
}]
|
||||
}
|
||||
};
|
||||
var formData = JSON.parse(JSON.stringify(this.form));
|
||||
var checkRes = this.$zmmFormCheck.check(formData, rules);
|
||||
if (checkRes) {
|
||||
this.$http.request({
|
||||
url: '/my/editGender',
|
||||
method: 'POST',
|
||||
data:JSON.stringify(formData),
|
||||
success: (res) => {
|
||||
if (res.data.code == 200) {
|
||||
uni.navigateBack({
|
||||
delta:1
|
||||
}).then(()=>{
|
||||
uni.showToast({
|
||||
title:'修改成功',
|
||||
icon:'success'
|
||||
})
|
||||
this.$store.dispatch('get_UserInfo')
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: this.$zmmFormCheck.error,
|
||||
icon: "none",
|
||||
position: 'bottom'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
switch (e.index) {
|
||||
case 0:
|
||||
this.subform()
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* #ifdef APP-PLUS */
|
||||
.bgColor{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #EDEDED;
|
||||
overflow: auto;
|
||||
}
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
page{
|
||||
background: #EDEDED;
|
||||
}
|
||||
/* #endif */
|
||||
.remarkForm{
|
||||
// padding:24rpx 44rpx;
|
||||
display: flex;flex-direction: column;
|
||||
}
|
||||
.remarkForm-item{
|
||||
display: flex;flex-direction: column;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.remarkForm-textarea{
|
||||
width: 100%;
|
||||
line-height: 48rpx;
|
||||
min-height: 240rpx;
|
||||
}
|
||||
.remarkForm-label{font-size: 26rpx;color: #5C5C5C;margin-bottom: 15rpx;}
|
||||
.remarkForm-input{
|
||||
border-radius: 12rpx;
|
||||
background-color: #F7F7F7;
|
||||
height: 110rpx;
|
||||
line-height: 110rpx;
|
||||
padding:0 34rpx;
|
||||
}
|
||||
</style>
|
||||
101
im-uniapp/wx/personDetail/editIntro.vue
Normal file
101
im-uniapp/wx/personDetail/editIntro.vue
Normal file
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<view>
|
||||
<watermark></watermark>
|
||||
<form @submit="subform" class="remarkForm">
|
||||
<view class="remarkForm-item">
|
||||
<view class="remarkForm-label">个性签名 (发表你的个性签名吧)</view>
|
||||
<input class="remarkForm-input" placeholder="个性签名" type="text" v-model="form.intro" />
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form:{
|
||||
intro:'',
|
||||
userId:''
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.form.userId=e.userId
|
||||
this.form.intro=e.intro
|
||||
},
|
||||
methods: {
|
||||
subform(e) {
|
||||
var rules = {
|
||||
intro: {
|
||||
rules: [{
|
||||
checkType: "required",
|
||||
errorMsg: "请填写内容"
|
||||
}]
|
||||
}
|
||||
};
|
||||
var formData = JSON.parse(JSON.stringify(this.form));
|
||||
var checkRes = this.$zmmFormCheck.check(formData, rules);
|
||||
if (checkRes) {
|
||||
this.$http.request({
|
||||
url: '/my/editIntro',
|
||||
method: 'POST',
|
||||
data:JSON.stringify(formData),
|
||||
success: (res) => {
|
||||
if (res.data.code == 200) {
|
||||
uni.navigateBack({
|
||||
delta:1
|
||||
}).then(()=>{
|
||||
uni.showToast({
|
||||
title:'修改成功',
|
||||
icon:'success'
|
||||
})
|
||||
this.$store.dispatch('get_UserInfo')
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: this.$zmmFormCheck.error,
|
||||
icon: "none",
|
||||
position: 'bottom'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
switch (e.index) {
|
||||
case 0:
|
||||
this.subform()
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.remarkForm{
|
||||
padding:24rpx 44rpx;
|
||||
display: flex;flex-direction: column;
|
||||
}
|
||||
.remarkForm-item{
|
||||
display: flex;flex-direction: column;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.remarkForm-textarea{
|
||||
width: 100%;
|
||||
line-height: 48rpx;
|
||||
min-height: 240rpx;
|
||||
}
|
||||
.remarkForm-label{font-size: 26rpx;color: #5C5C5C;margin-bottom: 15rpx;}
|
||||
.remarkForm-input{
|
||||
border-radius: 12rpx;
|
||||
background-color: #F7F7F7;
|
||||
height: 110rpx;
|
||||
line-height: 110rpx;
|
||||
padding:0 34rpx;
|
||||
}
|
||||
</style>
|
||||
101
im-uniapp/wx/personDetail/editNikeName.vue
Normal file
101
im-uniapp/wx/personDetail/editNikeName.vue
Normal file
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<view>
|
||||
<watermark></watermark>
|
||||
<form @submit="subform" class="remarkForm">
|
||||
<view class="remarkForm-item">
|
||||
<view class="remarkForm-label">名字(好名字可以让朋友更容易记住你)</view>
|
||||
<input class="remarkForm-input" placeholder="名字" type="text" v-model="form.nickName" />
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form:{
|
||||
nickName:'',
|
||||
userId:''
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.form.userId=e.userId
|
||||
this.form.nickName=e.nickName
|
||||
},
|
||||
methods: {
|
||||
subform(e) {
|
||||
var rules = {
|
||||
nickName: {
|
||||
rules: [{
|
||||
checkType: "required",
|
||||
errorMsg: "请填写内容"
|
||||
}]
|
||||
}
|
||||
};
|
||||
var formData = JSON.parse(JSON.stringify(this.form));
|
||||
var checkRes = this.$zmmFormCheck.check(formData, rules);
|
||||
if (checkRes) {
|
||||
this.$http.request({
|
||||
url: '/my/editNick',
|
||||
method: 'POST',
|
||||
data:JSON.stringify(formData),
|
||||
success: (res) => {
|
||||
if (res.data.code == 200) {
|
||||
uni.navigateBack({
|
||||
delta:1
|
||||
}).then(()=>{
|
||||
uni.showToast({
|
||||
title:'修改成功',
|
||||
icon:'success'
|
||||
})
|
||||
this.$store.dispatch('get_UserInfo')
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: this.$zmmFormCheck.error,
|
||||
icon: "none",
|
||||
position: 'bottom'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
switch (e.index) {
|
||||
case 0:
|
||||
this.subform()
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.remarkForm{
|
||||
padding:24rpx 44rpx;
|
||||
display: flex;flex-direction: column;
|
||||
}
|
||||
.remarkForm-item{
|
||||
display: flex;flex-direction: column;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.remarkForm-textarea{
|
||||
width: 100%;
|
||||
line-height: 48rpx;
|
||||
min-height: 240rpx;
|
||||
}
|
||||
.remarkForm-label{font-size: 26rpx;color: #5C5C5C;margin-bottom: 15rpx;}
|
||||
.remarkForm-input{
|
||||
border-radius: 12rpx;
|
||||
background-color: #F7F7F7;
|
||||
height: 110rpx;
|
||||
line-height: 110rpx;
|
||||
padding:0 34rpx;
|
||||
}
|
||||
</style>
|
||||
131
im-uniapp/wx/personDetail/editPass.vue
Normal file
131
im-uniapp/wx/personDetail/editPass.vue
Normal file
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<view>
|
||||
<watermark></watermark>
|
||||
<form @submit="subform" class="remarkForm">
|
||||
<view class="remarkForm-item">
|
||||
<view class="remarkForm-label">原密码</view>
|
||||
<input class="remarkForm-input" placeholder="请填写原密码" type="password" v-model="form.password" />
|
||||
</view>
|
||||
<view class="remarkForm-item">
|
||||
<view class="remarkForm-label">新密码 (密码最长8-16位且由数字与字母组合)</view>
|
||||
<input class="remarkForm-input" placeholder="请填写新密码" type="password" v-model="form.pwd" />
|
||||
</view>
|
||||
<view class="remarkForm-item">
|
||||
<view class="remarkForm-label">确认密码</view>
|
||||
<input class="remarkForm-input" placeholder="请再次填写新密码" type="password" v-model="form.repwd" />
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form:{
|
||||
password:'',
|
||||
pwd:'',
|
||||
repwd:''
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
|
||||
},
|
||||
methods: {
|
||||
subform(e) {
|
||||
var rules = {
|
||||
password: {
|
||||
rules: [{
|
||||
checkType: "required",
|
||||
errorMsg: "请填写原密码"
|
||||
}]
|
||||
},
|
||||
pwd: {
|
||||
rules: [{
|
||||
checkType: "required",
|
||||
errorMsg: "请填写新密码"
|
||||
},{
|
||||
checkType: "reg",
|
||||
checkRule:/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,16}$/,
|
||||
errorMsg: "密码8-16位,由数字与字母组成"
|
||||
}]
|
||||
},
|
||||
repwd: {
|
||||
rules: [{
|
||||
checkType: "required",
|
||||
errorMsg: "请再次填写新密码"
|
||||
},{
|
||||
checkType: "same",
|
||||
checkRule:"pwd",
|
||||
errorMsg: "两次密码不一致"
|
||||
}]
|
||||
}
|
||||
};
|
||||
var formData = JSON.parse(JSON.stringify(this.form));
|
||||
var checkRes = this.$zmmFormCheck.check(formData, rules);
|
||||
formData.password=this.$md5.hex_md5(formData.password)
|
||||
formData.pwd=this.$md5.hex_md5(formData.pwd)
|
||||
if (checkRes) {
|
||||
this.$http.request({
|
||||
url: '/my/editPass',
|
||||
method: 'POST',
|
||||
data:JSON.stringify(formData),
|
||||
success: (res) => {
|
||||
if (res.data.code == 200) {
|
||||
uni.showToast({
|
||||
title:'修改成功',
|
||||
icon:'success'
|
||||
})
|
||||
this.form={
|
||||
password:'',
|
||||
pwd:'',
|
||||
repwd:''
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: this.$zmmFormCheck.error,
|
||||
icon: "none",
|
||||
position: 'bottom'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
switch (e.index) {
|
||||
case 0:
|
||||
this.subform()
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.remarkForm{
|
||||
padding:24rpx 44rpx;
|
||||
display: flex;flex-direction: column;
|
||||
}
|
||||
.remarkForm-item{
|
||||
display: flex;flex-direction: column;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.remarkForm-textarea{
|
||||
width: 100%;
|
||||
line-height: 48rpx;
|
||||
min-height: 240rpx;
|
||||
}
|
||||
.remarkForm-label{font-size: 26rpx;color: #5C5C5C;margin-bottom: 15rpx;}
|
||||
.remarkForm-input{
|
||||
border-radius: 12rpx;
|
||||
background-color: #F7F7F7;
|
||||
height: 110rpx;
|
||||
line-height: 110rpx;
|
||||
padding:0 34rpx;
|
||||
}
|
||||
</style>
|
||||
101
im-uniapp/wx/personDetail/editchatNo.vue
Normal file
101
im-uniapp/wx/personDetail/editchatNo.vue
Normal file
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<view>
|
||||
<watermark></watermark>
|
||||
<form @submit="subform" class="remarkForm">
|
||||
<view class="remarkForm-item">
|
||||
<view class="remarkForm-label">微聊号</view>
|
||||
<input class="remarkForm-input" placeholder="请输入" type="text" v-model="form.chatNo" />
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form:{
|
||||
chatNo:'',
|
||||
userId:''
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.form.userId=e.userId
|
||||
this.form.chatNo=e.chatNo
|
||||
},
|
||||
methods: {
|
||||
subform(e) {
|
||||
var rules = {
|
||||
chatNo: {
|
||||
rules: [{
|
||||
checkType: "required",
|
||||
errorMsg: "请填写内容"
|
||||
}]
|
||||
}
|
||||
};
|
||||
var formData = JSON.parse(JSON.stringify(this.form));
|
||||
var checkRes = this.$zmmFormCheck.check(formData, rules);
|
||||
if (checkRes) {
|
||||
this.$http.request({
|
||||
url: '/my/editChatNo',
|
||||
method: 'POST',
|
||||
data:JSON.stringify(formData),
|
||||
success: (res) => {
|
||||
if (res.data.code == 200) {
|
||||
uni.navigateBack({
|
||||
delta:1
|
||||
}).then(()=>{
|
||||
uni.showToast({
|
||||
title:'修改成功',
|
||||
icon:'success'
|
||||
})
|
||||
this.$store.dispatch('get_UserInfo')
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: this.$zmmFormCheck.error,
|
||||
icon: "none",
|
||||
position: 'bottom'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
switch (e.index) {
|
||||
case 0:
|
||||
this.subform()
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.remarkForm{
|
||||
padding:24rpx 44rpx;
|
||||
display: flex;flex-direction: column;
|
||||
}
|
||||
.remarkForm-item{
|
||||
display: flex;flex-direction: column;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.remarkForm-textarea{
|
||||
width: 100%;
|
||||
line-height: 48rpx;
|
||||
min-height: 240rpx;
|
||||
}
|
||||
.remarkForm-label{font-size: 26rpx;color: #5C5C5C;margin-bottom: 15rpx;}
|
||||
.remarkForm-input{
|
||||
border-radius: 12rpx;
|
||||
background-color: #F7F7F7;
|
||||
height: 110rpx;
|
||||
line-height: 110rpx;
|
||||
padding:0 34rpx;
|
||||
}
|
||||
</style>
|
||||
186
im-uniapp/wx/personDetail/index.vue
Normal file
186
im-uniapp/wx/personDetail/index.vue
Normal file
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<view class="bgColor">
|
||||
<watermark></watermark>
|
||||
<view class="xw-tool-list">
|
||||
<view class="xw-tool-list-content">
|
||||
<view class="xw-tool-item">
|
||||
<text class="xw-tool-text">头像</text>
|
||||
<zmm-upload-avatar v-model="avatar" @change="avatarChange"></zmm-upload-avatar>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<tool-list-wx :list="list1" @itemClick="itemClick"></tool-list-wx>
|
||||
<tool-list-wx :list="list2" @itemClick="itemClick2"></tool-list-wx>
|
||||
<tool-list-wx :list="list3" @itemClick="itemClick3"></tool-list-wx>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
avatar:this.$store.state.userInfo.portrait,
|
||||
list2:[{
|
||||
title: '二维码名片',
|
||||
path: '#',
|
||||
else:[{
|
||||
type: 'img',
|
||||
content: '../../static/wx/t05.png'
|
||||
}]
|
||||
}]
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
userInfo(){
|
||||
return this.$store.state.userInfo
|
||||
},
|
||||
list1(){
|
||||
return [{
|
||||
title: '名字',
|
||||
path: '#',
|
||||
else:[{
|
||||
type: 'text',
|
||||
content: this.$store.state.userInfo.nickName
|
||||
}]
|
||||
},{
|
||||
title: '微聊号',
|
||||
path: '#',
|
||||
else:[{
|
||||
type: 'text',
|
||||
content: this.$store.state.userInfo.chatNo
|
||||
}]
|
||||
}]
|
||||
},
|
||||
list3(){
|
||||
return [{
|
||||
title: '性别',
|
||||
path: '#',
|
||||
else:[{
|
||||
type: 'text',
|
||||
content: this.$store.state.userInfo.genderLabel
|
||||
}]
|
||||
},{
|
||||
title: '地区',
|
||||
path: '#',
|
||||
else:[{
|
||||
type: 'text',
|
||||
content: this.$store.state.userInfo.provinces+' '+this.$store.state.userInfo.city
|
||||
}]
|
||||
},{
|
||||
title: '个性签名',
|
||||
path: '#',
|
||||
else:[{
|
||||
type: 'text',
|
||||
content: this.$store.state.userInfo.intro
|
||||
}]
|
||||
}]
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
methods: {
|
||||
itemClick(e,i){
|
||||
switch (i){
|
||||
case 0:
|
||||
uni.navigateTo({
|
||||
url:'editNikeName?userId='+this.userInfo.userId+'&nickName='+this.userInfo.nickName
|
||||
})
|
||||
break;
|
||||
case 1:
|
||||
uni.navigateTo({
|
||||
url:'editchatNo?userId='+this.userInfo.userId+'&chatNo='+this.userInfo.chatNo
|
||||
})
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
itemClick2(e,i){
|
||||
switch (i){
|
||||
case 0:
|
||||
uni.navigateTo({
|
||||
url:'QRcode'
|
||||
})
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
itemClick3(e,i){
|
||||
switch (i){
|
||||
case 0:
|
||||
uni.navigateTo({
|
||||
url:'editGender?userId='+this.userInfo.userId+'&gender='+this.userInfo.gender
|
||||
})
|
||||
break;
|
||||
case 1:
|
||||
uni.navigateTo({
|
||||
url:'editAddress?userId='+this.userInfo.userId+'&provinces='+this.userInfo.provinces+'&city='+this.userInfo.city
|
||||
})
|
||||
break;
|
||||
case 2:
|
||||
uni.navigateTo({
|
||||
url:'editIntro?userId='+this.userInfo.userId+'&intro='+this.userInfo.intro
|
||||
})
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
avatarChange(e){
|
||||
this.$http.request({
|
||||
url: '/my/editPortrait',
|
||||
method: 'POST',
|
||||
data:JSON.stringify({portrait:e}),
|
||||
success: (res) => {
|
||||
if (res.data.code == 200) {
|
||||
uni.showToast({
|
||||
title:'修改成功',
|
||||
icon:'none'
|
||||
})
|
||||
this.$store.dispatch('get_UserInfo')
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* #ifdef APP-PLUS */
|
||||
.bgColor{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #EDEDED;
|
||||
overflow: auto;
|
||||
}
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
page{
|
||||
background: #EDEDED;
|
||||
}
|
||||
/* #endif */
|
||||
.xw-tool-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #ffffff;
|
||||
border-bottom: 1px #eee solid;
|
||||
}
|
||||
|
||||
.xw-tool-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding: 26rpx 24rpx;
|
||||
}
|
||||
.xw-tool-item:nth-last-child(1) {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.xw-tool-text {
|
||||
margin-right: auto;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user