Skip to content

Commit

Permalink
Merge pull request #28 from Chadwuo/one-piece
Browse files Browse the repository at this point in the history
v2.1
全新的页面
  • Loading branch information
Chadwuo authored Jan 2, 2023
2 parents 51e48be + 868ad34 commit c9ee2ca
Show file tree
Hide file tree
Showing 298 changed files with 11,989 additions and 1,367 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@
li-ji-weapp
├── LICENSE.txt
├── README.md
├── /miniprogram/--小程序
├── /miniprogram/--小程序目录
│ ├── /alicloud/--阿里云 Serverless服务
│ ├── /config/--MP-CU配置文件
│ ├── /mp-cu/--ColorUi主框架的文件夹,不建议修改这里面的文件,以免后续升级时,被覆盖。
│ ├── /mp-sdk/--ColorUi框架的辅助文件夹,封装了一些常用的方法函数、扩展图标库等,按需使用,如不需要,可删除此文件夹。
│ ├── /components/--自定义组件
│ ├── /images/--图片
│ ├── /pages/--页面
│ ├── /static/--资源文件
│ ├── /utils/
│ ├── app.js
│ ├── app.json
│ ├── app.wxss
Expand All @@ -57,12 +62,14 @@ li-ji-weapp

### 鸣谢

- [MP-CU](https://github.com/Color-UI/MP-CU):colorUI3.x 微信小程序原生版
- [Vant weapp](https://github.com/youzan/vant-weapp):轻量、可靠的小程序 UI 组件库
- [wl-pinyin](https://www.npmjs.com/package/wl-pinyin):汉字转拼音库
- [dayjs](https://github.com/iamkun/dayjs):Moment.js 的 2kB 轻量化方案,拥有同样强大的 API
- [wx-calendar](https://github.com/lspriv/wx-calendar):借鉴了MIUI 12日历的部分设计,制作适合微信小程序的日历
- <s>腾讯云(涨价了,负担不起,已迁移至阿里云)</s>
- [阿里云 Serverless](https://serverless.aliyun.com/):阿里云 Serverless
- [阿里云 Serverless](https://serverless.aliyun.com):阿里云 Serverless
- [今日诗词 API](https://www.jinrishici.com)![今日诗词](https://v2.jinrishici.com/one.svg)

<!-- links -->
[license-url]: https://github.com/chadwuo/li-ji-weapp/blob/master/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion miniprogram/alicloud/services/giftReceive.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ exports.getGiftReceivePage = async (parameter) => {
},
{
$sort: {
date: -1
money: -1
}
},
{
Expand Down
47 changes: 29 additions & 18 deletions miniprogram/app.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
const {
getUserInfo
getUserInfo
} = require('./alicloud/services/user');

import {
colorUI
} from './config/ColorUI'
import {
colorUISdk
} from './config/mp-sdk'


App({
userInfo: null,
async onLaunch() {
// 查询缓存中用户信息
this.userInfo = wx.getStorageSync('user')
if (!this.userInfo) {
// 如果缓存中没有,去数据库中 查询
const res = await getUserInfo()
if (res.success) {
//TODO 这里有问题 此处为 app.onLaunch与page.onLoad异步问题 导致 index page的onLoad方法 无法拿到userInfo
this.userInfo = res.data
wx.setStorageSync('user', res.data)
}
colorUI, //挂载到app上
colorUISdk,
userInfo: null,
async onLaunch() {
console.log("软件版本", colorUISdk.version)
// 查询缓存中用户信息
this.userInfo = wx.getStorageSync('user')
if (!this.userInfo) {
// 如果缓存中没有,去数据库中 查询
const res = await getUserInfo()
if (res.success) {
//TODO 这里有问题 此处为 app.onLaunch与page.onLoad异步问题 导致 index page的onLoad方法 无法拿到userInfo
this.userInfo = res.data
wx.setStorageSync('user', res.data)
}

// wx.navigateTo({
// url: '/pages/login/index',
// })
}
},
// wx.navigateTo({
// url: '/pages/login/index',
// })
}
},
});
194 changes: 101 additions & 93 deletions miniprogram/app.json
Original file line number Diff line number Diff line change
@@ -1,95 +1,103 @@
{
"pages": [
"pages/index/index",
"pages/book/details/index",
"pages/book/edit/index",
"pages/book/select/index",
"pages/giftOut/index",
"pages/giftOut/edit/index",
"pages/giftReceive/edit/index",
"pages/friend/index",
"pages/friend/details/index",
"pages/friend/edit/index",
"pages/friend/select/index",
"pages/mine/index",
"pages/profile/index",
"pages/login/index",
"pages/about/index",
"pages/issue/index",
"pages/question/index",
"pages/sponsor/index",
"pages/family/index",
"pages/calendar/index"
],
"window": {
"backgroundColor": "#F76664",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#F76664",
"navigationBarTitleText": "礼记",
"navigationBarTextStyle": "white"
},
"tabBar": {
"color": "#7A7E83",
"selectedColor": "#F76664",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/index/index",
"text": "礼记",
"iconPath": "./images/book_gray.png",
"selectedIconPath": "./images/book_red.png"
},
{
"text": "送礼",
"pagePath": "pages/giftOut/index",
"iconPath": "./images/icon_post.png",
"selectedIconPath": "./images/icon_post_red.png"
},
{
"pagePath": "pages/friend/index",
"text": "亲友",
"iconPath": "./images/contact_gray.png",
"selectedIconPath": "./images/contact_red.png"
},
{
"pagePath": "pages/mine/index",
"text": "我的",
"iconPath": "./images/mine_gray.png",
"selectedIconPath": "./images/mine_red.png"
}
]
},
"sitemapLocation": "sitemap.json",
"usingComponents": {
"footer": "/components/footer/index",
"van-action-sheet": "@vant/weapp/action-sheet/index",
"van-button": "@vant/weapp/button/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-divider": "@vant/weapp/divider/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-empty": "@vant/weapp/empty/index",
"van-field": "@vant/weapp/field/index",
"van-grid": "@vant/weapp/grid/index",
"van-grid-item": "@vant/weapp/grid-item/index",
"van-icon": "@vant/weapp/icon/index",
"van-index-bar": "@vant/weapp/index-bar/index",
"van-index-anchor": "@vant/weapp/index-anchor/index",
"van-image": "@vant/weapp/image/index",
"van-notify": "@vant/weapp/notify/index",
"van-notice-bar": "@vant/weapp/notice-bar/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index",
"van-sticky": "@vant/weapp/sticky/index",
"van-search": "@vant/weapp/search/index",
"van-swipe-cell": "@vant/weapp/swipe-cell/index",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-tag": "@vant/weapp/tag/index",
"van-transition": "@vant/weapp/transition/index"
}
"pages": [
"pages/index/index",
"pages/book/details/index",
"pages/book/edit/index",
"pages/book/select/index",
"pages/giftOut/index",
"pages/giftOut/edit/index",
"pages/giftReceive/edit/index",
"pages/friend/index",
"pages/friend/details/index",
"pages/friend/edit/index",
"pages/friend/select/index",
"pages/mine/index",
"pages/profile/index",
"pages/login/index",
"pages/about/index",
"pages/issue/index",
"pages/question/index",
"pages/family/index",
"pages/set/index",
"pages/calendar/index"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTitleText": "礼记",
"navigationBarTextStyle": "black",
"navigationStyle": "custom"
},
"tabBar": {
"color": "#DA372A",
"selectedColor": "#DA372A",
"borderStyle": "white",
"backgroundColor": "#fff",
"list": [{
"pagePath": "pages/index/index",
"text": "礼记"
},
{
"text": "送礼",
"pagePath": "pages/giftOut/index"
},
{
"pagePath": "pages/friend/index",
"text": "亲友"
},
{
"pagePath": "pages/mine/index",
"text": "我的"
}
]
},
"sitemapLocation": "sitemap.json",
"usingComponents": {
"ui-sys": "mp-cu/colorUI/components/ui-sys/ui-sys",
"ui-title": "mp-cu/colorUI/components/ui-title/ui-title",
"ui-code": "mp-cu/colorUI/components/ui-code/ui-code",
"ui-loading": "mp-cu/colorUI/components/ui-loading/ui-loading",
"ui-menu": "mp-cu/colorUI/components/ui-menu/ui-menu",
"ui-menu-item": "mp-cu/colorUI/components/ui-menu-item/ui-menu-item",
"ui-avatar": "mp-cu/colorUI/components/ui-avatar/ui-avatar",
"ui-avatar-stack": "mp-cu/colorUI/components/ui-avatar-stack/ui-avatar-stack",
"ui-modal": "mp-cu/colorUI/components/ui-modal/ui-modal",
"ui-toast": "mp-cu/colorUI/components/ui-toast/ui-toast",
"ui-switch": "mp-cu/colorUI/components/ui-switch/ui-switch",
"ui-radio-group": "mp-cu/colorUI/components/ui-radio-group/ui-radio-group",
"ui-radio": "mp-cu/colorUI/components/ui-radio/ui-radio",
"ui-card": "mp-cu/colorUI/components/ui-card/ui-card",
"ui-fixed": "mp-cu/colorUI/components/ui-fixed/ui-fixed",
"ui-img": "mp-cu/colorUI/components/ui-img/ui-img",
"ui-navbar": "/mp-cu/colorUI/components/ui-navbar/ui-navbar",
"ui-swiper": "/mp-cu/colorUI/components/ui-swiper/ui-swiper",
"ui-text-size": "/mp-cu/colorUI/components/ui-text-size/ui-text-size",
"ui-tag": "/mp-cu/colorUI/components/ui-tag/ui-tag",
"ui-progress": "/mp-cu/colorUI/components/ui-progress/ui-progress",
"ui-tab": "/mp-cu/colorUI/components/ui-tab/ui-tab",
"ui-popover": "/mp-cu/colorUI/components/ui-popover/ui-popover",
"ui-steps": "/mp-cu/colorUI/components/ui-steps/ui-steps",
"ui-form": "/mp-cu/colorUI/components/ui-form/ui-form",
"ui-form-group": "/mp-cu/colorUI/components/ui-form-group/ui-form-group",
"ui-input-box": "/mp-cu/colorUI/components/ui-input-box/ui-input-box",
"ui-checkbox": "/mp-cu/colorUI/components/ui-checkbox/ui-checkbox",
"ui-checkbox-group": "/mp-cu/colorUI/components/ui-checkbox-group/ui-checkbox-group",
"ui-change-theme": "/mp-cu/colorUI/components/ui-change-theme/ui-change-theme",
"ui-parameter": "/mp-sdk/components/ui-parameter/ui-parameter",
"van-action-sheet": "@vant/weapp/action-sheet/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-empty": "@vant/weapp/empty/index",
"van-index-bar": "@vant/weapp/index-bar/index",
"van-index-anchor": "@vant/weapp/index-anchor/index",
"van-notify": "@vant/weapp/notify/index",
"van-notice-bar": "@vant/weapp/notice-bar/index",
"van-search": "@vant/weapp/search/index",
"van-tab": "@vant/weapp/tab/index",
"van-swipe-cell": "@vant/weapp/swipe-cell/index",
"van-tabs": "@vant/weapp/tabs/index"
}
}
3 changes: 3 additions & 0 deletions miniprogram/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* 整个页面的布局 */
@import './mp-cu/colorUI/scss/ui';
@import './mp-sdk/icon/doc';
12 changes: 0 additions & 12 deletions miniprogram/app.wxss

This file was deleted.

30 changes: 0 additions & 30 deletions miniprogram/components/footer/index.js

This file was deleted.

5 changes: 0 additions & 5 deletions miniprogram/components/footer/index.json

This file was deleted.

9 changes: 0 additions & 9 deletions miniprogram/components/footer/index.wxml

This file was deleted.

1 change: 0 additions & 1 deletion miniprogram/components/footer/index.wxss

This file was deleted.

Loading

0 comments on commit c9ee2ca

Please sign in to comment.