Skip to content

Commit

Permalink
add juejin project
Browse files Browse the repository at this point in the history
  • Loading branch information
myvin committed Aug 19, 2018
0 parents commit bb6843e
Show file tree
Hide file tree
Showing 209 changed files with 9,439 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# juejin
掘金第三方版小程序

32 changes: 32 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
App({
onLaunch () {
let that = this
wx.getSystemInfo({
success: function (res) {
that.globalData.systeminfo = res
},
})
},
globalData: {
systeminfo: {},
config: {
loginRequestUrl: 'https://juejin.im/auth/type/phoneNumber',
notifyRequestUrl: 'https://ufp-api-ms.juejin.im/v1',
bannerRequestUrl: 'https://banner-storage-ms.juejin.im/v1',
timelineRequestUrl: 'https://timeline-merger-ms.juejin.im/v1',
xiaoceRequestUrl: 'https://xiaoce-timeline-api-ms.juejin.im/v1',
xiaoceCacheApiMs: 'https://xiaoce-cache-api-ms.juejin.im/v1',
postStorageApiMsRequestUrl: 'https://post-storage-api-ms.juejin.im/v1',
userLikeWrapperMsRequestUrl: 'https://user-like-wrapper-ms.juejin.im/v1',
// searchMergerMsRequestUrl: 'https://search-merger-ms.juejin.im/v1',
collectionSetMsRequestUrl: 'https://collection-set-ms.juejin.im/v1',
shortMsgMsRequestUrl: 'https://short-msg-ms.juejin.im/v1',
ufpApiMsRequestUrl: 'https://ufp-api-ms.juejin.im/v1',
lccroApiMsRequestUrl: 'https://lccro-api-ms.juejin.im/v1',
entryViewStorageApiMsRequestUrl: 'https://entry-view-storage-api-ms.juejin.im/v1',
goldTagMsRequestUrl: 'https://gold-tag-ms.juejin.im/v1',
userNotificationApiMsRequestUrl: 'https://user-notification-api-ms.juejin.im/v1',
apiRequestUrl: 'https://user-storage-api-ms.juejin.im/v1'
}
},
})
74 changes: 74 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"pages": [
"pages/launch/launch",
"pages/index/index",
"pages/my/my",
"pages/personal/personal",
"pages/setting/setting",
"pages/about/about",
"pages/feidian/feidian",
"pages/login/login",
"pages/search/search",
"pages/xiaoce/xiaoce",
"pages/post/post",
"pages/favorate/favorate",
"pages/readHistory/readHistory",
"pages/collectionSet/collectionSet",
"pages/myPins/myPins",
"pages/feedback/feedback",
"pages/infoCenter/infoCenter",
"pages/entry/entry",
"pages/purchasedXiaoce/purchasedXiaoce",
"pages/originalPost/originalPost",
"pages/sharePost/sharePost",
"pages/articleData/articleData",
"pages/subscribedTag/subscribedTag",
"pages/manageTag/manageTag",
"pages/dynamic/dynamic",
"pages/feidianDetail/feidianDetail"
],
"window": {
"backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "#3281ff",
"navigationBarTitleText": "掘金",
"navigationBarTextStyle": "light"
},
"tabBar": {
"color": "#abb4bf",
"selectedColor": "#3281ff",
"borderStyle": "white",
"backgroundColor": "#fff",
"list": [
{
"pagePath": "pages/index/index",
"text": "主页",
"iconPath": "img/tab_home_normal.png",
"selectedIconPath": "img/tab_home.png"
},
{
"pagePath": "pages/search/search",
"text": "搜索",
"iconPath": "img/tab_explore_normal.png",
"selectedIconPath": "img/tab_explore.png"
},
{
"pagePath": "pages/feidian/feidian",
"text": "沸点",
"iconPath": "img/tab_feidian_normal.png",
"selectedIconPath": "img/tab_feidian.png"
},
{
"pagePath": "pages/xiaoce/xiaoce",
"text": "小册",
"iconPath": "img/tab_xiaoce_normal.png",
"selectedIconPath": "img/tab_xiaoce.png"
},
{
"pagePath": "pages/my/my",
"text": "我的",
"iconPath": "img/tab_profile_normal.png",
"selectedIconPath": "img/tab_profile.png"
}
]
}
}
119 changes: 119 additions & 0 deletions app.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
::-webkit-scrollbar {
display: none;
}
page {
-webkit-font-smoothing: antialiased;
font-family: "PingHei","Helvetica Neue","Helvetica","Arial","Verdana","sans-serif";
font-size: 28rpx;
background: #F4F6F9;
}
.card {
background: #fff;
margin-bottom: 20rpx;
}
.items .item {
height: 90rpx;
padding: 0 40rpx;
border-bottom: 1rpx solid #efefef;
display: flex;
justify-content: space-between;
align-items: center;
}
.items .item:last-child {
border-bottom: none;
}
.items .item .title {
flex: 1;
font-size: 32rpx;
color: #333;
display: flex;
align-items: center;
}
.items .item image {
width: 42rpx;
height: 42rpx;
margin-right: 40rpx;
}
.items .item .count {
font-size: 24rpx;
color: #abb4bf;
}
.items .item .count.reddot {
height: 30rpx;
line-height: 30rpx;
border-radius: 15rpx;
padding: 0 7px;
background: #ff5959;
color: #fff;
}
.rotate {
-webkit-animation: rotate .8s linear infinite;
animation: rotate .8s linear infinite;
}
@-webkit-keyframes rotate {
0% {
-webkit-transform: rotate(0);
transform: rotate(0)
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg)
}
}
@keyframes rotate {
0% {
-webkit-transform: rotate(0);
transform: rotate(0)
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg)
}
}
.hover-class,
.navigator-hover {
background: #f2f2f2 !important;
}

