diff --git a/manifest.json b/manifest.json index 7194ea0..841ce0a 100644 --- a/manifest.json +++ b/manifest.json @@ -59,6 +59,12 @@ }, "usingComponents" : true, "requiredPrivateInfos": ["getLocation"], + "optimization" : { + "minify": { + "js": true, + "css": true + } + }, "permission" : { "scope.userLocation" : { "desc" : "你的位置信息将用于获取周边服务" diff --git a/pages.json b/pages.json index 0b127f5..21380d6 100644 --- a/pages.json +++ b/pages.json @@ -203,13 +203,6 @@ "usingComponents": {} } }, - // { - // "path" : "pages/meetingDetail/ceshi/ceshi", - // "style" : - // { - // "navigationBarTitleText" : "" - // } - // }, { "path": "pages/sign/sign", "style": { diff --git a/pages/activeDetail/index.vue b/pages/activeDetail/index.vue index dd91b96..21b3144 100644 --- a/pages/activeDetail/index.vue +++ b/pages/activeDetail/index.vue @@ -1,554 +1,451 @@ \ No newline at end of file diff --git a/pages/chat/index.vue b/pages/chat/index.vue index 328e9fa..58ac98a 100644 --- a/pages/chat/index.vue +++ b/pages/chat/index.vue @@ -1,180 +1,216 @@ \ No newline at end of file diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 4231e67..fc8bb00 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -85,12 +85,18 @@ - - - 社区电话: - {{communityPhone}} - + + + 社区电话: + {{communityPhone}} + @@ -157,8 +163,7 @@ { key: 5, url: "/static/imgs/service/service_notice.png", - name: '设置', - pageUrl: 'serviceNoticeList' + name: '设置' }, { key: 6, @@ -174,6 +179,9 @@ this.initData(); }, methods: { + handleCloseModal() { + this.showPhoneDialog = false; + }, // 初始化数据 async initData() { const token = uni.getStorageSync('token'); @@ -198,15 +206,18 @@ // 更新用户信息 updateUserInfo(data) { + // 显示时拼接IMAGE_BASE_URL + const avatarUrl = data.avatar ? `${IMAGE_BASE_URL}${data.avatar}` : '/static/imgs/index/nav.png'; + this.userInfo = { nickName: data.name || data.nickName || '未命名用户', - avatarUrl: data.avatar || data.avatarUrl || '/static/imgs/index/nav.png', + avatarUrl: avatarUrl, bio: data.introduce || data.bio || '这家伙很懒,什么都没有写~', phone: data.phone || '' }; // 更新显示头像 - this.displayAvatar = this.userInfo.avatarUrl || '/static/imgs/index/nav.png'; + this.displayAvatar = this.userInfo.avatarUrl; this.formData = { name: this.userInfo.nickName, @@ -367,13 +378,14 @@ // 登录完成处理 async loginComplete(data) { try { - // 获取最新用户信息 + // 获取最新用户信息 + this.showEditModal = false; const res = await get('/api/v1/app_auth/mine'); if (res && res.success) { uni.setStorageSync('userInfo', res.data); this.updateUserInfo(res.data); this.isLogin = true; - this.showEditModal = false; + // this.showEditModal = false; this.showPhoneButton = false; uni.showToast({ title: '登录成功' @@ -414,7 +426,7 @@ }); }); - if (fileInfo.size > 2 * 1024 * 1024) { + if (fileInfo.size > 3 * 1024 * 1024) { throw new Error('图片大小不能超过2MB'); } @@ -452,7 +464,7 @@ try { const res = JSON.parse(uploadRes.data); if (res && res.success) { - resolve(`${IMAGE_BASE_URL}${res.data}`); + resolve(res.data); } else { reject(new Error(res.message || '上传失败')); } @@ -507,7 +519,12 @@ name, bio } = this.formData; - const avatarUrl = this.avatarList.length > 0 ? this.avatarList[0].url : ""; + console.log("====", this.avatarList) + let avatarUrl = this.avatarList.length > 0 ? this.avatarList[0].url : ""; + + if (avatarUrl && avatarUrl.includes(IMAGE_BASE_URL)) { + avatarUrl = avatarUrl.replace(IMAGE_BASE_URL, ''); + } if (!name) { uni.showToast({ @@ -535,12 +552,13 @@ // 3. 更新本地存储和页面数据 uni.setStorageSync('userInfo', res.data); this.updateUserInfo(res.data); + this.showEditModal = false; uni.hideLoading(); uni.showToast({ title: '修改成功' }); - this.showEditModal = false; + } else { throw new Error(res.message || '获取用户信息失败'); } @@ -559,10 +577,17 @@ this.showEditModal = false; }, + // 跳转页面 // 跳转页面 goPage(item) { if (item.key === 6) { // 联系社区的特殊处理 this.handleContactCommunity(); + + return; + } + + if (item.key === 5) { // 设置的特殊处理 + this.handleEditClick(); // 调用编辑用户信息的方法 return; } @@ -580,12 +605,22 @@ // 处理联系社区点击 handleContactCommunity() { - if (!this.checkLogin()) { - this.showEditModal = true; - return; - } - - this.showPhoneDialog = true; + if (!this.checkLogin()) { + this.showEditModal = true; + return; + } + + uni.showModal({ + title: '联系社区', + content: '是否要拨打社区电话:' + this.communityPhone, + confirmText: '拨打', + cancelText: '取消', + success: (res) => { + if (res.confirm) { + this.callCommunityPhone(); + } + } + }); }, // 拨打社区电话 diff --git a/pages/neighborDetail/index.vue b/pages/neighborDetail/index.vue index 631c108..625ff22 100644 --- a/pages/neighborDetail/index.vue +++ b/pages/neighborDetail/index.vue @@ -13,65 +13,63 @@ {{ postData.title }} {{ postData.content }} - + - - 评论 ({{ getTotalComments() }}) + + 评论 ({{ getTotalComments() }}) + - - - - - - - - - - {{ comment.pusherName }} - {{ formatTime(comment.createdAt) }} - - {{ comment.content }} - - 回复 - - - {{ getChildCount(comment) }}条回复{{ foldedComments.includes(comment.id) ? '展开' : '折叠' }} + + + + + + {{ comment.content }} + + + + + 回复 + + + + + + 加载更多 + - 回复 @{{ getReplyUsername(replyingTo) }} 取消 - @@ -83,724 +81,523 @@ - - \ No newline at end of file diff --git a/pages/serviceTickets/index.vue b/pages/serviceTickets/index.vue index 313bf4b..be1bc58 100644 --- a/pages/serviceTickets/index.vue +++ b/pages/serviceTickets/index.vue @@ -1,6 +1,41 @@