├── page ├── web │ ├── pages │ │ ├── index │ │ │ ├── index.json │ │ │ ├── index.wxss │ │ │ ├── index.wxml │ │ │ └── index.js │ │ └── logs │ │ │ ├── logs.json │ │ │ ├── logs.wxss │ │ │ ├── logs.wxml │ │ │ └── logs.js │ ├── index.json │ ├── index.wxss │ ├── index.wxml │ └── index.js ├── account │ ├── index.json │ ├── index.wxss │ ├── index.js │ └── index.wxml └── common │ ├── foot.wxml │ ├── head.wxml │ ├── index.wxss │ └── lib │ └── weui.wxss ├── image ├── pause.png ├── play.png ├── plus.png ├── stop.png ├── trash.png ├── avatar.jpg ├── record.png ├── wechat.png ├── green_tri.png ├── icon │ ├── ecg.png │ ├── resp.png │ ├── temp.png │ ├── user.png │ ├── homepage.png │ ├── ecg-selected.png │ ├── resp-selected.png │ ├── temp-selected.png │ ├── user-selected.png │ └── homepage-selected.png ├── icon_API.png ├── icon_foot.png ├── location.png ├── wechatHL.png ├── icon_API_HL.png ├── icon_component.png ├── icon64_appwx_logo.png └── icon_component_HL.png ├── utils └── util.js ├── readme.md ├── project.config.json ├── app.json ├── config.js ├── app.js ├── LICENSE └── app.wxss /page/web/pages/index/index.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /page/account/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "用户" 3 | } 4 | -------------------------------------------------------------------------------- /page/web/pages/logs/logs.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "查看启动日志" 3 | } -------------------------------------------------------------------------------- /image/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/pause.png -------------------------------------------------------------------------------- /image/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/play.png -------------------------------------------------------------------------------- /image/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/plus.png -------------------------------------------------------------------------------- /image/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/stop.png -------------------------------------------------------------------------------- /image/trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/trash.png -------------------------------------------------------------------------------- /image/avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/avatar.jpg -------------------------------------------------------------------------------- /image/record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/record.png -------------------------------------------------------------------------------- /image/wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/wechat.png -------------------------------------------------------------------------------- /image/green_tri.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/green_tri.png -------------------------------------------------------------------------------- /image/icon/ecg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon/ecg.png -------------------------------------------------------------------------------- /image/icon/resp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon/resp.png -------------------------------------------------------------------------------- /image/icon/temp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon/temp.png -------------------------------------------------------------------------------- /image/icon/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon/user.png -------------------------------------------------------------------------------- /image/icon_API.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon_API.png -------------------------------------------------------------------------------- /image/icon_foot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon_foot.png -------------------------------------------------------------------------------- /image/location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/location.png -------------------------------------------------------------------------------- /image/wechatHL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/wechatHL.png -------------------------------------------------------------------------------- /image/icon_API_HL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon_API_HL.png -------------------------------------------------------------------------------- /image/icon/homepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon/homepage.png -------------------------------------------------------------------------------- /image/icon_component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon_component.png -------------------------------------------------------------------------------- /page/web/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "首页", 3 | "enablePullDownRefresh":true 4 | } 5 | -------------------------------------------------------------------------------- /image/icon/ecg-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon/ecg-selected.png -------------------------------------------------------------------------------- /image/icon64_appwx_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon64_appwx_logo.png -------------------------------------------------------------------------------- /image/icon_component_HL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon_component_HL.png -------------------------------------------------------------------------------- /image/icon/resp-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon/resp-selected.png -------------------------------------------------------------------------------- /image/icon/temp-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon/temp-selected.png -------------------------------------------------------------------------------- /image/icon/user-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon/user-selected.png -------------------------------------------------------------------------------- /image/icon/homepage-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanglelecc/laracms-xcx/HEAD/image/icon/homepage-selected.png -------------------------------------------------------------------------------- /page/web/pages/logs/logs.wxss: -------------------------------------------------------------------------------- 1 | .log-list { 2 | display: flex; 3 | flex-direction: column; 4 | padding: 40rpx; 5 | } 6 | .log-item { 7 | margin: 10rpx; 8 | } 9 | -------------------------------------------------------------------------------- /page/web/pages/logs/logs.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{index + 1}}. {{log}} 5 | 6 | 7 | -------------------------------------------------------------------------------- /page/common/foot.wxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /page/common/head.wxml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /page/web/pages/logs/logs.js: -------------------------------------------------------------------------------- 1 | //logs.js 2 | const util = require('../../../../utils/util.js') 3 | 4 | Page({ 5 | data: { 6 | logs: [] 7 | }, 8 | onLoad: function () { 9 | this.setData({ 10 | logs: (wx.getStorageSync('logs') || []).map(log => { 11 | return util.formatTime(new Date(log)) 12 | }) 13 | }) 14 | } 15 | }) 16 | -------------------------------------------------------------------------------- /page/web/pages/index/index.wxss: -------------------------------------------------------------------------------- 1 | /**index.wxss**/ 2 | .userinfo { 3 | display: flex; 4 | flex-direction: column; 5 | align-items: center; 6 | } 7 | 8 | .userinfo-avatar { 9 | width: 128rpx; 10 | height: 128rpx; 11 | margin: 20rpx; 12 | border-radius: 50%; 13 | } 14 | 15 | .userinfo-nickname { 16 | color: #aaa; 17 | } 18 | 19 | .usermotto { 20 | margin-top: 200px; 21 | } -------------------------------------------------------------------------------- /page/account/index.wxss: -------------------------------------------------------------------------------- 1 | @import "../common/index.wxss"; 2 | 3 | .user-box{ 4 | margin-bottom: 40rpx; 5 | padding: 20rpx 30rpx; 6 | display: flex; 7 | align-items: center; 8 | background-color: #FFF; 9 | } 10 | .user-box-img{ 11 | margin-right: 46rpx; 12 | width:150rpx; 13 | height:150rpx; 14 | border-radius: 10rpx; 15 | } 16 | .user-box-ctn{ 17 | flex-shrink: 100; 18 | } 19 | .user-box-title{ 20 | font-size: 34rpx; 21 | } 22 | .user-box-desc{ 23 | margin-top: 12rpx; 24 | font-size: 26rpx; 25 | color: #888; 26 | } -------------------------------------------------------------------------------- /utils/util.js: -------------------------------------------------------------------------------- 1 | const formatTime = date => { 2 | const year = date.getFullYear() 3 | const month = date.getMonth() + 1 4 | const day = date.getDate() 5 | const hour = date.getHours() 6 | const minute = date.getMinutes() 7 | const second = date.getSeconds() 8 | 9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') 10 | } 11 | 12 | const formatNumber = n => { 13 | n = n.toString() 14 | return n[1] ? n : '0' + n 15 | } 16 | 17 | module.exports = { 18 | formatTime: formatTime 19 | } 20 | -------------------------------------------------------------------------------- /page/web/pages/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{userInfo.nickName}} 8 | 9 | 10 | 11 | {{motto}} 12 | 13 | 14 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## 项目概述 2 | 3 | * 产品名称:LaraCMS小程序 4 | * 项目代号:laracms-xcx 5 | * GitHub:https://github.com/wanglelecc/laracms-xcx 6 | 7 | LaraCMS小程序 是一个简单的小程序应用,基于 LaraCMS提供的API编写而成,意在提供一个扩展思路和API的验证,应用本身并不提供复杂的功能,如有需要可自行扩展。LaraCMS后台管理系统请见 [《LaraCMS 后台管理系统》](https://laravel-china.org/articles/8899/laracms-backstage-management-system)。 8 | 小程序开发文档 [ 小程序开发文档 ](https://mp.weixin.qq.com/debug/wxadoc/dev/) 9 | 10 | 11 | ## 功能如下 12 | 13 | - 首页 —— 获取 LaraCMS 文章内容; 14 | - 个人中心 —— 基于小程序API获取用户信息; 15 | 16 | ## 预览 17 | ![首页](https://www.56br.com/images/laracms-xcx-01.png) 18 | ![用户](https://www.56br.com/images/laracms-xcx-02.png) 19 | -------------------------------------------------------------------------------- /page/web/index.wxss: -------------------------------------------------------------------------------- 1 | @import "../common/index.wxss"; 2 | 3 | 4 | .index-box{ 5 | margin-bottom: 20rpx; 6 | padding: 20rpx 30rpx; 7 | display: flex; 8 | align-items: center; 9 | background-color: #FFF; 10 | } 11 | .index-box-img{ 12 | margin-right: 46rpx; 13 | width:150rpx; 14 | height:150rpx; 15 | border-radius: 10rpx; 16 | } 17 | .index-box-ctn{ 18 | flex-shrink: 100; 19 | } 20 | .index-box-title{ 21 | font-size: 34rpx; 22 | } 23 | .index-box-desc{ 24 | margin-top: 12rpx; 25 | font-size: 26rpx; 26 | color: #888; 27 | } 28 | 29 | .index-item-message{ 30 | font-size: 22rpx; 31 | text-align: center; 32 | color:#888; 33 | } -------------------------------------------------------------------------------- /project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件。", 3 | "setting": { 4 | "urlCheck": true, 5 | "es6": true, 6 | "postcss": true, 7 | "minified": true, 8 | "newFeature": true 9 | }, 10 | "compileType": "miniprogram", 11 | "libVersion": "1.9.93", 12 | "appid": "wxaf7696447c9dbec9", 13 | "projectname": "LaraCMS", 14 | "isGameTourist": false, 15 | "condition": { 16 | "search": { 17 | "current": -1, 18 | "list": [] 19 | }, 20 | "conversation": { 21 | "current": -1, 22 | "list": [] 23 | }, 24 | "game": { 25 | "currentL": -1, 26 | "list": [] 27 | }, 28 | "miniprogram": { 29 | "current": -1, 30 | "list": [] 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages":[ 3 | "page/web/index", 4 | 5 | 6 | "page/account/index" 7 | ], 8 | "window": { 9 | "backgroundTextStyle": "light", 10 | "navigationBarBackgroundColor": "#F8F8F8", 11 | "navigationBarTitleText": "LaraCMS", 12 | "navigationBarTextStyle": "black" 13 | }, 14 | "tabBar": { 15 | "list": [ 16 | { 17 | "pagePath": "page/web/index", 18 | "text": "首页", 19 | "iconPath": "/image/icon/homepage.png", 20 | "selectedIconPath": "/image/icon/homepage-selected.png" 21 | }, 22 | { 23 | "pagePath": "page/account/index", 24 | "text": "用户", 25 | "iconPath": "/image/icon/user.png", 26 | "selectedIconPath": "/image/icon/user-selected.png" 27 | } 28 | ] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /page/account/index.js: -------------------------------------------------------------------------------- 1 | var app = getApp() 2 | Page({ 3 | data: { 4 | hasUserInfo: false 5 | }, 6 | 7 | onLoad: function () { 8 | this.getUserInfo(); 9 | }, 10 | 11 | getUserInfo: function () { 12 | var that = this 13 | 14 | if (app.globalData.hasLogin === false) { 15 | wx.login({ 16 | success: _getUserInfo 17 | }) 18 | } else { 19 | _getUserInfo() 20 | } 21 | 22 | function _getUserInfo() { 23 | wx.getUserInfo({ 24 | success: function (res) { 25 | that.setData({ 26 | hasUserInfo: true, 27 | userInfo: res.userInfo 28 | }) 29 | that.update() 30 | console.log(res.userInfo) 31 | } 32 | }) 33 | } 34 | }, 35 | clear: function () { 36 | this.setData({ 37 | hasUserInfo: false, 38 | userInfo: {} 39 | }) 40 | } 41 | }) -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 小程序配置文件 3 | */ 4 | 5 | var host = "www.56br.com/api" 6 | 7 | var config = { 8 | 9 | // 下面的地址配合云端 Server 工作 10 | host, 11 | 12 | // 登录地址,用于建立会话 13 | loginUrl: `https://${host}/login`, 14 | 15 | // 文章地址 16 | articleUrl: `https://${host}/articles/1`, 17 | 18 | // 测试的请求地址,用于测试会话 19 | requestUrl: `https://${host}/testRequest`, 20 | 21 | // 用code换取openId 22 | openIdUrl: `https://${host}/openid`, 23 | 24 | // 测试的信道服务接口 25 | tunnelUrl: `https://${host}/tunnel`, 26 | 27 | // 生成支付订单的接口 28 | paymentUrl: `https://${host}/payment`, 29 | 30 | // 发送模板消息接口 31 | templateMessageUrl: `https://${host}/templateMessage`, 32 | 33 | // 上传文件接口 34 | uploadFileUrl: `https://${host}/upload`, 35 | 36 | // 下载示例图片接口 37 | downloadExampleUrl: `https://${host}/static/weapp.jpg` 38 | }; 39 | 40 | module.exports = config 41 | -------------------------------------------------------------------------------- /page/account/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{userInfo.nickName}} 8 | Codding 改变世界! 9 | 10 | 11 | 12 | 13 | 14 | 15 | 设置 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | App({ 3 | onLaunch: function () { 4 | // 展示本地存储能力 5 | var logs = wx.getStorageSync('logs') || [] 6 | logs.unshift(Date.now()) 7 | wx.setStorageSync('logs', logs) 8 | 9 | // 登录 10 | wx.login({ 11 | success: res => { 12 | // 发送 res.code 到后台换取 openId, sessionKey, unionId 13 | } 14 | }) 15 | // 获取用户信息 16 | wx.getSetting({ 17 | success: res => { 18 | if (res.authSetting['scope.userInfo']) { 19 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 20 | wx.getUserInfo({ 21 | success: res => { 22 | // 可以将 res 发送给后台解码出 unionId 23 | this.globalData.userInfo = res.userInfo 24 | 25 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 26 | // 所以此处加入 callback 以防止这种情况 27 | if (this.userInfoReadyCallback) { 28 | this.userInfoReadyCallback(res) 29 | } 30 | } 31 | }) 32 | } 33 | } 34 | }) 35 | }, 36 | globalData: { 37 | userInfo: null 38 | } 39 | }) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 稀饭不加糖 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /page/web/pages/index/index.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | motto: 'Hello World', 8 | userInfo: {}, 9 | hasUserInfo: false, 10 | canIUse: wx.canIUse('button.open-type.getUserInfo') 11 | }, 12 | //事件处理函数 13 | bindViewTap: function() { 14 | wx.navigateTo({ 15 | url: '../logs/logs' 16 | }) 17 | }, 18 | onLoad: function () { 19 | if (app.globalData.userInfo) { 20 | this.setData({ 21 | userInfo: app.globalData.userInfo, 22 | hasUserInfo: true 23 | }) 24 | } else if (this.data.canIUse){ 25 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 26 | // 所以此处加入 callback 以防止这种情况 27 | app.userInfoReadyCallback = res => { 28 | this.setData({ 29 | userInfo: res.userInfo, 30 | hasUserInfo: true 31 | }) 32 | } 33 | } else { 34 | // 在没有 open-type=getUserInfo 版本的兼容处理 35 | wx.getUserInfo({ 36 | success: res => { 37 | app.globalData.userInfo = res.userInfo 38 | this.setData({ 39 | userInfo: res.userInfo, 40 | hasUserInfo: true 41 | }) 42 | } 43 | }) 44 | } 45 | }, 46 | getUserInfo: function(e) { 47 | console.log(e) 48 | app.globalData.userInfo = e.detail.userInfo 49 | this.setData({ 50 | userInfo: e.detail.userInfo, 51 | hasUserInfo: true 52 | }) 53 | } 54 | }) 55 | -------------------------------------------------------------------------------- /page/web/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | 21 | 22 | 23 | 24 | {{item.title}} 25 | {{item.desription}} 26 | 27 | 28 | 29 | 30 | 暂无数据. 31 | 32 | 33 | 34 | 没有数据了... 35 | 36 | 37 | 加载更多... 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /page/common/index.wxss: -------------------------------------------------------------------------------- 1 | .index-hd { 2 | padding: 80rpx; 3 | text-align: center; 4 | } 5 | .index-bd { 6 | padding: 0 30rpx 40rpx; 7 | } 8 | .index-ft { 9 | padding-bottom: 20rpx; 10 | text-align: center; 11 | } 12 | .index-logo { 13 | width: 86rpx; 14 | height: 86rpx; 15 | } 16 | .index-desc { 17 | margin-top: 20rpx; 18 | color: #888888; 19 | font-size: 28rpx; 20 | } 21 | 22 | 23 | .navigator-box { 24 | opacity: 0; 25 | position: relative; 26 | background-color: #FFFFFF; 27 | line-height: 1.41176471; 28 | font-size: 34rpx; 29 | 30 | transform: translateY(-50%); 31 | transition: .3s; 32 | } 33 | .navigator-box-show { 34 | opacity: 1; 35 | transform: translateY(0); 36 | } 37 | .navigator { 38 | padding: 20rpx 30rpx; 39 | position: relative; 40 | display: flex; 41 | align-items: center; 42 | } 43 | .navigator:before { 44 | content: " "; 45 | position: absolute; 46 | left: 30rpx; 47 | top: 0; 48 | right: 30rpx; 49 | height: 1px; 50 | border-top: 1rpx solid #D8D8D8; 51 | color: #D8D8D8; 52 | } 53 | .navigator:first-child:before { 54 | display: none; 55 | } 56 | .navigator-text { 57 | flex: 1; 58 | } 59 | .navigator-arrow { 60 | padding-right: 26rpx; 61 | position: relative; 62 | } 63 | .navigator-arrow:after { 64 | content: " "; 65 | display: inline-block; 66 | height: 18rpx; 67 | width: 18rpx; 68 | border-width: 2rpx 2rpx 0 0; 69 | border-color: #888888; 70 | border-style: solid; 71 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0); 72 | position: absolute; 73 | top: 50%; 74 | margin-top: -8rpx; 75 | right: 28rpx; 76 | } 77 | 78 | 79 | .kind-list-item { 80 | margin: 20rpx 0; 81 | background-color: #FFFFFF; 82 | border-radius: 4rpx; 83 | overflow: hidden; 84 | } 85 | .kind-list-item:first-child { 86 | margin-top: 0; 87 | } 88 | .kind-list-text{ 89 | flex: 1; 90 | } 91 | .kind-list-img { 92 | width: 60rpx; 93 | height: 60rpx; 94 | } 95 | .kind-list-item-hd { 96 | padding: 30rpx; 97 | display: flex; 98 | align-items: center; 99 | 100 | transition: opacity .3s; 101 | } 102 | .kind-list-item-hd-show { 103 | opacity: .2; 104 | } 105 | .kind-list-item-bd { 106 | height: 0; 107 | overflow: hidden; 108 | } 109 | .kind-list-item-bd-show { 110 | height: auto; 111 | } -------------------------------------------------------------------------------- /page/web/index.js: -------------------------------------------------------------------------------- 1 | const articleUrl = require('../../config').articleUrl 2 | const duration = 2000 3 | 4 | 5 | Page({ 6 | 7 | data : { 8 | data : [], 9 | page : 1, 10 | loading:false, 11 | noData:false 12 | }, 13 | stopPullDownRefresh: function () { 14 | wx.stopPullDownRefresh({ 15 | complete: function (res) { 16 | wx.hideToast() 17 | console.log(res, new Date()) 18 | } 19 | }) 20 | }, 21 | /** 22 | * 生命周期函数--监听页面加载 23 | */ 24 | onLoad: function (options) { 25 | this.requestArticle() 26 | }, 27 | 28 | // 请求数据 29 | requestArticle : function(){ 30 | var self = this 31 | 32 | self.setData({ 33 | loading: true 34 | }) 35 | 36 | wx.request({ 37 | method: 'GET', 38 | url: articleUrl, 39 | data: { 40 | page: self.data.page, 41 | noncestr: Date.now() 42 | }, 43 | success: function (result) { 44 | // wx.showToast({ 45 | // title: '请求成功', 46 | // icon: 'success', 47 | // mask: true, 48 | // duration: duration 49 | // }) 50 | self.setData({ 51 | loading: false 52 | }) 53 | 54 | if (result.statusCode == 200) { 55 | 56 | var tmpData = self.data.data 57 | for (var i = 0; i < result.data.data.length; i++){ 58 | tmpData.push(result.data.data[i]) 59 | } 60 | 61 | self.setData({ 62 | data: tmpData 63 | }) 64 | 65 | if ( self.data.page < result.data.meta.pagination.total_pages ){ 66 | self.setData({ 67 | data: self.data.page + 1, 68 | noData : false 69 | }) 70 | }else{ 71 | self.setData({ 72 | noData:true 73 | }) 74 | } 75 | } 76 | console.log('request success', result) 77 | self.stopPullDownRefresh() 78 | }, 79 | 80 | fail: function ({ errMsg }) { 81 | console.log('request fail', errMsg) 82 | self.setData({ 83 | loading: false 84 | }) 85 | self.stopPullDownRefresh() 86 | } 87 | }) 88 | }, 89 | 90 | /** 91 | * 生命周期函数--监听页面初次渲染完成 92 | */ 93 | onReady: function () { 94 | 95 | }, 96 | 97 | /** 98 | * 生命周期函数--监听页面显示 99 | */ 100 | onShow: function () { 101 | 102 | }, 103 | 104 | /** 105 | * 生命周期函数--监听页面隐藏 106 | */ 107 | onHide: function () { 108 | 109 | }, 110 | 111 | /** 112 | * 生命周期函数--监听页面卸载 113 | */ 114 | onUnload: function () { 115 | 116 | }, 117 | 118 | /** 119 | * 页面相关事件处理函数--监听用户下拉动作 120 | */ 121 | onPullDownRefresh: function () { 122 | this.setData({ 123 | data:[], 124 | page:1 125 | }) 126 | this.requestArticle() 127 | // wx.showToast({ 128 | // title: 'loading...', 129 | // icon: 'loading' 130 | // }); 131 | // console.log('onPullDownRefresh', new Date()) 132 | }, 133 | 134 | /** 135 | * 页面上拉触底事件的处理函数 136 | */ 137 | onReachBottom: function () { 138 | if(this.data.noData == false){ 139 | this.requestArticle() 140 | } 141 | }, 142 | 143 | /** 144 | * 用户点击右上角分享 145 | */ 146 | onShareAppMessage: function () { 147 | 148 | } 149 | }) 150 | -------------------------------------------------------------------------------- /app.wxss: -------------------------------------------------------------------------------- 1 | /* reset */ 2 | page { 3 | background-color: #F8F8F8; 4 | height: 100%; 5 | font-size: 32rpx; 6 | line-height: 1.6; 7 | } 8 | checkbox, radio{ 9 | margin-right: 10rpx; 10 | } 11 | button{ 12 | margin-top: 20rpx; 13 | margin-bottom: 20rpx; 14 | } 15 | form{ 16 | width: 100%; 17 | } 18 | 19 | /* lib */ 20 | .strong{ 21 | font-weight: bold; 22 | } 23 | .tc{ 24 | text-align: center; 25 | } 26 | 27 | /* page */ 28 | .container { 29 | display: flex; 30 | flex-direction: column; 31 | min-height: 100%; 32 | justify-content: space-between; 33 | font-size: 32rpx; 34 | font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif; 35 | } 36 | .page-head{ 37 | padding: 60rpx 50rpx 80rpx; 38 | text-align: center; 39 | } 40 | .page-head-title{ 41 | display: inline-block; 42 | padding: 0 40rpx 20rpx 40rpx; 43 | font-size: 32rpx; 44 | color: #BEBEBE; 45 | } 46 | .page-head-line{ 47 | margin: 0 auto; 48 | width: 150rpx; 49 | height: 2rpx; 50 | background-color: #D8D8D8; 51 | } 52 | .page-head-desc{ 53 | padding-top: 20rpx; 54 | color: #9B9B9B; 55 | font-size: 32rpx; 56 | } 57 | 58 | .page-body { 59 | width: 100%; 60 | flex-grow: 1; 61 | overflow-x: hidden; 62 | } 63 | .page-body-wrapper { 64 | display: flex; 65 | flex-direction: column; 66 | align-items: center; 67 | width: 100%; 68 | } 69 | .page-body-wording { 70 | text-align: center; 71 | padding: 200rpx 100rpx; 72 | } 73 | .page-body-info { 74 | display: flex; 75 | flex-direction: column; 76 | align-items: center; 77 | background-color: #fff; 78 | width: 100%; 79 | padding: 50rpx 0 150rpx 0; 80 | } 81 | .page-body-title { 82 | margin-bottom: 100rpx; 83 | font-size: 32rpx; 84 | } 85 | .page-body-text { 86 | font-size: 30rpx; 87 | line-height: 26px; 88 | color: #ccc; 89 | } 90 | .page-body-text-small { 91 | font-size: 24rpx; 92 | color: #000; 93 | margin-bottom: 100rpx; 94 | } 95 | 96 | .page-foot{ 97 | margin: 100rpx 0 30rpx 0; 98 | text-align: center; 99 | color: #1aad19; 100 | font-size: 0; 101 | } 102 | .icon-foot{ 103 | width: 152rpx; 104 | height: 23rpx; 105 | } 106 | 107 | .page-section{ 108 | width: 100%; 109 | margin-bottom: 60rpx; 110 | } 111 | .page-section_center{ 112 | display: flex; 113 | flex-direction: column; 114 | align-items: center; 115 | } 116 | .page-section:last-child{ 117 | margin-bottom: 0; 118 | } 119 | .page-section-gap{ 120 | box-sizing: border-box; 121 | padding: 0 30rpx; 122 | } 123 | .page-section-spacing{ 124 | box-sizing: border-box; 125 | padding: 0 80rpx; 126 | } 127 | .page-section-title{ 128 | font-size: 28rpx; 129 | color: #999999; 130 | margin-bottom: 10rpx; 131 | padding-left: 30rpx; 132 | padding-right: 30rpx; 133 | } 134 | .page-section-gap .page-section-title{ 135 | padding-left: 0; 136 | padding-right: 0; 137 | } 138 | .page-section-ctn{ 139 | 140 | } 141 | 142 | /* widget */ 143 | .btn-area{ 144 | margin-top: 60rpx; 145 | box-sizing: border-box; 146 | width: 100%; 147 | padding: 0 30rpx; 148 | } 149 | 150 | .image-plus { 151 | width: 150rpx; 152 | height: 150rpx; 153 | border: 2rpx solid #D9D9D9; 154 | position: relative; 155 | } 156 | .image-plus-nb{ 157 | border: 0; 158 | } 159 | .image-plus-text{ 160 | color: #888888; 161 | font-size: 28rpx; 162 | } 163 | .image-plus-horizontal { 164 | position: absolute; 165 | top: 50%; 166 | left: 50%; 167 | background-color: #d9d9d9; 168 | width: 4rpx; 169 | height: 80rpx; 170 | transform: translate(-50%, -50%); 171 | } 172 | .image-plus-vertical { 173 | position: absolute; 174 | top: 50%; 175 | left: 50%; 176 | background-color: #d9d9d9; 177 | width: 80rpx; 178 | height: 4rpx; 179 | transform: translate(-50%, -50%); 180 | } 181 | 182 | .demo-text-1{ 183 | position: relative; 184 | align-items: center; 185 | justify-content: center; 186 | background-color: #1AAD19; 187 | color: #FFFFFF; 188 | font-size: 36rpx; 189 | } 190 | .demo-text-1:before{ 191 | content: 'A'; 192 | position: absolute; 193 | top: 50%; 194 | left: 50%; 195 | transform: translate(-50%, -50%); 196 | } 197 | .demo-text-2{ 198 | position: relative; 199 | align-items: center; 200 | justify-content: center; 201 | background-color: #2782D7; 202 | color: #FFFFFF; 203 | font-size: 36rpx; 204 | } 205 | .demo-text-2:before{ 206 | content: 'B'; 207 | position: absolute; 208 | top: 50%; 209 | left: 50%; 210 | transform: translate(-50%, -50%); 211 | } 212 | .demo-text-3{ 213 | position: relative; 214 | align-items: center; 215 | justify-content: center; 216 | background-color: #F1F1F1; 217 | color: #353535; 218 | font-size: 36rpx; 219 | } 220 | .demo-text-3:before{ 221 | content: 'C'; 222 | position: absolute; 223 | top: 50%; 224 | left: 50%; 225 | transform: translate(-50%, -50%); 226 | } -------------------------------------------------------------------------------- /page/common/lib/weui.wxss: -------------------------------------------------------------------------------- 1 | /*! 2 | * weui.js v1.1.0 (https://github.com/weui/weui-wxss) 3 | * Copyright 2016, wechat ui team 4 | * MIT license 5 | */ 6 | page { 7 | line-height: 1.6; 8 | font-family: -apple-system-font, "Helvetica Neue", sans-serif; 9 | } 10 | icon { 11 | vertical-align: middle; 12 | } 13 | .weui-cells { 14 | position: relative; 15 | margin-top: 1.17647059em; 16 | background-color: #FFFFFF; 17 | line-height: 1.41176471; 18 | font-size: 17px; 19 | } 20 | .weui-cells:before { 21 | content: " "; 22 | position: absolute; 23 | left: 0; 24 | top: 0; 25 | right: 0; 26 | height: 1px; 27 | border-top: 1rpx solid #D9D9D9; 28 | color: #D9D9D9; 29 | } 30 | .weui-cells:after { 31 | content: " "; 32 | position: absolute; 33 | left: 0; 34 | bottom: 0; 35 | right: 0; 36 | height: 1px; 37 | border-bottom: 1rpx solid #D9D9D9; 38 | color: #D9D9D9; 39 | } 40 | .weui-cells__title { 41 | margin-top: .77em; 42 | margin-bottom: .3em; 43 | padding-left: 15px; 44 | padding-right: 15px; 45 | color: #999999; 46 | font-size: 14px; 47 | } 48 | .weui-cells_after-title { 49 | margin-top: 0; 50 | } 51 | .weui-cells__tips { 52 | margin-top: .3em; 53 | color: #999999; 54 | padding-left: 15px; 55 | padding-right: 15px; 56 | font-size: 14px; 57 | } 58 | .weui-cell { 59 | padding: 10px 15px; 60 | position: relative; 61 | display: -webkit-box; 62 | display: -webkit-flex; 63 | display: flex; 64 | -webkit-box-align: center; 65 | -webkit-align-items: center; 66 | align-items: center; 67 | } 68 | .weui-cell:before { 69 | content: " "; 70 | position: absolute; 71 | left: 0; 72 | top: 0; 73 | right: 0; 74 | height: 1px; 75 | border-top: 1rpx solid #D9D9D9; 76 | color: #D9D9D9; 77 | left: 15px; 78 | } 79 | .weui-cell:first-child:before { 80 | display: none; 81 | } 82 | .weui-cell_active { 83 | background-color: #ECECEC; 84 | } 85 | .weui-cell_primary { 86 | -webkit-box-align: start; 87 | -webkit-align-items: flex-start; 88 | align-items: flex-start; 89 | } 90 | .weui-cell__bd { 91 | -webkit-box-flex: 1; 92 | -webkit-flex: 1; 93 | flex: 1; 94 | } 95 | .weui-cell__ft { 96 | text-align: right; 97 | color: #999999; 98 | } 99 | .weui-cell_access { 100 | color: inherit; 101 | } 102 | .weui-cell__ft_in-access { 103 | padding-right: 13px; 104 | position: relative; 105 | } 106 | .weui-cell__ft_in-access:after { 107 | content: " "; 108 | display: inline-block; 109 | height: 6px; 110 | width: 6px; 111 | border-width: 2px 2px 0 0; 112 | border-color: #C8C8CD; 113 | border-style: solid; 114 | -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0); 115 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0); 116 | position: relative; 117 | top: -2px; 118 | position: absolute; 119 | top: 50%; 120 | margin-top: -4px; 121 | right: 2px; 122 | } 123 | .weui-cell_link { 124 | color: #586C94; 125 | font-size: 14px; 126 | } 127 | .weui-cell_link:active { 128 | background-color: #ECECEC; 129 | } 130 | .weui-cell_link:first-child:before { 131 | display: block; 132 | } 133 | .weui-icon-radio { 134 | margin-left: 3.2px; 135 | margin-right: 3.2px; 136 | } 137 | .weui-icon-checkbox_circle, 138 | .weui-icon-checkbox_success { 139 | margin-left: 4.6px; 140 | margin-right: 4.6px; 141 | } 142 | .weui-check__label:active { 143 | background-color: #ECECEC; 144 | } 145 | .weui-check { 146 | position: absolute; 147 | left: -9999px; 148 | } 149 | .weui-check__hd_in-checkbox { 150 | padding-right: 0.35em; 151 | } 152 | .weui-cell__ft_in-radio { 153 | padding-left: 0.35em; 154 | } 155 | .weui-cell_input { 156 | padding-top: 0; 157 | padding-bottom: 0; 158 | } 159 | .weui-label { 160 | width: 105px; 161 | word-wrap: break-word; 162 | word-break: break-all; 163 | } 164 | .weui-input { 165 | height: 2.58823529em; 166 | min-height: 2.58823529em; 167 | line-height: 2.58823529em; 168 | } 169 | .weui-toptips { 170 | position: fixed; 171 | -webkit-transform: translateZ(0); 172 | transform: translateZ(0); 173 | top: 0; 174 | left: 0; 175 | right: 0; 176 | padding: 5px; 177 | font-size: 14px; 178 | text-align: center; 179 | color: #FFFFFF; 180 | z-index: 5000; 181 | word-wrap: break-word; 182 | word-break: break-all; 183 | } 184 | .weui-toptips_warn { 185 | background-color: #E64340; 186 | } 187 | .weui-textarea { 188 | display: block; 189 | width: 100%; 190 | } 191 | .weui-textarea-counter { 192 | color: #B2B2B2; 193 | text-align: right; 194 | } 195 | .weui-textarea-counter_warn { 196 | color: #E64340; 197 | } 198 | .weui-cell_warn { 199 | color: #E64340; 200 | } 201 | .weui-form-preview { 202 | position: relative; 203 | background-color: #FFFFFF; 204 | } 205 | .weui-form-preview:before { 206 | content: " "; 207 | position: absolute; 208 | left: 0; 209 | top: 0; 210 | right: 0; 211 | height: 1px; 212 | border-top: 1rpx solid #D9D9D9; 213 | color: #D9D9D9; 214 | } 215 | .weui-form-preview:after { 216 | content: " "; 217 | position: absolute; 218 | left: 0; 219 | bottom: 0; 220 | right: 0; 221 | height: 1px; 222 | border-bottom: 1rpx solid #D9D9D9; 223 | color: #D9D9D9; 224 | } 225 | .weui-form-preview__value { 226 | font-size: 14px; 227 | } 228 | .weui-form-preview__value_in-hd { 229 | font-size: 26px; 230 | } 231 | .weui-form-preview__hd { 232 | position: relative; 233 | padding: 10px 15px; 234 | text-align: right; 235 | line-height: 2.5em; 236 | } 237 | .weui-form-preview__hd:after { 238 | content: " "; 239 | position: absolute; 240 | left: 0; 241 | bottom: 0; 242 | right: 0; 243 | height: 1px; 244 | border-bottom: 1rpx solid #D9D9D9; 245 | color: #D9D9D9; 246 | left: 15px; 247 | } 248 | .weui-form-preview__bd { 249 | padding: 10px 15px; 250 | font-size: .9em; 251 | text-align: right; 252 | color: #999999; 253 | line-height: 2; 254 | } 255 | .weui-form-preview__ft { 256 | position: relative; 257 | line-height: 50px; 258 | display: -webkit-box; 259 | display: -webkit-flex; 260 | display: flex; 261 | } 262 | .weui-form-preview__ft:after { 263 | content: " "; 264 | position: absolute; 265 | left: 0; 266 | top: 0; 267 | right: 0; 268 | height: 1px; 269 | border-top: 1rpx solid #D5D5D6; 270 | color: #D5D5D6; 271 | } 272 | .weui-form-preview__item { 273 | overflow: hidden; 274 | } 275 | .weui-form-preview__label { 276 | float: left; 277 | margin-right: 1em; 278 | min-width: 4em; 279 | color: #999999; 280 | text-align: justify; 281 | text-align-last: justify; 282 | } 283 | .weui-form-preview__value { 284 | display: block; 285 | overflow: hidden; 286 | word-break: normal; 287 | word-wrap: break-word; 288 | } 289 | .weui-form-preview__btn { 290 | position: relative; 291 | display: block; 292 | -webkit-box-flex: 1; 293 | -webkit-flex: 1; 294 | flex: 1; 295 | color: #3CC51F; 296 | text-align: center; 297 | } 298 | .weui-form-preview__btn:after { 299 | content: " "; 300 | position: absolute; 301 | left: 0; 302 | top: 0; 303 | width: 1px; 304 | bottom: 0; 305 | border-left: 1rpx solid #D5D5D6; 306 | color: #D5D5D6; 307 | } 308 | .weui-form-preview__btn:first-child:after { 309 | display: none; 310 | } 311 | .weui-form-preview__btn_active { 312 | background-color: #EEEEEE; 313 | } 314 | .weui-form-preview__btn_default { 315 | color: #999999; 316 | } 317 | .weui-form-preview__btn_primary { 318 | color: #0BB20C; 319 | } 320 | .weui-cell_select { 321 | padding: 0; 322 | } 323 | .weui-select { 324 | position: relative; 325 | padding-left: 15px; 326 | padding-right: 30px; 327 | height: 2.58823529em; 328 | min-height: 2.58823529em; 329 | line-height: 2.58823529em; 330 | border-right: 1rpx solid #D9D9D9; 331 | } 332 | .weui-select:before { 333 | content: " "; 334 | display: inline-block; 335 | height: 6px; 336 | width: 6px; 337 | border-width: 2px 2px 0 0; 338 | border-color: #C8C8CD; 339 | border-style: solid; 340 | -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0); 341 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0); 342 | position: relative; 343 | top: -2px; 344 | position: absolute; 345 | top: 50%; 346 | right: 15px; 347 | margin-top: -4px; 348 | } 349 | .weui-select_in-select-after { 350 | padding-left: 0; 351 | } 352 | .weui-cell__hd_in-select-after, 353 | .weui-cell__bd_in-select-before { 354 | padding-left: 15px; 355 | } 356 | .weui-cell_vcode { 357 | padding-right: 0; 358 | } 359 | .weui-vcode-img { 360 | margin-left: 5px; 361 | height: 2.58823529em; 362 | vertical-align: middle; 363 | } 364 | .weui-vcode-btn { 365 | display: inline-block; 366 | height: 2.58823529em; 367 | margin-left: 5px; 368 | padding: 0 0.6em 0 0.7em; 369 | border-left: 1px solid #E5E5E5; 370 | line-height: 2.58823529em; 371 | vertical-align: middle; 372 | font-size: 17px; 373 | color: #3CC51F; 374 | white-space: nowrap; 375 | } 376 | .weui-vcode-btn:active { 377 | color: #52a341; 378 | } 379 | .weui-cell_switch { 380 | padding-top: 6px; 381 | padding-bottom: 6px; 382 | } 383 | .weui-uploader__hd { 384 | display: -webkit-box; 385 | display: -webkit-flex; 386 | display: flex; 387 | padding-bottom: 10px; 388 | -webkit-box-align: center; 389 | -webkit-align-items: center; 390 | align-items: center; 391 | } 392 | .weui-uploader__title { 393 | -webkit-box-flex: 1; 394 | -webkit-flex: 1; 395 | flex: 1; 396 | } 397 | .weui-uploader__info { 398 | color: #B2B2B2; 399 | } 400 | .weui-uploader__bd { 401 | margin-bottom: -4px; 402 | margin-right: -9px; 403 | overflow: hidden; 404 | } 405 | .weui-uploader__file { 406 | float: left; 407 | margin-right: 9px; 408 | margin-bottom: 9px; 409 | } 410 | .weui-uploader__img { 411 | display: block; 412 | width: 79px; 413 | height: 79px; 414 | } 415 | .weui-uploader__file_status { 416 | position: relative; 417 | } 418 | .weui-uploader__file_status:before { 419 | content: " "; 420 | position: absolute; 421 | top: 0; 422 | right: 0; 423 | bottom: 0; 424 | left: 0; 425 | background-color: rgba(0, 0, 0, 0.5); 426 | } 427 | .weui-uploader__file-content { 428 | position: absolute; 429 | top: 50%; 430 | left: 50%; 431 | -webkit-transform: translate(-50%, -50%); 432 | transform: translate(-50%, -50%); 433 | color: #FFFFFF; 434 | } 435 | .weui-uploader__input-box { 436 | float: left; 437 | position: relative; 438 | margin-right: 9px; 439 | margin-bottom: 9px; 440 | width: 77px; 441 | height: 77px; 442 | border: 1px solid #D9D9D9; 443 | } 444 | .weui-uploader__input-box:before, 445 | .weui-uploader__input-box:after { 446 | content: " "; 447 | position: absolute; 448 | top: 50%; 449 | left: 50%; 450 | -webkit-transform: translate(-50%, -50%); 451 | transform: translate(-50%, -50%); 452 | background-color: #D9D9D9; 453 | } 454 | .weui-uploader__input-box:before { 455 | width: 2px; 456 | height: 39.5px; 457 | } 458 | .weui-uploader__input-box:after { 459 | width: 39.5px; 460 | height: 2px; 461 | } 462 | .weui-uploader__input-box:active { 463 | border-color: #999999; 464 | } 465 | .weui-uploader__input-box:active:before, 466 | .weui-uploader__input-box:active:after { 467 | background-color: #999999; 468 | } 469 | .weui-uploader__input { 470 | position: absolute; 471 | z-index: 1; 472 | top: 0; 473 | left: 0; 474 | width: 100%; 475 | height: 100%; 476 | opacity: 0; 477 | } 478 | .weui-article { 479 | padding: 20px 15px; 480 | font-size: 15px; 481 | } 482 | .weui-article__section { 483 | margin-bottom: 1.5em; 484 | } 485 | .weui-article__h1 { 486 | font-size: 18px; 487 | font-weight: 400; 488 | margin-bottom: .9em; 489 | } 490 | .weui-article__h2 { 491 | font-size: 16px; 492 | font-weight: 400; 493 | margin-bottom: .34em; 494 | } 495 | .weui-article__h3 { 496 | font-weight: 400; 497 | font-size: 15px; 498 | margin-bottom: .34em; 499 | } 500 | .weui-article__p { 501 | margin: 0 0 .8em; 502 | } 503 | .weui-msg { 504 | padding-top: 36px; 505 | text-align: center; 506 | } 507 | .weui-msg__link { 508 | display: inline; 509 | color: #586C94; 510 | } 511 | .weui-msg__icon-area { 512 | margin-bottom: 30px; 513 | } 514 | .weui-msg__text-area { 515 | margin-bottom: 25px; 516 | padding: 0 20px; 517 | } 518 | .weui-msg__title { 519 | margin-bottom: 5px; 520 | font-weight: 400; 521 | font-size: 20px; 522 | } 523 | .weui-msg__desc { 524 | font-size: 14px; 525 | color: #999999; 526 | } 527 | .weui-msg__opr-area { 528 | margin-bottom: 25px; 529 | } 530 | .weui-msg__extra-area { 531 | margin-bottom: 15px; 532 | font-size: 14px; 533 | color: #999999; 534 | } 535 | @media screen and (min-height: 438px) { 536 | .weui-msg__extra-area { 537 | position: fixed; 538 | left: 0; 539 | bottom: 0; 540 | width: 100%; 541 | text-align: center; 542 | } 543 | } 544 | .weui-flex { 545 | display: -webkit-box; 546 | display: -webkit-flex; 547 | display: flex; 548 | } 549 | .weui-flex__item { 550 | -webkit-box-flex: 1; 551 | -webkit-flex: 1; 552 | flex: 1; 553 | } 554 | .weui-btn { 555 | margin-top: 15px; 556 | } 557 | .weui-btn:first-child { 558 | margin-top: 0; 559 | } 560 | .weui-btn-area { 561 | margin: 1.17647059em 15px 0.3em; 562 | } 563 | .weui-agree { 564 | display: block; 565 | padding: .5em 15px; 566 | font-size: 13px; 567 | } 568 | .weui-agree__text { 569 | color: #999999; 570 | } 571 | .weui-agree__link { 572 | display: inline; 573 | color: #586C94; 574 | } 575 | .weui-agree__checkbox { 576 | position: absolute; 577 | left: -9999px; 578 | } 579 | .weui-agree__checkbox-icon { 580 | position: relative; 581 | top: 2px; 582 | display: inline-block; 583 | border: 1px solid #D1D1D1; 584 | background-color: #FFFFFF; 585 | border-radius: 3px; 586 | width: 11px; 587 | height: 11px; 588 | } 589 | .weui-agree__checkbox-icon-check { 590 | position: absolute; 591 | top: 1px; 592 | left: 1px; 593 | } 594 | .weui-footer { 595 | color: #999999; 596 | font-size: 14px; 597 | text-align: center; 598 | } 599 | .weui-footer_fixed-bottom { 600 | position: fixed; 601 | bottom: .52em; 602 | left: 0; 603 | right: 0; 604 | } 605 | .weui-footer__links { 606 | font-size: 0; 607 | } 608 | .weui-footer__link { 609 | display: inline-block; 610 | vertical-align: top; 611 | margin: 0 .62em; 612 | position: relative; 613 | font-size: 14px; 614 | color: #586C94; 615 | } 616 | .weui-footer__link:before { 617 | content: " "; 618 | position: absolute; 619 | left: 0; 620 | top: 0; 621 | width: 1px; 622 | bottom: 0; 623 | border-left: 1rpx solid #C7C7C7; 624 | color: #C7C7C7; 625 | left: -0.65em; 626 | top: .36em; 627 | bottom: .36em; 628 | } 629 | .weui-footer__link:first-child:before { 630 | display: none; 631 | } 632 | .weui-footer__text { 633 | padding: 0 .34em; 634 | font-size: 12px; 635 | } 636 | .weui-grids { 637 | border-top: 1rpx solid #D9D9D9; 638 | border-left: 1rpx solid #D9D9D9; 639 | overflow: hidden; 640 | } 641 | .weui-grid { 642 | position: relative; 643 | float: left; 644 | padding: 20px 10px; 645 | width: 33.33333333%; 646 | box-sizing: border-box; 647 | border-right: 1rpx solid #D9D9D9; 648 | border-bottom: 1rpx solid #D9D9D9; 649 | } 650 | .weui-grid_active { 651 | background-color: #ECECEC; 652 | } 653 | .weui-grid__icon { 654 | display: block; 655 | width: 28px; 656 | height: 28px; 657 | margin: 0 auto; 658 | } 659 | .weui-grid__label { 660 | margin-top: 5px; 661 | display: block; 662 | text-align: center; 663 | color: #000000; 664 | font-size: 14px; 665 | white-space: nowrap; 666 | text-overflow: ellipsis; 667 | overflow: hidden; 668 | } 669 | .weui-loading { 670 | margin: 0 5px; 671 | width: 20px; 672 | height: 20px; 673 | display: inline-block; 674 | vertical-align: middle; 675 | -webkit-animation: weuiLoading 1s steps(12, end) infinite; 676 | animation: weuiLoading 1s steps(12, end) infinite; 677 | background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat; 678 | background-size: 100%; 679 | } 680 | @-webkit-keyframes weuiLoading { 681 | 0% { 682 | -webkit-transform: rotate3d(0, 0, 1, 0deg); 683 | transform: rotate3d(0, 0, 1, 0deg); 684 | } 685 | 100% { 686 | -webkit-transform: rotate3d(0, 0, 1, 360deg); 687 | transform: rotate3d(0, 0, 1, 360deg); 688 | } 689 | } 690 | @keyframes weuiLoading { 691 | 0% { 692 | -webkit-transform: rotate3d(0, 0, 1, 0deg); 693 | transform: rotate3d(0, 0, 1, 0deg); 694 | } 695 | 100% { 696 | -webkit-transform: rotate3d(0, 0, 1, 360deg); 697 | transform: rotate3d(0, 0, 1, 360deg); 698 | } 699 | } 700 | .weui-badge { 701 | display: inline-block; 702 | padding: .15em .4em; 703 | min-width: 8px; 704 | border-radius: 18px; 705 | background-color: #F43530; 706 | color: #FFFFFF; 707 | line-height: 1.2; 708 | text-align: center; 709 | font-size: 12px; 710 | vertical-align: middle; 711 | } 712 | .weui-badge_dot { 713 | padding: .4em; 714 | min-width: 0; 715 | } 716 | .weui-loadmore { 717 | width: 65%; 718 | margin: 1.5em auto; 719 | line-height: 1.6em; 720 | font-size: 14px; 721 | text-align: center; 722 | } 723 | .weui-loadmore__tips { 724 | display: inline-block; 725 | vertical-align: middle; 726 | } 727 | .weui-loadmore_line { 728 | border-top: 1px solid #E5E5E5; 729 | margin-top: 2.4em; 730 | } 731 | .weui-loadmore__tips_in-line { 732 | position: relative; 733 | top: -0.9em; 734 | padding: 0 .55em; 735 | background-color: #FFFFFF; 736 | color: #999999; 737 | } 738 | .weui-loadmore__tips_in-dot { 739 | position: relative; 740 | padding: 0 .16em; 741 | width: 4px; 742 | height: 1.6em; 743 | } 744 | .weui-loadmore__tips_in-dot:before { 745 | content: " "; 746 | position: absolute; 747 | top: 50%; 748 | left: 50%; 749 | margin-top: -1px; 750 | margin-left: -2px; 751 | width: 4px; 752 | height: 4px; 753 | border-radius: 50%; 754 | background-color: #E5E5E5; 755 | } 756 | .weui-panel { 757 | background-color: #FFFFFF; 758 | margin-top: 10px; 759 | position: relative; 760 | overflow: hidden; 761 | } 762 | .weui-panel:first-child { 763 | margin-top: 0; 764 | } 765 | .weui-panel:before { 766 | content: " "; 767 | position: absolute; 768 | left: 0; 769 | top: 0; 770 | right: 0; 771 | height: 1px; 772 | border-top: 1rpx solid #E5E5E5; 773 | color: #E5E5E5; 774 | } 775 | .weui-panel:after { 776 | content: " "; 777 | position: absolute; 778 | left: 0; 779 | bottom: 0; 780 | right: 0; 781 | height: 1px; 782 | border-bottom: 1rpx solid #E5E5E5; 783 | color: #E5E5E5; 784 | } 785 | .weui-panel__hd { 786 | padding: 14px 15px 10px; 787 | color: #999999; 788 | font-size: 13px; 789 | position: relative; 790 | } 791 | .weui-panel__hd:after { 792 | content: " "; 793 | position: absolute; 794 | left: 0; 795 | bottom: 0; 796 | right: 0; 797 | height: 1px; 798 | border-bottom: 1rpx solid #E5E5E5; 799 | color: #E5E5E5; 800 | left: 15px; 801 | } 802 | .weui-media-box { 803 | padding: 15px; 804 | position: relative; 805 | } 806 | .weui-media-box:before { 807 | content: " "; 808 | position: absolute; 809 | left: 0; 810 | top: 0; 811 | right: 0; 812 | height: 1px; 813 | border-top: 1rpx solid #E5E5E5; 814 | color: #E5E5E5; 815 | left: 15px; 816 | } 817 | .weui-media-box:first-child:before { 818 | display: none; 819 | } 820 | .weui-media-box__title { 821 | font-weight: 400; 822 | font-size: 17px; 823 | width: auto; 824 | overflow: hidden; 825 | text-overflow: ellipsis; 826 | white-space: nowrap; 827 | word-wrap: normal; 828 | word-wrap: break-word; 829 | word-break: break-all; 830 | } 831 | .weui-media-box__desc { 832 | color: #999999; 833 | font-size: 13px; 834 | line-height: 1.2; 835 | overflow: hidden; 836 | text-overflow: ellipsis; 837 | display: -webkit-box; 838 | -webkit-box-orient: vertical; 839 | -webkit-line-clamp: 2; 840 | } 841 | .weui-media-box__info { 842 | margin-top: 15px; 843 | padding-bottom: 5px; 844 | font-size: 13px; 845 | color: #CECECE; 846 | line-height: 1em; 847 | list-style: none; 848 | overflow: hidden; 849 | } 850 | .weui-media-box__info__meta { 851 | float: left; 852 | padding-right: 1em; 853 | } 854 | .weui-media-box__info__meta_extra { 855 | padding-left: 1em; 856 | border-left: 1px solid #CECECE; 857 | } 858 | .weui-media-box__title_in-text { 859 | margin-bottom: 8px; 860 | } 861 | .weui-media-box_appmsg { 862 | display: -webkit-box; 863 | display: -webkit-flex; 864 | display: flex; 865 | -webkit-box-align: center; 866 | -webkit-align-items: center; 867 | align-items: center; 868 | } 869 | .weui-media-box__thumb { 870 | width: 100%; 871 | height: 100%; 872 | vertical-align: top; 873 | } 874 | .weui-media-box__hd_in-appmsg { 875 | margin-right: .8em; 876 | width: 60px; 877 | height: 60px; 878 | line-height: 60px; 879 | text-align: center; 880 | } 881 | .weui-media-box__bd_in-appmsg { 882 | -webkit-box-flex: 1; 883 | -webkit-flex: 1; 884 | flex: 1; 885 | min-width: 0; 886 | } 887 | .weui-media-box_small-appmsg { 888 | padding: 0; 889 | } 890 | .weui-cells_in-small-appmsg { 891 | margin-top: 0; 892 | } 893 | .weui-cells_in-small-appmsg:before { 894 | display: none; 895 | } 896 | .weui-progress { 897 | display: -webkit-box; 898 | display: -webkit-flex; 899 | display: flex; 900 | -webkit-box-align: center; 901 | -webkit-align-items: center; 902 | align-items: center; 903 | } 904 | .weui-progress__bar { 905 | -webkit-box-flex: 1; 906 | -webkit-flex: 1; 907 | flex: 1; 908 | } 909 | .weui-progress__opr { 910 | margin-left: 15px; 911 | font-size: 0; 912 | } 913 | .weui-navbar { 914 | display: -webkit-box; 915 | display: -webkit-flex; 916 | display: flex; 917 | position: absolute; 918 | z-index: 500; 919 | top: 0; 920 | width: 100%; 921 | border-bottom: 1rpx solid #CCCCCC; 922 | } 923 | .weui-navbar__item { 924 | position: relative; 925 | display: block; 926 | -webkit-box-flex: 1; 927 | -webkit-flex: 1; 928 | flex: 1; 929 | padding: 13px 0; 930 | text-align: center; 931 | font-size: 0; 932 | } 933 | .weui-navbar__item.weui-bar__item_on { 934 | color: #1AAD19; 935 | } 936 | .weui-navbar__slider { 937 | position: absolute; 938 | content: " "; 939 | left: 0; 940 | bottom: 0; 941 | width: 6em; 942 | height: 3px; 943 | background-color: #1AAD19; 944 | -webkit-transition: -webkit-transform .3s; 945 | transition: -webkit-transform .3s; 946 | transition: transform .3s; 947 | transition: transform .3s, -webkit-transform .3s; 948 | } 949 | .weui-navbar__title { 950 | display: inline-block; 951 | font-size: 15px; 952 | max-width: 8em; 953 | width: auto; 954 | overflow: hidden; 955 | text-overflow: ellipsis; 956 | white-space: nowrap; 957 | word-wrap: normal; 958 | } 959 | .weui-tab { 960 | position: relative; 961 | height: 100%; 962 | } 963 | .weui-tab__panel { 964 | box-sizing: border-box; 965 | height: 100%; 966 | padding-top: 50px; 967 | overflow: auto; 968 | -webkit-overflow-scrolling: touch; 969 | } 970 | .weui-search-bar { 971 | position: relative; 972 | padding: 8px 10px; 973 | display: -webkit-box; 974 | display: -webkit-flex; 975 | display: flex; 976 | box-sizing: border-box; 977 | background-color: #EFEFF4; 978 | border-top: 1rpx solid #D7D6DC; 979 | border-bottom: 1rpx solid #D7D6DC; 980 | } 981 | .weui-icon-search { 982 | margin-right: 8px; 983 | font-size: inherit; 984 | } 985 | .weui-icon-search_in-box { 986 | position: absolute; 987 | left: 10px; 988 | top: 7px; 989 | } 990 | .weui-search-bar__text { 991 | display: inline-block; 992 | font-size: 14px; 993 | vertical-align: middle; 994 | } 995 | .weui-search-bar__form { 996 | position: relative; 997 | -webkit-box-flex: 1; 998 | -webkit-flex: auto; 999 | flex: auto; 1000 | border-radius: 5px; 1001 | background: #FFFFFF; 1002 | border: 1rpx solid #E6E6EA; 1003 | } 1004 | .weui-search-bar__box { 1005 | position: relative; 1006 | padding-left: 30px; 1007 | padding-right: 30px; 1008 | width: 100%; 1009 | box-sizing: border-box; 1010 | z-index: 1; 1011 | } 1012 | .weui-search-bar__input { 1013 | height: 28px; 1014 | line-height: 28px; 1015 | font-size: 14px; 1016 | } 1017 | .weui-icon-clear { 1018 | position: absolute; 1019 | top: 0; 1020 | right: 0; 1021 | padding: 7px 8px; 1022 | font-size: 0; 1023 | } 1024 | .weui-search-bar__label { 1025 | position: absolute; 1026 | top: 0; 1027 | right: 0; 1028 | bottom: 0; 1029 | left: 0; 1030 | z-index: 2; 1031 | border-radius: 3px; 1032 | text-align: center; 1033 | color: #9B9B9B; 1034 | background: #FFFFFF; 1035 | line-height: 28px; 1036 | } 1037 | .weui-search-bar__cancel-btn { 1038 | margin-left: 10px; 1039 | line-height: 28px; 1040 | color: #09BB07; 1041 | white-space: nowrap; 1042 | } 1043 | --------------------------------------------------------------------------------