diff --git a/src/project/tianfuxing/AppHome/AppHome.vue b/src/project/tianfuxing/AppHome/AppHome.vue index eeeb9a8..6b7de3c 100644 --- a/src/project/tianfuxing/AppHome/AppHome.vue +++ b/src/project/tianfuxing/AppHome/AppHome.vue @@ -70,7 +70,7 @@ onLoad () { this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight uni.setNavigationBarColor({ - frontColor: '#000000' + frontColor: 'black' }) this.getList() diff --git a/src/project/tianfuxing/AppHome/Culture.vue b/src/project/tianfuxing/AppHome/Culture.vue index 4340f18..38f9cd7 100644 --- a/src/project/tianfuxing/AppHome/Culture.vue +++ b/src/project/tianfuxing/AppHome/Culture.vue @@ -120,7 +120,7 @@ export default { uploadFile (img, total, type) { uni.uploadFile({ - url: this.$instance.defaults.baseURL + '/api/file/add', + url: this.$instance.defaults.baseURL + '/file/add', filePath: img, name: 'file', header: { @@ -162,7 +162,7 @@ export default { getList () { if (this.isMore) return - this.$instance.post(`/appwechatescalation/list`, null, { + this.$instance.post(`/api/appwechatescalation/list`, null, { params: { current: this.current, size: 10, diff --git a/src/project/tianfuxing/AppHome/PhotoReport.vue b/src/project/tianfuxing/AppHome/PhotoReport.vue index 216e56b..e98c824 100644 --- a/src/project/tianfuxing/AppHome/PhotoReport.vue +++ b/src/project/tianfuxing/AppHome/PhotoReport.vue @@ -118,7 +118,7 @@ uploadFile (img, total) { uni.uploadFile({ - url: this.$instance.defaults.baseURL + '/api/file/add', + url: this.$instance.defaults.baseURL + '/file/add', filePath: img, name: 'file', header: { diff --git a/src/project/tianfuxing/AppMy/AppMy.vue b/src/project/tianfuxing/AppMy/AppMy.vue index 6011d35..ec6e3b7 100644 --- a/src/project/tianfuxing/AppMy/AppMy.vue +++ b/src/project/tianfuxing/AppMy/AppMy.vue @@ -70,6 +70,10 @@ this.getUserInfo() this.getList() } + + uni.$on('updateUserInfo', () => { + this.getUserInfo() + }) }, methods: { @@ -100,7 +104,8 @@ this.$instance.post(`/api/appwechatintegraldetail/list`, null, { params: { current: this.current, - size: 10 + size: 10, + openId: this.user.openId } }).then(res => { if (res.code === 0) { @@ -161,12 +166,12 @@ } p { + margin-top: 18px; color: #8891A1; font-size: 26px; } h2 { - margin-bottom: 18px; font-weight: 600; font-size: 34px; color: #1D2229; diff --git a/src/project/tianfuxing/AppMy/UserInfo.vue b/src/project/tianfuxing/AppMy/UserInfo.vue index f36e850..45a00c0 100644 --- a/src/project/tianfuxing/AppMy/UserInfo.vue +++ b/src/project/tianfuxing/AppMy/UserInfo.vue @@ -19,7 +19,7 @@
-
保存
+
保存
@@ -57,10 +57,37 @@ }) }, + save () { + if (!this.userInfo.avatarUrl) { + return this.$toast('请上传头像') + } + + if (!this.userInfo.nickName) { + return this.$toast('请输入昵称') + } + + this.$loading() + this.$instance.post('/api/appwechatuser/update-nickName', null, { + params: { + ...this.userInfo + } + }).then(res => { + if (res.code === 0) { + this.$toast('保存成功') + + uni.$emit('updateUserInfo') + + setTimeout(() => { + wx.navigateBack() + }, 600) + } + }) + }, + onChooseAvatar (e) { this.$loading() uni.uploadFile({ - url: this.$instance.defaults.baseURL + '/api/file/add', + url: this.$instance.defaults.baseURL + '/file/add', filePath: e.detail.avatarUrl, name: 'file', header: { @@ -92,19 +119,6 @@ success: res => { } }) - }, - - save () { - this.$loading() - this.$http.post('/app/editUserInfo', null, { - params: { - ...this.userInfo - } - }).then(res => { - if (res.code === 0) { - this.$toast('保存成功') - } - }) } } }