梁航:我的匹配接口
This commit is contained in:
@@ -1,45 +1,48 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="avatar">
|
||||
<u-avatar @click="changeAvatar()" :src="avatar"></u-avatar>
|
||||
<u-avatar @click="changeAvatar()" :src="Info.avatar"></u-avatar>
|
||||
</view>
|
||||
<view class="name-edit">
|
||||
<text>用户名:</text>
|
||||
<u-input border="surround" v-model="username"></u-input>
|
||||
<u-input border="surround" v-model="Info.username"></u-input>
|
||||
</view>
|
||||
<view class="send">
|
||||
<u-button @click="editInfo" color="linear-gradient(to right, #E86262, #CC3333)">提交</u-button>
|
||||
<u-button @click="editInfo(Info)" color="linear-gradient(to right, #E86262, #CC3333)">提交</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
data(){
|
||||
return {
|
||||
username:'',
|
||||
avatar:''
|
||||
Info:{
|
||||
avatar:[],
|
||||
username:''
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeAvatar(){
|
||||
// uni.uploadFile()
|
||||
console.log(111);
|
||||
uni.chooseImage({
|
||||
success: (chooseImageRes) => {
|
||||
this.Info.avatar = chooseImageRes.tempFilePaths.toString() ;
|
||||
}
|
||||
});
|
||||
},
|
||||
editInfo(){
|
||||
this.$api.editPersonInfo({
|
||||
nickname:this.$data.nickname,
|
||||
avatar:this.$data.avatar,
|
||||
Headers:wx.getStorageSync('token')
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
editInfo(data){
|
||||
let resdata=JSON.stringify(data);
|
||||
this.$api.editPersonInfo(resdata).then(res => {
|
||||
console.log(resdata);
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
let that = this
|
||||
this.$data.username = wx.getStorageSync('nickname')
|
||||
this.$data.avatar = wx.getStorageSync('avatar')
|
||||
this.$data.Info.username = wx.getStorageSync('nickname')
|
||||
this.$data.Info.avatar = wx.getStorageSync('avatar')
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,10 +23,17 @@
|
||||
data() {
|
||||
return {
|
||||
titletext:'',
|
||||
listId:''
|
||||
listId:'',
|
||||
matchList:[]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getMatch(){
|
||||
this.$api.getMyMatch().then(res => {
|
||||
this.macthList = res.data.data
|
||||
console.log(res);
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
onLoad: function (option) {
|
||||
@@ -47,9 +54,10 @@
|
||||
if(this.titletext == '发布的店铺出租'){
|
||||
this.listId = 3
|
||||
}
|
||||
if(this.titletext == '我的匹配')
|
||||
if(this.titletext == '我的匹配'){
|
||||
this.listId = 4
|
||||
|
||||
this.getMatch()
|
||||
}
|
||||
|
||||
},
|
||||
computed:{
|
||||
|
||||
@@ -69,7 +69,7 @@ const service = {
|
||||
header['content-type'] = 'application/x-www-form-urlencoded'
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
method: 'put',
|
||||
method: 'post',
|
||||
url: serverHost + url,
|
||||
data: data,
|
||||
header: header,
|
||||
@@ -203,10 +203,18 @@ const apiService = {
|
||||
resolve(service.get(url))
|
||||
})
|
||||
},
|
||||
//修改个人信息
|
||||
editPersonInfo(data){
|
||||
const url = `/center/userupdate`
|
||||
const url = `center/userupdate`
|
||||
return new Promise((resolve,reject) => {
|
||||
resolve(service.post(url,data))
|
||||
resolve(service.putWithFormData(url,data))
|
||||
})
|
||||
},
|
||||
//获取我的匹配
|
||||
getMyMatch(){
|
||||
const url = `/center/match/`
|
||||
return new Promise((resolve,reject) => {
|
||||
resolve(service.get(url))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user