From 6b96f204e4083d32996c2943a25e36c15d668bd1 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 17 七月 2025 15:33:20 +0800
Subject: [PATCH] 前端
---
small-program/pages/set-up/set-up.vue | 77 ++++++++++++++++++++++++--------------
1 files changed, 48 insertions(+), 29 deletions(-)
diff --git a/small-program/pages/set-up/set-up.vue b/small-program/pages/set-up/set-up.vue
index 26c1813..4e00413 100644
--- a/small-program/pages/set-up/set-up.vue
+++ b/small-program/pages/set-up/set-up.vue
@@ -11,7 +11,7 @@
<view class="setup-list-item">
<view class="label">鏄电О</view>
<view class="val">
- <input type="text" v-model='nickname' placeholder="璇疯緭鍏�" />
+ <input type="text" v-model='nickName' placeholder="璇疯緭鍏�" />
</view>
</view>
<view class="setup-list-item">
@@ -21,7 +21,7 @@
</view>
</view>
</view>
- <view class="setup-sub">閫�鍑虹櫥褰�</view>
+ <view class="setup-sub" @click="updateMemberInfo">淇濆瓨</view>
</view>
</template>
@@ -35,13 +35,14 @@
return {
name:null,
coverImage:null,
- nickname:null,
+ nickName:null,
fullCoverImage:null
};
},
onShow(options){
+ console.log(this.userInfo)
this.coverImage = this.userInfo.coverImage
- this.nickname = this.userInfo.nickname
+ this.nickName = this.userInfo.nickName
this.fullCoverImage = this.userInfo.fullCoverImage
this.name = this.userInfo.name
},
@@ -61,36 +62,53 @@
var that = this
console.log(fileUrl, 'fileUrl')
uni.uploadFile({
- url: `web/public/upload?folder=member` ,
- filePath: fileUrl,
- name: 'file',
- success:(data)=>{
- const res = JSON.parse(data.data)
- that.coverImage = res.data.imgaddr
- that.fullCoverImage = res.data.url
- that.updateMemberInfo()
- },
- fail:(e)=>{
- uni.showToast({
- title: '涓婁紶澶辫触',
- duration: 2000,
- icon: "none"
- });
- }
+ url: this.$baseUrl + 'web/public/upload',
+ filePath: fileUrl,
+ name: 'file',
+ formData: {
+ 'folder': 'member'
+ },
+ success:(data)=>{
+ const res = JSON.parse(data.data)
+ that.coverImage = res.data.imgaddr
+ that.fullCoverImage = res.data.url
+ that.updateMemberInfo()
+ },
+ fail:(e)=>{
+ uni.showToast({
+ title: '涓婁紶澶辫触',
+ duration: 2000,
+ icon: "none"
+ });
+ }
})
},
updateMemberInfo() {
+ if((!this.name ||this.name.trim() =='' )
+ &&(!this.nickName ||this.nickName.trim() =='')
+ &&(!this.coverImage ||this.coverImage.trim() =='')){
+ uni.showToast({
+ title: '瀵逛笉璧凤紝璇锋寜瑕佹眰濉啓淇℃伅锛�',
+ icon: "none",
+ duration: 2000
+ });
+ return
+ }
var that = this
this.$u.api.editMemberInfo({
- name:that.name,
- coverImage:that.nickname,
- coverImage:that.coverImage,
+ name:that.name,
+ nickName:that.nickName,
+ coverImage:that.coverImage,
}).then(res =>{
- uni.showToast({
- title: '鏇存柊鎴愬姛',
- icon: "none",
- duration: 2000
- });
+ that.userInfo.name = this.name
+ that.userInfo.nickName = this.nickName
+ that.userInfo.coverImage = this.coverImage
+ that.userInfo.fullCoverImage = this.fullCoverImage
+ uni.showToast({
+ title: '鏇存柊鎴愬姛',
+ icon: "none",
+ duration: 2000
+ });
})
}
}
@@ -194,7 +212,8 @@
border-radius: 44rpx;
font-weight: 500;
font-size: 32rpx;
- color: #5BBE38;
+ color: white;
+ background-color: #15CF52;
margin-top: 80rpx;
border: 1rpx solid #15CF52;
}
--
Gitblit v1.9.3