头像
This commit is contained in:
parent
f946789c8e
commit
46a5948463
@ -3,10 +3,19 @@ import request from '@/utils/request'
|
|||||||
|
|
||||||
//------------------博主、通告主-----------------------
|
//------------------博主、通告主-----------------------
|
||||||
//查询博主详情
|
//查询博主详情
|
||||||
export function bloggerDetail(userId) {
|
export function queryDetail(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/member/member/bloggerDetail/' + userId,
|
url: '/member/member/queryDetail',
|
||||||
method: 'get'
|
method: 'get',
|
||||||
|
params:params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//保存博主
|
||||||
|
export function uniSaveMember(data) {
|
||||||
|
return request({
|
||||||
|
url: '/member/member/uniSaveMember',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@
|
|||||||
getStrData
|
getStrData
|
||||||
} from '@/utils/auth.js'
|
} from '@/utils/auth.js'
|
||||||
import {
|
import {
|
||||||
bloggerDetail
|
queryDetail
|
||||||
} from '@/api/business/member.js'
|
} from '@/api/business/member.js'
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@ -215,7 +215,6 @@
|
|||||||
popupImgUrl: "",
|
popupImgUrl: "",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {},
|
|
||||||
onShow() {
|
onShow() {
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -225,7 +224,7 @@
|
|||||||
mounted() {
|
mounted() {
|
||||||
if (null != getJSONData(constant.userInfo)) {
|
if (null != getJSONData(constant.userInfo)) {
|
||||||
this.userInfo = getJSONData(constant.userInfo)
|
this.userInfo = getJSONData(constant.userInfo)
|
||||||
this.getBloggerDetail()
|
this.getDetail()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -240,11 +239,12 @@
|
|||||||
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
|
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
|
||||||
this.$refs.popup.open(type)
|
this.$refs.popup.open(type)
|
||||||
},
|
},
|
||||||
getBloggerDetail() {
|
getDetail() {
|
||||||
bloggerDetail(this.userInfo.userId).then(res => {
|
queryDetail({userId:this.userInfo.userId,userType:this.localUserType}).then(res => {
|
||||||
this.userInfo.tfansNum = res.data.tfansNum.toString()
|
this.userInfo.tfansNum = res.data.tfansNum.toString()
|
||||||
this.userInfo.pointsBalance = res.data.pointsBalance.toString()
|
this.userInfo.pointsBalance = res.data.pointsBalance.toString()
|
||||||
this.userInfo.report = res.data.report.toString()
|
this.userInfo.report = res.data.report.toString()
|
||||||
|
this.userInfo.avatar = this.imageUrl+res.data.avatar
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -254,6 +254,7 @@
|
|||||||
changeUserType(type)
|
changeUserType(type)
|
||||||
this.localUserType = type
|
this.localUserType = type
|
||||||
this.$emit('update:nowUserType', this.localUserType)
|
this.$emit('update:nowUserType', this.localUserType)
|
||||||
|
this.getDetail()
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
handleToInfo() {
|
handleToInfo() {
|
||||||
@ -284,7 +285,7 @@
|
|||||||
* 跳转编辑页
|
* 跳转编辑页
|
||||||
*/
|
*/
|
||||||
goEdit() {
|
goEdit() {
|
||||||
this.$tab.navigateTo('/pages/mine/set/my-info')
|
this.$tab.navigateTo('/pages/mine/set/my-info?userType='+this.localUserType+'&userId='+this.userInfo.userId)
|
||||||
},
|
},
|
||||||
viewNewPeople() {
|
viewNewPeople() {
|
||||||
this.$tab.navigateTo(
|
this.$tab.navigateTo(
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<view class="form-data-box">
|
<view class="form-data-box">
|
||||||
<!-- 基础表单校验 -->
|
<!-- 基础表单校验 -->
|
||||||
<uni-forms ref="valiForm" :rules="rules" :modelValue="valiFormData">
|
<uni-forms ref="valiForm" :rules="rules" :modelValue="valiFormData">
|
||||||
<uni-forms-item labelWidth="280rpx" label="头像" required name="avatar">
|
<uni-forms-item labelWidth="280rpx" label="头像" name="avatar">
|
||||||
<uni-file-picker small="true" :value="fileList" :sizeType="sizeType" @select="afterRead"
|
<uni-file-picker small="true" :value="fileList" :sizeType="sizeType" @select="afterRead"
|
||||||
@delete="deleteFile" limit="1"></uni-file-picker>
|
@delete="deleteFile" limit="1"></uni-file-picker>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
@ -18,15 +18,15 @@
|
|||||||
<uni-forms-item labelWidth="280rpx" label="绑定手机号" required name="userName">
|
<uni-forms-item labelWidth="280rpx" label="绑定手机号" required name="userName">
|
||||||
<uni-easyinput disabled v-model="valiFormData.userName" />
|
<uni-easyinput disabled v-model="valiFormData.userName" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item labelWidth="280rpx" label="收款码" required name="tRecipientImage">
|
<uni-forms-item labelWidth="280rpx" label="收款码" name="trecipientImage">
|
||||||
<uni-file-picker small="true" :value="recipientImageList" :sizeType="sizeType"
|
<uni-file-picker small="true" :value="recipientImageList" :sizeType="sizeType"
|
||||||
@select="afterReadRecipient" @delete="deleteFileRecipient" limit="1"></uni-file-picker>
|
@select="afterReadRecipient" @delete="deleteFileRecipient" limit="1"></uni-file-picker>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item labelWidth="280rpx" label="收款码真实姓名" required name="tRecipientName">
|
<uni-forms-item labelWidth="280rpx" label="收款码真实姓名" name="trecipientName">
|
||||||
<uni-easyinput v-model="valiFormData.tRecipientName" placeholder="请输入" />
|
<uni-easyinput v-model="valiFormData.trecipientName" placeholder="请输入" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item labelWidth="280rpx" label="通告报名免打扰" required name="tOpenDisturb">
|
<uni-forms-item labelWidth="280rpx" label="通告报名免打扰" name="topenDisturb">
|
||||||
<uni-data-checkbox v-model="valiFormData.tOpenDisturb" :localdata="ranges" />
|
<uni-data-checkbox v-model="valiFormData.topenDisturb" :localdata="ranges" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</uni-forms>
|
</uni-forms>
|
||||||
<button type="primary" style="background-color: #FC2B49;" @click="submit('valiForm')">提交</button>
|
<button type="primary" style="background-color: #FC2B49;" @click="submit('valiForm')">提交</button>
|
||||||
@ -38,17 +38,25 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
||||||
|
import config from '@/config'
|
||||||
|
import {
|
||||||
|
queryDetail,uniSaveMember
|
||||||
|
} from '@/api/business/member.js'
|
||||||
|
import upload from '@/utils/upload'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
navigationBarVue
|
navigationBarVue
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
userType:'',
|
||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
//头像数组
|
//头像数组
|
||||||
fileList: [],
|
fileList: [],
|
||||||
|
fileImageUrl:[],
|
||||||
//收款码数组
|
//收款码数组
|
||||||
recipientImageList: [],
|
recipientImageList: [],
|
||||||
|
recipientImageUrl: [],
|
||||||
ranges: [{
|
ranges: [{
|
||||||
text: '开启',
|
text: '开启',
|
||||||
value: "1"
|
value: "1"
|
||||||
@ -62,18 +70,18 @@
|
|||||||
nickName: "",
|
nickName: "",
|
||||||
phonenumber: "",
|
phonenumber: "",
|
||||||
userName: "",
|
userName: "",
|
||||||
tRecipientImage: "",
|
trecipientImage: "",
|
||||||
tRecipientName: "",
|
trecipientName: "",
|
||||||
tOpenDisturb: "0"
|
topenDisturb: "0"
|
||||||
},
|
},
|
||||||
// 校验规则
|
// 校验规则
|
||||||
rules: {
|
rules: {
|
||||||
avatar: {
|
// avatar: {
|
||||||
rules: [{
|
// rules: [{
|
||||||
required: true,
|
// required: true,
|
||||||
errorMessage: '头像不能为空'
|
// errorMessage: '头像不能为空'
|
||||||
}]
|
// }]
|
||||||
},
|
// },
|
||||||
nickName: {
|
nickName: {
|
||||||
rules: [{
|
rules: [{
|
||||||
required: true,
|
required: true,
|
||||||
@ -86,35 +94,76 @@
|
|||||||
errorMessage: '联系方式不能为空'
|
errorMessage: '联系方式不能为空'
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
tRecipientImage: {
|
// trecipientImage: {
|
||||||
rules: [{
|
// rules: [{
|
||||||
required: true,
|
// required: true,
|
||||||
errorMessage: '收款码不能为空'
|
// errorMessage: '收款码不能为空'
|
||||||
}]
|
// }]
|
||||||
},
|
// },
|
||||||
tRecipientName: {
|
// trecipientName: {
|
||||||
rules: [{
|
// rules: [{
|
||||||
required: true,
|
// required: true,
|
||||||
errorMessage: '收款码真实姓名不能为空'
|
// errorMessage: '收款码真实姓名不能为空'
|
||||||
}]
|
// }]
|
||||||
},
|
// },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad(options){
|
||||||
|
this.userType = options.userType
|
||||||
|
this.userId = options.userId
|
||||||
|
this.initData(options.userType,options.userId)
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goMyBlackList() {
|
goMyBlackList() {
|
||||||
this.$tab.navigateTo('/pages/mine/set/black-list')
|
this.$tab.navigateTo('/pages/mine/set/black-list')
|
||||||
},
|
},
|
||||||
submit(ref) {
|
submit(ref) {
|
||||||
|
this.valiFormData.avatar = this.fileImageUrl.join(',');
|
||||||
|
this.valiFormData.trecipientImage = this.recipientImageUrl.join(',');
|
||||||
|
let that = this
|
||||||
this.$refs[ref].validate().then(res => {
|
this.$refs[ref].validate().then(res => {
|
||||||
console.log('success', res);
|
uniSaveMember(that.valiFormData).then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `校验通过`
|
icon: 'success',
|
||||||
})
|
duration: 2000,
|
||||||
|
title: '保存成功'
|
||||||
|
});
|
||||||
|
uni.navigateBack()
|
||||||
|
})
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log('err', err);
|
console.log('err', err);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**初始化数据*/
|
||||||
|
initData(userType,userId){
|
||||||
|
this.fileList = []
|
||||||
|
this.fileImageUrl = []
|
||||||
|
this.recipientImageList = []
|
||||||
|
this.recipientImageUrl = []
|
||||||
|
queryDetail({userType:userType,userId:userId}).then(res=>{
|
||||||
|
console.log(res,131)
|
||||||
|
this.valiFormData = res.data
|
||||||
|
if (this.valiFormData.avatar != null && this.valiFormData.avatar != ''){
|
||||||
|
this.fileImageUrl = this.valiFormData.avatar.split(',')
|
||||||
|
this.fileImageUrl.map((item)=>{
|
||||||
|
this.fileList.push({
|
||||||
|
url:config.baseUrl + item
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (this.valiFormData.trecipientImage != null && this.valiFormData.trecipientImage != ''){
|
||||||
|
this.recipientImageUrl = this.valiFormData.trecipientImage.split(',')
|
||||||
|
this.recipientImageUrl.map((item)=>{
|
||||||
|
this.recipientImageList.push({
|
||||||
|
url:config.baseUrl + item
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
afterRead(file) {
|
afterRead(file) {
|
||||||
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
||||||
upload({
|
upload({
|
||||||
@ -123,8 +172,9 @@
|
|||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(res, '215')
|
console.log(res, '215')
|
||||||
this.fileList.push({
|
this.fileList.push({
|
||||||
url: config.baseUrl + res.data
|
url: res.url
|
||||||
})
|
})
|
||||||
|
this.fileImageUrl.push(res.fileName)
|
||||||
console.log(this.fileList, 'fileList')
|
console.log(this.fileList, 'fileList')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -132,6 +182,7 @@
|
|||||||
deleteFile(file, index) {
|
deleteFile(file, index) {
|
||||||
console.log('删除文件');
|
console.log('删除文件');
|
||||||
this.fileList.splice(index, 1);
|
this.fileList.splice(index, 1);
|
||||||
|
this.fileImageUrl.splice(index, 1);
|
||||||
},
|
},
|
||||||
afterReadRecipient(file) {
|
afterReadRecipient(file) {
|
||||||
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
||||||
@ -141,14 +192,16 @@
|
|||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(res, '215')
|
console.log(res, '215')
|
||||||
this.recipientImageList.push({
|
this.recipientImageList.push({
|
||||||
url: config.baseUrl + res.data
|
url: res.url
|
||||||
})
|
})
|
||||||
|
this.recipientImageUrl.push(res.fileName)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteFileRecipient(file, index) {
|
deleteFileRecipient(file, index) {
|
||||||
console.log('删除文件');
|
console.log('删除文件');
|
||||||
this.recipientImageList.splice(index, 1);
|
this.recipientImageList.splice(index, 1);
|
||||||
|
this.recipientImageUrl.splice(index, 1);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user