From b07248d07b07f99b830f2d70e5526a73d2684012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Thu, 16 Nov 2023 21:42:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 20 +++---- pages/my/edit/edit.vue | 133 ++++++++++++++++++++++++++++++++--------- pages/my/my.vue | 41 +++++++------ service/request.js | 25 +++++--- 4 files changed, 155 insertions(+), 64 deletions(-) diff --git a/pages.json b/pages.json index 31eb97f..8e4147a 100644 --- a/pages.json +++ b/pages.json @@ -172,17 +172,17 @@ "navigationBarTitleText": "", "enablePullDownRefresh": false } + }, { + "path": "pages/my/edit/edit", + "style": { + "navigationBarTitleText": "修改个人信息", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#339967", + "enablePullDownRefresh": false + } + } - ,{ - "path" : "pages/my/edit/edit", - "style" : - { - "navigationBarTitleText": "修改个人信息", - "enablePullDownRefresh": false - } - - } - ], + ], "tabBar": { "color": "#CCCCCC", "borderStyle": "white", diff --git a/pages/my/edit/edit.vue b/pages/my/edit/edit.vue index f448e44..fa9a520 100644 --- a/pages/my/edit/edit.vue +++ b/pages/my/edit/edit.vue @@ -1,69 +1,146 @@ - + + + .u-button { + width: 644rpx !important; + height: 86rpx !important; + background: #0EBB5B; + border-radius: 20rpx !important; + } + \ No newline at end of file diff --git a/pages/my/my.vue b/pages/my/my.vue index bbb5e5d..81bd79b 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -7,8 +7,10 @@ {{username}} - 账号:{{account}} - + 账号:{{account}} + + + @@ -43,8 +45,8 @@ data() { return { src: 'https://cdn.uviewui.com/uview/album/2.jpg', - account: '', - username: '', + account: '123', + username: '用户名', isLoad: true } }, @@ -54,8 +56,9 @@ return } this.isLoad = true - this.$data.account = wx.getStorageSync('account') - this.$data.username = wx.getStorageSync('nickname') + // this.$data.account = wx.getStorageSync('account') + // this.$data.username = wx.getStorageSync('nickname') + this.getInfo() }, methods: { reOnLoad() { @@ -86,17 +89,22 @@ url: '/pages/Partnerships/Partnerships' }) }, - toEdit(){ + toEdit() { uni.navigateTo({ - url:'/pages/my/edit/edit' + url: '/pages/my/edit/edit' + }) + }, + //---------页面调用接口示例------------ + getInfo() { + this.$api.getUser().then(res => { + console.log('userInfo', res); + var data = res.data.data + if (data) { + this.src = uni.getStorageSync('img_url') + data.avatar + this.username = data.nickname + } }) } - //---------页面调用接口示例------------ - // getInfo() { - // this.$api.getUserInfo().then(res => { - // console.log('userInfo', res); - // }) - // } } } @@ -134,9 +142,8 @@ font-weight: 1rpx; display: flex; } - .edit-icon{ - - } + + .edit-icon {} } \ No newline at end of file diff --git a/service/request.js b/service/request.js index a83e178..b1d58ab 100644 --- a/service/request.js +++ b/service/request.js @@ -130,7 +130,7 @@ const apiService = { serverHost, imgUrl: 'https://spsp.feashow.com/', key: 'ZRKBZ-Q7FWL-GVZPK-MCRBU-4XFB5-ATBDB', - uploadImgUrl: serverHost + `/upload/image/`, + uploadImgUrl: serverHost + '/upload/image/', //登录接口 login(data) { const url = '/login/mnpLogin' @@ -211,27 +211,34 @@ const apiService = { resolve(service.get(url)) }) }, + //获取个人信息 + getUser() { + const url = '/center/userinfo' + return new Promise((resolve, reject) => { + resolve(service.get(url)) + }) + }, //修改个人信息 - editPersonInfo(data){ + editPersonInfo(data) { const url = `center/userupdate` - return new Promise((resolve,reject) => { - resolve(service.putWithFormData(url,data)) + return new Promise((resolve, reject) => { + resolve(service.post(url, data)) }) }, //获取我的匹配 - getMyMatch(){ + getMyMatch() { const url = `/center/match/` - return new Promise((resolve,reject) => { + return new Promise((resolve, reject) => { resolve(service.get(url)) }) }, //获取行业和业态 - getClassList(pid){ + getClassList(pid) { const url = `/home/classlist/?pid=${pid}` - return new Promise((resolve,reject) => { + return new Promise((resolve, reject) => { resolve(service.post(url)) }) - } + }, } export { apiService,