├── search ├── search.json ├── search │ ├── search.json │ ├── search.wxml │ ├── search.wxss │ └── search.js ├── search.wxss ├── search.wxml └── search.js ├── square ├── square.json ├── question │ ├── question.json │ ├── question.wxml │ ├── question.js │ └── question.wxss ├── square.wxss ├── square.wxml └── square.js ├── pages ├── search │ ├── search.json │ ├── search │ │ ├── search.json │ │ ├── search.wxml │ │ ├── search.wxss │ │ └── search.js │ ├── search.wxss │ ├── search.wxml │ └── search.js ├── square │ ├── square.json │ ├── question │ │ ├── question.json │ │ ├── question.wxml │ │ ├── question.wxss │ │ └── question.js │ ├── square.wxss │ ├── square.wxml │ └── square.js ├── user │ ├── register │ │ ├── register.json │ │ ├── register.wxss │ │ ├── register.wxml │ │ └── register.js │ ├── user-index │ │ ├── user-index.json │ │ ├── user-index.wxml │ │ ├── user-index.wxss │ │ └── user-index.js │ ├── user.json │ ├── user.js │ ├── user.wxss │ └── user.wxml └── topics │ ├── topics.json │ ├── topics.wxml │ ├── topics.wxss │ └── topics.js ├── user ├── register │ ├── register.json │ ├── register.wxss │ ├── register.wxml │ └── register.js ├── user-index │ ├── user-index.json │ ├── user-index.wxml │ ├── user-index.wxss │ └── user-index.js ├── user.json ├── user.js ├── user.wxss └── user.wxml ├── topics ├── topics.json ├── topics.wxml ├── topics.wxss └── topics.js ├── images ├── head.png ├── image.png ├── user.png ├── 动态码.png ├── message.png ├── search.png ├── square.png ├── topics.png ├── password.png ├── telephone.png ├── username.png ├── checknumber.png ├── search_selected.png ├── square_selected.png ├── topics_selected.png └── user_selected.png ├── results ├── all.gif ├── square.png └── topics.png ├── utils └── util.js ├── app.js ├── app.json ├── app.wxss ├── README.md └── style └── weui.wxss /search/search.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /square/square.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /pages/search/search.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /pages/square/square.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /search/search/search.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /pages/search/search/search.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /square/question/question.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /user/register/register.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /user/user-index/user-index.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /pages/square/question/question.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /pages/user/register/register.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /pages/user/user-index/user-index.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /search/search.wxss: -------------------------------------------------------------------------------- 1 | /* pages/search/search.wxss */ -------------------------------------------------------------------------------- /pages/search/search.wxss: -------------------------------------------------------------------------------- 1 | /* pages/search/search.wxss */ -------------------------------------------------------------------------------- /topics/topics.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "话题列表" 3 | } -------------------------------------------------------------------------------- /user/user.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "登录沪江账号" 3 | } -------------------------------------------------------------------------------- /pages/user/user.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "登录沪江账号" 3 | } -------------------------------------------------------------------------------- /pages/topics/topics.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "话题列表" 3 | } -------------------------------------------------------------------------------- /images/head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/head.png -------------------------------------------------------------------------------- /images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/image.png -------------------------------------------------------------------------------- /images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/user.png -------------------------------------------------------------------------------- /images/动态码.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/动态码.png -------------------------------------------------------------------------------- /results/all.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/results/all.gif -------------------------------------------------------------------------------- /images/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/message.png -------------------------------------------------------------------------------- /images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/search.png -------------------------------------------------------------------------------- /images/square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/square.png -------------------------------------------------------------------------------- /images/topics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/topics.png -------------------------------------------------------------------------------- /results/square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/results/square.png -------------------------------------------------------------------------------- /results/topics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/results/topics.png -------------------------------------------------------------------------------- /images/password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/password.png -------------------------------------------------------------------------------- /images/telephone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/telephone.png -------------------------------------------------------------------------------- /images/username.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/username.png -------------------------------------------------------------------------------- /images/checknumber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/checknumber.png -------------------------------------------------------------------------------- /images/search_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/search_selected.png -------------------------------------------------------------------------------- /images/square_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/square_selected.png -------------------------------------------------------------------------------- /images/topics_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/topics_selected.png -------------------------------------------------------------------------------- /images/user_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiHao24/HuJiang/HEAD/images/user_selected.png -------------------------------------------------------------------------------- /search/search/search.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 取消 8 | 9 | 10 | 11 | 暂无结果,换个词试试 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /pages/search/search/search.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 取消 8 | 9 | 10 | 11 | 暂无结果,换个词试试 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /search/search/search.wxss: -------------------------------------------------------------------------------- 1 | /* pages/search/search/search.wxss */ 2 | 3 | .search { 4 | width: 90%; 5 | height: 80rpx; 6 | line-height: 80rpx; 7 | margin: 10rpx auto; 8 | display: flex; 9 | align-items: center; 10 | justify-content: space-between; 11 | } 12 | 13 | .search-input { 14 | display: flex; 15 | border-bottom: 1rpx solid #11CF7E; 16 | flex: 1; 17 | } 18 | 19 | .search-text { 20 | flex: 1; 21 | } 22 | 23 | .search-back { 24 | width: 80rpx; 25 | } 26 | 27 | .search-question { 28 | width: 90%; 29 | margin: 40rpx auto; 30 | background-color: #11CF7E; 31 | } 32 | 33 | .serach-text { 34 | display: block; 35 | text-align: center; 36 | font-size: 28rpx; 37 | color: #e6e6e6; 38 | } -------------------------------------------------------------------------------- /search/search.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 搜索你的问题 8 | 9 | 10 | 11 | 你可以这样问 12 | 13 | 14 | 日语入门那本买教材好? 15 | 16 | 17 | 请问如何高效的记忆英语单词? 18 | 19 | 20 | 如何快速提高韩语阅读能力? 21 | 22 | -------------------------------------------------------------------------------- /pages/search/search.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 搜索你的问题 8 | 9 | 10 | 11 | 你可以这样问 12 | 13 | 14 | 日语入门那本买教材好? 15 | 16 | 17 | 请问如何高效的记忆英语单词? 18 | 19 | 20 | 如何快速提高韩语阅读能力? 21 | 22 | -------------------------------------------------------------------------------- /pages/search/search/search.wxss: -------------------------------------------------------------------------------- 1 | /* pages/search/search/search.wxss */ 2 | 3 | .search { 4 | width: 90%; 5 | height: 80rpx; 6 | line-height: 80rpx; 7 | margin: 10rpx auto; 8 | display: flex; 9 | align-items: center; 10 | justify-content: space-between; 11 | } 12 | 13 | .search-input { 14 | display: flex; 15 | border-bottom: 1rpx solid #11CF7E; 16 | flex: 1; 17 | } 18 | 19 | .search-text { 20 | flex: 1; 21 | } 22 | 23 | .search-back { 24 | width: 80rpx; 25 | } 26 | 27 | .search-question { 28 | width: 90%; 29 | margin: 40rpx auto; 30 | background-color: #11CF7E; 31 | } 32 | 33 | .serach-text { 34 | display: block; 35 | text-align: center; 36 | font-size: 28rpx; 37 | color: #e6e6e6; 38 | } -------------------------------------------------------------------------------- /user/user-index/user-index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | dreamer 6 | 7 | 8 | {{item}} 9 | 10 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /pages/user/user-index/user-index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | dreamer 6 | 7 | 8 | {{item}} 9 | 10 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /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 | 10 | getUserInfo: function(cb) { 11 | var that = this 12 | if (this.globalData.userInfo) { 13 | typeof cb == "function" && cb(this.globalData.userInfo) 14 | } else { 15 | //调用登录接口 16 | wx.getUserInfo({ 17 | withCredentials: false, 18 | success: function(res) { 19 | that.globalData.userInfo = res.userInfo 20 | typeof cb == "function" && cb(that.globalData.userInfo) 21 | } 22 | }) 23 | } 24 | }, 25 | 26 | globalData: { 27 | userInfo: null 28 | } 29 | }) -------------------------------------------------------------------------------- /user/register/register.wxss: -------------------------------------------------------------------------------- 1 | /* pages/user/register/register.wxss */ 2 | 3 | page { 4 | height: 100%; 5 | } 6 | 7 | .register { 8 | margin: auto; 9 | } 10 | 11 | .log-text { 12 | width: 80%; 13 | font-size: 24rpx; 14 | margin: 40rpx auto; 15 | text-align: center; 16 | } 17 | 18 | .log-color-text { 19 | color: green; 20 | } 21 | 22 | .log { 23 | border: 1px solid #e6e6e6; 24 | border-radius: 8rpx; 25 | height: 80rpx; 26 | width: 80%; 27 | display: flex; 28 | align-items: center; 29 | margin: 80rpx auto; 30 | } 31 | 32 | .log-icon { 33 | width: 50rpx; 34 | height: 50rpx; 35 | margin: auto 10rpx; 36 | } 37 | 38 | .log-login { 39 | background-color: green; 40 | width: 80%; 41 | } 42 | 43 | .log-register { 44 | font-size: 28rpx; 45 | width: 80%; 46 | display: inline-block; 47 | margin: 20rpx auto; 48 | text-align: right; 49 | } -------------------------------------------------------------------------------- /pages/user/register/register.wxss: -------------------------------------------------------------------------------- 1 | /* pages/user/register/register.wxss */ 2 | 3 | page { 4 | height: 100%; 5 | } 6 | 7 | .register { 8 | margin: auto; 9 | } 10 | 11 | .log-text { 12 | width: 80%; 13 | font-size: 24rpx; 14 | margin: 40rpx auto; 15 | text-align: center; 16 | } 17 | 18 | .log-color-text { 19 | color: green; 20 | } 21 | 22 | .log { 23 | border: 1px solid #e6e6e6; 24 | border-radius: 8rpx; 25 | height: 80rpx; 26 | width: 80%; 27 | display: flex; 28 | align-items: center; 29 | margin: 80rpx auto; 30 | } 31 | 32 | .log-icon { 33 | width: 50rpx; 34 | height: 50rpx; 35 | margin: auto 10rpx; 36 | } 37 | 38 | .log-login { 39 | background-color: green; 40 | width: 80%; 41 | } 42 | 43 | .log-register { 44 | font-size: 28rpx; 45 | width: 80%; 46 | display: inline-block; 47 | margin: 20rpx auto; 48 | text-align: right; 49 | } -------------------------------------------------------------------------------- /user/user-index/user-index.wxss: -------------------------------------------------------------------------------- 1 | /* pages/user/user-index/user-index.wxss */ 2 | 3 | .page { 4 | height: 100%; 5 | } 6 | 7 | .page-user { 8 | display: flex; 9 | align-items: center; 10 | justify-content: space-between; 11 | height: 200rpx; 12 | background-color: #11CF7E; 13 | border-bottom: 30rpx solid #e6e6e6; 14 | } 15 | 16 | .username { 17 | flex: 1; 18 | } 19 | 20 | .index-navbar { 21 | height: 80rpx; 22 | border-bottom: 2rpx solid #e6e6e6; 23 | display: flex; 24 | } 25 | 26 | .item { 27 | flex: 1; 28 | text-align: center; 29 | height: 100%; 30 | line-height: 80rpx; 31 | } 32 | 33 | .active { 34 | color: #11CF7E; 35 | border-bottom: 2rpx solid #11CF7E; 36 | } 37 | 38 | .header { 39 | margin: auto 50rpx; 40 | border-radius: 50%; 41 | width: 100rpx; 42 | height: 100rpx; 43 | } 44 | 45 | .qustion-apply, 46 | .qustion-ask { 47 | margin-top: 100rpx; 48 | text-align: center; 49 | } -------------------------------------------------------------------------------- /pages/user/user-index/user-index.wxss: -------------------------------------------------------------------------------- 1 | /* pages/user/user-index/user-index.wxss */ 2 | 3 | .page { 4 | height: 100%; 5 | } 6 | 7 | .page-user { 8 | display: flex; 9 | align-items: center; 10 | justify-content: space-between; 11 | height: 200rpx; 12 | background-color: #11CF7E; 13 | border-bottom: 30rpx solid #e6e6e6; 14 | } 15 | 16 | .username { 17 | flex: 1; 18 | } 19 | 20 | .index-navbar { 21 | height: 80rpx; 22 | border-bottom: 2rpx solid #e6e6e6; 23 | display: flex; 24 | } 25 | 26 | .item { 27 | flex: 1; 28 | text-align: center; 29 | height: 100%; 30 | line-height: 80rpx; 31 | } 32 | 33 | .active { 34 | color: #11CF7E; 35 | border-bottom: 2rpx solid #11CF7E; 36 | } 37 | 38 | .header { 39 | margin: auto 50rpx; 40 | border-radius: 50%; 41 | width: 100rpx; 42 | height: 100rpx; 43 | } 44 | 45 | .qustion-apply, 46 | .qustion-ask { 47 | margin-top: 100rpx; 48 | text-align: center; 49 | } -------------------------------------------------------------------------------- /user/user-index/user-index.js: -------------------------------------------------------------------------------- 1 | // pages/user/user-index/user-index.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | navbar: ['我的提问', '我的回答'], 9 | currentTab: 0, 10 | }, 11 | navbarTap: function(e) { 12 | this.setData({ 13 | currentTab: e.currentTarget.dataset.idx 14 | }) 15 | }, 16 | /** 17 | * 生命周期函数--监听页面加载 18 | */ 19 | onLoad: function(options) { 20 | 21 | }, 22 | 23 | /** 24 | * 生命周期函数--监听页面初次渲染完成 25 | */ 26 | onReady: function() { 27 | 28 | }, 29 | 30 | /** 31 | * 生命周期函数--监听页面显示 32 | */ 33 | onShow: function() { 34 | 35 | }, 36 | 37 | /** 38 | * 生命周期函数--监听页面隐藏 39 | */ 40 | onHide: function() { 41 | 42 | }, 43 | 44 | /** 45 | * 生命周期函数--监听页面卸载 46 | */ 47 | onUnload: function() { 48 | 49 | }, 50 | 51 | /** 52 | * 页面相关事件处理函数--监听用户下拉动作 53 | */ 54 | onPullDownRefresh: function() { 55 | 56 | }, 57 | 58 | /** 59 | * 页面上拉触底事件的处理函数 60 | */ 61 | onReachBottom: function() { 62 | 63 | }, 64 | 65 | /** 66 | * 用户点击右上角分享 67 | */ 68 | onShareAppMessage: function() { 69 | 70 | } 71 | }) -------------------------------------------------------------------------------- /pages/user/user-index/user-index.js: -------------------------------------------------------------------------------- 1 | // pages/user/user-index/user-index.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | navbar: ['我的提问', '我的回答'], 9 | currentTab: 0, 10 | }, 11 | navbarTap: function(e) { 12 | this.setData({ 13 | currentTab: e.currentTarget.dataset.idx 14 | }) 15 | }, 16 | /** 17 | * 生命周期函数--监听页面加载 18 | */ 19 | onLoad: function(options) { 20 | 21 | }, 22 | 23 | /** 24 | * 生命周期函数--监听页面初次渲染完成 25 | */ 26 | onReady: function() { 27 | 28 | }, 29 | 30 | /** 31 | * 生命周期函数--监听页面显示 32 | */ 33 | onShow: function() { 34 | 35 | }, 36 | 37 | /** 38 | * 生命周期函数--监听页面隐藏 39 | */ 40 | onHide: function() { 41 | 42 | }, 43 | 44 | /** 45 | * 生命周期函数--监听页面卸载 46 | */ 47 | onUnload: function() { 48 | 49 | }, 50 | 51 | /** 52 | * 页面相关事件处理函数--监听用户下拉动作 53 | */ 54 | onPullDownRefresh: function() { 55 | 56 | }, 57 | 58 | /** 59 | * 页面上拉触底事件的处理函数 60 | */ 61 | onReachBottom: function() { 62 | 63 | }, 64 | 65 | /** 66 | * 用户点击右上角分享 67 | */ 68 | onShareAppMessage: function() { 69 | 70 | } 71 | }) -------------------------------------------------------------------------------- /search/search/search.js: -------------------------------------------------------------------------------- 1 | // pages/search/search/search.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | 9 | }, 10 | back: function() { 11 | wx.navigateBack({ 12 | url: '/pages/search/search' 13 | }) 14 | }, 15 | ask: function() { 16 | wx.navigateTo({ 17 | url: '/pages/square/question/question' 18 | }) 19 | }, 20 | 21 | /** 22 | * 生命周期函数--监听页面加载 23 | */ 24 | onLoad: function(options) { 25 | 26 | }, 27 | 28 | /** 29 | * 生命周期函数--监听页面初次渲染完成 30 | */ 31 | onReady: function() { 32 | 33 | }, 34 | 35 | /** 36 | * 生命周期函数--监听页面显示 37 | */ 38 | onShow: function() { 39 | 40 | }, 41 | 42 | /** 43 | * 生命周期函数--监听页面隐藏 44 | */ 45 | onHide: function() { 46 | 47 | }, 48 | 49 | /** 50 | * 生命周期函数--监听页面卸载 51 | */ 52 | onUnload: function() { 53 | 54 | }, 55 | 56 | /** 57 | * 页面相关事件处理函数--监听用户下拉动作 58 | */ 59 | onPullDownRefresh: function() { 60 | 61 | }, 62 | 63 | /** 64 | * 页面上拉触底事件的处理函数 65 | */ 66 | onReachBottom: function() { 67 | 68 | }, 69 | 70 | /** 71 | * 用户点击右上角分享 72 | */ 73 | onShareAppMessage: function() { 74 | 75 | } 76 | }) -------------------------------------------------------------------------------- /pages/search/search/search.js: -------------------------------------------------------------------------------- 1 | // pages/search/search/search.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | 9 | }, 10 | back: function() { 11 | wx.navigateBack({ 12 | url: '/pages/search/search' 13 | }) 14 | }, 15 | ask: function() { 16 | wx.navigateTo({ 17 | url: '/pages/square/question/question' 18 | }) 19 | }, 20 | 21 | /** 22 | * 生命周期函数--监听页面加载 23 | */ 24 | onLoad: function(options) { 25 | 26 | }, 27 | 28 | /** 29 | * 生命周期函数--监听页面初次渲染完成 30 | */ 31 | onReady: function() { 32 | 33 | }, 34 | 35 | /** 36 | * 生命周期函数--监听页面显示 37 | */ 38 | onShow: function() { 39 | 40 | }, 41 | 42 | /** 43 | * 生命周期函数--监听页面隐藏 44 | */ 45 | onHide: function() { 46 | 47 | }, 48 | 49 | /** 50 | * 生命周期函数--监听页面卸载 51 | */ 52 | onUnload: function() { 53 | 54 | }, 55 | 56 | /** 57 | * 页面相关事件处理函数--监听用户下拉动作 58 | */ 59 | onPullDownRefresh: function() { 60 | 61 | }, 62 | 63 | /** 64 | * 页面上拉触底事件的处理函数 65 | */ 66 | onReachBottom: function() { 67 | 68 | }, 69 | 70 | /** 71 | * 用户点击右上角分享 72 | */ 73 | onShareAppMessage: function() { 74 | 75 | } 76 | }) -------------------------------------------------------------------------------- /user/register/register.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 注册代表您已经阅读并同意 24 | 《沪江用户协议》 25 | 去登录>> 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /pages/user/register/register.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 注册代表您已经阅读并同意 24 | 《沪江用户协议》 25 | 去登录>> 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /square/square.wxss: -------------------------------------------------------------------------------- 1 | /* pages/square/square.wxss */ 2 | 3 | page { 4 | height: 100%; 5 | } 6 | 7 | 8 | /* 数据显示 */ 9 | 10 | .item-box { 11 | border-bottom: 2rpx solid #e6e6e6; 12 | margin: 0 auto; 13 | padding: 15rpx 20rpx; 14 | font-size: 30rpx; 15 | } 16 | 17 | .user { 18 | display: flex; 19 | align-items: center; 20 | justify-content: space-between; 21 | } 22 | 23 | .user-header { 24 | width: 50rpx; 25 | height: 50rpx; 26 | border-radius: 50%; 27 | margin-right: 30rpx; 28 | } 29 | 30 | .user-name { 31 | flex: 1; 32 | } 33 | 34 | .user-question-type { 35 | display: inline-block; 36 | height: 40rpx; 37 | font-size: 30rpx; 38 | line-height: 40rpx; 39 | margin-right: 20rpx; 40 | padding: 10rpx; 41 | font-size: 26rpx; 42 | border: 2rpx solid #e6e6e6; 43 | } 44 | 45 | .apply-text { 46 | display: block; 47 | margin: 20rpx 0; 48 | } 49 | 50 | .apply-count { 51 | display: block; 52 | font-size: 24rpx; 53 | } 54 | 55 | 56 | /* 提问按妞 */ 57 | 58 | .question { 59 | width: 100rpx; 60 | height: 100rpx; 61 | line-height: 100rpx; 62 | border-radius: 50%; 63 | background-color: yellow; 64 | color: #fff; 65 | right: 50rpx; 66 | bottom: 60rpx; 67 | text-align: center; 68 | position: fixed; 69 | } -------------------------------------------------------------------------------- /search/search.js: -------------------------------------------------------------------------------- 1 | // pages/search/search.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | src: "https://media.ifanrusercontent.com/media/user_files/trochili/ca/b6/cab63881836403cab865417ab0d7d94d099cb309-3b57c70a300404573f849df082c55c5038dafe40.png", 9 | url: '/pages/search/search/search' 10 | 11 | }, 12 | toast: function() { 13 | wx.navigateTo({ 14 | url: '/pages/search/search/search' 15 | }) 16 | }, 17 | 18 | /** 19 | * 生命周期函数--监听页面加载 20 | */ 21 | onLoad: function(options) { 22 | 23 | }, 24 | 25 | /** 26 | * 生命周期函数--监听页面初次渲染完成 27 | */ 28 | onReady: function() { 29 | 30 | }, 31 | 32 | /** 33 | * 生命周期函数--监听页面显示 34 | */ 35 | onShow: function() { 36 | 37 | }, 38 | 39 | /** 40 | * 生命周期函数--监听页面隐藏 41 | */ 42 | onHide: function() { 43 | 44 | }, 45 | 46 | /** 47 | * 生命周期函数--监听页面卸载 48 | */ 49 | onUnload: function() { 50 | 51 | }, 52 | 53 | /** 54 | * 页面相关事件处理函数--监听用户下拉动作 55 | */ 56 | onPullDownRefresh: function() { 57 | 58 | }, 59 | 60 | /** 61 | * 页面上拉触底事件的处理函数 62 | */ 63 | onReachBottom: function() { 64 | 65 | }, 66 | 67 | /** 68 | * 用户点击右上角分享 69 | */ 70 | onShareAppMessage: function() { 71 | 72 | } 73 | }) -------------------------------------------------------------------------------- /pages/search/search.js: -------------------------------------------------------------------------------- 1 | // pages/search/search.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | src: "https://media.ifanrusercontent.com/media/user_files/trochili/ca/b6/cab63881836403cab865417ab0d7d94d099cb309-3b57c70a300404573f849df082c55c5038dafe40.png", 9 | url: '/pages/search/search/search' 10 | 11 | }, 12 | toast: function() { 13 | wx.navigateTo({ 14 | url: '/pages/search/search/search' 15 | }) 16 | }, 17 | 18 | /** 19 | * 生命周期函数--监听页面加载 20 | */ 21 | onLoad: function(options) { 22 | 23 | }, 24 | 25 | /** 26 | * 生命周期函数--监听页面初次渲染完成 27 | */ 28 | onReady: function() { 29 | 30 | }, 31 | 32 | /** 33 | * 生命周期函数--监听页面显示 34 | */ 35 | onShow: function() { 36 | 37 | }, 38 | 39 | /** 40 | * 生命周期函数--监听页面隐藏 41 | */ 42 | onHide: function() { 43 | 44 | }, 45 | 46 | /** 47 | * 生命周期函数--监听页面卸载 48 | */ 49 | onUnload: function() { 50 | 51 | }, 52 | 53 | /** 54 | * 页面相关事件处理函数--监听用户下拉动作 55 | */ 56 | onPullDownRefresh: function() { 57 | 58 | }, 59 | 60 | /** 61 | * 页面上拉触底事件的处理函数 62 | */ 63 | onReachBottom: function() { 64 | 65 | }, 66 | 67 | /** 68 | * 用户点击右上角分享 69 | */ 70 | onShareAppMessage: function() { 71 | 72 | } 73 | }) -------------------------------------------------------------------------------- /pages/square/square.wxss: -------------------------------------------------------------------------------- 1 | /* pages/square/square.wxss */ 2 | 3 | page { 4 | height: 100%; 5 | } 6 | 7 | 8 | /* 数据显示 */ 9 | 10 | .item-box { 11 | border-bottom: 2rpx solid #e6e6e6; 12 | margin: 0 auto; 13 | padding: 15rpx 20rpx; 14 | font-size: 30rpx; 15 | } 16 | 17 | .user { 18 | display: flex; 19 | align-items: center; 20 | justify-content: space-between; 21 | } 22 | 23 | .user-header { 24 | width: 50rpx; 25 | height: 50rpx; 26 | border-radius: 50%; 27 | margin-right: 30rpx; 28 | } 29 | 30 | .user-name { 31 | flex: 1; 32 | } 33 | 34 | .user-question-type { 35 | display: inline-block; 36 | height: 40rpx; 37 | font-size: 30rpx; 38 | line-height: 40rpx; 39 | margin-right: 20rpx; 40 | padding: 10rpx; 41 | font-size: 26rpx; 42 | border: 2rpx solid #e6e6e6; 43 | } 44 | 45 | .apply-text { 46 | display: block; 47 | margin: 20rpx 0; 48 | } 49 | 50 | .apply-count { 51 | display: block; 52 | font-size: 24rpx; 53 | } 54 | 55 | 56 | /* 提问按妞 */ 57 | 58 | .question { 59 | width: 100rpx; 60 | height: 100rpx; 61 | line-height: 100rpx; 62 | border-radius: 50%; 63 | background-color: yellow; 64 | color: #fff; 65 | right: 50rpx; 66 | bottom: 60rpx; 67 | text-align: center; 68 | position: fixed; 69 | } -------------------------------------------------------------------------------- /user/user.js: -------------------------------------------------------------------------------- 1 | // pages/user/user.js 2 | Page({ 3 | /** 4 | * 页面的初始数据 5 | */ 6 | data: { 7 | // username: '/images/username.png', 8 | navbar: ['普通登录', '手机快速登录'], 9 | currentTab: 0, 10 | url: '/pages/user/register/register' 11 | }, 12 | 13 | navbarTap: function(e) { 14 | this.setData({ 15 | currentTab: e.currentTarget.dataset.idx 16 | }) 17 | }, 18 | defaultTap: function() { 19 | wx.navigateTo({ 20 | url: '/pages/user/user-index/user-index' 21 | }) 22 | }, 23 | /** 24 | * 生命周期函数--监听页面加载 25 | */ 26 | onLoad: function(options) { 27 | 28 | }, 29 | 30 | /** 31 | * 生命周期函数--监听页面初次渲染完成 32 | */ 33 | onReady: function() { 34 | 35 | }, 36 | 37 | /** 38 | * 生命周期函数--监听页面显示 39 | */ 40 | onShow: function() { 41 | 42 | }, 43 | 44 | /** 45 | * 生命周期函数--监听页面隐藏 46 | */ 47 | onHide: function() { 48 | 49 | }, 50 | 51 | /** 52 | * 生命周期函数--监听页面卸载 53 | */ 54 | onUnload: function() { 55 | 56 | }, 57 | 58 | /** 59 | * 页面相关事件处理函数--监听用户下拉动作 60 | */ 61 | onPullDownRefresh: function() { 62 | 63 | }, 64 | 65 | /** 66 | * 页面上拉触底事件的处理函数 67 | */ 68 | onReachBottom: function() { 69 | 70 | }, 71 | 72 | /** 73 | * 用户点击右上角分享 74 | */ 75 | onShareAppMessage: function() { 76 | 77 | } 78 | }) -------------------------------------------------------------------------------- /pages/user/user.js: -------------------------------------------------------------------------------- 1 | // pages/user/user.js 2 | Page({ 3 | /** 4 | * 页面的初始数据 5 | */ 6 | data: { 7 | // username: '/images/username.png', 8 | navbar: ['普通登录', '手机快速登录'], 9 | currentTab: 0, 10 | url: '/pages/user/register/register' 11 | }, 12 | 13 | navbarTap: function(e) { 14 | this.setData({ 15 | currentTab: e.currentTarget.dataset.idx 16 | }) 17 | }, 18 | defaultTap: function() { 19 | wx.navigateTo({ 20 | url: '/pages/user/user-index/user-index' 21 | }) 22 | }, 23 | /** 24 | * 生命周期函数--监听页面加载 25 | */ 26 | onLoad: function(options) { 27 | 28 | }, 29 | 30 | /** 31 | * 生命周期函数--监听页面初次渲染完成 32 | */ 33 | onReady: function() { 34 | 35 | }, 36 | 37 | /** 38 | * 生命周期函数--监听页面显示 39 | */ 40 | onShow: function() { 41 | 42 | }, 43 | 44 | /** 45 | * 生命周期函数--监听页面隐藏 46 | */ 47 | onHide: function() { 48 | 49 | }, 50 | 51 | /** 52 | * 生命周期函数--监听页面卸载 53 | */ 54 | onUnload: function() { 55 | 56 | }, 57 | 58 | /** 59 | * 页面相关事件处理函数--监听用户下拉动作 60 | */ 61 | onPullDownRefresh: function() { 62 | 63 | }, 64 | 65 | /** 66 | * 页面上拉触底事件的处理函数 67 | */ 68 | onReachBottom: function() { 69 | 70 | }, 71 | 72 | /** 73 | * 用户点击右上角分享 74 | */ 75 | onShareAppMessage: function() { 76 | 77 | } 78 | }) -------------------------------------------------------------------------------- /user/user.wxss: -------------------------------------------------------------------------------- 1 | /* pages/user/user.wxss */ 2 | 3 | page { 4 | height: 100%; 5 | } 6 | 7 | .user-navbar { 8 | margin-top: 200rpx; 9 | display: flex; 10 | align-items: center; 11 | justify-content: space-between; 12 | background: #fff; 13 | } 14 | 15 | .user-navbar .item { 16 | flex: 1; 17 | text-align: center; 18 | line-height: 80rpx; 19 | } 20 | 21 | .active { 22 | color: #11CF7E; 23 | border-bottom: 2rpx solid #11CF7E; 24 | } 25 | 26 | 27 | /* 登录样式 */ 28 | 29 | .log, 30 | .log-number { 31 | border-radius: 8rpx; 32 | height: 80rpx; 33 | width: 80%; 34 | display: flex; 35 | align-items: center; 36 | margin: 80rpx auto; 37 | } 38 | 39 | .log { 40 | border: 1px solid #e6e6e6; 41 | } 42 | 43 | .log-input-text { 44 | flex: 1; 45 | } 46 | 47 | .log-icon { 48 | width: 50rpx; 49 | height: 50rpx; 50 | padding: 15rpx 20rpx; 51 | border: 2rpx solid #e6e6e6; 52 | border-right: none; 53 | } 54 | 55 | .text { 56 | display: inline-block; 57 | height: 100%; 58 | border: 2rpx solid #e6e6e6; 59 | border-left: none; 60 | border-radius: 8rpx; 61 | } 62 | 63 | .log-login { 64 | background-color: green; 65 | width: 80%; 66 | } 67 | 68 | .log-source { 69 | height: 100%; 70 | line-height: 80rpx; 71 | width: 240rpx; 72 | margin-left: 40rpx; 73 | background-color: #eee; 74 | } 75 | 76 | .log-register { 77 | font-size: 28rpx; 78 | width: 80%; 79 | margin: 20rpx auto; 80 | } 81 | 82 | .log-register-text { 83 | float: right; 84 | } -------------------------------------------------------------------------------- /pages/user/user.wxss: -------------------------------------------------------------------------------- 1 | /* pages/user/user.wxss */ 2 | 3 | page { 4 | height: 100%; 5 | } 6 | 7 | .user-navbar { 8 | margin-top: 200rpx; 9 | display: flex; 10 | align-items: center; 11 | justify-content: space-between; 12 | background: #fff; 13 | } 14 | 15 | .user-navbar .item { 16 | flex: 1; 17 | text-align: center; 18 | line-height: 80rpx; 19 | } 20 | 21 | .active { 22 | color: #11CF7E; 23 | border-bottom: 2rpx solid #11CF7E; 24 | } 25 | 26 | 27 | /* 登录样式 */ 28 | 29 | .log, 30 | .log-number { 31 | border-radius: 8rpx; 32 | height: 80rpx; 33 | width: 80%; 34 | display: flex; 35 | align-items: center; 36 | margin: 80rpx auto; 37 | } 38 | 39 | .log { 40 | border: 1px solid #e6e6e6; 41 | } 42 | 43 | .log-input-text { 44 | flex: 1; 45 | } 46 | 47 | .log-icon { 48 | width: 50rpx; 49 | height: 50rpx; 50 | padding: 15rpx 20rpx; 51 | border: 2rpx solid #e6e6e6; 52 | border-right: none; 53 | } 54 | 55 | .text { 56 | display: inline-block; 57 | height: 100%; 58 | border: 2rpx solid #e6e6e6; 59 | border-left: none; 60 | border-radius: 8rpx; 61 | } 62 | 63 | .log-login { 64 | background-color: green; 65 | width: 80%; 66 | } 67 | 68 | .log-source { 69 | height: 100%; 70 | line-height: 80rpx; 71 | width: 240rpx; 72 | margin-left: 40rpx; 73 | background-color: #eee; 74 | } 75 | 76 | .log-register { 77 | font-size: 28rpx; 78 | width: 80%; 79 | margin: 20rpx auto; 80 | } 81 | 82 | .log-register-text { 83 | float: right; 84 | } -------------------------------------------------------------------------------- /topics/topics.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{area[areaIndex]}} 6 | 7 | 8 | 9 | 10 | {{item}} 11 | 12 | 13 | 14 | 15 | 28 | 29 | 30 | 31 | 32 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /pages/topics/topics.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{area[areaIndex]}} 6 | 7 | 8 | 9 | 10 | {{item}} 11 | 12 | 13 | 14 | 15 | 28 | 29 | 30 | 31 | 32 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /user/register/register.js: -------------------------------------------------------------------------------- 1 | // pages/user/register/register.js 2 | var status = true; 3 | Page({ 4 | 5 | /** 6 | * 页面的初始数据 7 | */ 8 | data: {}, 9 | login: function() { 10 | wx.navigateBack({ 11 | url: '/pages/user/user' 12 | }) 13 | }, 14 | 15 | toastShow: function(event) { 16 | status = false 17 | console.log('注册成功!'); 18 | this.setData({ status: status })     //setData方法可以建立新的data属性,从而起到跟视图实时同步的效果 19 | setTimeout(function() { 20 | wx.navigateBack({ 21 | url: '/pages/user/user' 22 | }) 23 | }, 3000); 24 | }, 25 | 26 | toastHide: function(event) { 27 | status = true 28 | this.setData({ status: status }) 29 | }, 30 | 31 | data: { 32 | status: status             //data里面的属性可以传递到视图 33 | }, 34 | 35 | /** 36 | * 生命周期函数--监听页面加载 37 | */ 38 | onLoad: function(options) { 39 | 40 | }, 41 | 42 | /** 43 | * 生命周期函数--监听页面初次渲染完成 44 | */ 45 | onReady: function() { 46 | 47 | }, 48 | 49 | /** 50 | * 生命周期函数--监听页面显示 51 | */ 52 | onShow: function() { 53 | 54 | }, 55 | 56 | /** 57 | * 生命周期函数--监听页面隐藏 58 | */ 59 | onHide: function() { 60 | 61 | }, 62 | 63 | /** 64 | * 生命周期函数--监听页面卸载 65 | */ 66 | onUnload: function() { 67 | 68 | }, 69 | 70 | /** 71 | * 页面相关事件处理函数--监听用户下拉动作 72 | */ 73 | onPullDownRefresh: function() { 74 | 75 | }, 76 | 77 | /** 78 | * 页面上拉触底事件的处理函数 79 | */ 80 | onReachBottom: function() { 81 | 82 | }, 83 | 84 | /** 85 | * 用户点击右上角分享 86 | */ 87 | onShareAppMessage: function() { 88 | 89 | } 90 | }) -------------------------------------------------------------------------------- /pages/user/register/register.js: -------------------------------------------------------------------------------- 1 | // pages/user/register/register.js 2 | var status = true; 3 | Page({ 4 | 5 | /** 6 | * 页面的初始数据 7 | */ 8 | data: {}, 9 | login: function() { 10 | wx.navigateBack({ 11 | url: '/pages/user/user' 12 | }) 13 | }, 14 | 15 | toastShow: function(event) { 16 | status = false 17 | console.log('注册成功!'); 18 | this.setData({ status: status })     //setData方法可以建立新的data属性,从而起到跟视图实时同步的效果 19 | setTimeout(function() { 20 | wx.navigateBack({ 21 | url: '/pages/user/user' 22 | }) 23 | }, 3000); 24 | }, 25 | 26 | toastHide: function(event) { 27 | status = true 28 | this.setData({ status: status }) 29 | }, 30 | 31 | data: { 32 | status: status             //data里面的属性可以传递到视图 33 | }, 34 | 35 | /** 36 | * 生命周期函数--监听页面加载 37 | */ 38 | onLoad: function(options) { 39 | 40 | }, 41 | 42 | /** 43 | * 生命周期函数--监听页面初次渲染完成 44 | */ 45 | onReady: function() { 46 | 47 | }, 48 | 49 | /** 50 | * 生命周期函数--监听页面显示 51 | */ 52 | onShow: function() { 53 | 54 | }, 55 | 56 | /** 57 | * 生命周期函数--监听页面隐藏 58 | */ 59 | onHide: function() { 60 | 61 | }, 62 | 63 | /** 64 | * 生命周期函数--监听页面卸载 65 | */ 66 | onUnload: function() { 67 | 68 | }, 69 | 70 | /** 71 | * 页面相关事件处理函数--监听用户下拉动作 72 | */ 73 | onPullDownRefresh: function() { 74 | 75 | }, 76 | 77 | /** 78 | * 页面上拉触底事件的处理函数 79 | */ 80 | onReachBottom: function() { 81 | 82 | }, 83 | 84 | /** 85 | * 用户点击右上角分享 86 | */ 87 | onShareAppMessage: function() { 88 | 89 | } 90 | }) -------------------------------------------------------------------------------- /topics/topics.wxss: -------------------------------------------------------------------------------- 1 | /* pages/topics/topics.wxss */ 2 | 3 | page { 4 | height: 100%; 5 | } 6 | 7 | .navbar { 8 | width: 100%; 9 | height: 80rpx; 10 | display: flex; 11 | align-items: center; 12 | background: #fff; 13 | border-bottom: 2px solid #e6e6e6; 14 | position: fixed; 15 | top: 0; 16 | } 17 | 18 | .picker { 19 | width: 120rpx; 20 | height: 100%; 21 | line-height: 80rpx; 22 | border-right: 2rpx solid #e6e6e6; 23 | } 24 | 25 | .item { 26 | flex: 1; 27 | height: 100%; 28 | line-height: 80rpx; 29 | text-align: center; 30 | } 31 | 32 | .active { 33 | color: #11CF7E; 34 | border-bottom: 2rpx solid #11CF7E; 35 | } 36 | 37 | .picker-text:after { 38 | content: ''; 39 | width: 20rpx; 40 | line-height: 20rpx; 41 | margin-top: 30rpx; 42 | height: 20rpx; 43 | border-top: 2px solid #e6e6e6; 44 | border-right: 2px solid #e6e6e6; 45 | position: absolute; 46 | transform: rotate(135deg); 47 | margin-top: 25rpx; 48 | margin-left: 10rpx; 49 | } 50 | 51 | 52 | /* 内容区 */ 53 | 54 | .content { 55 | width: 100%; 56 | margin: 20rpx 0; 57 | height: 400rpx; 58 | border: 2rpx solid #000; 59 | } 60 | 61 | .content-image { 62 | width: 100%; 63 | height: 100%; 64 | background-size: cover; 65 | } 66 | 67 | .content-text { 68 | display: block; 69 | width: 300rpx; 70 | height: 86rpx; 71 | color: #000; 72 | margin-top: -300rpx; 73 | margin-left: 30rpx; 74 | } 75 | 76 | .count { 77 | width: 100%; 78 | height: 70rpx; 79 | line-height: 70rpx; 80 | background: #000; 81 | opacity: .5; 82 | margin-top: 142rpx; 83 | } 84 | 85 | .content-count { 86 | color: #fff; 87 | margin-left: 30rpx; 88 | } -------------------------------------------------------------------------------- /square/question/question.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 问题* 4 | 5 |