/* 滑动切换 tab 样式 */
.top.tabs {
position: relative;
}
.top.tabs .inner {
display: flex;
align-items: center;
background: #3281ff;
color: #fff;
}
.top.tabs .tab {
display: flex;
justify-content: center;
align-items: center;
width: 50%;
height: 80rpx;
color: #ccc;
transition: 250ms ease-out;
}
.top.tabs .tab.active {
transition: 250ms ease-out;
color: #fff;
}
.top.tabs .bar {
position: absolute;
top: 78rpx;
left: 0;
width: 50%;
height: 2rpx;
background: #fff;
transition: 250ms ease-out;
}
/* 用于滑动 tab 的 swiper 样式 */
swiper.swiper {
flex: 1;
}
.swiper swiper-item {
overflow: scroll;
}
.swiper scroll-view {
height: 100%;
}
13 changes: 13 additions & 0 deletions components/empty/empty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
let utils = require('../../utils/utils')
Component({
properties: {
img: {
type: String,
value: '/img/logo_gray.png',
},
tip: {
type: String,
value: '这里空空的什么都没有呢...',
},
},
})
3 changes: 3 additions & 0 deletions components/empty/empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"component": true
}
4 changes: 4 additions & 0 deletions components/empty/empty.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<view class='empty'>
<image src='{{img}}'></image>
<view>{{tip}}</view>
</view>
15 changes: 15 additions & 0 deletions components/empty/empty.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.empty {
font-size: 28rpx;
color: #999;
min-height: 100vh;
background: #fff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.empty image {
width: 150rpx;
height: 120rpx;
margin-bottom: 30rpx;
}
15 changes: 15 additions & 0 deletions components/feidianItem/feidianItem/feidianItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Component({
properties: {
item: {
type: Object,
value: {}
},
},
methods: {
toPostDetail(e) {
wx.navigateTo({
url: `/pages/post/post?id=${e.currentTarget.dataset.id}`,
})
},
},
})
7 changes: 7 additions & 0 deletions components/feidianItem/feidianItem/feidianItem.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"feidianItemTop": "/components/feidianItem/feidianItemTop/feidianItemTop",
"feidianItemBottom": "/components/feidianItem/feidianItemBottom/feidianItemBottom"
}
}
4 changes: 4 additions & 0 deletions components/feidianItem/feidianItem/feidianItem.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<view class='item' hover-class='hover-class'>
<feidianItemTop item='{{item}}'></feidianItemTop>
<feidianItemBottom item='{{item}}'></feidianItemBottom>
</view>
4 changes: 4 additions & 0 deletions components/feidianItem/feidianItem/feidianItem.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.item {
background: #fff;
margin-bottom: 20rpx;
}
8 changes: 8 additions & 0 deletions components/feidianItem/feidianItemBottom/feidianItemBottom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Component({
properties: {
item: {
type: Object,
value: {}
},
},
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"component": true
}
13 changes: 13 additions & 0 deletions components/feidianItem/feidianItemBottom/feidianItemBottom.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<view class='footer'>
<view class='i'>
<image wx:if='{{item.isLiked}}' src='/img/zan_green_feidian3.png'></image>
<image wx:if='{{!item.isLiked}}' src='/img/zan_grey_feidian3.png'></image>
<text>{{item.likedCount || '赞'}}</text>
</view>
<view class='i'>
<image src='/img/fd_reply.png'></image><text>{{item.commentCount || '评论'}}</text>
</view>
<view class='i'>
<image src='/img/fd_share.png'></image>
</view>
</view>
18 changes: 18 additions & 0 deletions components/feidianItem/feidianItemBottom/feidianItemBottom.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.footer {
display: flex;
justify-content: space-around;
align-items: center;
border-top: 1rpx solid #efefef;
height: 80rpx;
color: #999;
font-size: 28rpx;
}
.footer image {
width: 36rpx;
height: 36rpx;
margin-right: 12rpx;
}
.footer .i {
display: flex;
align-items: center;
}
16 changes: 16 additions & 0 deletions components/feidianItem/feidianItemTop/feidianItemTop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Component({
properties: {
item: {
type: Object,
value: {}
},
},
methods: {
toFeidianDetail (e) {
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: `/pages/feidianDetail/feidianDetail?msgId=${id}`,
})
},
},
})
3 changes: 3 additions & 0 deletions components/feidianItem/feidianItemTop/feidianItemTop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"component": true
}
Loading

0 comments on commit bb6843e

Please sign in to comment.