Skip to content

Commit

Permalink
Merge pull request #43 from Chadwuo/one-piece
Browse files Browse the repository at this point in the history
日常 bug 修复
  • Loading branch information
Chadwuo authored Mar 18, 2023
2 parents c07ec79 + 07e8485 commit 9f88362
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 65 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

礼尚往来,是中华民族的传统美德,老一辈人一般会在举行宴席的时候用手写人情簿的方式来记录每一个亲友的送礼,然后在对方有宴席邀请的时候翻阅人情簿,计算出送礼金额。这种方式存在很多弊端,比如人情簿丢失、无法携带在身边、很难搜索到某个人的送礼记录、由于手写原因无法辨认清楚内容等等。

「礼记」是一个基于微信小程序的在线人情帐簿,随身携带、快速查找人情、统计汇总礼金、亲友往来明细、家庭共享记账。让生活没有"难"还的人情
「礼记」是一款微信小程序,方便随时随地查看和记录亲友的礼金情况。随身携带、快速查找人情、统计汇总礼金、亲友往来明细、家庭共享记账、安全可靠

---

Expand Down Expand Up @@ -56,17 +56,26 @@ li-ji-weapp
```

### 作者

- [Chadwuo](https://github.com/chadwuo)

<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://github.com/chadwuo" target="_blank">
<img width="80px" src="https://avatars.githubusercontent.com/u/41413559?v=4" alt="@chadwuo">
<div>@chadwuo</div>
</a>
</td>
</tr>
</tbody>
</table>

### 更新日志

[ChangeLog](https://github.com/chadwuo/li-ji-weapp/releases)

### 版权说明

该项目签署了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),请自由地享受和参与开源。

### 鸣谢

Expand Down
1 change: 0 additions & 1 deletion miniprogram/alicloud/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion miniprogram/pages/about/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</view>

<view class="paragraph" style="text-indent: 2em;">
「礼记」是一个基于微信小程序的在线人情帐簿,随身携带、快速查找人情、统计汇总礼金、亲友往来明细、家庭共享记账。
「礼记」是一款微信小程序,方便随时随地查看和记录亲友的礼金情况。随身携带、快速查找人情、统计汇总礼金、亲友往来明细、家庭共享记账、安全可靠
</view>

<ui-menu ui="mt-5 radius-lg">
Expand Down
2 changes: 1 addition & 1 deletion miniprogram/pages/book/edit/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<button class="ui-btn block round border border-red bg-red-light" bindtap="onDelete">删 除</button>
</van-col>
<van-col span="{{_id?16:24}}">
<button class="ui-btn block round bg-red-gradient" disabled="{{!title|!date.value}}" bindtap="onSave">保 存</button>
<button class="ui-btn block round bg-red" disabled="{{!title|!date.value}}" bindtap="onSave">保 存</button>
</van-col>
</van-row>
</ui-fixed>
Expand Down
2 changes: 1 addition & 1 deletion miniprogram/pages/friend/edit/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<button class="ui-btn block round border border-red bg-red-light" bindtap="onDelete">删 除</button>
</van-col>
<van-col span="{{_id?16:24}}">
<button class="ui-btn block round bg-red-gradient" disabled="{{!name}}" bindtap="onSave">保 存</button>
<button class="ui-btn block round bg-red" disabled="{{!name}}" bindtap="onSave">保 存</button>
</van-col>
</van-row>
</ui-fixed>
Expand Down
2 changes: 1 addition & 1 deletion miniprogram/pages/giftOut/edit/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<button class="ui-btn block round border border-red bg-red-light" bindtap="onDelete">删 除</button>
</van-col>
<van-col span="{{_id?16:24}}">
<button class="ui-btn block round bg-red-gradient" disabled="{{!friendName|!date.value|!title|!money}}" bindtap="onSave">保 存</button>
<button class="ui-btn block round bg-red" disabled="{{!friendName|!date.value|!title|!money}}" bindtap="onSave">保 存</button>
</van-col>
</van-row>
</ui-fixed>
Expand Down
2 changes: 1 addition & 1 deletion miniprogram/pages/giftReceive/edit/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<button class="ui-btn block round border border-red bg-red-light" bindtap="onDelete">删 除</button>
</van-col>
<van-col span="{{_id?16:24}}">
<button class="ui-btn block round bg-red-gradient" disabled="{{!friendName|!money}}" bindtap="onSave">保 存</button>
<button class="ui-btn block round bg-red" disabled="{{!friendName|!money}}" bindtap="onSave">保 存</button>
</van-col>
</van-row>
</ui-fixed>
Expand Down
120 changes: 73 additions & 47 deletions miniprogram/pages/mine/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
],
},
// 监听用户滑动页面事件。
Expand Down Expand Up @@ -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 {
Expand All @@ -137,7 +163,7 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () { },
onReady: function () {},

/**
* 生命周期函数--监听页面显示
Expand All @@ -153,22 +179,22 @@ Page({
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { },
onHide: function () {},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { },
onUnload: function () {},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { },
onPullDownRefresh: function () {},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () { },
onReachBottom: function () {},

/**
* 用户点击右上角分享
Expand Down
15 changes: 9 additions & 6 deletions miniprogram/pages/mine/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<view class="flex-center flex-sub" wx:if="{{scrollTop > sys_navBar}}">我的</view>
</ui-navbar>
<view class='ui-container'>
<view class="flex-bar my-4" bindtap="onShowProfile">
<view class="flex-bar my-4" bindtap="onShowPopup">
<ui-avatar ui="xxl ellipse" src="{{avatarUrl}}" />
<view class="flex-sub pl-3">
<!-- <view class="text-xl">登录,享受更多服务。</view> -->
Expand Down Expand Up @@ -54,20 +54,23 @@
</view>
</ui-sys>

<van-popup show="{{ showProfile }}" round position="bottom" bind:close="onCloseProfile">
<van-popup show="{{ popupVisible }}" round position="bottom" bind:close="onClosePopup">
<view class="py-5 flex-column flex-center ui-container">
<text class="text-bold flex self-start">完善用户信息体验更多功能</text>
<ui-avatar ui="round sl mt-6" src="{{avatarUrl}}">
<ui-avatar ui="round sl mt-6" src="{{avatarUrl_edit}}">
<ui-tag badge="bl" bg="shadow ui-BG-Main" isSlot icon>
<text class="cicon-camera text-white" />
</ui-tag>
<button class="open-btn" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
</button>
</ui-avatar>

<view class="w-100 px-4">
<input model:value="{{ nickName }}" class="text-center mt-5 py-3 round" style="background-color: #F6F6F6;" placeholder="点击获取昵称" type="nickname" />
<button class="ui-btn bg-red block round mt-5" bindtap="onSaveProfile">保存</button>
<input model:value="{{ nickName_edit }}" class="text-center mt-5 py-3 round" style="background-color: #F6F6F6;" placeholder="点击获取昵称" type="nickname" />
<button disabled="{{confirmLoading}}" class="ui-btn bg-red block round mt-5" bindtap="onSaveProfile">
保存
<ui-loading wx:if="{{confirmLoading}}" color />
</button>
</view>
</view>
</van-popup>
3 changes: 2 additions & 1 deletion project.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"useCompilerPlugins": [
"sass"
],
"ignoreUploadUnusedFiles": true
"ignoreUploadUnusedFiles": true,
"condition": false
},
"condition": {},
"editorSetting": {
Expand Down

0 comments on commit 9f88362

Please sign in to comment.