diff --git a/README.md b/README.md index dba63ca8..cd8d692d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ 礼尚往来,是中华民族的传统美德,老一辈人一般会在举行宴席的时候用手写人情簿的方式来记录每一个亲友的送礼,然后在对方有宴席邀请的时候翻阅人情簿,计算出送礼金额。这种方式存在很多弊端,比如人情簿丢失、无法携带在身边、很难搜索到某个人的送礼记录、由于手写原因无法辨认清楚内容等等。 - 「礼记」是一个基于微信小程序的在线人情帐簿,随身携带、快速查找人情、统计汇总礼金、亲友往来明细、家庭共享记账。让生活没有"难"还的人情。 + 「礼记」是一款微信小程序,方便随时随地查看和记录亲友的礼金情况。随身携带、快速查找人情、统计汇总礼金、亲友往来明细、家庭共享记账、安全可靠。 --- @@ -56,9 +56,18 @@ li-ji-weapp ``` ### 作者 - -- [Chadwuo](https://github.com/chadwuo) - + + + + + + +
+ + @chadwuo +
@chadwuo
+
+
### 更新日志 @@ -66,7 +75,7 @@ li-ji-weapp ### 版权说明 -该项目签署了GPL-3.0授权许可,详情请参阅 [LICENSE.txt](https://github.com/chadwuo/li-ji-weapp/blob/master/LICENSE) +该项目签署了GPL-3.0授权许可,详情请参阅 [LICENSE.txt](https://github.com/chadwuo/li-ji-weapp/blob/master/LICENSE),请自由地享受和参与开源。 ### 鸣谢 diff --git a/miniprogram/alicloud/.gitignore b/miniprogram/alicloud/.gitignore deleted file mode 100644 index 652bb1b1..00000000 --- a/miniprogram/alicloud/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/index.js diff --git a/miniprogram/pages/about/index.wxml b/miniprogram/pages/about/index.wxml index 7ef83def..e1e21dab 100644 --- a/miniprogram/pages/about/index.wxml +++ b/miniprogram/pages/about/index.wxml @@ -13,7 +13,7 @@ - 「礼记」是一个基于微信小程序的在线人情帐簿,随身携带、快速查找人情、统计汇总礼金、亲友往来明细、家庭共享记账。 + 「礼记」是一款微信小程序,方便随时随地查看和记录亲友的礼金情况。随身携带、快速查找人情、统计汇总礼金、亲友往来明细、家庭共享记账、安全可靠。 diff --git a/miniprogram/pages/book/edit/index.wxml b/miniprogram/pages/book/edit/index.wxml index aa1e08ed..8b0e0a74 100644 --- a/miniprogram/pages/book/edit/index.wxml +++ b/miniprogram/pages/book/edit/index.wxml @@ -27,7 +27,7 @@ - + diff --git a/miniprogram/pages/friend/edit/index.wxml b/miniprogram/pages/friend/edit/index.wxml index 0fd1a0a4..db443c10 100644 --- a/miniprogram/pages/friend/edit/index.wxml +++ b/miniprogram/pages/friend/edit/index.wxml @@ -26,7 +26,7 @@ - + diff --git a/miniprogram/pages/giftOut/edit/index.wxml b/miniprogram/pages/giftOut/edit/index.wxml index cd53f05f..d2996869 100644 --- a/miniprogram/pages/giftOut/edit/index.wxml +++ b/miniprogram/pages/giftOut/edit/index.wxml @@ -42,7 +42,7 @@ - + diff --git a/miniprogram/pages/giftReceive/edit/index.wxml b/miniprogram/pages/giftReceive/edit/index.wxml index 2b4b6bfd..bd197a62 100644 --- a/miniprogram/pages/giftReceive/edit/index.wxml +++ b/miniprogram/pages/giftReceive/edit/index.wxml @@ -28,7 +28,7 @@ - + diff --git a/miniprogram/pages/mine/index.js b/miniprogram/pages/mine/index.js index a1e8b843..933a297e 100644 --- a/miniprogram/pages/mine/index.js +++ b/miniprogram/pages/mine/index.js @@ -16,36 +16,39 @@ Page({ jinrishici: '', avatarUrl: '', nickName: '', - showProfile: false, + avatarUrl_edit: '', + nickName_edit: '', + popupVisible: false, + confirmLoading: false, welcome: welcome(), totalGift: { receiveTotal: '', outTotal: '' }, menus: [{ - icon: "cicon-home-community", - name: "我的家庭", - color: "text-mauve", - path: "/pages/family/index" - }, - { - icon: "cicon-event-list", - name: "数据导出", - color: "text-orange", - path: "/pages/backup/index" - }, - { - icon: "cicon-demo", - name: "统计分析", - color: "text-red", - path: "/pages/analysis/index" - }, - { - icon: "cicon-person-pin-circle-o", - name: "亲友关系", - color: "text-green", - path: "/pages/relationship/index" - } + icon: "cicon-home-community", + name: "我的家庭", + color: "text-mauve", + path: "/pages/family/index" + }, + { + icon: "cicon-event-list", + name: "数据导出", + color: "text-orange", + path: "/pages/backup/index" + }, + { + icon: "cicon-demo", + name: "统计分析", + color: "text-red", + path: "/pages/analysis/index" + }, + { + icon: "cicon-person-pin-circle-o", + name: "亲友关系", + color: "text-green", + path: "/pages/relationship/index" + } ], }, // 监听用户滑动页面事件。 @@ -86,39 +89,62 @@ Page({ }; console.log(avatarUrl) app.mpserverless.file.uploadFile(options).then(res => { - console.log(res); this.setData({ - avatarUrl: res.fileUrl + avataavatarUrl_editrUrl: res.fileUrl }) }); }, - onShowProfile() { + onShowPopup() { this.setData({ - showProfile: true + popupVisible: true, + avatarUrl_edit: app.userInfo.avatarUrl, + nickName_edit: app.userInfo.nickName, }) }, - onCloseProfile() { + onClosePopup() { this.setData({ - showProfile: false + popupVisible: false }) }, // 保存个人信息 async onSaveProfile() { + this.setData({ + confirmLoading: true + }) + + const avatarUrl = this.data.avatarUrl_edit + const nickName = this.data.nickName_edit + const res = await userService.updateUserInfo({ _id: app.userInfo._id, - nickName: this.data.nickName, - avatarUrl: this.data.avatarUrl, - }) - if (res.success) { - wx.showToast({ - title: '更新成功', - }) - app.userInfo.nickName = this.data.nickName - app.userInfo.avatarUrl = this.data.avatarUrl - } - this.setData({ - showProfile: false + nickName: nickName, + avatarUrl: avatarUrl, }) + + setTimeout(() => { + if (res.success) { + wx.showToast({ + title: '更新成功', + }) + + this.setData({ + avatarUrl: avatarUrl, + nickName: nickName, + popupVisible: false, + confirmLoading: false + }) + app.userInfo.nickName = nickName + app.userInfo.avatarUrl = avatarUrl + } else { + wx.showToast({ + title: res.message, + icon: "none" + }) + this.setData({ + confirmLoading: false + }) + } + }, 600); }, async getGiftTotal() { const { @@ -137,7 +163,7 @@ Page({ /** * 生命周期函数--监听页面初次渲染完成 */ - onReady: function () { }, + onReady: function () {}, /** * 生命周期函数--监听页面显示 @@ -153,22 +179,22 @@ Page({ /** * 生命周期函数--监听页面隐藏 */ - onHide: function () { }, + onHide: function () {}, /** * 生命周期函数--监听页面卸载 */ - onUnload: function () { }, + onUnload: function () {}, /** * 页面相关事件处理函数--监听用户下拉动作 */ - onPullDownRefresh: function () { }, + onPullDownRefresh: function () {}, /** * 页面上拉触底事件的处理函数 */ - onReachBottom: function () { }, + onReachBottom: function () {}, /** * 用户点击右上角分享 diff --git a/miniprogram/pages/mine/index.wxml b/miniprogram/pages/mine/index.wxml index 5de97d96..b4f48a6b 100644 --- a/miniprogram/pages/mine/index.wxml +++ b/miniprogram/pages/mine/index.wxml @@ -3,7 +3,7 @@ 我的 - + @@ -54,20 +54,23 @@ - + 完善用户信息体验更多功能 - + - + - - + + \ No newline at end of file diff --git a/project.config.json b/project.config.json index 6cd5df09..21491114 100644 --- a/project.config.json +++ b/project.config.json @@ -24,7 +24,8 @@ "useCompilerPlugins": [ "sass" ], - "ignoreUploadUnusedFiles": true + "ignoreUploadUnusedFiles": true, + "condition": false }, "condition": {}, "editorSetting": {