Skip to content

Commit

Permalink
feat: 重构页面代码,抽离业务组件,升级组件库版本
Browse files Browse the repository at this point in the history
  • Loading branch information
YYJeffrey committed Feb 10, 2022
1 parent ad2af42 commit c784fb6
Show file tree
Hide file tree
Showing 45 changed files with 121 additions and 1,535 deletions.
15 changes: 9 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
//app.js
import api from "./config/api"
import wxutil, { autoUpdate, getStorage } from "./miniprogram_npm/@yyjeffrey/wxutil/index"
import wxutil from "./miniprogram_npm/@yyjeffrey/wxutil/index"

App({
api: api,
wxutil: wxutil,

globalData: {
appId: wx.getAccountInfoSync().miniProgram.appId,
githubURI: "YYJeffrey/july_client",
githubURL: "https://github.com/YYJeffrey/july_client",
userDetail: null
likeAuthor: "https://img.yejiefeng.com/qr/qr_like.png", // 作者的赞赏码
userDetail: null, // 用户信息详情
tokenExpires: 86400 * 28 // Token过期时间
},

onLaunch() {
this.getUserDetail()
autoUpdate()
wxutil.autoUpdate()
},

/**
* 获取用户详情
*/
getUserDetail() {
const userDetail = getStorage("userDetail")
const userDetail = wxutil.getStorage("userDetail")
if (userDetail) {
this.globalData.userDetail = userDetail
} else {
Expand All @@ -44,8 +47,8 @@ App({
* Token无效跳转授权页
*/
gotoAuthPage(res) {
if (res.message == "Token Is Invalid") {
wx.removeStorageSync('userDetail')
if (res.message === "Token Is Invalid") {
wx.removeStorageSync("userDetail")
wx.navigateTo({
url: "/pages/auth/index",
})
Expand Down
21 changes: 17 additions & 4 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"pages/user-edit/index",
"pages/visiting-card/index",
"pages/message/index",
"pages/images-cropper/index",
"pages/following/index",
"pages/follower/index",
"pages/auth/index",
Expand Down Expand Up @@ -68,10 +67,24 @@
"l-input": "./miniprogram_npm/lin-ui/input/index",
"l-textarea": "./miniprogram_npm/lin-ui/textarea/index",
"l-image-clipper": "./miniprogram_npm/lin-ui/image-clipper/index",
"l-image-clipper-tools": "./miniprogram_npm/lin-ui/image-clipper-tools/index",
"l-card": "./components/card/index",
"nothing": "./components/nothing/index"
"nothing": "./components/nothing/index",
"avatar": "./components/avatar/index",
"nickname": "./components/nickname/index",
"tags-pannel": "./components/tags-pannel/index",
"star-list": "./components/star-list/index",
"comment-item": "./components/comment-item/index",
"hole-item": "./components/hole-item/index",
"chat-item": "./components/chat-item/index",
"follow-item": "./components/follow-item/index",
"message-item": "./components/message-item/index",
"topic-item": "./components/topic-item/index",
"favor-bar": "./components/favor-bar/index",
"profile-card": "./components/profile-card/index",
"profile-topic": "./components/profile-topic/index",
"profile-comment": "./components/profile-comment/index",
"profile-star": "./components/profile-star/index"
},
"lazyCodeLoading": "requiredComponents",
"style": "v2",
"sitemapLocation": "sitemap.json"
}
15 changes: 6 additions & 9 deletions app.wxss
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
/**app.wxss**/

page {
background: #f7f7f7;
font-family: "苹方";
font-size: 28rpx;
color: #333;
box-sizing: border-box;
letter-spacing: 1rpx;
word-wrap: break-word;
font-size: 28rpx;
letter-spacing: 1rpx;
color: #333;
background: #f7f7f7;
}

.container {
height: 100%;
width: 100%;
display: flex;
box-sizing: border-box;
flex-direction: column;
padding: 10rpx 30rpx;
box-sizing: border-box;
padding: 20rpx 30rpx;
}

image {
Expand Down
32 changes: 0 additions & 32 deletions components/card/index.js

This file was deleted.

4 changes: 0 additions & 4 deletions components/card/index.json

This file was deleted.

26 changes: 0 additions & 26 deletions components/card/index.wxml

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion config/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const ossDomain = "https://img.yejiefeng.com"

export default {
baseAPI, // 根接口
socketAPI: socketAPI, // Socket接口
socketAPI: socketAPI, // socket接口
ossDomain: ossDomain, // OSS域名
labelAPI: baseAPI + "label/", // 标签接口
topicAPI: baseAPI + "topic/", // 话题接口
Expand Down
Binary file removed images/bg/bg_auth.png
Binary file not shown.
Binary file added images/icon_favor/comment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon_favor/comment_hl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon_favor/star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon_favor/star_hl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon_favor/view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon_favor/view_hl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/logo/qrcode.jpg
Binary file not shown.
Loading

0 comments on commit c784fb6

Please sign in to comment.