├── README.md
├── app.js
├── app.json
├── app.wxss
├── data
├── data_discovery.js
├── data_discovery_next.js
├── data_index.js
└── data_index_next.js
├── images
├── 1444983318907-_DSC1826.jpg
├── 24213.jpg
├── 24280.jpg
├── allread.png
├── book.png
├── bottom_tab.gif
├── burger.png
├── burger_focus.png
├── chat.png
├── chat_focus.png
├── comment.png
├── comment2.png
├── discovery.png
├── discovery_focus.png
├── draft.png
├── eye.png
├── flag.png
├── good-bad.png
├── heart2.png
├── icon1.jpeg
├── icon8.jpg
├── icon9.jpeg
├── index.png
├── index_focus.png
├── index_scroll.gif
├── invite.png
├── lighting.png
├── live.png
├── more.png
├── navigation.gif
├── recent.png
├── ring.png
├── ring_focus.png
├── search.png
├── star.png
├── star2.png
├── top_tab.gif
├── v_discovery.png
├── v_index.png
├── write.png
└── zhi.png
├── pages
├── answer
│ ├── answer.js
│ ├── answer.json
│ ├── answer.wxml
│ └── answer.wxss
├── chat
│ ├── chat.js
│ ├── chat.json
│ ├── chat.wxml
│ └── chat.wxss
├── discovery
│ ├── discovery.js
│ ├── discovery.json
│ ├── discovery.wxml
│ └── discovery.wxss
├── index
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── more
│ ├── more.js
│ ├── more.json
│ ├── more.wxml
│ └── more.wxss
├── notify
│ ├── notify.js
│ ├── notify.json
│ ├── notify.wxml
│ └── notify.wxss
└── question
│ ├── question.js
│ ├── question.json
│ ├── question.wxml
│ └── question.wxss
└── utils
└── util.js
/README.md:
--------------------------------------------------------------------------------
1 | # weapp-wechat-zhihu
2 |
3 | 微信中的知乎--微信小程序 demo // Zhihu in Wechat
4 |
5 | 
6 |
7 | ### description
8 | - 界面及交互设计来自知乎 Android 版本
9 | - _工具_: [微信 web 开发者工具](https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html?t=1477579747265)
10 | - _数据_: 没有开放 API, 所以使用伪造本地数据
11 |
12 | #### 功能及使用的组件等
13 | * 列表式渲染数据
14 | * 自定义顶部 tabbar
15 | * 下拉刷新
16 | * 上拉加载更多
17 | * 轮播图
18 |
等...
19 |
20 | ### Setup
21 |
22 | ```
23 | git@github.com:RebeccaHanjw/weapp-wechat-zhihu.git
24 | ```
25 | 下载安装Wechat DEV Tools, 并导入项目
26 |
27 | ### 演示
28 |
29 | 首页下拉刷新等
30 |
31 | 
32 |
33 | 底部 tab 切换
34 |
35 | 
36 |
37 | 顶部自定义 tab 切换
38 |
39 | 
40 |
41 | 页面跳转
42 |
43 | 
44 |
45 |
46 | ##### Demo 用于学习交流, 转载请注明出处
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | App({
3 | onLaunch: function () {
4 | //调用API从本地缓存中获取数据
5 | var logs = wx.getStorageSync('logs') || []
6 | logs.unshift(Date.now())
7 | wx.setStorageSync('logs', logs)
8 | },
9 | getUserInfo:function(cb){
10 | var that = this
11 | if(this.globalData.userInfo){
12 | typeof cb == "function" && cb(this.globalData.userInfo)
13 | }else{
14 | //调用登录接口
15 | wx.login({
16 | success: function () {
17 | wx.getUserInfo({
18 | success: function (res) {
19 | that.globalData.userInfo = res.userInfo
20 | typeof cb == "function" && cb(that.globalData.userInfo)
21 | }
22 | })
23 | }
24 | })
25 | }
26 | },
27 | globalData:{
28 | userInfo:null
29 | }
30 | })
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages":[
3 | "pages/index/index",
4 | "pages/discovery/discovery",
5 | "pages/notify/notify",
6 | "pages/chat/chat",
7 | "pages/more/more",
8 | "pages/answer/answer",
9 | "pages/question/question"
10 | ],
11 | "window":{
12 | "backgroundTextStyle":"light",
13 | "navigationBarBackgroundColor": "#0068C4",
14 | "navigationBarTitleText": "知乎",
15 | "navigationBarTextStyle":"white",
16 | "enablePullDownRefresh":true
17 | },
18 | "tabBar": {
19 | "color": "#626567",
20 | "selectedColor": "#2A8CE5",
21 | "backgroundColor": "#FBFBFB",
22 | "borderStyle": "white",
23 | "list": [{
24 | "pagePath": "pages/index/index",
25 | "text": "",
26 | "iconPath": "images/index.png",
27 | "selectedIconPath": "images/index_focus.png"
28 | }, {
29 | "pagePath": "pages/discovery/discovery",
30 | "text": "",
31 | "iconPath": "images/discovery.png",
32 | "selectedIconPath": "images/discovery_focus.png"
33 | }, {
34 | "pagePath": "pages/notify/notify",
35 | "text": "",
36 | "iconPath": "images/ring.png",
37 | "selectedIconPath": "images/ring_focus.png"
38 | }, {
39 | "pagePath": "pages/chat/chat",
40 | "text": "",
41 | "iconPath": "images/chat.png",
42 | "selectedIconPath": "images/chat_focus.png"
43 | }, {
44 | "pagePath": "pages/more/more",
45 | "text": "",
46 | "iconPath": "images/burger.png",
47 | "selectedIconPath": "images/burger_focus.png"
48 | }]
49 | },
50 | "networkTimeout": {
51 | "request": 10000,
52 | "downloadFile": 10000
53 | },
54 | "debug": true
55 | }
56 |
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | .container {
3 | height: 100%;
4 | display: flex;
5 | flex-direction: column;
6 | align-items: center;
7 | justify-content: space-between;
8 | /*padding: 200rpx 0;*/
9 | box-sizing: border-box;
10 | background: #F0F4F3;
11 | }
12 |
13 | .container.withtab{
14 | margin: 105rpx 0 0 0;
15 | /*top: 105rpx;*/
16 | }
17 | .flex-wrp{
18 | display: flex;
19 | }
20 | .flex-tab{
21 | flex-flow: row nowrap;
22 | justify-content: space-around;
23 | align-items: stretch;
24 | }
25 | .flex-item{
26 | flex-grow: 1;
27 | text-align: center;
28 | }
29 | .top-tab{
30 | width: 750rpx;
31 | height: 100rpx;
32 | background: #298DE5;
33 | color: #8CCEFD;
34 | font-size: 28rpx;
35 | line-height: 100rpx;
36 | box-shadow: 0 2px 2px #bebebe;
37 | margin: 0 0 8rpx 0;
38 | position: fixed;
39 | top: 0;
40 | z-index: 9999;
41 | }
42 | .toptab.active{
43 | color: #ffffff;
44 | border-bottom: solid 2px #ffffff;
45 | }
46 | .container{
47 | padding: 0;
48 | font-size: 14rpx;
49 | color: #000;
50 | }
51 | .container .feed-item{
52 | width: 690rpx;
53 | padding: 30rpx 30rpx 20rpx;
54 | margin: 7rpx 0 6rpx 0;
55 | background: #ffffff;
56 | border-top: 1px solid #eee;
57 | border-bottom: 1px solid #eee;
58 | box-shadow: 0 2px 5px #eeeeee;
59 | }
60 | .container .feed-item .feed-source{
61 | width: 690rpx;
62 | left: 0;
63 | height: 50rpx;
64 | }
65 | .container .feed-item .feed-source .avatar{
66 | position: relative;
67 | display: inline-block;
68 | }
69 | .container .feed-item .feed-source a{
70 | display: inline-block;
71 | height: 40rpx;
72 | }
73 | .container .feed-item .feed-source .avatar image{
74 | /*position: absolute;*/
75 | display: inline-block;
76 | width: 45rpx;
77 | height: 45rpx;
78 | border-radius: 45rpx;
79 | top: 10rpx;
80 | vertical-align: middle;
81 | }
82 | .container .feed-item .feed-source text{
83 | /*position: absolute;*/
84 | display: inline-block;
85 | height: 40rpx;
86 | line-height: 40rpx;
87 | vertical-align: middle;
88 | margin: 0 0 0 15rpx;
89 | color: #a0acac;
90 | font-size: 26rpx;
91 | }
92 | .container .feed-item .feed-source .item-more{
93 | display: inline-block;
94 | width: 40rpx;
95 | height: 45rpx;
96 | float: right;
97 | }
98 | .container .feed-item .feed-content{
99 | padding: 10rpx 0 0 0;
100 | }
101 | .container .feed-item .feed-content .question text{
102 | font-size: 28rpx;
103 | font-weight: 600px;
104 | line-height: 40rpx;
105 | text-space: 5rpx;
106 | }
107 | .container .feed-item .feed-content .answer-body{
108 | padding: 10rpx 0 0 0;
109 | /*height: 10rpx;*/
110 | font-size: 24rpx;
111 | line-height: 28rpx;
112 | color: #5b5b5b;
113 | }
114 | .container .feed-item .feed-content .answer-actions{
115 | width: 690rpx;
116 | padding: 10rpx 0 0;
117 | color: #a0acac;
118 | }
119 | .container .feed-item .feed-content .answer-actions view{
120 | display: inline-block;
121 | vertical-align: text-bottom;
122 | padding: 0 10rpx 0 0;
123 | font-size: 24rpx;
124 | }
125 | .container .feed-item .feed-content .answer-actions .dot ::after{
126 | content: "•";
127 | }
--------------------------------------------------------------------------------
/data/data_discovery.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Rebecca_Han on 16/10/26.
3 | */
4 | module.exports = {
5 |
6 | }
7 |
8 | var discovery= {
9 | "id": 3,
10 | "data": [
11 | {
12 | "question_id": 1,
13 | "answer_id": 3,
14 | "feed_source_id": 23,
15 | "feed_source_name": "Rebecca1",
16 | "feed_source_txt": "赞了回答1",
17 | "feed_source_img": "../../images/icon1.jpeg",
18 | "question": "选择 Kindle 而不是纸质书的原因是什么?",
19 | "answer_ctnt": "难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的怎么真心不懂了...",
20 | "good_num": "112",
21 | "comment_num": "18"
22 | },
23 | {
24 | "question_id": 2,
25 | "answer_id": 25,
26 | "feed_source_id": 24,
27 | "feed_source_name": "Alex2",
28 | "feed_source_txt": "回答了问题2",
29 | "feed_source_img": "../../images/icon8.jpg",
30 | "question": "如何评价周杰伦的「中文歌才是最屌的」的言论?",
31 | "answer_ctnt": "不知道题主是否是学音乐的。 音乐有公认的经典,也有明显的流行趋势没有错。但归根结底,音乐是一种艺术,艺术是很主观的东西。跟画作一个道理,毕加索是大家,但很多人看不懂他的话,甚至觉得很难看...",
32 | "good_num": "112",
33 | "comment_num": "18"
34 | },
35 | {
36 | "question_id": 3,
37 | "answer_id": 61,
38 | "feed_source_id": 25,
39 | "feed_source_name": "George3",
40 | "feed_source_txt": "赞了回答3",
41 | "feed_source_img": "../../images/icon9.jpeg",
42 | "question": "气象铁塔的辐射大吗?",
43 | "answer_ctnt": "我不知道那个铁塔的情况,不过气象铁塔上会有一些测太阳辐射的设备,如果说辐射的话,太阳辐射那么多,大家赶紧躲进地底下呀~~~~~要不然辐射量这么大,会变异的呀~~~~",
44 | "good_num": "112",
45 | "comment_num": "18"
46 | },
47 | {
48 | "question_id": 4,
49 | "answer_id": 3,
50 | "feed_source_id": 23,
51 | "feed_source_name": "Rebecca4",
52 | "feed_source_txt": "赞了回答4",
53 | "feed_source_img": "../../images/icon1.jpeg",
54 | "question": "选择 Kindle 而不是纸质书的原因是什么?",
55 | "answer_ctnt": "难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的怎么真心不懂了...",
56 | "good_num": "112",
57 | "comment_num": "18"
58 | },
59 | {
60 | "question_id": 5,
61 | "answer_id": 25,
62 | "feed_source_id": 24,
63 | "feed_source_name": "Alex5",
64 | "feed_source_txt": "回答了问题5",
65 | "feed_source_img": "../../images/icon8.jpg",
66 | "question": "如何评价周杰伦的「中文歌才是最屌的」的言论?",
67 | "answer_ctnt": "不知道题主是否是学音乐的。 音乐有公认的经典,也有明显的流行趋势没有错。但归根结底,音乐是一种艺术,艺术是很主观的东西。跟画作一个道理,毕加索是大家,但很多人看不懂他的话,甚至觉得很难看...",
68 | "good_num": "112",
69 | "comment_num": "18"
70 | },
71 | {
72 | "question_id": 6,
73 | "answer_id": 61,
74 | "feed_source_id": 25,
75 | "feed_source_name": "George6",
76 | "feed_source_txt": "赞了回答6",
77 | "feed_source_img": "../../images/icon9.jpeg",
78 | "question": "气象铁塔的辐射大吗?",
79 | "answer_ctnt": "我不知道那个铁塔的情况,不过气象铁塔上会有一些测太阳辐射的设备,如果说辐射的话,太阳辐射那么多,大家赶紧躲进地底下呀~~~~~要不然辐射量这么大,会变异的呀~~~~",
80 | "good_num": "112",
81 | "comment_num": "18"
82 | },
83 | {
84 | "question_id": 7,
85 | "answer_id": 3,
86 | "feed_source_id": 23,
87 | "feed_source_name": "Rebecca7",
88 | "feed_source_txt": "赞了回答7",
89 | "feed_source_img": "../../images/icon1.jpeg",
90 | "question": "选择 Kindle 而不是纸质书的原因是什么?",
91 | "answer_ctnt": "难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的怎么真心不懂了...",
92 | "good_num": "112",
93 | "comment_num": "18"
94 | },
95 | {
96 | "question_id": 8,
97 | "answer_id": 25,
98 | "feed_source_id": 24,
99 | "feed_source_name": "Alex8",
100 | "feed_source_txt": "回答了问题8",
101 | "feed_source_img": "../../images/icon8.jpg",
102 | "question": "如何评价周杰伦的「中文歌才是最屌的」的言论?",
103 | "answer_ctnt": "不知道题主是否是学音乐的。 音乐有公认的经典,也有明显的流行趋势没有错。但归根结底,音乐是一种艺术,艺术是很主观的东西。跟画作一个道理,毕加索是大家,但很多人看不懂他的话,甚至觉得很难看...",
104 | "good_num": "112",
105 | "comment_num": "18"
106 | }
107 |
108 | ]
109 |
110 | }
111 |
112 | module.exports.discovery = discovery;
--------------------------------------------------------------------------------
/data/data_discovery_next.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Rebecca_Han on 16/10/27.
3 | */
4 |
5 | module.exports={
6 |
7 | };
8 |
9 | var next = {
10 | "id": 4,
11 | "data": [
12 | {
13 | "question_id": 9,
14 | "answer_id": 61,
15 | "feed_source_id": 25,
16 | "feed_source_name": "George9",
17 | "feed_source_txt": "赞了回答9",
18 | "feed_source_img": "../../images/icon9.jpeg",
19 | "question": "气象铁塔的辐射大吗?",
20 | "answer_ctnt": "我不知道那个铁塔的情况,不过气象铁塔上会有一些测太阳辐射的设备,如果说辐射的话,太阳辐射那么多,大家赶紧躲进地底下呀~~~~~要不然辐射量这么大,会变异的呀~~~~",
21 | "good_num": "112",
22 | "comment_num": "18"
23 | },
24 | {
25 | "question_id": 10,
26 | "answer_id": 3,
27 | "feed_source_id": 23,
28 | "feed_source_name": "Rebecca10",
29 | "feed_source_txt": "赞了回答10",
30 | "feed_source_img": "../../images/icon1.jpeg",
31 | "question": "选择 Kindle 而不是纸质书的原因是什么?",
32 | "answer_ctnt": "难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的怎么真心不懂了...",
33 | "good_num": "112",
34 | "comment_num": "18"
35 | },
36 | {
37 | "question_id": 11,
38 | "answer_id": 25,
39 | "feed_source_id": 24,
40 | "feed_source_name": "Alex11",
41 | "feed_source_txt": "回答了问题11",
42 | "feed_source_img": "../../images/icon8.jpg",
43 | "question": "如何评价周杰伦的「中文歌才是最屌的」的言论?",
44 | "answer_ctnt": "不知道题主是否是学音乐的。 音乐有公认的经典,也有明显的流行趋势没有错。但归根结底,音乐是一种艺术,艺术是很主观的东西。跟画作一个道理,毕加索是大家,但很多人看不懂他的话,甚至觉得很难看...",
45 | "good_num": "112",
46 | "comment_num": "18"
47 | },
48 | {
49 | "question_id": 12,
50 | "answer_id": 61,
51 | "feed_source_id": 25,
52 | "feed_source_name": "George12",
53 | "feed_source_txt": "赞了回答12",
54 | "feed_source_img": "../../images/icon9.jpeg",
55 | "question": "气象铁塔的辐射大吗?",
56 | "answer_ctnt": "我不知道那个铁塔的情况,不过气象铁塔上会有一些测太阳辐射的设备,如果说辐射的话,太阳辐射那么多,大家赶紧躲进地底下呀~~~~~要不然辐射量这么大,会变异的呀~~~~",
57 | "good_num": "112",
58 | "comment_num": "18"
59 | },
60 | {
61 | "question_id": 13,
62 | "answer_id": 3,
63 | "feed_source_id": 23,
64 | "feed_source_name": "Rebecca13",
65 | "feed_source_txt": "赞了回答13",
66 | "feed_source_img": "../../images/icon1.jpeg",
67 | "question": "选择 Kindle 而不是纸质书的原因是什么?",
68 | "answer_ctnt": "难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的怎么真心不懂了...",
69 | "good_num": "112",
70 | "comment_num": "18"
71 | },
72 | {
73 | "question_id": 14,
74 | "answer_id": 25,
75 | "feed_source_id": 24,
76 | "feed_source_name": "Alex14",
77 | "feed_source_txt": "回答了问题14",
78 | "feed_source_img": "../../images/icon8.jpg",
79 | "question": "如何评价周杰伦的「中文歌才是最屌的」的言论?",
80 | "answer_ctnt": "不知道题主是否是学音乐的。 音乐有公认的经典,也有明显的流行趋势没有错。但归根结底,音乐是一种艺术,艺术是很主观的东西。跟画作一个道理,毕加索是大家,但很多人看不懂他的话,甚至觉得很难看...",
81 | "good_num": "112",
82 | "comment_num": "18"
83 | },
84 | {
85 | "question_id": 15,
86 | "answer_id": 61,
87 | "feed_source_id": 25,
88 | "feed_source_name": "George15",
89 | "feed_source_txt": "赞了回答15",
90 | "feed_source_img": "../../images/icon9.jpeg",
91 | "question": "气象铁塔的辐射大吗?",
92 | "answer_ctnt": "我不知道那个铁塔的情况,不过气象铁塔上会有一些测太阳辐射的设备,如果说辐射的话,太阳辐射那么多,大家赶紧躲进地底下呀~~~~~要不然辐射量这么大,会变异的呀~~~~",
93 | "good_num": "112",
94 | "comment_num": "18"
95 | },
96 | {
97 | "question_id": 16,
98 | "answer_id": 3,
99 | "feed_source_id": 23,
100 | "feed_source_name": "Rebecca16",
101 | "feed_source_txt": "赞了回答16",
102 | "feed_source_img": "../../images/icon1.jpeg",
103 | "question": "选择 Kindle 而不是纸质书的原因是什么?",
104 | "answer_ctnt": "难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的怎么真心不懂了...",
105 | "good_num": "112",
106 | "comment_num": "18"
107 | }
108 |
109 | ]
110 |
111 | }
112 | module.exports.next = next;
--------------------------------------------------------------------------------
/data/data_index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Rebecca_Han on 16/10/26.
3 | */
4 | module.exports = {
5 |
6 | }
7 |
8 | var index= {
9 | "id": 1,
10 | "data": [
11 | {
12 | "question_id": 1,
13 | "answer_id": 3,
14 | "feed_source_id": 23,
15 | "feed_source_name": "Rebecca",
16 | "feed_source_txt": "赞了回答1",
17 | "feed_source_img": "../../images/icon1.jpeg",
18 | "question": "选择 Kindle 而不是纸质书的原因是什么?",
19 | "answer_ctnt": "难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的怎么真心不懂了...",
20 | "good_num": "112",
21 | "comment_num": "18"
22 | },
23 | {
24 | "question_id": 2,
25 | "answer_id": 25,
26 | "feed_source_id": 24,
27 | "feed_source_name": "Alex",
28 | "feed_source_txt": "回答了问题2",
29 | "feed_source_img": "../../images/icon8.jpg",
30 | "question": "如何评价周杰伦的「中文歌才是最屌的」的言论?",
31 | "answer_ctnt": "不知道题主是否是学音乐的。 音乐有公认的经典,也有明显的流行趋势没有错。但归根结底,音乐是一种艺术,艺术是很主观的东西。跟画作一个道理,毕加索是大家,但很多人看不懂他的话,甚至觉得很难看...",
32 | "good_num": "112",
33 | "comment_num": "18"
34 | },
35 | {
36 | "question_id": 3,
37 | "answer_id": 61,
38 | "feed_source_id": 25,
39 | "feed_source_name": "George",
40 | "feed_source_txt": "赞了回答3",
41 | "feed_source_img": "../../images/icon9.jpeg",
42 | "question": "气象铁塔的辐射大吗?",
43 | "answer_ctnt": "我不知道那个铁塔的情况,不过气象铁塔上会有一些测太阳辐射的设备,如果说辐射的话,太阳辐射那么多,大家赶紧躲进地底下呀~~~~~要不然辐射量这么大,会变异的呀~~~~",
44 | "good_num": "112",
45 | "comment_num": "18"
46 | },
47 | {
48 | "question_id": 4,
49 | "answer_id": 3,
50 | "feed_source_id": 23,
51 | "feed_source_name": "Rebecca",
52 | "feed_source_txt": "赞了回答4",
53 | "feed_source_img": "../../images/icon1.jpeg",
54 | "question": "选择 Kindle 而不是纸质书的原因是什么?",
55 | "answer_ctnt": "难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的怎么真心不懂了...",
56 | "good_num": "112",
57 | "comment_num": "18"
58 | },
59 | {
60 | "question_id": 5,
61 | "answer_id": 25,
62 | "feed_source_id": 24,
63 | "feed_source_name": "Alex",
64 | "feed_source_txt": "回答了问题5",
65 | "feed_source_img": "../../images/icon8.jpg",
66 | "question": "如何评价周杰伦的「中文歌才是最屌的」的言论?",
67 | "answer_ctnt": "不知道题主是否是学音乐的。 音乐有公认的经典,也有明显的流行趋势没有错。但归根结底,音乐是一种艺术,艺术是很主观的东西。跟画作一个道理,毕加索是大家,但很多人看不懂他的话,甚至觉得很难看...",
68 | "good_num": "112",
69 | "comment_num": "18"
70 | },
71 | {
72 | "question_id": 6,
73 | "answer_id": 61,
74 | "feed_source_id": 25,
75 | "feed_source_name": "George",
76 | "feed_source_txt": "赞了回答6",
77 | "feed_source_img": "../../images/icon9.jpeg",
78 | "question": "气象铁塔的辐射大吗?",
79 | "answer_ctnt": "我不知道那个铁塔的情况,不过气象铁塔上会有一些测太阳辐射的设备,如果说辐射的话,太阳辐射那么多,大家赶紧躲进地底下呀~~~~~要不然辐射量这么大,会变异的呀~~~~",
80 | "good_num": "112",
81 | "comment_num": "18"
82 | },
83 | {
84 | "question_id": 7,
85 | "answer_id": 3,
86 | "feed_source_id": 23,
87 | "feed_source_name": "Rebecca",
88 | "feed_source_txt": "赞了回答7",
89 | "feed_source_img": "../../images/icon1.jpeg",
90 | "question": "选择 Kindle 而不是纸质书的原因是什么?",
91 | "answer_ctnt": "难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的怎么真心不懂了...",
92 | "good_num": "112",
93 | "comment_num": "18"
94 | },
95 | {
96 | "question_id": 8,
97 | "answer_id": 25,
98 | "feed_source_id": 24,
99 | "feed_source_name": "Alex",
100 | "feed_source_txt": "回答了问题8",
101 | "feed_source_img": "../../images/icon8.jpg",
102 | "question": "如何评价周杰伦的「中文歌才是最屌的」的言论?",
103 | "answer_ctnt": "不知道题主是否是学音乐的。 音乐有公认的经典,也有明显的流行趋势没有错。但归根结底,音乐是一种艺术,艺术是很主观的东西。跟画作一个道理,毕加索是大家,但很多人看不懂他的话,甚至觉得很难看...",
104 | "good_num": "112",
105 | "comment_num": "18"
106 | }
107 |
108 | ]
109 |
110 | }
111 |
112 | module.exports.index = index;
--------------------------------------------------------------------------------
/data/data_index_next.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Rebecca_Han on 16/10/27.
3 | */
4 |
5 | module.exports={
6 |
7 | };
8 |
9 | var next = {
10 | "id": 2,
11 | "data": [
12 | {
13 | "question_id": 9,
14 | "answer_id": 61,
15 | "feed_source_id": 25,
16 | "feed_source_name": "George",
17 | "feed_source_txt": "赞了回答9",
18 | "feed_source_img": "../../images/icon9.jpeg",
19 | "question": "气象铁塔的辐射大吗?",
20 | "answer_ctnt": "我不知道那个铁塔的情况,不过气象铁塔上会有一些测太阳辐射的设备,如果说辐射的话,太阳辐射那么多,大家赶紧躲进地底下呀~~~~~要不然辐射量这么大,会变异的呀~~~~",
21 | "good_num": "112",
22 | "comment_num": "18"
23 | },
24 | {
25 | "question_id": 10,
26 | "answer_id": 3,
27 | "feed_source_id": 23,
28 | "feed_source_name": "Rebecca",
29 | "feed_source_txt": "赞了回答10",
30 | "feed_source_img": "../../images/icon1.jpeg",
31 | "question": "选择 Kindle 而不是纸质书的原因是什么?",
32 | "answer_ctnt": "难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的怎么真心不懂了...",
33 | "good_num": "112",
34 | "comment_num": "18"
35 | },
36 | {
37 | "question_id": 11,
38 | "answer_id": 25,
39 | "feed_source_id": 24,
40 | "feed_source_name": "Alex",
41 | "feed_source_txt": "回答了问题11",
42 | "feed_source_img": "../../images/icon8.jpg",
43 | "question": "如何评价周杰伦的「中文歌才是最屌的」的言论?",
44 | "answer_ctnt": "不知道题主是否是学音乐的。 音乐有公认的经典,也有明显的流行趋势没有错。但归根结底,音乐是一种艺术,艺术是很主观的东西。跟画作一个道理,毕加索是大家,但很多人看不懂他的话,甚至觉得很难看...",
45 | "good_num": "112",
46 | "comment_num": "18"
47 | },
48 | {
49 | "question_id": 12,
50 | "answer_id": 61,
51 | "feed_source_id": 25,
52 | "feed_source_name": "George",
53 | "feed_source_txt": "赞了回答12",
54 | "feed_source_img": "../../images/icon9.jpeg",
55 | "question": "气象铁塔的辐射大吗?",
56 | "answer_ctnt": "我不知道那个铁塔的情况,不过气象铁塔上会有一些测太阳辐射的设备,如果说辐射的话,太阳辐射那么多,大家赶紧躲进地底下呀~~~~~要不然辐射量这么大,会变异的呀~~~~",
57 | "good_num": "112",
58 | "comment_num": "18"
59 | },
60 | {
61 | "question_id": 13,
62 | "answer_id": 3,
63 | "feed_source_id": 23,
64 | "feed_source_name": "Rebecca",
65 | "feed_source_txt": "赞了回答13",
66 | "feed_source_img": "../../images/icon1.jpeg",
67 | "question": "选择 Kindle 而不是纸质书的原因是什么?",
68 | "answer_ctnt": "难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的怎么真心不懂了...",
69 | "good_num": "112",
70 | "comment_num": "18"
71 | },
72 | {
73 | "question_id": 14,
74 | "answer_id": 25,
75 | "feed_source_id": 24,
76 | "feed_source_name": "Alex",
77 | "feed_source_txt": "回答了问题14",
78 | "feed_source_img": "../../images/icon8.jpg",
79 | "question": "如何评价周杰伦的「中文歌才是最屌的」的言论?",
80 | "answer_ctnt": "不知道题主是否是学音乐的。 音乐有公认的经典,也有明显的流行趋势没有错。但归根结底,音乐是一种艺术,艺术是很主观的东西。跟画作一个道理,毕加索是大家,但很多人看不懂他的话,甚至觉得很难看...",
81 | "good_num": "112",
82 | "comment_num": "18"
83 | },
84 | {
85 | "question_id": 15,
86 | "answer_id": 61,
87 | "feed_source_id": 25,
88 | "feed_source_name": "George",
89 | "feed_source_txt": "赞了回答15",
90 | "feed_source_img": "../../images/icon9.jpeg",
91 | "question": "气象铁塔的辐射大吗?",
92 | "answer_ctnt": "我不知道那个铁塔的情况,不过气象铁塔上会有一些测太阳辐射的设备,如果说辐射的话,太阳辐射那么多,大家赶紧躲进地底下呀~~~~~要不然辐射量这么大,会变异的呀~~~~",
93 | "good_num": "112",
94 | "comment_num": "18"
95 | },
96 | {
97 | "question_id": 16,
98 | "answer_id": 3,
99 | "feed_source_id": 23,
100 | "feed_source_name": "Rebecca",
101 | "feed_source_txt": "赞了回答16",
102 | "feed_source_img": "../../images/icon1.jpeg",
103 | "question": "选择 Kindle 而不是纸质书的原因是什么?",
104 | "answer_ctnt": "难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的怎么真心不懂了...",
105 | "good_num": "112",
106 | "comment_num": "18"
107 | }
108 |
109 | ]
110 |
111 | }
112 | module.exports.next = next;
--------------------------------------------------------------------------------
/images/1444983318907-_DSC1826.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/1444983318907-_DSC1826.jpg
--------------------------------------------------------------------------------
/images/24213.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/24213.jpg
--------------------------------------------------------------------------------
/images/24280.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/24280.jpg
--------------------------------------------------------------------------------
/images/allread.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/allread.png
--------------------------------------------------------------------------------
/images/book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/book.png
--------------------------------------------------------------------------------
/images/bottom_tab.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/bottom_tab.gif
--------------------------------------------------------------------------------
/images/burger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/burger.png
--------------------------------------------------------------------------------
/images/burger_focus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/burger_focus.png
--------------------------------------------------------------------------------
/images/chat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/chat.png
--------------------------------------------------------------------------------
/images/chat_focus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/chat_focus.png
--------------------------------------------------------------------------------
/images/comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/comment.png
--------------------------------------------------------------------------------
/images/comment2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/comment2.png
--------------------------------------------------------------------------------
/images/discovery.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/discovery.png
--------------------------------------------------------------------------------
/images/discovery_focus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/discovery_focus.png
--------------------------------------------------------------------------------
/images/draft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/draft.png
--------------------------------------------------------------------------------
/images/eye.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/eye.png
--------------------------------------------------------------------------------
/images/flag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/flag.png
--------------------------------------------------------------------------------
/images/good-bad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/good-bad.png
--------------------------------------------------------------------------------
/images/heart2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/heart2.png
--------------------------------------------------------------------------------
/images/icon1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/icon1.jpeg
--------------------------------------------------------------------------------
/images/icon8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/icon8.jpg
--------------------------------------------------------------------------------
/images/icon9.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/icon9.jpeg
--------------------------------------------------------------------------------
/images/index.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/index.png
--------------------------------------------------------------------------------
/images/index_focus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/index_focus.png
--------------------------------------------------------------------------------
/images/index_scroll.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/index_scroll.gif
--------------------------------------------------------------------------------
/images/invite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/invite.png
--------------------------------------------------------------------------------
/images/lighting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/lighting.png
--------------------------------------------------------------------------------
/images/live.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/live.png
--------------------------------------------------------------------------------
/images/more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/more.png
--------------------------------------------------------------------------------
/images/navigation.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/navigation.gif
--------------------------------------------------------------------------------
/images/recent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/recent.png
--------------------------------------------------------------------------------
/images/ring.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/ring.png
--------------------------------------------------------------------------------
/images/ring_focus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/ring_focus.png
--------------------------------------------------------------------------------
/images/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/search.png
--------------------------------------------------------------------------------
/images/star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/star.png
--------------------------------------------------------------------------------
/images/star2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/star2.png
--------------------------------------------------------------------------------
/images/top_tab.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/top_tab.gif
--------------------------------------------------------------------------------
/images/v_discovery.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/v_discovery.png
--------------------------------------------------------------------------------
/images/v_index.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/v_index.png
--------------------------------------------------------------------------------
/images/write.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/write.png
--------------------------------------------------------------------------------
/images/zhi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RebeccaHanjw/weapp-wechat-zhihu/e8b7b4b9e2baceb4d34a3affb06931df93707d5f/images/zhi.png
--------------------------------------------------------------------------------
/pages/answer/answer.js:
--------------------------------------------------------------------------------
1 | //answer.js
2 | var util = require('../../utils/util.js')
3 |
4 | var app = getApp()
5 | Page({
6 | data: {
7 | motto: '知乎--微信小程序版',
8 | userInfo: {}
9 | },
10 | //事件处理函数
11 | toQuestion: function() {
12 | wx.navigateTo({
13 | url: '../question/question'
14 | })
15 | },
16 | onLoad: function () {
17 | console.log('onLoad')
18 | var that = this
19 | //调用应用实例的方法获取全局数据
20 | app.getUserInfo(function(userInfo){
21 | //更新数据
22 | that.setData({
23 | userInfo:userInfo
24 | })
25 | })
26 | },
27 | tapName: function(event){
28 | console.log(event)
29 | }
30 | })
31 |
--------------------------------------------------------------------------------
/pages/answer/answer.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "回答"
3 | }
--------------------------------------------------------------------------------
/pages/answer/answer.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 选择 Kindle 而不是纸质书的原因是什么?
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Rebecca
14 | WEB前端*不靠谱天气预报员*想做代码小仙女
15 |
16 |
17 | 十 关注
18 |
19 |
20 |
21 |
22 | 难道不明白纸质书更贵啊!!!
23 |
24 | 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。
25 |
26 | 另外,用kindle看小说的怎么真心不懂了。题主不看小说么?难道题主拿来看教科书还是技术文档?还是题主觉得小说就是小时代内样的?(对小时代没偏见,尊重多样性)
27 |
28 | 而且纸质书搬起来真心困难啊!当初毕业带不回来,忍痛卖了不少好桑心!
29 |
30 | 碎片时间阅读总不能天天背着一本书吧,那么占地方。
31 |
32 | 看到描述最后一段,感觉有骗答案的嫌疑
33 |
34 |
35 |
36 |
37 | 难道不明白纸质书更贵啊!!!
38 |
39 | 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。
40 |
41 | 另外,用kindle看小说的怎么真心不懂了。题主不看小说么?难道题主拿来看教科书还是技术文档?还是题主觉得小说就是小时代内样的?(对小时代没偏见,尊重多样性)
42 |
43 | 而且纸质书搬起来真心困难啊!当初毕业带不回来,忍痛卖了不少好桑心!
44 |
45 | 碎片时间阅读总不能天天背着一本书吧,那么占地方。
46 |
47 | 看到描述最后一段,感觉有骗答案的嫌疑
48 |
49 |
50 |
51 |
52 |
53 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/pages/answer/answer.wxss:
--------------------------------------------------------------------------------
1 | /**answer.wxss**/
2 |
3 | .container {
4 | padding: 0;
5 | font-size: 14rpx;
6 | background: #F0F4F3;
7 | color: #000;
8 | }
9 |
10 | .question {
11 | position: relative;
12 | width: 650rpx;
13 | padding: 40rpx 50rpx 30rpx;
14 | background: #298DE5;
15 | color: #fff;
16 | font-size: 38rpx;
17 | line-height: 48rpx;
18 | }
19 | .answerer-wrp{
20 | position: relative;
21 | width: 750rpx;
22 | height: 150rpx;
23 | background: #fff;
24 | }
25 | .answerer-wrp .bg-half{
26 | position: absolute;
27 | top: 0;
28 | width: 750rpx;
29 | height: 75rpx;
30 | background: #298DE5;
31 | }
32 | .answerer {
33 | position: relative;
34 | margin: 0 auto;
35 | width: 630rpx;
36 | height: 90rpx;
37 | padding: 30rpx;
38 | background: #fff;
39 | border: solid 1px #ebebeb;
40 | border-radius: 3px;
41 | box-shadow: 0 1px 2px #bebebe;
42 | }
43 | .answerer .avatar {
44 | flex: 1;
45 | width: 90rpx;
46 | height: 90rpx;
47 | }
48 |
49 | .answerer .avatar image {
50 | display: inline-block;
51 | width: 90rpx;
52 | height: 90rpx;
53 | border-radius: 90rpx;
54 | }
55 | .answerer .answerer-info{
56 | flex: 5;
57 | text-align: left;
58 | padding: 10rpx 20rpx;
59 | line-height: 38rpx;
60 | }
61 | .answerer .answerer-info text{
62 | display: block;
63 | }
64 | .answerer .answerer-info .answerer-name{
65 | font-size: 32rpx;
66 | }
67 | .answerer .answerer-info .answerer-des{
68 | font-size: 22rpx;
69 | color: #808080;
70 | line-height: 28rpx;
71 | }
72 | .answerer .follow{
73 | flex: 2;
74 | padding: 15rpx 0;
75 | font-size: 22rpx;
76 | }
77 | .answerer .follow text{
78 | display: inline-block;
79 | padding: 15rpx 20rpx;
80 | color: #40bcd0;
81 | border: solid 2px #40bcd0;
82 | border-radius: 6rpx;
83 | }
84 | .answer-content{
85 | padding: 30rpx 40rpx;
86 | background: #ffffff;
87 | }
88 | .answer-content text{
89 | font-size: 32rpx;
90 | color: #454545;
91 | line-height: 44rpx;
92 | }
93 | .answer-content image{
94 | width: 100%;
95 | margin: 20rpx 0;
96 | }
97 | .answer-footer{
98 | position: fixed;
99 | bottom: 0;
100 | height: 70rpx;
101 | border-top: solid 1px #ebebeb;
102 | background: #ffffff;
103 | width: 670rpx;
104 | padding: 20rpx 40rpx;
105 | }
106 | .answer-footer .good{
107 | flex: 1;
108 | /*display: inline-block;*/
109 | height: 40rpx;
110 | border: solid 1px #d1d1d1;
111 | border-radius: 3px;
112 | padding: 10rpx 8rpx;
113 | margin: 10rpx 0;
114 | }
115 | .answer-footer .good .good-bad{
116 | display: inline-block;
117 | }
118 | .answer-footer .good image{
119 | display: inline-block;
120 | width: 38rpx;
121 | height: 38rpx;
122 | vertical-align: middle;
123 | }
124 | .answer-footer .good .good-num{
125 | display: inline-block;
126 | padding: 10rpx 4rpx;
127 | /*font-size: 24rpx;*/
128 | }
129 | .answer-footer .operation-wrp{
130 | flex: 5;
131 | }
132 | .answer-footer .operation{
133 | justify-content: space-between;
134 | padding: 0 0 0 60rpx;
135 | }
136 | .answer-footer .operation-btn{
137 | flex: 1;
138 | text-align: center;
139 | }
140 | .answer-footer .operation image{
141 | display: block;
142 | margin: 0 auto;
143 | width: 50rpx;
144 | height: 50rpx;
145 | }
146 | .answer-footer .operation-btn text{
147 | display: block;
148 | font-size: 14rpx;
149 | color: #bebebe;
150 | }
151 |
--------------------------------------------------------------------------------
/pages/chat/chat.js:
--------------------------------------------------------------------------------
1 | //logs.js
2 | var util = require('../../utils/util.js')
3 | // Page({
4 | // data: {
5 | // logs: []
6 | // },
7 | // onLoad: function () {
8 | // this.setData({
9 | // logs: (wx.getStorageSync('logs') || []).map(function (log) {
10 | // return util.formatTime(new Date(log))
11 | // })
12 | // })
13 | // }
14 | // })
15 |
16 | Page({
17 | data: {
18 | focus: false,
19 | inputValue: ''
20 | },
21 | bindButtonTap: function() {
22 | this.setData({
23 | focus: Date.now()
24 | })
25 | },
26 | bindKeyInput: function(e) {
27 | this.setData({
28 | inputValue: e.detail.value
29 | })
30 | },
31 | bindReplaceInput: function(e) {
32 | var value = e.detail.value
33 | var pos = e.detail.cursor
34 | if(pos != -1){
35 | //光标在中间
36 | var left = e.detail.value.slice(0,pos)
37 | //计算光标的位置
38 | pos = left.replace(/11/g,'2').length
39 | }
40 |
41 | //直接返回对象,可以对输入进行过滤处理,同时可以控制光标的位置
42 | return {
43 | value: value.replace(/11/g,'2'),
44 | cursor: pos
45 | }
46 |
47 | //或者直接返回字符串,光标在最后边
48 | //return value.replace(/11/g,'2'),
49 | },
50 | bindHideKeyboard: function(e) {
51 | if (e.detail.value === '123') {
52 | //收起键盘
53 | wx.hideKeyboard()
54 | }
55 | }
56 | })
--------------------------------------------------------------------------------
/pages/chat/chat.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "私信"
3 | }
--------------------------------------------------------------------------------
/pages/chat/chat.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Alex
10 | 1 个月前
11 |
12 | 你好~ 你好~ 你好~
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | George
22 | 3 个月前
23 |
24 | 你好~ 你好~ 你好~
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/pages/chat/chat.wxss:
--------------------------------------------------------------------------------
1 | .chat-item{
2 | width: 725rpx;
3 | background: #ffffff;
4 | padding: 25rpx 25rpx 25rpx 0;
5 | border-bottom: solid 1px #ebebeb;
6 | }
7 | .chat-item image{
8 | width: 80rpx;
9 | height: 80rpx;
10 | border-radius: 80rpx;
11 | }
12 | .chat-item .avatar{
13 | flex: 1;
14 | }
15 | .chat-item .chat-content{
16 | flex: 4;
17 | text-align: left;
18 | }
19 | .chat-item .chat-content text{
20 | /*display: block;*/
21 | }
22 | .chat-item .chat-content .chat-source{
23 | color: #818A8F;
24 | font-size: 28rpx;
25 | padding: 4rpx 0 8rpx 0;
26 | }
27 | .chat-item .chat-content .chat-source .chatmate{
28 | font-size: 34rpx;
29 | color: #000000;
30 | text-align: left;
31 | }
32 | .chat-item .chat-content .chat-source .lasttime{
33 | flex: 1;
34 | font-size: 22rpx;
35 | float: right;
36 | vertical-align: text-bottom;
37 | }
38 | .chat-item .chat-content .chat-txt{
39 | display: block;
40 | color: #7b7b7b;
41 | font-size: 26rpx;
42 | line-height: 34rpx;
43 | }
--------------------------------------------------------------------------------
/pages/discovery/discovery.js:
--------------------------------------------------------------------------------
1 | //discovery.js
2 | var util = require('../../utils/util.js')
3 | Page({
4 | data: {
5 | navTab: ["推荐", "圆桌", "热门", "收藏"],
6 | currentNavtab: "0",
7 | imgUrls: [
8 | '../../images/24213.jpg',
9 | '../../images/24280.jpg',
10 | '../../images/1444983318907-_DSC1826.jpg'
11 | ],
12 | indicatorDots: false,
13 | autoplay: true,
14 | interval: 5000,
15 | duration: 1000,
16 | feed: [],
17 | feed_length: 0
18 | },
19 | onLoad: function () {
20 | console.log('onLoad')
21 | var that = this
22 | //调用应用实例的方法获取全局数据
23 | this.refresh();
24 | },
25 | switchTab: function(e){
26 | this.setData({
27 | currentNavtab: e.currentTarget.dataset.idx
28 | });
29 | },
30 |
31 | bindItemTap: function() {
32 | wx.navigateTo({
33 | url: '../answer/answer'
34 | })
35 | },
36 | bindQueTap: function() {
37 | wx.navigateTo({
38 | url: '../question/question'
39 | })
40 | },
41 | upper: function () {
42 | wx.showNavigationBarLoading()
43 | this.refresh();
44 | console.log("upper");
45 | setTimeout(function(){wx.hideNavigationBarLoading();wx.stopPullDownRefresh();}, 2000);
46 | },
47 | lower: function (e) {
48 | wx.showNavigationBarLoading();
49 | var that = this;
50 | setTimeout(function(){wx.hideNavigationBarLoading();that.nextLoad();}, 1000);
51 | console.log("lower")
52 | },
53 | //scroll: function (e) {
54 | // console.log("scroll")
55 | //},
56 |
57 | //网络请求数据, 实现刷新
58 | refresh0: function(){
59 | var index_api = '';
60 | util.getData(index_api)
61 | .then(function(data){
62 | //this.setData({
63 | //
64 | //});
65 | console.log(data);
66 | });
67 | },
68 |
69 | //使用本地 fake 数据实现刷新效果
70 | refresh: function(){
71 | var feed = util.getDiscovery();
72 | console.log("loaddata");
73 | var feed_data = feed.data;
74 | this.setData({
75 | feed:feed_data,
76 | feed_length: feed_data.length
77 | });
78 | },
79 |
80 | //使用本地 fake 数据实现继续加载效果
81 | nextLoad: function(){
82 | var next = util.discoveryNext();
83 | console.log("continueload");
84 | var next_data = next.data;
85 | this.setData({
86 | feed: this.data.feed.concat(next_data),
87 | feed_length: this.data.feed_length + next_data.length
88 | });
89 | }
90 | });
91 |
--------------------------------------------------------------------------------
/pages/discovery/discovery.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": ""
3 | }
--------------------------------------------------------------------------------
/pages/discovery/discovery.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{itemName}}
5 |
6 |
7 |
8 |
9 |
10 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | {{item.feed_source_name}}
27 |
28 |
29 |
30 |
31 |
32 | {{item.question}}
33 |
34 |
35 |
36 |
37 | {{item.answer_ctnt}}
38 |
39 |
40 |
41 | {{item.good_num}} 赞同
42 |
43 |
46 |
47 | 关注问题
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | 圆桌
57 |
58 |
59 | 热门
60 |
61 |
62 | 收藏
63 |
64 |
65 |
--------------------------------------------------------------------------------
/pages/discovery/discovery.wxss:
--------------------------------------------------------------------------------
1 | .container{
2 | height: 1500rpx;
3 | }
4 | .top-tab{
5 | width: 750rpx;
6 | height: 100rpx;
7 | background: #298DE5;
8 | color: #8CCEFD;
9 | font-size: 28rpx;
10 | line-height: 100rpx;
11 | box-shadow: 0 2px 2px #bebebe;
12 | margin: 0 0 8rpx 0;
13 | z-index: 9999;
14 | }
15 |
16 | .toptab.active{
17 | color: #ffffff;
18 | border-bottom: solid 2px #ffffff;
19 | }
20 | .activity{
21 | width: 750rpx;
22 | height: 375rpx;
23 | }
24 | .activity image{
25 | width: 750rpx;
26 | height: 375rpx;
27 | }
28 | .placehold{
29 | font-size: 28rpx;
30 | padding: 80rpx 0;
31 | }
--------------------------------------------------------------------------------
/pages/index/index.js:
--------------------------------------------------------------------------------
1 | //index.js
2 |
3 | var util = require('../../utils/util.js')
4 | var app = getApp()
5 | Page({
6 | data: {
7 | feed: [],
8 | feed_length: 0
9 | },
10 | //事件处理函数
11 | bindItemTap: function() {
12 | wx.navigateTo({
13 | url: '../answer/answer'
14 | })
15 | },
16 | bindQueTap: function() {
17 | wx.navigateTo({
18 | url: '../question/question'
19 | })
20 | },
21 | onLoad: function () {
22 | console.log('onLoad')
23 | var that = this
24 | //调用应用实例的方法获取全局数据
25 | this.getData();
26 | },
27 | upper: function () {
28 | wx.showNavigationBarLoading()
29 | this.refresh();
30 | console.log("upper");
31 | setTimeout(function(){wx.hideNavigationBarLoading();wx.stopPullDownRefresh();}, 2000);
32 | },
33 | lower: function (e) {
34 | wx.showNavigationBarLoading();
35 | var that = this;
36 | setTimeout(function(){wx.hideNavigationBarLoading();that.nextLoad();}, 1000);
37 | console.log("lower")
38 | },
39 | //scroll: function (e) {
40 | // console.log("scroll")
41 | //},
42 |
43 | //网络请求数据, 实现首页刷新
44 | refresh0: function(){
45 | var index_api = '';
46 | util.getData(index_api)
47 | .then(function(data){
48 | //this.setData({
49 | //
50 | //});
51 | console.log(data);
52 | });
53 | },
54 |
55 | //使用本地 fake 数据实现刷新效果
56 | getData: function(){
57 | var feed = util.getData2();
58 | console.log("loaddata");
59 | var feed_data = feed.data;
60 | this.setData({
61 | feed:feed_data,
62 | feed_length: feed_data.length
63 | });
64 | },
65 | refresh: function(){
66 | wx.showToast({
67 | title: '刷新中',
68 | icon: 'loading',
69 | duration: 3000
70 | });
71 | var feed = util.getData2();
72 | console.log("loaddata");
73 | var feed_data = feed.data;
74 | this.setData({
75 | feed:feed_data,
76 | feed_length: feed_data.length
77 | });
78 | setTimeout(function(){
79 | wx.showToast({
80 | title: '刷新成功',
81 | icon: 'success',
82 | duration: 2000
83 | })
84 | },3000)
85 |
86 | },
87 |
88 | //使用本地 fake 数据实现继续加载效果
89 | nextLoad: function(){
90 | wx.showToast({
91 | title: '加载中',
92 | icon: 'loading',
93 | duration: 4000
94 | })
95 | var next = util.getNext();
96 | console.log("continueload");
97 | var next_data = next.data;
98 | this.setData({
99 | feed: this.data.feed.concat(next_data),
100 | feed_length: this.data.feed_length + next_data.length
101 | });
102 | setTimeout(function(){
103 | wx.showToast({
104 | title: '加载成功',
105 | icon: 'success',
106 | duration: 2000
107 | })
108 | },3000)
109 | }
110 |
111 |
112 | })
113 |
--------------------------------------------------------------------------------
/pages/index/index.json:
--------------------------------------------------------------------------------
1 |
2 | {
3 |
4 | }
--------------------------------------------------------------------------------
/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | {{item.feed_source_name}}{{item.feed_source_txt}}
21 |
22 |
23 |
24 |
25 |
26 |
27 | {{item.question}}
28 |
29 |
30 |
31 |
32 | {{item.answer_ctnt}}
33 |
34 |
35 |
36 | {{item.good_num}} 赞同
37 |
38 |
41 |
42 | 关注问题
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /**index.wxss**/
2 |
3 | .container{
4 | height: 1500rpx;
5 | }
6 | .container .search{
7 | width: 735rpx;
8 | height: 65rpx;
9 | padding: 12.5rpx 0 12.5rpx 15rpx;
10 | background: #2A8CE5;
11 | }
12 | .container .search-left{
13 | flex: 8;
14 | background: #4EA3E7;
15 | text-align: left;
16 | }
17 | .container .search-left input{
18 | display: inline-block;
19 | height: 65rpx;
20 | font-size: 26rpx;
21 | }
22 | .search-placeholder{
23 | color: #8CCEFD;
24 | line-height: 20rpx;
25 | }
26 | .container .search .search-left image{
27 | display: inline-block;
28 | width: 35rpx;
29 | height: 35rpx;
30 | padding: 15rpx 15rpx 15rpx 20rpx;
31 | }
32 | .container .search .search-right{
33 | flex: 1;
34 | }
35 | .container .search .search-right image{
36 | width: 45rpx;
37 | height: 45rpx;
38 | padding: 10rpx;
39 | }
40 |
41 | .container{
42 | padding: 0;
43 | font-size: 14rpx;
44 | background: #F0F4F3;
45 | color: #000;
46 | }
47 | /*feed-item part is in app.wxss for multiplexing*/
--------------------------------------------------------------------------------
/pages/more/more.js:
--------------------------------------------------------------------------------
1 | //logs.js
2 | var util = require('../../utils/util.js')
3 | var app = getApp()
4 | Page({
5 | data: {
6 | motto: 'Hello World',
7 | userInfo: {}
8 | },
9 | //事件处理函数
10 | bindViewTap: function() {
11 | wx.navigateTo({
12 | url: ''
13 | })
14 | },
15 | onLoad: function () {
16 | console.log('onLoad')
17 | var that = this
18 | //调用应用实例的方法获取全局数据
19 | app.getUserInfo(function(userInfo){
20 | //更新数据
21 | that.setData({
22 | userInfo:userInfo
23 | })
24 | })
25 | }
26 | })
--------------------------------------------------------------------------------
/pages/more/more.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "更多"
3 | }
--------------------------------------------------------------------------------
/pages/more/more.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{userInfo.nickName}}
9 | 查看或编辑个人主页
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 我的关注
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | 我的收藏
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | 我的草稿
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | 最近浏览
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | 我的书架
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | 我的 Live
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | 我的值乎
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/pages/more/more.wxss:
--------------------------------------------------------------------------------
1 | .user {
2 | width: 725rpx;
3 | background: #ffffff;
4 | padding: 30rpx 25rpx 30rpx 0;
5 | margin: 15rpx 0 0 0;
6 | border-top: 1px solid #eee;
7 | border-bottom: 1px solid #dcdcdc;
8 | box-shadow: 0 2px 5px #eeeeee;
9 | }
10 | .user .userinfo-avatar{
11 | flex: 1;
12 | display: inline-block;
13 | width: 100rpx;
14 | height: 100rpx;
15 | border-radius: 80rpx;
16 | }
17 | .user .user-info{
18 | flex: 5;
19 | text-align: left;
20 | }
21 | .user .user-info text{
22 | display: block;
23 | }
24 | .user .user-info .userinfo-nickname{
25 | padding: 8rpx 0 10rpx 0;
26 | font-size: 30rpx;
27 | color: #818A8F;
28 | }
29 | .user .user-info .edit{
30 | font-size: 30rpx;
31 | color: #bababa;
32 | line-height: 34rpx;
33 | }
34 |
35 | .my{
36 | margin: 15rpx 0 0 0;
37 | border-top: solid 1px #ebebeb;
38 | border-bottom: solid 2px #ebebeb;
39 | }
40 | .my .my-item{
41 | width: 750rpx;
42 | background: #ffffff;
43 | padding: 0
44 | }
45 | .my .my-item .myitem-icon{
46 | flex: 1;
47 | }
48 | .my .my-item .myitem-icon image{
49 | width: 45rpx;
50 | height: 45rpx;
51 | padding: 37.5rpx 0;
52 | }
53 | .my .my-item .myitem-name{
54 | flex: 5;
55 | text-align: left;
56 | font-size: 34rpx;
57 | color: #6d6d6d;
58 | line-height: 60rpx;
59 | padding: 30rpx 0;
60 | border-bottom: solid 1px #ebebeb;
61 | }
62 | .my .my-item:last-child .myitem-name{
63 | border-bottom: none;
64 | }
--------------------------------------------------------------------------------
/pages/notify/notify.js:
--------------------------------------------------------------------------------
1 | //logs.js
2 | var util = require('../../utils/util.js')
3 | Page({
4 | data: {
5 | navTab: ["通知", "赞与感谢", "关注"],
6 | currentNavtab: "0"
7 | },
8 | onLoad: function () {
9 |
10 | },
11 | switchTab: function(e){
12 | this.setData({
13 | currentNavtab: e.currentTarget.dataset.idx
14 | });
15 | }
16 | })
17 |
--------------------------------------------------------------------------------
/pages/notify/notify.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": ""
3 | }
--------------------------------------------------------------------------------
/pages/notify/notify.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{itemName}}
5 |
6 |
7 |
8 |
9 |
10 | 0 条未读
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | Rebecca 回答了问题
19 | C#如何在不覆盖原有文件的情况下直接修改某一部分的内容?
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | Rebecca 回答了问题
28 | C#如何在不覆盖原有文件的情况下直接修改某一部分的内容?
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | Rebecca 回答了问题
37 | C#如何在不覆盖原有文件的情况下直接修改某一部分的内容?
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | Rebecca 回答了问题
46 | C#如何在不覆盖原有文件的情况下直接修改某一部分的内容?
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | Rebecca 回答了问题
55 | C#如何在不覆盖原有文件的情况下直接修改某一部分的内容?
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | Rebecca 回答了问题
64 | C#如何在不覆盖原有文件的情况下直接修改某一部分的内容?
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | Rebecca 回答了问题
73 | C#如何在不覆盖原有文件的情况下直接修改某一部分的内容?
74 |
75 |
76 |
77 |
78 | 赞与感谢
79 |
80 |
81 | 关注
82 |
83 |
84 |
--------------------------------------------------------------------------------
/pages/notify/notify.wxss:
--------------------------------------------------------------------------------
1 | .unread{
2 | color: #9A9C9B;
3 | height: 60rpx;
4 | padding: 10rpx 40rpx;
5 | text-align: left;
6 | width: 670rpx;
7 | }
8 | .unread text{
9 | display: inline-block;
10 | line-height: 60rpx;
11 | font-size: 22rpx;
12 | }
13 | .unread image{
14 | display: inline-block;
15 | width: 50rpx;
16 | height: 50rpx;
17 | vertical-align: middle;
18 | float: right;
19 | }
20 | .notify-item{
21 | width: 680rpx;
22 | background: #ffffff;
23 | padding: 25rpx 70rpx 25rpx 0;
24 | border-bottom: solid 1px #ebebeb;
25 | }
26 | .notify-item image{
27 | width: 80rpx;
28 | height: 80rpx;
29 | border-radius: 80rpx;
30 | }
31 | .notify-item .avatar{
32 | flex: 1;
33 | }
34 | .notify-item .notify-content{
35 | flex: 4;
36 | text-align: left;
37 | }
38 | .notify-item .notify-content text{
39 | display: block;
40 | }
41 | .notify-item .notify-content .notify-source{
42 | color: #818A8F;
43 | font-size: 28rpx;
44 | padding: 0 0 8rpx 0;
45 | }
46 | .notify-item .notify-content .notify-title{
47 | color: #AFAFAF;
48 | font-size: 30rpx;
49 | line-height: 34rpx;
50 | }
51 | .placehold{
52 | padding: 80rpx 0;
53 | font-size: 28rpx
54 | }
--------------------------------------------------------------------------------
/pages/question/question.js:
--------------------------------------------------------------------------------
1 | //answer.js
2 | var util = require('../../utils/util.js')
3 |
4 | var app = getApp()
5 | Page({
6 | data: {
7 | motto: '知乎--微信小程序版',
8 | userInfo: {}
9 | },
10 | //事件处理函数
11 | bindItemTap: function() {
12 | wx.navigateTo({
13 | url: '../answer/answer'
14 | })
15 | },
16 | onLoad: function () {
17 | console.log('onLoad')
18 | var that = this
19 | //调用应用实例的方法获取全局数据
20 | app.getUserInfo(function(userInfo){
21 | //更新数据
22 | that.setData({
23 | userInfo:userInfo
24 | })
25 | })
26 | },
27 | tapName: function(event){
28 | console.log(event)
29 | }
30 | })
31 |
--------------------------------------------------------------------------------
/pages/question/question.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "问题"
3 | }
--------------------------------------------------------------------------------
/pages/question/question.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 阅读
7 | 电子书
8 | Kindle
9 | 书籍
10 | 文学
11 |
12 |
13 | 选择 Kindle 而不是纸质书的原因是什么?
14 |
15 |
16 | WEB前端*不靠谱天气预报员*想做代码小仙女
17 |
18 |
19 |
20 |
21 |
22 | 3316
23 |
24 |
28 |
29 |
30 | 关注
31 |
32 |
33 |
34 |
35 |
36 |
37 | 邀请回答
38 |
39 |
40 |
41 | 写回答
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | Rebecca
53 |
54 |
55 |
56 |
57 |
58 | 难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的...
59 |
60 |
61 |
62 | 3.9K 赞同
63 |
64 |
67 |
68 | 2 个月前
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | Rebecca
82 |
83 |
84 |
85 |
86 |
87 | 难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的...
88 |
89 |
90 |
91 | 3.9K 赞同
92 |
93 |
96 |
97 | 2 个月前
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | Rebecca
111 |
112 |
113 |
114 |
115 |
116 | 难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的...
117 |
118 |
119 |
120 | 3.9K 赞同
121 |
122 |
125 |
126 | 2 个月前
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 | Rebecca
140 |
141 |
142 |
143 |
144 |
145 | 难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的...
146 |
147 |
148 |
149 | 3.9K 赞同
150 |
151 |
154 |
155 | 2 个月前
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 | Rebecca
169 |
170 |
171 |
172 |
173 |
174 | 难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的...
175 |
176 |
177 |
178 | 3.9K 赞同
179 |
180 |
183 |
184 | 2 个月前
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 | Rebecca
198 |
199 |
200 |
201 |
202 |
203 | 难道不明白纸质书更贵啊!!! 若觉得kindle更贵,我觉得要么阅读量太少,那确实没有买kindle的必要。要么买的都是盗版的纸质书?我不清楚不加以评论。。。 另外,用kindle看小说的...
204 |
205 |
206 |
207 | 3.9K 赞同
208 |
209 |
212 |
213 | 2 个月前
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
--------------------------------------------------------------------------------
/pages/question/question.wxss:
--------------------------------------------------------------------------------
1 | /**answer.wxss**/
2 |
3 | .answer-feed {
4 | padding: 0;
5 | font-size: 14rpx;
6 | background: #F0F4F3;
7 | color: #000;
8 | }
9 | .question-wrp{
10 | border-radius: 3px;
11 | box-shadow: 0 1px 2px #bebebe;
12 | }
13 | .question-item{
14 | width: 710rpx;
15 | padding: 40rpx 20rpx 10rpx;
16 | background: #fff;
17 | }
18 | .question-item .que-tag{
19 |
20 | }
21 | .question-item .que-tag .tag{
22 | height: 28rpx;
23 | padding: 15rpx 20rpx;
24 | border-radius: 28rpx;
25 | margin: 0 10rpx;
26 | background: #EEF5F8;
27 | color: #2186E0;
28 | font-size: 28rpx;
29 | vertical-align: middle;
30 | }
31 | .question-item .que-title{
32 | padding: 40rpx 20rpx 30rpx;
33 | font-size: 38rpx;
34 | }
35 | .question-item .que-content{
36 | padding: 0 20rpx;
37 | font-size: 26rpx;
38 | }
39 | .question-item .que-follow{
40 | margin: 20rpx;
41 | height: 68rpx;
42 | }
43 | .question-item .que-follow view{
44 | display: inline-block;
45 | margin: 0 40rpx 0 0;
46 | }
47 |
48 | .question-item .que-follow image{
49 | width: 50rpx;
50 | height: 50rpx;
51 | margin: 0 10rpx 0 0;
52 | vertical-align: middle;
53 | }
54 | .question-item .que-follow .left{
55 | float: left;
56 | padding: 10rpx 0;
57 | }
58 | .question-item .que-follow .left text{
59 | color: #AFAFAF;
60 | height: 50rpx;
61 | vertical-align: middle;
62 | padding: 18rpx 0;
63 | font-size: 24rpx;
64 | }
65 | .question-item .que-follow .right{
66 | float: right;
67 | padding: 20rpx 55rpx;
68 | color: #ffffff;
69 | background: #52C980;
70 | border-radius: 3px;
71 | font-size: 26rpx;
72 | margin: 0;
73 | }
74 | .que-operate{
75 | width: 750rpx;
76 | border-top: solid 1px #ebebeb;
77 | border-bottom: solid 1px #ebebeb;
78 | color: #889091;
79 | vertical-align: middle;
80 | background: #ffffff;
81 | }
82 | .que-operate .flex-item{
83 | padding: 20rpx 0;
84 | font-size: 26rpx;
85 | }
86 | .que-operate .invite{
87 | border-right: solid 2px #ebebeb;
88 | }
89 | .que-operate image{
90 | width: 50rpx;
91 | height: 50rpx;
92 | vertical-align: middle;
93 | margin: 0 20rpx 0 0;
94 | }
95 |
96 | /*.answer-feed .feed-item{*/
97 | /*width: 690rpx;*/
98 | /*padding: 30rpx 30rpx 20rpx;*/
99 | /*margin: 7rpx 0 6rpx 0;*/
100 | /*background: #ffffff;*/
101 | /*border-top: 1px solid #eee;*/
102 | /*border-bottom: 1px solid #eee;*/
103 | /*box-shadow: 0 2px 5px #eeeeee;*/
104 | /*}*/
105 | /*.answer-feed .feed-item .feed-source{*/
106 | /*width: 690rpx;*/
107 | /*left: 0;*/
108 | /*height: 50rpx;*/
109 | /*}*/
110 | /*.answer-feed .feed-item .feed-source .avatar{*/
111 | /*position: relative;*/
112 | /*display: inline-block;*/
113 | /*}*/
114 | /*.answer-feed .feed-item .feed-source a{*/
115 | /*display: inline-block;*/
116 | /*height: 40rpx;*/
117 | /*}*/
118 | /*.answer-feed .feed-item .feed-source .avatar image{*/
119 | /*/!*position: absolute;*!/*/
120 | /*display: inline-block;*/
121 | /*width: 45rpx;*/
122 | /*height: 45rpx;*/
123 | /*border-radius: 45rpx;*/
124 | /*top: 10rpx;*/
125 | /*vertical-align: middle;*/
126 | /*}*/
127 | /*.answer-feed .feed-item .feed-source text{*/
128 | /*/!*position: absolute;*!/*/
129 | /*display: inline-block;*/
130 | /*height: 40rpx;*/
131 | /*line-height: 40rpx;*/
132 | /*vertical-align: middle;*/
133 | /*margin: 0 0 0 15rpx;*/
134 | /*color: #a0acac;*/
135 | /*font-size: 16rpx;*/
136 | /*}*/
137 | /*.answer-feed .feed-item .feed-source .item-more{*/
138 | /*display: inline-block;*/
139 | /*width: 40rpx;*/
140 | /*height: 45rpx;*/
141 | /*float: right;*/
142 | /*}*/
143 | /*.answer-feed .feed-item .feed-content{*/
144 | /*padding: 10rpx 0 0 0;*/
145 | /*}*/
146 | /*.answer-feed .feed-item .feed-content .question text{*/
147 | /*font-size: 28rpx;*/
148 | /*font-weight: 600px;*/
149 | /*line-height: 40rpx;*/
150 | /*text-space: 5rpx;*/
151 | /*}*/
152 | .answer-feed .feed-item .feed-content .answer-body{
153 | padding: 0;
154 | /*height: 10rpx;*/
155 | font-size: 24rpx;
156 | line-height: 28rpx;
157 | color: #5b5b5b;
158 | }
159 | /*.answer-feed .feed-item .feed-content .answer-actions{*/
160 | /*width: 690rpx;*/
161 | /*padding: 10rpx 0 0;*/
162 | /*color: #a0acac;*/
163 | /*}*/
164 | /*.answer-feed .feed-item .feed-content .answer-actions view{*/
165 | /*display: inline-block;*/
166 | /*vertical-align: text-bottom;*/
167 | /*padding: 0 10rpx 0 0;*/
168 | /*font-size: 24rpx;*/
169 | /*}*/
170 | /*.answer-feed .feed-item .feed-content .answer-actions .dot ::after{*/
171 | /*content: "•";*/
172 | /*}*/
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
--------------------------------------------------------------------------------
/utils/util.js:
--------------------------------------------------------------------------------
1 | function formatTime(date) {
2 | var year = date.getFullYear()
3 | var month = date.getMonth() + 1
4 | var day = date.getDate()
5 |
6 | var hour = date.getHours()
7 | var minute = date.getMinutes()
8 | var second = date.getSeconds()
9 |
10 |
11 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
12 | }
13 |
14 | function formatNumber(n) {
15 | n = n.toString()
16 | return n[1] ? n : '0' + n
17 | }
18 |
19 | module.exports = {
20 | formatTime: formatTime
21 | };
22 |
23 | var index = require('../data/data_index.js')
24 | var index_next = require('../data/data_index_next.js')
25 | var discovery = require('../data/data_discovery.js')
26 | var discovery_next = require('../data/data_discovery_next.js')
27 |
28 | function getData(url){
29 | return new Promise(function(resolve, reject){
30 | wx.request({
31 | url: url,
32 | data: {},
33 | header: {
34 | //'Content-Type': 'application/json'
35 | },
36 | success: function(res) {
37 | console.log("success")
38 | resolve(res)
39 | },
40 | fail: function (res) {
41 | reject(res)
42 | console.log("failed")
43 | }
44 | })
45 | })
46 | }
47 |
48 | function getData2(){
49 | return index.index;
50 | }
51 |
52 | function getNext(){
53 | return index_next.next;
54 | }
55 |
56 | function getDiscovery(){
57 | return discovery.discovery;
58 | }
59 |
60 | function discoveryNext(){
61 | return discovery_next.next;
62 | }
63 |
64 |
65 |
66 | module.exports.getData = getData;
67 | module.exports.getData2 = getData2;
68 | module.exports.getNext = getNext;
69 | module.exports.getDiscovery = getDiscovery;
70 | module.exports.discoveryNext = discoveryNext;
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------