Repository: tommenx/wxss
Branch: master
Commit: 7c3cd9345c35
Files: 189
Total size: 243.5 KB
Directory structure:
gitextract_uivxnbgl/
├── LICENSE
├── README.md
├── checkin.sql
├── client/
│ ├── README.md
│ ├── app.js
│ ├── app.json
│ ├── app.wxss
│ ├── config.js
│ ├── dist/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── app.wxss
│ │ ├── example/
│ │ │ ├── actionsheet/
│ │ │ │ ├── actionsheet.js
│ │ │ │ ├── actionsheet.wxml
│ │ │ │ └── actionsheet.wxss
│ │ │ ├── article/
│ │ │ │ ├── article.js
│ │ │ │ ├── article.wxml
│ │ │ │ └── article.wxss
│ │ │ ├── badge/
│ │ │ │ ├── badge.js
│ │ │ │ └── badge.wxml
│ │ │ ├── button/
│ │ │ │ ├── button.js
│ │ │ │ ├── button.wxml
│ │ │ │ └── button.wxss
│ │ │ ├── dialog/
│ │ │ │ ├── dialog.js
│ │ │ │ ├── dialog.wxml
│ │ │ │ └── dialog.wxss
│ │ │ ├── flex/
│ │ │ │ ├── flex.js
│ │ │ │ ├── flex.wxml
│ │ │ │ └── flex.wxss
│ │ │ ├── footer/
│ │ │ │ ├── footer.js
│ │ │ │ ├── footer.wxml
│ │ │ │ └── footer.wxss
│ │ │ ├── gallery/
│ │ │ │ ├── gallery.js
│ │ │ │ └── gallery.wxml
│ │ │ ├── grid/
│ │ │ │ ├── grid.js
│ │ │ │ └── grid.wxml
│ │ │ ├── icons/
│ │ │ │ ├── icons.js
│ │ │ │ ├── icons.wxml
│ │ │ │ └── icons.wxss
│ │ │ ├── images/
│ │ │ │ └── base64.js
│ │ │ ├── index.js
│ │ │ ├── index.wxml
│ │ │ ├── index.wxss
│ │ │ ├── input/
│ │ │ │ ├── input.js
│ │ │ │ └── input.wxml
│ │ │ ├── list/
│ │ │ │ ├── list.js
│ │ │ │ └── list.wxml
│ │ │ ├── loadmore/
│ │ │ │ ├── loadmore.js
│ │ │ │ ├── loadmore.wxml
│ │ │ │ └── loadmore.wxss
│ │ │ ├── msg/
│ │ │ │ ├── msg.js
│ │ │ │ ├── msg.wxml
│ │ │ │ ├── msg.wxss
│ │ │ │ ├── msg_fail.js
│ │ │ │ ├── msg_fail.wxml
│ │ │ │ ├── msg_fail.wxss
│ │ │ │ ├── msg_success.js
│ │ │ │ ├── msg_success.wxml
│ │ │ │ └── msg_success.wxss
│ │ │ ├── navbar/
│ │ │ │ ├── navbar.js
│ │ │ │ ├── navbar.wxml
│ │ │ │ └── navbar.wxss
│ │ │ ├── panel/
│ │ │ │ ├── panel.js
│ │ │ │ └── panel.wxml
│ │ │ ├── picker/
│ │ │ │ ├── picker.js
│ │ │ │ ├── picker.wxml
│ │ │ │ └── picker.wxss
│ │ │ ├── preview/
│ │ │ │ ├── preview.js
│ │ │ │ ├── preview.wxml
│ │ │ │ └── preview.wxss
│ │ │ ├── progress/
│ │ │ │ ├── progress.js
│ │ │ │ ├── progress.wxml
│ │ │ │ └── progress.wxss
│ │ │ ├── searchbar/
│ │ │ │ ├── searchbar.js
│ │ │ │ ├── searchbar.wxml
│ │ │ │ └── searchbar.wxss
│ │ │ ├── slider/
│ │ │ │ ├── slider.js
│ │ │ │ ├── slider.wxml
│ │ │ │ └── slider.wxss
│ │ │ ├── tabbar/
│ │ │ │ ├── tabbar.js
│ │ │ │ └── tabbar.wxml
│ │ │ ├── toast/
│ │ │ │ ├── toast.js
│ │ │ │ ├── toast.wxml
│ │ │ │ └── toast.wxss
│ │ │ └── uploader/
│ │ │ ├── uploader.js
│ │ │ └── uploader.wxml
│ │ └── style/
│ │ ├── base/
│ │ │ ├── fn.wxss
│ │ │ ├── mixin/
│ │ │ │ ├── setArrow.wxss
│ │ │ │ ├── setOnepx.wxss
│ │ │ │ └── text.wxss
│ │ │ ├── reset.wxss
│ │ │ └── variable/
│ │ │ ├── color.wxss
│ │ │ ├── global.wxss
│ │ │ ├── weui-button.wxss
│ │ │ ├── weui-cell.wxss
│ │ │ ├── weui-dialog.wxss
│ │ │ ├── weui-grid.wxss
│ │ │ ├── weui-msg.wxss
│ │ │ └── weui-progress.wxss
│ │ ├── weui.wxss
│ │ └── widget/
│ │ ├── weui-agree/
│ │ │ └── weui-agree.wxss
│ │ ├── weui-animate/
│ │ │ └── weui-animate.wxss
│ │ ├── weui-button/
│ │ │ └── weui-button.wxss
│ │ ├── weui-cell/
│ │ │ ├── weui-access.wxss
│ │ │ ├── weui-cell.wxss
│ │ │ ├── weui-check.wxss
│ │ │ ├── weui-form/
│ │ │ │ ├── weui-form-preview.wxss
│ │ │ │ ├── weui-form_common.wxss
│ │ │ │ ├── weui-select.wxss
│ │ │ │ └── weui-vcode.wxss
│ │ │ ├── weui-form.wxss
│ │ │ ├── weui-switch.wxss
│ │ │ └── weui-uploader.wxss
│ │ ├── weui-flex/
│ │ │ └── weui-flex.wxss
│ │ ├── weui-footer/
│ │ │ └── weui-footer.wxss
│ │ ├── weui-grid/
│ │ │ └── weui-grid.wxss
│ │ ├── weui-loading/
│ │ │ └── weui-loading.wxss
│ │ ├── weui-media-box/
│ │ │ └── weui-media-box.wxss
│ │ ├── weui-page/
│ │ │ ├── weui-article.wxss
│ │ │ └── weui-msg.wxss
│ │ ├── weui-panel/
│ │ │ └── weui-panel.wxss
│ │ ├── weui-progress/
│ │ │ └── weui-progress.wxss
│ │ ├── weui-searchbar/
│ │ │ └── weui-searchbar.wxss
│ │ ├── weui-tab/
│ │ │ ├── weui-navbar.wxss
│ │ │ └── weui-tab.wxss
│ │ └── weui-tips/
│ │ ├── weui-badge.wxss
│ │ └── weui-loadmore.wxss
│ ├── libs/
│ │ ├── amap-wx.js
│ │ └── qqmap-wx-jssdk.js
│ ├── pages/
│ │ ├── addLocation/
│ │ │ ├── addLocation.js
│ │ │ ├── addLocation.json
│ │ │ ├── addLocation.wxml
│ │ │ └── addLocation.wxss
│ │ ├── checkIn/
│ │ │ ├── checkIn.js
│ │ │ ├── checkIn.json
│ │ │ ├── checkIn.wxml
│ │ │ └── checkIn.wxss
│ │ ├── detail/
│ │ │ ├── detail.js
│ │ │ ├── detail.json
│ │ │ ├── detail.wxml
│ │ │ └── detail.wxss
│ │ ├── logs/
│ │ │ ├── logs.js
│ │ │ ├── logs.json
│ │ │ ├── logs.wxml
│ │ │ └── logs.wxss
│ │ ├── manage/
│ │ │ ├── manage.js
│ │ │ ├── manage.json
│ │ │ ├── manage.wxml
│ │ │ └── manage.wxss
│ │ ├── new/
│ │ │ ├── new.js
│ │ │ ├── new.json
│ │ │ ├── new.wxml
│ │ │ └── new.wxss
│ │ ├── search/
│ │ │ ├── search.js
│ │ │ ├── search.json
│ │ │ ├── search.wxml
│ │ │ └── search.wxss
│ │ ├── searchDetail/
│ │ │ ├── searchDetail.js
│ │ │ ├── searchDetail.json
│ │ │ ├── searchDetail.wxml
│ │ │ └── searchDetail.wxss
│ │ └── user/
│ │ ├── user.js
│ │ ├── user.json
│ │ ├── user.wxml
│ │ └── user.wxss
│ ├── project.config.json
│ └── utils/
│ ├── getdistance.js
│ ├── upload.js
│ └── util.js
└── server/
└── checkin/
├── .idea/
│ ├── checkin.iml
│ ├── jsLibraryMappings.xml
│ ├── modules.xml
│ ├── runConfigurations/
│ │ └── bin_www.xml
│ └── workspace.xml
├── app.js
├── bin/
│ └── www
├── configs/
│ └── config.js
├── models/
│ ├── activity.js
│ ├── apply.js
│ ├── check.js
│ └── person.js
├── package.json
├── public/
│ └── stylesheets/
│ └── style.css
├── routes/
│ ├── activity.js
│ ├── check.js
│ ├── index.js
│ └── person.js
├── utils/
│ └── dbConnection.js
└── views/
├── error.ejs
└── index.ejs
================================================
FILE CONTENTS
================================================
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2019 zeng xiang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# 活动考勤签到小程序
## 效果图

## 功能
#### 创建活动
1. 可以添加活动名称、简介等信息
2. 地点选择时有搜索建议并能够在地图上标注
3. 签到方式选择包括:照片(上传活动照片)、地点(在活动地点附近500米内)、人脸(本人签到)
#### 活动搜索
1. 通过数据库的模糊搜索简单实现——每输入一个字都进行查询
2. 点击结果列表可以查看活动详情
#### 活动管理
1. 根据当前日期分成两个Tab:正在进行中、已结束
2. 点击可以进入活动详情界面
#### 活动详情
1. 查看活动的发起人、起止日期、活动地点、简介
2. 查看参与的人数
3. 活动的签到情况根据日期进行归档,点击日期可以查看当日的签到情况
#### 活动签到
1. 首先必须上传打卡照片,从相册中选择
2. 点击地点验证即可通过当前经纬度以及活动地点经纬度简单计算距离,小于500m认为在活动区域
3. 点击人脸验证,通过Face++的人脸对比接口,将上传的照片和个人信息页面的照片进行对比,置信度大于50可以认作是同一个人
4. 当所有的要求都满足后,完成活动的签到
#### 个人信息
1. 可以更改当前的照片
## 相关技术
1. 数据库采用MySQL
2. 服务器基于Nodejs的Express4.0框架搭建,简单的接收JSON数据并返回,所有的活动信息、签到结果都记录在数据库中
3. 个人信息图片、签到图片都存储在腾讯云的cos中
4. 地理位置的推荐使用腾讯的地图接口
## 项目部署
#### 客户端
1. 小程序客户端放在client文件夹,使用小程序开发工具打开
2. 填补client/checkin/config.js中的腾讯云对象存储的相关信息
3. 填补client/checkin/pages/checkIn/checkIn.js中相应的API的key等
#### 服务端
1. 安装Nodejs,执行 node app.js
2. 数据库的配置在server/checkin/congigs/config.js中
#### 数据库
执行SQL文件即可
================================================
FILE: checkin.sql
================================================
/*
Navicat Premium Data Transfer
Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 50720
Source Host : localhost:3306
Source Schema : checkin
Target Server Type : MySQL
Target Server Version : 50720
File Encoding : 65001
Date: 31/03/2018 19:27:31
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for t_activity
-- ----------------------------
DROP TABLE IF EXISTS `t_activity`;
CREATE TABLE `t_activity` (
`F_ID` int(11) NOT NULL AUTO_INCREMENT,
`F_CreaterId` int(11) NOT NULL,
`F_Caption` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`F_Desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`F_Location` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`F_Lat` float NULL DEFAULT NULL,
`F_Lng` float NULL DEFAULT NULL,
`F_StartDate` date NULL DEFAULT NULL,
`F_EndDate` date NULL DEFAULT NULL,
`F_IfFace` int(11) NULL DEFAULT NULL,
`F_IfLocation` int(11) NULL DEFAULT NULL,
`F_IfPhoto` int(11) NULL DEFAULT NULL,
PRIMARY KEY (`F_ID`) USING BTREE,
INDEX `F_CreaterId`(`F_CreaterId`) USING BTREE,
CONSTRAINT `t_activity_ibfk_1` FOREIGN KEY (`F_CreaterId`) REFERENCES `t_user` (`F_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for t_apply
-- ----------------------------
DROP TABLE IF EXISTS `t_apply`;
CREATE TABLE `t_apply` (
`F_ID` int(11) NOT NULL AUTO_INCREMENT,
`F_ApplyerId` int(11) NOT NULL,
`F_ActivityId` int(11) NOT NULL,
`F_ApplyDate` date NULL DEFAULT NULL,
PRIMARY KEY (`F_ID`) USING BTREE,
INDEX `F_ApplyerId`(`F_ApplyerId`) USING BTREE,
INDEX `F_ActivityId`(`F_ActivityId`) USING BTREE,
CONSTRAINT `t_apply_ibfk_1` FOREIGN KEY (`F_ApplyerId`) REFERENCES `t_user` (`F_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `t_apply_ibfk_2` FOREIGN KEY (`F_ActivityId`) REFERENCES `t_activity` (`F_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for t_check
-- ----------------------------
DROP TABLE IF EXISTS `t_check`;
CREATE TABLE `t_check` (
`F_ID` int(11) NOT NULL AUTO_INCREMENT,
`F_ActivityId` int(11) NULL DEFAULT NULL,
`F_UserID` int(11) NULL DEFAULT NULL,
`F_CheckDate` date NULL DEFAULT NULL,
`F_PhotoUrl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`F_ID`) USING BTREE,
INDEX `F_ActivityId`(`F_ActivityId`) USING BTREE,
INDEX `F_UserID`(`F_UserID`) USING BTREE,
CONSTRAINT `t_check_ibfk_1` FOREIGN KEY (`F_ActivityId`) REFERENCES `t_activity` (`F_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `t_check_ibfk_2` FOREIGN KEY (`F_UserID`) REFERENCES `t_user` (`F_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 30 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
`F_ID` int(11) NOT NULL AUTO_INCREMENT,
`F_Name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`F_PhotoUrl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`F_ID`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- View structure for v_activity_info
-- ----------------------------
DROP VIEW IF EXISTS `v_activity_info`;
CREATE ALGORITHM = UNDEFINED DEFINER = `root`@`localhost` SQL SECURITY DEFINER VIEW `v_activity_info` AS select `t_activity`.`F_ID` AS `F_ActivityId`,`t_user`.`F_Name` AS `F_CreaterName`,`t_activity`.`F_Caption` AS `F_Caption`,`t_activity`.`F_Desc` AS `F_Desc`,`t_activity`.`F_Location` AS `F_Location`,`t_activity`.`F_Lat` AS `F_Lat`,`t_activity`.`F_Lng` AS `F_Lng`,`t_activity`.`F_StartDate` AS `F_StartDate`,`t_activity`.`F_EndDate` AS `F_EndDate`,`t_activity`.`F_IfFace` AS `F_IfFace`,`t_activity`.`F_IfLocation` AS `F_IfLocation`,`t_activity`.`F_IfPhoto` AS `F_IfPhoto` from (`t_activity` join `t_user` on((`t_activity`.`F_CreaterId` = `t_user`.`F_ID`)));
-- ----------------------------
-- View structure for v_apply_activity
-- ----------------------------
DROP VIEW IF EXISTS `v_apply_activity`;
CREATE ALGORITHM = UNDEFINED DEFINER = `root`@`localhost` SQL SECURITY DEFINER VIEW `v_apply_activity` AS select `t_activity`.`F_ID` AS `F_ID`,`t_activity`.`F_CreaterId` AS `F_CreaterId`,`t_activity`.`F_Caption` AS `F_Caption`,`t_activity`.`F_Desc` AS `F_Desc`,`t_activity`.`F_Lat` AS `F_Lat`,`t_activity`.`F_Lng` AS `F_Lng`,`t_activity`.`F_StartDate` AS `F_StartDate`,`t_activity`.`F_EndDate` AS `F_EndDate`,`t_activity`.`F_IfFace` AS `F_IfFace`,`t_activity`.`F_IfLocation` AS `F_IfLocation`,`t_activity`.`F_IfPhoto` AS `F_IfPhoto`,`t_apply`.`F_ApplyDate` AS `F_ApplyDate`,`t_apply`.`F_ApplyerId` AS `F_ApplyerId`,`t_activity`.`F_Location` AS `F_Location` from (`t_apply` join `t_activity` on((`t_apply`.`F_ActivityId` = `t_activity`.`F_ID`)));
-- ----------------------------
-- View structure for v_apply_info
-- ----------------------------
DROP VIEW IF EXISTS `v_apply_info`;
CREATE ALGORITHM = UNDEFINED DEFINER = `root`@`localhost` SQL SECURITY DEFINER VIEW `v_apply_info` AS select `t_activity`.`F_ID` AS `F_ID`,count(0) AS `F_ApplyNum`,`t_activity`.`F_Caption` AS `F_Caption`,`t_apply`.`F_ApplyerId` AS `F_ApplyerId` from (`t_activity` join `t_apply` on((`t_apply`.`F_ActivityId` = `t_activity`.`F_ID`))) group by `t_activity`.`F_ID`;
-- ----------------------------
-- View structure for v_check_detail
-- ----------------------------
DROP VIEW IF EXISTS `v_check_detail`;
CREATE ALGORITHM = UNDEFINED DEFINER = `root`@`localhost` SQL SECURITY DEFINER VIEW `v_check_detail` AS select `t_check`.`F_ActivityId` AS `F_ActivityId`,`t_check`.`F_UserID` AS `F_UserId`,`t_check`.`F_PhotoUrl` AS `F_CheckPhotoUrl`,`t_user`.`F_Name` AS `F_UserName`,`t_check`.`F_CheckDate` AS `F_CheckDate` from (`t_user` join `t_check` on((`t_check`.`F_UserID` = `t_user`.`F_ID`)));
SET FOREIGN_KEY_CHECKS = 1;
================================================
FILE: client/README.md
================================================
# checkin
================================================
FILE: client/app.js
================================================
//app.js
var config = require('./config.js');
App({
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
// wx.login({
// success: res => {
// // 发送 res.code 到后台换取 openId, sessionKey, unionId
// }
// })
// 获取用户信息
// wx.getSetting({
// success: res => {
// if (res.authSetting['scope.userInfo']) {
// // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
// wx.getUserInfo({
// success: res => {
// // 可以将 res 发送给后台解码出 unionId
// this.globalData.userInfo = res.userInfo
// console.log(res.userInfo);
// // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// // 所以此处加入 callback 以防止这种情况
// if (this.userInfoReadyCallback) {
// this.userInfoReadyCallback(res)
// }
// }
// })
// }
// }
// })
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
var that = this;
that.globalData.userInfo = res.userInfo;
wx.request({
url: config.url+'/person/',
data: {
'username':res.userInfo.nickName
},
method: 'POST',
success: function(user_res){
that.globalData.user_id = user_res.data.userId
that.globalData.avator_url = user_res.data.avatorUrl
console.log(user_res.data);
}
})
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
});
},
globalData: {
userInfo: null,
users:null,
user_id:null,
avator_url:null
},
data: {
haveLocation: false,
activity_lat: -1,
activity_lng: -1,
activity_location: ""
}
})
================================================
FILE: client/app.json
================================================
{
"pages": [
"pages/search/search",
"pages/detail/detail",
"pages/manage/manage",
"pages/checkIn/checkIn",
"pages/new/new",
"pages/addLocation/addLocation",
"pages/user/user",
"pages/logs/logs",
"pages/searchDetail/searchDetail"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
},
"tabBar": {
"color": "#9b9b9b",
"selectedColor": "#2ba245",
"borderStyle": "white",
"position": "bottom",
"list": [
{
"pagePath": "pages/new/new",
"text": "新建",
"iconPath": "image/new_normal.png",
"selectedIconPath": "image/new_pressed.png"
},
{
"pagePath": "pages/search/search",
"text": "查找",
"iconPath": "image/search_normal.png",
"selectedIconPath": "image/search_pressed.png"
},
{
"pagePath": "pages/manage/manage",
"text": "管理",
"iconPath": "image/manage_normal.png",
"selectedIconPath": "image/manage_pressed.png"
},
{
"pagePath": "pages/user/user",
"text": "我的",
"iconPath": "image/user_normal.png",
"selectedIconPath": "image/user_pressed.png"
}
]
}
}
================================================
FILE: client/app.wxss
================================================
/**app.wxss**/
@import "dist/style/weui.wxss";
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
page{
background-color: #F8F8F8;
font-size: 16px;
font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
}
.page__hd {
padding: 40px;
}
.page__bd {
padding-bottom: 40px;
}
.page__bd_spacing {
padding-left: 15px;
padding-right: 15px;
}
.page__ft{
padding-bottom: 10px;
text-align: center;
}
.page__title {
text-align: left;
font-size: 20px;
font-weight: 400;
}
.page__desc {
margin-top: 5px;
color: #888888;
text-align: left;
font-size: 14px;
}
================================================
FILE: client/config.js
================================================
//服务器地址
var url = ''
//腾讯云对象存储鉴权地址
var cosSignatureUrl = '';
//腾讯云对象存储的区域:华东地区为sh
var cosRegion = '';
//腾讯云对象存储cos的APPID
var cosAPPID = '12XXXXXXXX';
//腾讯云COSSecretId
var cosSecretId = '';
//腾讯云COSSecretKey
var cosSecretKey = '';
//bucket
var cosBucketName = '';
//dir路径
var cosDirName = '';
module.exports = {
url: url,
cosSignatureUrl: cosSignatureUrl,
cosRegion: cosRegion,
cosAPPID: cosAPPID,
cosBucketName: cosBucketName,
cosDirName: cosDirName
}
================================================
FILE: client/dist/app.js
================================================
App({
onLaunch: function () {
console.log('App Launch')
},
onShow: function () {
console.log('App Show')
},
onHide: function () {
console.log('App Hide')
},
globalData: {
hasLogin: false
}
});
================================================
FILE: client/dist/app.json
================================================
{
"pages": [
"example/index",
"example/button/button",
"example/list/list",
"example/input/input",
"example/slider/slider",
"example/uploader/uploader",
"example/article/article",
"example/badge/badge",
"example/flex/flex",
"example/footer/footer",
"example/gallery/gallery",
"example/grid/grid",
"example/icons/icons",
"example/loadmore/loadmore",
"example/panel/panel",
"example/preview/preview",
"example/progress/progress",
"example/actionsheet/actionsheet",
"example/dialog/dialog",
"example/msg/msg",
"example/msg/msg_success",
"example/msg/msg_fail",
"example/picker/picker",
"example/toast/toast",
"example/navbar/navbar",
"example/tabbar/tabbar",
"example/searchbar/searchbar"
],
"window": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "WeUI for 小程序",
"navigationBarBackgroundColor": "#f8f8f8",
"backgroundColor": "#f8f8f8"
},
"networkTimeout": {
"request": 10000,
"connectSocket": 10000,
"uploadFile": 10000,
"downloadFile": 10000
},
"debug": true
}
================================================
FILE: client/dist/app.wxss
================================================
@import 'style/weui.wxss';
page{
background-color: #F8F8F8;
font-size: 16px;
font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
}
.page__hd {
padding: 40px;
}
.page__bd {
padding-bottom: 40px;
}
.page__bd_spacing {
padding-left: 15px;
padding-right: 15px;
}
.page__ft{
padding-bottom: 10px;
text-align: center;
}
.page__title {
text-align: left;
font-size: 20px;
font-weight: 400;
}
.page__desc {
margin-top: 5px;
color: #888888;
text-align: left;
font-size: 14px;
}
================================================
FILE: client/dist/example/actionsheet/actionsheet.js
================================================
Page({
open: function(){
wx.showActionSheet({
itemList: ['A', 'B', 'C'],
success: function(res) {
if (!res.cancel) {
console.log(res.tapIndex)
}
}
});
}
});
================================================
FILE: client/dist/example/actionsheet/actionsheet.wxml
================================================
ActionSheet
弹出式菜单,采用小程序原生的actionsheet
================================================
FILE: client/dist/example/actionsheet/actionsheet.wxss
================================================
page{
background-color: #FFFFFF;
}
================================================
FILE: client/dist/example/article/article.js
================================================
Page({});
================================================
FILE: client/dist/example/article/article.wxml
================================================
Article
文章
大标题
章标题
1.1 节标题
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
1.2 节标题
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
================================================
FILE: client/dist/example/article/article.wxss
================================================
page{
background-color: #FFFFFF;
}
image{
margin: 4px 0;
}
================================================
FILE: client/dist/example/badge/badge.js
================================================
Page({});
================================================
FILE: client/dist/example/badge/badge.wxml
================================================
Badge
徽章
新消息提示跟摘要信息后,统一在列表右侧
单行列表
详细信息
未读数红点跟在主题信息后,统一在列表左侧
8
联系人名称
摘要信息
单行列表
8
单行列表
8
详细信息
单行列表
New
================================================
FILE: client/dist/example/button/button.js
================================================
Page({});
================================================
FILE: client/dist/example/button/button.wxml
================================================
Button
按钮,WeUI采用小程序原生的按钮为主体,加入一些间距的样式。
================================================
FILE: client/dist/example/button/button.wxss
================================================
.button-sp-area{
margin: 0 auto;
padding-top: 15px;
width: 60%;
}
.mini-btn{
margin-right: 5px;
}
================================================
FILE: client/dist/example/dialog/dialog.js
================================================
Page({
openConfirm: function () {
wx.showModal({
title: '弹窗标题',
content: '弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内',
confirmText: "主操作",
cancelText: "辅助操作",
success: function (res) {
console.log(res);
if (res.confirm) {
console.log('用户点击主操作')
}else{
console.log('用户点击辅助操作')
}
}
});
},
openAlert: function () {
wx.showModal({
content: '弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内',
showCancel: false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
}
}
});
}
});
================================================
FILE: client/dist/example/dialog/dialog.wxml
================================================
Dialog
对话框,采用小程序原生的modal
================================================
FILE: client/dist/example/dialog/dialog.wxss
================================================
page{
background-color: #FFFFFF;
}
================================================
FILE: client/dist/example/flex/flex.js
================================================
Page({});
================================================
FILE: client/dist/example/flex/flex.wxml
================================================
Flex
Flex布局
weui
weui
weui
weui
weui
weui
weui
weui
weui
weui
weui
weui
weui
================================================
FILE: client/dist/example/flex/flex.wxss
================================================
.placeholder{
margin: 5px;
padding: 0 10px;
text-align: center;
background-color: #EBEBEB;
height: 2.3em;
line-height: 2.3em;
color: #cfcfcf;
}
================================================
FILE: client/dist/example/footer/footer.js
================================================
Page({});
================================================
FILE: client/dist/example/footer/footer.wxml
================================================
Footer
页脚
================================================
FILE: client/dist/example/footer/footer.wxss
================================================
/* 作为展示用的样式 */
.weui-footer{
margin-bottom: 50px;
}
.weui-footer_fixed-bottom{
margin-bottom: 0;
}
================================================
FILE: client/dist/example/gallery/gallery.js
================================================
Page({});
================================================
FILE: client/dist/example/gallery/gallery.wxml
================================================
Gallery
画廊,建议采用小程序原生的wx.previewImage来实现。详情请看小程序文档。
================================================
FILE: client/dist/example/grid/grid.js
================================================
Page({
data: {
grids: [0, 1, 2, 3, 4, 5, 6, 7, 8]
}
});
================================================
FILE: client/dist/example/grid/grid.wxml
================================================
Grid
九宫格
Grid
================================================
FILE: client/dist/example/icons/icons.js
================================================
Page({});
================================================
FILE: client/dist/example/icons/icons.wxml
================================================
Icons
图标
成功
用于表示操作顺利达成
提示
用于表示信息提示;也常用于缺乏条件的操作拦截,提示用户所需信息
普通警告
用于表示操作后将引起一定后果的情况
强烈警告
用于表示操作后将引起严重的不可挽回的后果的情况
等待
用于表示等待
================================================
FILE: client/dist/example/icons/icons.wxss
================================================
icon{
margin-right: 13px;
}
.page__bd {
padding-left: 40px;
padding-right: 40px;
text-align: left;
}
.icon-box{
margin-bottom: 25px;
display: flex;
align-items: center;
}
.icon-box__ctn{
flex-shrink: 100;
}
.icon-box__title{
font-size: 20px;
}
.icon-box__desc{
margin-top: 6px;
font-size: 12px;
color: #888888;
}
.icon_sp_area {
margin-top: 10px;
text-align: left;
}
================================================
FILE: client/dist/example/images/base64.js
================================================
module.exports = {
icon20: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAMAAABgZ9sFAAAAVFBMVEXx8fHMzMzr6+vn5+fv7+/t7e3d3d2+vr7W1tbHx8eysrKdnZ3p6enk5OTR0dG7u7u3t7ejo6PY2Njh4eHf39/T09PExMSvr6+goKCqqqqnp6e4uLgcLY/OAAAAnklEQVRIx+3RSRLDIAxE0QYhAbGZPNu5/z0zrXHiqiz5W72FqhqtVuuXAl3iOV7iPV/iSsAqZa9BS7YOmMXnNNX4TWGxRMn3R6SxRNgy0bzXOW8EBO8SAClsPdB3psqlvG+Lw7ONXg/pTld52BjgSSkA3PV2OOemjIDcZQWgVvONw60q7sIpR38EnHPSMDQ4MjDjLPozhAkGrVbr/z0ANjAF4AcbXmYAAAAASUVORK5CYII=",
icon60: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAMAAAAOusbgAAAAeFBMVEUAwAD///+U5ZTc9twOww7G8MYwzDCH4YcfyR9x23Hw+/DY9dhm2WZG0kbT9NP0/PTL8sux7LFe115T1VM+zz7i+OIXxhes6qxr2mvA8MCe6J6M4oz6/frr+us5zjn2/fa67rqB4IF13XWn6ad83nxa1loqyirn+eccHxx4AAAC/klEQVRo3u2W2ZKiQBBF8wpCNSCyLwri7v//4bRIFVXoTBBB+DAReV5sG6lTXDITiGEYhmEYhmEYhmEYhmEY5v9i5fsZGRx9PyGDne8f6K9cfd+mKXe1yNG/0CcqYE86AkBMBh66f20deBc7wA/1WFiTwvSEpBMA2JJOBsSLxe/4QEEaJRrASP8EVF8Q74GbmevKg0saa0B8QbwBdjRyADYxIhqxAZ++IKYtciPXLQVG+imw+oo4Bu56rjEJ4GYsvPmKOAB+xlz7L5aevqUXuePWVhvWJ4eWiwUQ67mK51qPj4dFDMlRLBZTqF3SDvmr4BwtkECu5gHWPkmDfQh02WLxXuvbvC8ku8F57GsI5e0CmUwLz1kq3kD17R1In5816rGvQ5VMk5FEtIiWislTffuDpl/k/PzscdQsv8r9qWq4LRWX6tQYtTxvI3XyrwdyQxChXioOngH3dLgOFjk0all56XRi/wDFQrGQU3Os5t0wJu1GNtNKHdPqYaGYQuRDfbfDf26AGLYSyGS3ZAK4S8XuoAlxGSdYMKwqZKM9XJMtyqXi7HX/CiAZS6d8bSVUz5J36mEMFDTlAFQzxOT1dzLRljjB6+++ejFqka+mXIe6F59mw22OuOw1F4T6lg/9VjL1rLDoI9Xzl1MSYDNHnPQnt3D1EE7PrXjye/3pVpr1Z45hMUdcACc5NVQI0bOdS1WA0wuz73e7/5TNqBPhQXPEFGJNV2zNqWI7QKBd2Gn6AiBko02zuAOXeWIXjV0jNqdKegaE/kJQ6Bfs4aju04lMLkA2T5wBSYPKDGF3RKhFYEa6A1L1LG2yacmsaZ6YPOSAMKNsO+N5dNTfkc5Aqe26uxHpx7ZirvgCwJpWq/lmX1hA7LyabQ34tt5RiJKXSwQ+0KU0V5xg+hZrd4Bn1n4EID+WkQdgLfRNtvil9SPfwy+WQ7PFBWQz6dGWZBLkeJFXZGCfLUjCgGgqXo5TuSu3cugdcTv/HjqnBTEMwzAMwzAMwzAMwzAMw/zf/AFbXiOA6frlMAAAAABJRU5ErkJggg=="
};
================================================
FILE: client/dist/example/index.js
================================================
Page({
data: {
list: [
{
id: 'form',
name: '表单',
open: false,
pages: ['button', 'list', 'input', 'slider', 'uploader']
},
{
id: 'widget',
name: '基础组件',
open: false,
pages: ['article', 'badge', 'flex', 'footer', 'gallery', 'grid', 'icons', 'loadmore', 'panel', 'preview', 'progress']
},
{
id: 'feedback',
name: '操作反馈',
open: false,
pages: ['actionsheet', 'dialog', 'msg', 'picker', 'toast']
},
{
id: 'nav',
name: '导航相关',
open: false,
pages: ['navbar', 'tabbar']
},
{
id: 'search',
name: '搜索相关',
open: false,
pages: ['searchbar']
}
]
},
kindToggle: function (e) {
var id = e.currentTarget.id, list = this.data.list;
for (var i = 0, len = list.length; i < len; ++i) {
if (list[i].id == id) {
list[i].open = !list[i].open
} else {
list[i].open = false
}
}
this.setData({
list: list
});
}
});
================================================
FILE: client/dist/example/index.wxml
================================================
WeUI
WeUI 是一套同微信原生视觉体验一致的基础样式库,由微信官方设计团队为微信内网页和微信小程序量身设计,令用户的使用感知更加统一。
{{item.name}}
{{page}}
================================================
FILE: client/dist/example/index.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-flex{-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-cells{margin-top:0;opacity:0;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:.3s;transition:.3s}.weui-cells:after,.weui-cells:before{display:none}.weui-cells_show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.weui-cell:before{right:15px}.kind-list__item{margin:10px 0;background-color:#fff;border-radius:2px;overflow:hidden}.kind-list__item:first-child{margin-top:0}.kind-list__img{width:30px;height:30px}.kind-list__item-hd{padding:20px;-webkit-transition:opacity .3s;transition:opacity .3s}.kind-list__item-hd_show{opacity:.4}.kind-list__item-bd{height:0;overflow:hidden}.kind-list__item-bd_show{height:auto}
================================================
FILE: client/dist/example/input/input.js
================================================
Page({
data: {
showTopTips: false,
radioItems: [
{name: 'cell standard', value: '0'},
{name: 'cell standard', value: '1', checked: true}
],
checkboxItems: [
{name: 'standard is dealt for u.', value: '0', checked: true},
{name: 'standard is dealicient for u.', value: '1'}
],
date: "2016-09-01",
time: "12:01",
countryCodes: ["+86", "+80", "+84", "+87"],
countryCodeIndex: 0,
countries: ["中国", "美国", "英国"],
countryIndex: 0,
accounts: ["微信号", "QQ", "Email"],
accountIndex: 0,
isAgree: false
},
showTopTips: function(){
var that = this;
this.setData({
showTopTips: true
});
setTimeout(function(){
that.setData({
showTopTips: false
});
}, 3000);
},
radioChange: function (e) {
console.log('radio发生change事件,携带value值为:', e.detail.value);
var radioItems = this.data.radioItems;
for (var i = 0, len = radioItems.length; i < len; ++i) {
radioItems[i].checked = radioItems[i].value == e.detail.value;
}
this.setData({
radioItems: radioItems
});
},
checkboxChange: function (e) {
console.log('checkbox发生change事件,携带value值为:', e.detail.value);
var checkboxItems = this.data.checkboxItems, values = e.detail.value;
for (var i = 0, lenI = checkboxItems.length; i < lenI; ++i) {
checkboxItems[i].checked = false;
for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
if(checkboxItems[i].value == values[j]){
checkboxItems[i].checked = true;
break;
}
}
}
this.setData({
checkboxItems: checkboxItems
});
},
bindDateChange: function (e) {
this.setData({
date: e.detail.value
})
},
bindTimeChange: function (e) {
this.setData({
time: e.detail.value
})
},
bindCountryCodeChange: function(e){
console.log('picker country code 发生选择改变,携带值为', e.detail.value);
this.setData({
countryCodeIndex: e.detail.value
})
},
bindCountryChange: function(e) {
console.log('picker country 发生选择改变,携带值为', e.detail.value);
this.setData({
countryIndex: e.detail.value
})
},
bindAccountChange: function(e) {
console.log('picker account 发生选择改变,携带值为', e.detail.value);
this.setData({
accountIndex: e.detail.value
})
},
bindAgreeChange: function (e) {
this.setData({
isAgree: !!e.detail.value.length
});
}
});
================================================
FILE: client/dist/example/input/input.wxml
================================================
Input
表单输入
错误提示
单选列表项
添加更多
复选列表项
添加更多
表单
qq
手机号
获取验证码
日期
{{date}}
时间
{{time}}
验证码
底部说明文字底部说明文字
表单报错
卡号
开关
标题文字
文本框
文本域
0/200
选择
{{countryCodes[countryCodeIndex]}}
选择
{{accounts[accountIndex]}}
国家/地区
{{countries[countryIndex]}}
================================================
FILE: client/dist/example/list/list.js
================================================
var base64 = require("../images/base64");
Page({
onLoad: function(){
this.setData({
icon: base64.icon20
});
}
});
================================================
FILE: client/dist/example/list/list.wxml
================================================
List
列表
带说明的列表项
标题文字
说明文字
带图标、说明的列表项
标题文字
说明文字
标题文字
说明文字
带跳转的列表项
cell standard
cell standard
带说明、跳转的列表项
cell standard
说明文字
cell standard
说明文字
带图标、说明、跳转的列表项
cell standard
说明文字
cell standard
说明文字
================================================
FILE: client/dist/example/loadmore/loadmore.js
================================================
Page({});
================================================
FILE: client/dist/example/loadmore/loadmore.wxml
================================================
Loadmore
加载更多
正在加载
暂无数据
================================================
FILE: client/dist/example/loadmore/loadmore.wxss
================================================
page{
background-color: #FFFFFF;
}
================================================
FILE: client/dist/example/msg/msg.js
================================================
Page({
openSuccess: function () {
wx.navigateTo({
url: 'msg_success'
})
},
openFail: function () {
wx.navigateTo({
url: 'msg_fail'
})
}
});
================================================
FILE: client/dist/example/msg/msg.wxml
================================================
Msg
提示页
================================================
FILE: client/dist/example/msg/msg.wxss
================================================
page{
background-color: #FFFFFF;
}
================================================
FILE: client/dist/example/msg/msg_fail.js
================================================
Page({});
================================================
FILE: client/dist/example/msg/msg_fail.wxml
================================================
操作失败
内容详情,可根据实际需要安排,如果换行则不超过规定长度,居中展现文字链接
================================================
FILE: client/dist/example/msg/msg_fail.wxss
================================================
page{
background-color: #FFFFFF;
}
================================================
FILE: client/dist/example/msg/msg_success.js
================================================
Page({});
================================================
FILE: client/dist/example/msg/msg_success.wxml
================================================
操作成功
内容详情,可根据实际需要安排,如果换行则不超过规定长度,居中展现文字链接
================================================
FILE: client/dist/example/msg/msg_success.wxss
================================================
page{
background-color: #FFFFFF;
}
================================================
FILE: client/dist/example/navbar/navbar.js
================================================
var sliderWidth = 96; // 需要设置slider的宽度,用于计算中间位置
Page({
data: {
tabs: ["选项一", "选项二", "选项三"],
activeIndex: 1,
sliderOffset: 0,
sliderLeft: 0
},
onLoad: function () {
var that = this;
wx.getSystemInfo({
success: function(res) {
that.setData({
sliderLeft: (res.windowWidth / that.data.tabs.length - sliderWidth) / 2,
sliderOffset: res.windowWidth / that.data.tabs.length * that.data.activeIndex
});
}
});
},
tabClick: function (e) {
this.setData({
sliderOffset: e.currentTarget.offsetLeft,
activeIndex: e.currentTarget.id
});
}
});
================================================
FILE: client/dist/example/navbar/navbar.wxml
================================================
{{item}}
选项一的内容
选项二的内容
选项三的内容
================================================
FILE: client/dist/example/navbar/navbar.wxss
================================================
page,
.page,
.page__bd{
height: 100%;
}
.page__bd{
padding-bottom: 0;
}
.weui-tab__content{
padding-top: 60px;
text-align: center;
}
================================================
FILE: client/dist/example/panel/panel.js
================================================
var base64 = require("../images/base64");
Page({
onLoad: function(){
this.setData({
icon20: base64.icon20,
icon60: base64.icon60
});
}
});
================================================
FILE: client/dist/example/panel/panel.wxml
================================================
Panel
面板
图文组合列表
标题一
由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状,有自己的运行轨道。
标题二
由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状,有自己的运行轨道。
查看更多
文字组合列表
标题一
由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状,有自己的运行轨道。
标题二
由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状,有自己的运行轨道。
查看更多
小图文组合列表
文字标题
文字标题
文字列表附来源
标题一
由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状,有自己的运行轨道。
文字来源
时间
================================================
FILE: client/dist/example/picker/picker.js
================================================
Page({
data: {
array: ['美国', '中国', '巴西', '日本'],
index: 0,
date: '2016-09-01',
time: '12:01'
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
index: e.detail.value
})
},
bindDateChange: function(e) {
this.setData({
date: e.detail.value
})
},
bindTimeChange: function(e) {
this.setData({
time: e.detail.value
})
}
});
================================================
FILE: client/dist/example/picker/picker.wxml
================================================
Picker
选择器,这里使用小程序原生的picker。
================================================
FILE: client/dist/example/picker/picker.wxss
================================================
page{
background-color: #FFFFFF;
}
================================================
FILE: client/dist/example/preview/preview.js
================================================
Page({});
================================================
FILE: client/dist/example/preview/preview.wxml
================================================
Preview
表单预览
付款金额
¥2400.00
商品
电动打蛋机
标题标题
名字名字名字
标题标题
很长很长的名字很长很长的名字很长很长的名字很长很长的名字很长很长的名字
操作
付款金额
¥2400.00
商品
电动打蛋机
标题标题
名字名字名字
标题标题
很长很长的名字很长很长的名字很长很长的名字很长很长的名字很长很长的名字
辅助操作
操作
================================================
FILE: client/dist/example/preview/preview.wxss
================================================
.weui-form-preview{
margin-bottom: 25px;
}
================================================
FILE: client/dist/example/progress/progress.js
================================================
function _next(){
var that = this;
if(this.data.progress >= 100){
this.setData({
disabled: false
});
return true;
}
this.setData({
progress: ++this.data.progress
});
setTimeout(function(){
_next.call(that);
}, 20);
}
Page({
data: {
progress: 0,
disabled: false
},
upload: function(){
if(this.data.disabled) return;
this.setData({
progress: 0,
disabled: true
});
_next.call(this);
}
});
================================================
FILE: client/dist/example/progress/progress.wxml
================================================
Progress
进度条,这里采用小程序原生的progress
================================================
FILE: client/dist/example/progress/progress.wxss
================================================
.weui-progress{
margin-bottom: 24px;
}
================================================
FILE: client/dist/example/searchbar/searchbar.js
================================================
Page({
data: {
inputShowed: false,
inputVal: ""
},
showInput: function () {
this.setData({
inputShowed: true
});
},
hideInput: function () {
this.setData({
inputVal: "",
inputShowed: false
});
},
clearInput: function () {
this.setData({
inputVal: ""
});
},
inputTyping: function (e) {
this.setData({
inputVal: e.detail.value
});
}
});
================================================
FILE: client/dist/example/searchbar/searchbar.wxml
================================================
SearchBar
搜索栏
取消
实时搜索文本
实时搜索文本
实时搜索文本
实时搜索文本
================================================
FILE: client/dist/example/searchbar/searchbar.wxss
================================================
.searchbar-result{
margin-top: 0;
font-size: 14px;
}
.searchbar-result:before{
display: none;
}
.weui-cell{
padding: 12px 15px 12px 35px;
}
================================================
FILE: client/dist/example/slider/slider.js
================================================
Page({});
================================================
FILE: client/dist/example/slider/slider.wxml
================================================
Slider
滑块,这里采用小程序原生的slider。
================================================
FILE: client/dist/example/slider/slider.wxss
================================================
slider{
margin-bottom: 30px;
}
================================================
FILE: client/dist/example/tabbar/tabbar.js
================================================
Page({});
================================================
FILE: client/dist/example/tabbar/tabbar.wxml
================================================
Tabbar
底部导航,建议采用小程序原生的tabbar,通过设置app.json来实现。详情请看小程序文档。
================================================
FILE: client/dist/example/toast/toast.js
================================================
Page({
openToast: function () {
wx.showToast({
title: '已完成',
icon: 'success',
duration: 3000
});
},
openLoading: function () {
wx.showToast({
title: '数据加载中',
icon: 'loading',
duration: 3000
});
}
});
================================================
FILE: client/dist/example/toast/toast.wxml
================================================
Toast
弹出式提示,采用小程序原生的toast
================================================
FILE: client/dist/example/toast/toast.wxss
================================================
page{
background-color: #FFFFFF;
}
================================================
FILE: client/dist/example/uploader/uploader.js
================================================
Page({
data: {
files: []
},
chooseImage: function (e) {
var that = this;
wx.chooseImage({
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
that.setData({
files: that.data.files.concat(res.tempFilePaths)
});
}
})
},
previewImage: function(e){
wx.previewImage({
current: e.currentTarget.id, // 当前显示图片的http链接
urls: this.data.files // 需要预览的图片http链接列表
})
}
});
================================================
FILE: client/dist/example/uploader/uploader.wxml
================================================
Uploader
上传组件
图片上传
{{files.length}}/2
50%
================================================
FILE: client/dist/style/base/fn.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
================================================
FILE: client/dist/style/base/mixin/setArrow.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
================================================
FILE: client/dist/style/base/mixin/setOnepx.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
================================================
FILE: client/dist/style/base/mixin/text.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
================================================
FILE: client/dist/style/base/reset.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
page{line-height:1.6;font-family:-apple-system-font,Helvetica Neue,sans-serif}icon{vertical-align:middle}
================================================
FILE: client/dist/style/base/variable/color.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
================================================
FILE: client/dist/style/base/variable/global.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
================================================
FILE: client/dist/style/base/variable/weui-button.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
================================================
FILE: client/dist/style/base/variable/weui-cell.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
================================================
FILE: client/dist/style/base/variable/weui-dialog.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
================================================
FILE: client/dist/style/base/variable/weui-grid.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
================================================
FILE: client/dist/style/base/variable/weui-msg.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
================================================
FILE: client/dist/style/base/variable/weui-progress.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
================================================
FILE: client/dist/style/weui.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
page{line-height:1.6;font-family:-apple-system-font,Helvetica Neue,sans-serif}icon{vertical-align:middle}.weui-cells{position:relative;margin-top:1.17647059em;background-color:#fff;line-height:1.41176471;font-size:17px}.weui-cells:before{top:0;border-top:1rpx solid #d9d9d9}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d9d9d9}.weui-cells:after{bottom:0;border-bottom:1rpx solid #d9d9d9}.weui-cells__title{margin-top:.77em;margin-bottom:.3em;padding-left:15px;padding-right:15px;color:#999;font-size:14px}.weui-cells_after-title{margin-top:0}.weui-cells__tips{margin-top:.3em;color:#999;padding-left:15px;padding-right:15px;font-size:14px}.weui-cell{padding:10px 15px;position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #d9d9d9;color:#d9d9d9;left:15px}.weui-cell:first-child:before{display:none}.weui-cell_active{background-color:#ececec}.weui-cell_primary{-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start}.weui-cell__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-cell__ft{text-align:right;color:#999}.weui-cell_access{color:inherit}.weui-cell__ft_in-access{padding-right:13px;position:relative}.weui-cell__ft_in-access:after{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;margin-top:-4px;right:2px}.weui-cell_link{color:#586c94;font-size:14px}.weui-cell_link:active{background-color:#ececec}.weui-cell_link:first-child:before{display:block}.weui-icon-radio{margin-left:3.2px;margin-right:3.2px}.weui-icon-checkbox_circle,.weui-icon-checkbox_success{margin-left:4.6px;margin-right:4.6px}.weui-check__label:active{background-color:#ececec}.weui-check{position:absolute;left:-9999px}.weui-check__hd_in-checkbox{padding-right:.35em}.weui-cell__ft_in-radio{padding-left:.35em}.weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:2.58823529em;min-height:2.58823529em;line-height:2.58823529em}.weui-toptips{position:fixed;-webkit-transform:translateZ(0);transform:translateZ(0);top:0;left:0;right:0;padding:5px;font-size:14px;text-align:center;color:#fff;z-index:5000;word-wrap:break-word;word-break:break-all}.weui-toptips_warn{background-color:#e64340}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:#b2b2b2;text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#e64340}.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid #d9d9d9}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d9d9d9}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid #d9d9d9}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:10px 15px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid #d9d9d9;color:#d9d9d9;left:15px}.weui-form-preview__bd{padding:10px 15px;font-size:.9em;text-align:right;color:#999;line-height:2}.weui-form-preview__ft{position:relative;line-height:50px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #d5d5d6;color:#d5d5d6}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:#999;text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3cc51f;text-align:center}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #d5d5d6;color:#d5d5d6}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#eee}.weui-form-preview__btn_default{color:#999}.weui-form-preview__btn_primary{color:#0bb20c}.weui-cell_select{padding:0}.weui-select{position:relative;padding-left:15px;padding-right:30px;height:2.58823529em;min-height:2.58823529em;line-height:2.58823529em;border-right:1rpx solid #d9d9d9}.weui-select:before{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;right:15px;margin-top:-4px}.weui-select_in-select-after{padding-left:0}.weui-cell__bd_in-select-before,.weui-cell__hd_in-select-after{padding-left:15px}.weui-cell_vcode{padding-right:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:2.58823529em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1px solid #e5e5e5;line-height:2.58823529em;font-size:17px;color:#3cc51f;white-space:nowrap}.weui-vcode-btn:active{color:#52a341}.weui-cell_switch{padding-top:6px;padding-bottom:6px}.weui-uploader__hd{display:-webkit-box;display:-webkit-flex;display:flex;padding-bottom:10px;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-uploader__title{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__info{color:#b2b2b2}.weui-uploader__bd{margin-bottom:-4px;margin-right:-9px;overflow:hidden}.weui-uploader__file{float:left;margin-right:9px;margin-bottom:9px}.weui-uploader__img{display:block;width:79px;height:79px}.weui-uploader__file_status{position:relative}.weui-uploader__file_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.5)}.weui-uploader__file-content{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#fff}.weui-uploader__input-box{float:left;position:relative;margin-right:9px;margin-bottom:9px;width:77px;height:77px;border:1px solid #d9d9d9}.weui-uploader__input-box:after,.weui-uploader__input-box:before{content:" ";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#d9d9d9}.weui-uploader__input-box:before{width:2px;height:39.5px}.weui-uploader__input-box:after{width:39.5px;height:2px}.weui-uploader__input-box:active{border-color:#999}.weui-uploader__input-box:active:after,.weui-uploader__input-box:active:before{background-color:#999}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0}.weui-article{padding:20px 15px;font-size:15px}.weui-article__section{margin-bottom:1.5em}.weui-article__h1{font-size:18px;font-weight:400;margin-bottom:.9em}.weui-article__h2{font-size:16px;font-weight:400;margin-bottom:.34em}.weui-article__h3{font-weight:400;font-size:15px;margin-bottom:.34em}.weui-article__p{margin:0 0 .8em}.weui-msg{padding-top:36px;text-align:center}.weui-msg__link{display:inline;color:#586c94}.weui-msg__icon-area{margin-bottom:30px}.weui-msg__text-area{margin-bottom:25px;padding:0 20px}.weui-msg__title{margin-bottom:5px;font-weight:400;font-size:20px}.weui-msg__desc{font-size:14px;color:#999}.weui-msg__opr-area{margin-bottom:25px}.weui-msg__extra-area{margin-bottom:15px;font-size:14px;color:#999}@media screen and (min-height:438px){.weui-msg__extra-area{position:fixed;left:0;bottom:0;width:100%;text-align:center}}.weui-flex{display:-webkit-box;display:-webkit-flex;display:flex}.weui-flex__item{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn{margin-top:15px}.weui-btn:first-child{margin-top:0}.weui-btn-area{margin:1.17647059em 15px .3em}.weui-agree{display:block;padding:.5em 15px;font-size:13px}.weui-agree__text{color:#999}.weui-agree__link{display:inline;color:#586c94}.weui-agree__checkbox{position:absolute;left:-9999px}.weui-agree__checkbox-icon{position:relative;top:2px;display:inline-block;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:11px;height:11px}.weui-agree__checkbox-icon-check{position:absolute;top:1px;left:1px}.weui-footer{color:#999;font-size:14px;text-align:center}.weui-footer_fixed-bottom{position:fixed;bottom:.52em;left:0;right:0}.weui-footer__links{font-size:0}.weui-footer__link{display:inline-block;vertical-align:top;margin:0 .62em;position:relative;font-size:14px;color:#586c94}.weui-footer__link:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #c7c7c7;color:#c7c7c7;left:-.65em;top:.36em;bottom:.36em}.weui-footer__link:first-child:before{display:none}.weui-footer__text{padding:0 .34em;font-size:12px}.weui-grids{border-top:1rpx solid #d9d9d9;border-left:1rpx solid #d9d9d9;overflow:hidden}.weui-grid{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid #d9d9d9;border-bottom:1rpx solid #d9d9d9}.weui-grid_active{background-color:#ececec}.weui-grid__icon{display:block;width:28px;height:28px;margin:0 auto}.weui-grid__label{margin-top:5px;display:block;text-align:center;color:#000;font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:a 1s steps(12) infinite;animation:a 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#e64340;color:#fff;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}.weui-loadmore{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.weui-loadmore__tips{display:inline-block;vertical-align:middle}.weui-loadmore_line{border-top:1px solid #e5e5e5;margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-.9em;padding:0 .55em;background-color:#fff;color:#999}.weui-loadmore__tips_in-dot{position:relative;padding:0 .16em;width:4px;height:1.6em}.weui-loadmore__tips_in-dot:before{content:" ";position:absolute;top:50%;left:50%;margin-top:-1px;margin-left:-2px;width:4px;height:4px;border-radius:50%;background-color:#e5e5e5}.weui-panel{background-color:#fff;margin-top:10px;position:relative;overflow:hidden}.weui-panel:first-child{margin-top:0}.weui-panel:before{top:0;border-top:1rpx solid #e5e5e5}.weui-panel:after,.weui-panel:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#e5e5e5}.weui-panel:after{bottom:0;border-bottom:1rpx solid #e5e5e5}.weui-panel__hd{padding:14px 15px 10px;color:#999;font-size:13px;position:relative}.weui-panel__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid #e5e5e5;color:#e5e5e5;left:15px}.weui-media-box{padding:15px;position:relative}.weui-media-box:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #e5e5e5;color:#e5e5e5;left:15px}.weui-media-box:first-child:before{display:none}.weui-media-box__title{font-weight:400;font-size:17px;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal;word-wrap:break-word;word-break:break-all}.weui-media-box__desc{color:#999;font-size:13px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-media-box__info{margin-top:15px;padding-bottom:5px;font-size:13px;color:#cecece;line-height:1em;list-style:none;overflow:hidden}.weui-media-box__info__meta{float:left;padding-right:1em}.weui-media-box__info__meta_extra{padding-left:1em;border-left:1px solid #cecece}.weui-media-box__title_in-text{margin-bottom:8px}.weui-media-box_appmsg{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-media-box__thumb{width:100%;height:100%;vertical-align:top}.weui-media-box__hd_in-appmsg{margin-right:.8em;width:60px;height:60px;line-height:60px;text-align:center}.weui-media-box__bd_in-appmsg{-webkit-box-flex:1;-webkit-flex:1;flex:1;min-width:0}.weui-media-box_small-appmsg{padding:0}.weui-cells_in-small-appmsg{margin-top:0}.weui-cells_in-small-appmsg:before{display:none}.weui-progress{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-progress__bar{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-progress__opr{margin-left:15px;font-size:0}.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;z-index:500;top:0;width:100%;border-bottom:1rpx solid #ccc}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:13px 0;text-align:center;font-size:0}.weui-navbar__item.weui-bar__item_on{color:#1aad19}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:3px;background-color:#1aad19;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.weui-navbar__title{display:inline-block;font-size:15px;max-width:8em;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.weui-tab{position:relative;height:100%}.weui-tab__panel{box-sizing:border-box;height:100%;padding-top:50px;overflow:auto;-webkit-overflow-scrolling:touch}.weui-search-bar{position:relative;padding:8px 10px;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;background-color:#efeff4;border-top:1rpx solid #d7d6dc;border-bottom:1rpx solid #d7d6dc}.weui-icon-search{margin-right:8px;font-size:inherit}.weui-icon-search_in-box{position:absolute;left:10px;top:7px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:middle}.weui-search-bar__form{position:relative;-webkit-box-flex:1;-webkit-flex:auto;flex:auto;border-radius:5px;background:#fff;border:1rpx solid #e6e6ea}.weui-search-bar__box{position:relative;padding-left:30px;padding-right:30px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:28px;line-height:28px;font-size:14px}.weui-icon-clear{position:absolute;top:0;right:0;padding:7px 8px;font-size:0}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:3px;text-align:center;color:#9b9b9b;background:#fff;line-height:28px}.weui-search-bar__cancel-btn{margin-left:10px;line-height:28px;color:#09bb07;white-space:nowrap}
================================================
FILE: client/dist/style/widget/weui-agree/weui-agree.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-agree{display:block;padding:.5em 15px;font-size:13px}.weui-agree__text{color:#999}.weui-agree__link{display:inline;color:#586c94}.weui-agree__checkbox{position:absolute;left:-9999px}.weui-agree__checkbox-icon{position:relative;top:2px;display:inline-block;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:11px;height:11px}.weui-agree__checkbox-icon-check{position:absolute;top:1px;left:1px}
================================================
FILE: client/dist/style/widget/weui-animate/weui-animate.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
@-webkit-keyframes a{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes a{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.weui-animate-slide-up{-webkit-animation:a ease .3s forwards;animation:a ease .3s forwards}@-webkit-keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}.weui-animate-slide-down{-webkit-animation:b ease .3s forwards;animation:b ease .3s forwards}@-webkit-keyframes c{0%{opacity:0}to{opacity:1}}@keyframes c{0%{opacity:0}to{opacity:1}}.weui-animate-fade-in{-webkit-animation:c ease .3s forwards;animation:c ease .3s forwards}@-webkit-keyframes d{0%{opacity:1}to{opacity:0}}@keyframes d{0%{opacity:1}to{opacity:0}}.weui-animate-fade-out{-webkit-animation:d ease .3s forwards;animation:d ease .3s forwards}
================================================
FILE: client/dist/style/widget/weui-button/weui-button.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn{margin-top:15px}.weui-btn:first-child{margin-top:0}.weui-btn-area{margin:1.17647059em 15px .3em}
================================================
FILE: client/dist/style/widget/weui-cell/weui-access.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_access{color:inherit}.weui-cell__ft_in-access{padding-right:13px;position:relative}.weui-cell__ft_in-access:after{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;margin-top:-4px;right:2px}.weui-cell_link{color:#586c94;font-size:14px}.weui-cell_link:active{background-color:#ececec}.weui-cell_link:first-child:before{display:block}
================================================
FILE: client/dist/style/widget/weui-cell/weui-cell.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cells{position:relative;margin-top:1.17647059em;background-color:#fff;line-height:1.41176471;font-size:17px}.weui-cells:before{top:0;border-top:1rpx solid #d9d9d9}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d9d9d9}.weui-cells:after{bottom:0;border-bottom:1rpx solid #d9d9d9}.weui-cells__title{margin-top:.77em;margin-bottom:.3em;padding-left:15px;padding-right:15px;color:#999;font-size:14px}.weui-cells_after-title{margin-top:0}.weui-cells__tips{margin-top:.3em;color:#999;padding-left:15px;padding-right:15px;font-size:14px}.weui-cell{padding:10px 15px;position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #d9d9d9;color:#d9d9d9;left:15px}.weui-cell:first-child:before{display:none}.weui-cell_active{background-color:#ececec}.weui-cell_primary{-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start}.weui-cell__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-cell__ft{text-align:right;color:#999}
================================================
FILE: client/dist/style/widget/weui-cell/weui-check.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-icon-radio{margin-left:3.2px;margin-right:3.2px}.weui-icon-checkbox_circle,.weui-icon-checkbox_success{margin-left:4.6px;margin-right:4.6px}.weui-check__label:active{background-color:#ececec}.weui-check{position:absolute;left:-9999px}.weui-check__hd_in-checkbox{padding-right:.35em}.weui-cell__ft_in-radio{padding-left:.35em}
================================================
FILE: client/dist/style/widget/weui-cell/weui-form/weui-form-preview.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid #d9d9d9}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d9d9d9}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid #d9d9d9}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:10px 15px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid #d9d9d9;color:#d9d9d9;left:15px}.weui-form-preview__bd{padding:10px 15px;font-size:.9em;text-align:right;color:#999;line-height:2}.weui-form-preview__ft{position:relative;line-height:50px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #d5d5d6;color:#d5d5d6}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:#999;text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3cc51f;text-align:center}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #d5d5d6;color:#d5d5d6}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#eee}.weui-form-preview__btn_default{color:#999}.weui-form-preview__btn_primary{color:#0bb20c}
================================================
FILE: client/dist/style/widget/weui-cell/weui-form/weui-form_common.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:2.58823529em;min-height:2.58823529em;line-height:2.58823529em}.weui-toptips{position:fixed;-webkit-transform:translateZ(0);transform:translateZ(0);top:0;left:0;right:0;padding:5px;font-size:14px;text-align:center;color:#fff;z-index:5000;word-wrap:break-word;word-break:break-all}.weui-toptips_warn{background-color:#e64340}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:#b2b2b2;text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#e64340}
================================================
FILE: client/dist/style/widget/weui-cell/weui-form/weui-select.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_select{padding:0}.weui-select{position:relative;padding-left:15px;padding-right:30px;height:2.58823529em;min-height:2.58823529em;line-height:2.58823529em;border-right:1rpx solid #d9d9d9}.weui-select:before{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;right:15px;margin-top:-4px}.weui-select_in-select-after{padding-left:0}.weui-cell__bd_in-select-before,.weui-cell__hd_in-select-after{padding-left:15px}
================================================
FILE: client/dist/style/widget/weui-cell/weui-form/weui-vcode.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_vcode{padding-right:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:2.58823529em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1px solid #e5e5e5;line-height:2.58823529em;font-size:17px;color:#3cc51f;white-space:nowrap}.weui-vcode-btn:active{color:#52a341}
================================================
FILE: client/dist/style/widget/weui-cell/weui-form.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:2.58823529em;min-height:2.58823529em;line-height:2.58823529em}.weui-toptips{position:fixed;-webkit-transform:translateZ(0);transform:translateZ(0);top:0;left:0;right:0;padding:5px;font-size:14px;text-align:center;color:#fff;z-index:5000;word-wrap:break-word;word-break:break-all}.weui-toptips_warn{background-color:#e64340}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:#b2b2b2;text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#e64340}.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid #d9d9d9}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d9d9d9}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid #d9d9d9}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:10px 15px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid #d9d9d9;color:#d9d9d9;left:15px}.weui-form-preview__bd{padding:10px 15px;font-size:.9em;text-align:right;color:#999;line-height:2}.weui-form-preview__ft{position:relative;line-height:50px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #d5d5d6;color:#d5d5d6}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:#999;text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3cc51f;text-align:center}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #d5d5d6;color:#d5d5d6}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#eee}.weui-form-preview__btn_default{color:#999}.weui-form-preview__btn_primary{color:#0bb20c}.weui-cell_select{padding:0}.weui-select{position:relative;padding-left:15px;padding-right:30px;height:2.58823529em;min-height:2.58823529em;line-height:2.58823529em;border-right:1rpx solid #d9d9d9}.weui-select:before{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;right:15px;margin-top:-4px}.weui-select_in-select-after{padding-left:0}.weui-cell__bd_in-select-before,.weui-cell__hd_in-select-after{padding-left:15px}.weui-cell_vcode{padding-right:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:2.58823529em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1px solid #e5e5e5;line-height:2.58823529em;font-size:17px;color:#3cc51f;white-space:nowrap}.weui-vcode-btn:active{color:#52a341}
================================================
FILE: client/dist/style/widget/weui-cell/weui-switch.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_switch{padding-top:6px;padding-bottom:6px}
================================================
FILE: client/dist/style/widget/weui-cell/weui-uploader.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-uploader__hd{display:-webkit-box;display:-webkit-flex;display:flex;padding-bottom:10px;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-uploader__title{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__info{color:#b2b2b2}.weui-uploader__bd{margin-bottom:-4px;margin-right:-9px;overflow:hidden}.weui-uploader__file{float:left;margin-right:9px;margin-bottom:9px}.weui-uploader__img{display:block;width:79px;height:79px}.weui-uploader__file_status{position:relative}.weui-uploader__file_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.5)}.weui-uploader__file-content{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#fff}.weui-uploader__input-box{float:left;position:relative;margin-right:9px;margin-bottom:9px;width:77px;height:77px;border:1px solid #d9d9d9}.weui-uploader__input-box:after,.weui-uploader__input-box:before{content:" ";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#d9d9d9}.weui-uploader__input-box:before{width:2px;height:39.5px}.weui-uploader__input-box:after{width:39.5px;height:2px}.weui-uploader__input-box:active{border-color:#999}.weui-uploader__input-box:active:after,.weui-uploader__input-box:active:before{background-color:#999}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0}
================================================
FILE: client/dist/style/widget/weui-flex/weui-flex.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-flex{display:-webkit-box;display:-webkit-flex;display:flex}.weui-flex__item{-webkit-box-flex:1;-webkit-flex:1;flex:1}
================================================
FILE: client/dist/style/widget/weui-footer/weui-footer.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-footer{color:#999;font-size:14px;text-align:center}.weui-footer_fixed-bottom{position:fixed;bottom:.52em;left:0;right:0}.weui-footer__links{font-size:0}.weui-footer__link{display:inline-block;vertical-align:top;margin:0 .62em;position:relative;font-size:14px;color:#586c94}.weui-footer__link:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #c7c7c7;color:#c7c7c7;left:-.65em;top:.36em;bottom:.36em}.weui-footer__link:first-child:before{display:none}.weui-footer__text{padding:0 .34em;font-size:12px}
================================================
FILE: client/dist/style/widget/weui-grid/weui-grid.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-grids{border-top:1rpx solid #d9d9d9;border-left:1rpx solid #d9d9d9;overflow:hidden}.weui-grid{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid #d9d9d9;border-bottom:1rpx solid #d9d9d9}.weui-grid_active{background-color:#ececec}.weui-grid__icon{display:block;width:28px;height:28px;margin:0 auto}.weui-grid__label{margin-top:5px;display:block;text-align:center;color:#000;font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
================================================
FILE: client/dist/style/widget/weui-loading/weui-loading.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:a 1s steps(12) infinite;animation:a 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}
================================================
FILE: client/dist/style/widget/weui-media-box/weui-media-box.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-media-box{padding:15px;position:relative}.weui-media-box:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #e5e5e5;color:#e5e5e5;left:15px}.weui-media-box:first-child:before{display:none}.weui-media-box__title{font-weight:400;font-size:17px;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal;word-wrap:break-word;word-break:break-all}.weui-media-box__desc{color:#999;font-size:13px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-media-box__info{margin-top:15px;padding-bottom:5px;font-size:13px;color:#cecece;line-height:1em;list-style:none;overflow:hidden}.weui-media-box__info__meta{float:left;padding-right:1em}.weui-media-box__info__meta_extra{padding-left:1em;border-left:1px solid #cecece}.weui-media-box__title_in-text{margin-bottom:8px}.weui-media-box_appmsg{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-media-box__thumb{width:100%;height:100%;vertical-align:top}.weui-media-box__hd_in-appmsg{margin-right:.8em;width:60px;height:60px;line-height:60px;text-align:center}.weui-media-box__bd_in-appmsg{-webkit-box-flex:1;-webkit-flex:1;flex:1;min-width:0}.weui-media-box_small-appmsg{padding:0}.weui-cells_in-small-appmsg{margin-top:0}.weui-cells_in-small-appmsg:before{display:none}
================================================
FILE: client/dist/style/widget/weui-page/weui-article.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-article{padding:20px 15px;font-size:15px}.weui-article__section{margin-bottom:1.5em}.weui-article__h1{font-size:18px;font-weight:400;margin-bottom:.9em}.weui-article__h2{font-size:16px;font-weight:400;margin-bottom:.34em}.weui-article__h3{font-weight:400;font-size:15px;margin-bottom:.34em}.weui-article__p{margin:0 0 .8em}
================================================
FILE: client/dist/style/widget/weui-page/weui-msg.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-msg{padding-top:36px;text-align:center}.weui-msg__link{display:inline;color:#586c94}.weui-msg__icon-area{margin-bottom:30px}.weui-msg__text-area{margin-bottom:25px;padding:0 20px}.weui-msg__title{margin-bottom:5px;font-weight:400;font-size:20px}.weui-msg__desc{font-size:14px;color:#999}.weui-msg__opr-area{margin-bottom:25px}.weui-msg__extra-area{margin-bottom:15px;font-size:14px;color:#999}@media screen and (min-height:438px){.weui-msg__extra-area{position:fixed;left:0;bottom:0;width:100%;text-align:center}}
================================================
FILE: client/dist/style/widget/weui-panel/weui-panel.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-panel{background-color:#fff;margin-top:10px;position:relative;overflow:hidden}.weui-panel:first-child{margin-top:0}.weui-panel:before{top:0;border-top:1rpx solid #e5e5e5}.weui-panel:after,.weui-panel:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#e5e5e5}.weui-panel:after{bottom:0;border-bottom:1rpx solid #e5e5e5}.weui-panel__hd{padding:14px 15px 10px;color:#999;font-size:13px;position:relative}.weui-panel__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid #e5e5e5;color:#e5e5e5;left:15px}
================================================
FILE: client/dist/style/widget/weui-progress/weui-progress.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-progress{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-progress__bar{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-progress__opr{margin-left:15px;font-size:0}
================================================
FILE: client/dist/style/widget/weui-searchbar/weui-searchbar.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-search-bar{position:relative;padding:8px 10px;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;background-color:#efeff4;border-top:1rpx solid #d7d6dc;border-bottom:1rpx solid #d7d6dc}.weui-icon-search{margin-right:8px;font-size:inherit}.weui-icon-search_in-box{position:absolute;left:10px;top:7px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:middle}.weui-search-bar__form{position:relative;-webkit-box-flex:1;-webkit-flex:auto;flex:auto;border-radius:5px;background:#fff;border:1rpx solid #e6e6ea}.weui-search-bar__box{position:relative;padding-left:30px;padding-right:30px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:28px;line-height:28px;font-size:14px}.weui-icon-clear{position:absolute;top:0;right:0;padding:7px 8px;font-size:0}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:3px;text-align:center;color:#9b9b9b;background:#fff;line-height:28px}.weui-search-bar__cancel-btn{margin-left:10px;line-height:28px;color:#09bb07;white-space:nowrap}
================================================
FILE: client/dist/style/widget/weui-tab/weui-navbar.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;z-index:500;top:0;width:100%;border-bottom:1rpx solid #ccc}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:13px 0;text-align:center;font-size:0}.weui-navbar__item.weui-bar__item_on{color:#1aad19}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:3px;background-color:#1aad19;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.weui-navbar__title{display:inline-block;font-size:15px;max-width:8em;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}
================================================
FILE: client/dist/style/widget/weui-tab/weui-tab.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;z-index:500;top:0;width:100%;border-bottom:1rpx solid #ccc}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:13px 0;text-align:center;font-size:0}.weui-navbar__item.weui-bar__item_on{color:#1aad19}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:3px;background-color:#1aad19;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.weui-navbar__title{display:inline-block;font-size:15px;max-width:8em;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.weui-tab{position:relative;height:100%}.weui-tab__panel{box-sizing:border-box;height:100%;padding-top:50px;overflow:auto;-webkit-overflow-scrolling:touch}
================================================
FILE: client/dist/style/widget/weui-tips/weui-badge.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#e64340;color:#fff;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}
================================================
FILE: client/dist/style/widget/weui-tips/weui-loadmore.wxss
================================================
/*!
* WeUI v1.1.1 (https://github.com/weui/weui-wxss)
* Copyright 2017 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-loadmore{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.weui-loadmore__tips{display:inline-block;vertical-align:middle}.weui-loadmore_line{border-top:1px solid #e5e5e5;margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-.9em;padding:0 .55em;background-color:#fff;color:#999}.weui-loadmore__tips_in-dot{position:relative;padding:0 .16em;width:4px;height:1.6em}.weui-loadmore__tips_in-dot:before{content:" ";position:absolute;top:50%;left:50%;margin-top:-1px;margin-left:-2px;width:4px;height:4px;border-radius:50%;background-color:#e5e5e5}
================================================
FILE: client/libs/amap-wx.js
================================================
function AMapWX(a){this.key=a.key,this.requestConfig={key:a.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"}}AMapWX.prototype.getWxLocation=function(a,b){wx.getLocation({type:"gcj02",success:function(a){var c=a.longitude+","+a.latitude;wx.setStorage({key:"userLocation",data:c}),b(c)},fail:function(c){wx.getStorage({key:"userLocation",success:function(a){a.data&&b(a.data)}}),a.fail({errCode:"0",errMsg:c.errMsg||""})}})},AMapWX.prototype.getRegeo=function(a){function c(c){var d=b.requestConfig;wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:b.key,location:c,extensions:"all",s:d.s,platform:d.platform,appname:b.key,sdkversion:d.sdkversion,logversion:d.logversion},method:"GET",header:{"content-type":"application/json"},success:function(b){var d,e,f,g,h,i,j,k,l;b.data.status&&"1"==b.data.status?(d=b.data.regeocode,e=d.addressComponent,f=[],g="",d&&d.roads[0]&&d.roads[0].name&&(g=d.roads[0].name+"附近"),h=c.split(",")[0],i=c.split(",")[1],d.pois&&d.pois[0]&&(g=d.pois[0].name+"附近",j=d.pois[0].location,j&&(h=parseFloat(j.split(",")[0]),i=parseFloat(j.split(",")[1]))),e.provice&&f.push(e.provice),e.city&&f.push(e.city),e.district&&f.push(e.district),e.streetNumber&&e.streetNumber.street&&e.streetNumber.number?(f.push(e.streetNumber.street),f.push(e.streetNumber.number)):(k="",d&&d.roads[0]&&d.roads[0].name&&(k=d.roads[0].name),f.push(k)),f=f.join(""),l=[{iconPath:a.iconPath,width:a.iconWidth,height:a.iconHeight,name:f,desc:g,longitude:h,latitude:i,id:0,regeocodeData:d}],a.success(l)):a.fail({errCode:b.data.infocode,errMsg:b.data.info})},fail:function(b){a.fail({errCode:"0",errMsg:b.errMsg||""})}})}var b=this;a.location?c(a.location):b.getWxLocation(a,function(a){c(a)})},AMapWX.prototype.getWeather=function(a){function d(d){var e="base";a.type&&"forecast"==a.type&&(e="all"),wx.request({url:"https://restapi.amap.com/v3/weather/weatherInfo",data:{key:b.key,city:d,extensions:e,s:c.s,platform:c.platform,appname:b.key,sdkversion:c.sdkversion,logversion:c.logversion},method:"GET",header:{"content-type":"application/json"},success:function(b){function c(a){var b={city:{text:"城市",data:a.city},weather:{text:"天气",data:a.weather},temperature:{text:"温度",data:a.temperature},winddirection:{text:"风向",data:a.winddirection+"风"},windpower:{text:"风力",data:a.windpower+"级"},humidity:{text:"湿度",data:a.humidity+"%"}};return b}var d,e;b.data.status&&"1"==b.data.status?b.data.lives?(d=b.data.lives,d&&d.length>0&&(d=d[0],e=c(d),e["liveData"]=d,a.success(e))):b.data.forecasts&&b.data.forecasts[0]&&a.success({forecast:b.data.forecasts[0]}):a.fail({errCode:b.data.infocode,errMsg:b.data.info})},fail:function(b){a.fail({errCode:"0",errMsg:b.errMsg||""})}})}function e(e){wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:b.key,location:e,extensions:"all",s:c.s,platform:c.platform,appname:b.key,sdkversion:c.sdkversion,logversion:c.logversion},method:"GET",header:{"content-type":"application/json"},success:function(b){var c,e;b.data.status&&"1"==b.data.status?(e=b.data.regeocode,e.addressComponent?c=e.addressComponent.adcode:e.aois&&e.aois.length>0&&(c=e.aois[0].adcode),d(c)):a.fail({errCode:b.data.infocode,errMsg:b.data.info})},fail:function(b){a.fail({errCode:"0",errMsg:b.errMsg||""})}})}var b=this,c=b.requestConfig;a.city?d(a.city):b.getWxLocation(a,function(a){e(a)})},AMapWX.prototype.getPoiAround=function(a){function d(d){var e={key:b.key,location:d,s:c.s,platform:c.platform,appname:b.key,sdkversion:c.sdkversion,logversion:c.logversion};a.querytypes&&(e["types"]=a.querytypes),a.querykeywords&&(e["keywords"]=a.querykeywords),wx.request({url:"https://restapi.amap.com/v3/place/around",data:e,method:"GET",header:{"content-type":"application/json"},success:function(b){var c,d,e,f;if(b.data.status&&"1"==b.data.status){if(b=b.data,b&&b.pois){for(c=[],d=0;d
================================================
FILE: client/pages/addLocation/addLocation.wxss
================================================
.searchbar-result{
margin-top: 0;
font-size: 14px;
}
.searchbar-result:before{
display: none;
}
.weui-cell{
padding: 12px 15px 12px 35px;
}
.btn-submit {
margin-top: 50rpx;
}
================================================
FILE: client/pages/checkIn/checkIn.js
================================================
// pages/checkIn/checkIn.js
var uploadFn = require('../../utils/upload.js');
var config = require('../../config.js');
var distance = require('../../utils/getdistance.js');
var QQMapWX = require('../../libs/qqmap-wx-jssdk.js');
//腾讯地图Key
var demo = new QQMapWX({
key: ''
});
const app = getApp();
var photo_check_url = null;
var photo_check_res = false;
var location_check_res = false;
var face_check_res = false;
var activity_lat = null;
var activity_lng = null;
var activity_id = null;
Page({
/**
* 页面的初始数据
*/
data: {
activity_title: "",
photo: "../../image/avator.jpg",
location_res: "等待验证",
face_res: "等待验证",
face_disabled:false,
location_disabled:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this;
console.log('点击打卡', photo_check_res, location_check_res)
activity_lat = options.lat;
activity_lng = options.lng;
activity_id = options.activityId;
console.log(options.activityId);
if(options.face == 0){
face_check_res = true;
}
if(options.location == 0) {
location_check_res = true;
}
console.log(options.face,options.location);
that.setData({
activity_title: options.title,
face_disabled: options.face==0?true:false,
location_disabled: options.location == 0 ? true : false
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
var that = this;
that.setData({
face_disabled: false,
location_disabled: false
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/**
* 选择图片
* api_key face++的人脸对比接口key
* api_secret face++的人脸对比接口secret
* image_url2 第二张人脸的照片
*/
chooseImage: function () {
wx.chooseImage({
success: function (res) {
var tempFilePaths = res.tempFilePaths
wx.uploadFile({
url: 'https://api-cn.faceplusplus.com/facepp/v3/compare', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'image_file1',
formData: {
'api_key': '',
'api_secret': '',
'image_url2': ''
},
success: function (res) {
console.log(res.data);
//do something
}
})
}
})
},
/**
* 点击上传打卡照片时,进行图片签到
*/
photoCheck: function () {
var me = this;
wx.chooseImage({
success: function (res) {
var filePath = res.tempFilePaths[0];
// var fileName = filePath.match(/http.{7}(.*)/);
// fileName = fileName[1];
var fileName = Date.parse(new Date()) + '.jpg';
uploadFn(filePath, fileName, me, function (photo_url) {
photo_check_url = photo_url;
photo_check_res = true;
// 最后用的时候再打开,否则频繁请求说不定要钱呢!
me.setData({
photo: photo_url
});
// console.log(photo_url);
});
},
})
},
/**
* 点击地点验证,进行地点签到
*/
locationCheck: function () {
var that = this;
wx.getLocation({
success: function (res) {
var p1 = {
lat: res.latitude,
lng: res.longitude
};
var p2 = {
lat: activity_lat,
lng: activity_lng
};
// console.log(p1, p2);
demo.calculateDistance({
to: [{
latitude: p1.lat,
longitude: p1.lng
}],
from: {
latitude: p2.lat,
longitude: p2.lng
},
success: function (res) {
var dis = res.result.elements[0].distance;
if (dis <= 1000) {
location_check_res = true;
that.setData({
location_res: "验证成功"
})
} else {
location_check_res = false;
that.setData({
location_res: "验证失败"
})
}
// console.log(res.result.elements[0].distance);
console.log(res);
},
fail: function (res) {
console.log(res);
},
})
},
})
},
/**
* 点击人脸验证,进行人脸签到
* api_key face++的人脸对比接口key
* api_secret face++的人脸对比接口secret
* image_url2 第二张人脸的照片
*/
faceCheck: function () {
var that = this;
wx.chooseImage({
success: function (res) {
var avator_url = app.globalData.avator_url;
console.log('本地照片地址',avator_url);
if (avator_url == '') {
wx.showToast({
title: '请绑定照片',
duration: 1000
})
} else {
var tempFilePaths = res.tempFilePaths
wx.uploadFile({
url: 'https://api-cn.faceplusplus.com/facepp/v3/compare', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'image_file1',
formData: {
'api_key': '',
'api_secret': '',
'image_url2': avator_url
},
success: function (res) {
console.log(res.data);
var obj = JSON.parse(res.data);
// console.log(obj.confidence);
if(obj.confidence >= 50){
face_check_res = true;
that.setData({
face_res:'验证成功'
})
}else if (obj.confidence < 50) {
that.setData({
face_res:'验证失败'
})
}else{
wx.showToast({
title: 'API并发控制',
duration: 1000
})
}
}
})
}
}
})
},
submitCheck: function(){
if(photo_check_res&&location_check_res&&face_check_res){
wx.request({
url: config.url + '/check',
method:'POST',
data:{
'userId':app.globalData.user_id,
'activityId':activity_id,
'photoUrl':photo_check_url
},
success: function(check_res){
if(check_res.data.code==1){
wx.navigateBack({
});
photo_check_res = false;
face_check_res = false;
location_check_res = false;
}
}
})
}else{
wx.showToast({
title: '请完成所有验证',
duration: 1000
})
}
}
})
================================================
FILE: client/pages/checkIn/checkIn.json
================================================
{}
================================================
FILE: client/pages/checkIn/checkIn.wxml
================================================
{{activity_title}}
{{location_res}}
{{face_res}}
================================================
FILE: client/pages/checkIn/checkIn.wxss
================================================
.page_check_hd {
padding: 20rpx;
}
.page_check_title{
font-size: 20px;
text-align: center;
height: 400;
}
.check_image_bd {
width: 100%;
align-content: center;
}
.check_image {
width: 600rpx;
height: 400rpx;
padding-left:75rpx;
}
.button-sp-area{
margin: 0 auto;
padding-top: 15px;
width: 60%;
}
.check_group{
margin: 0 auto;
padding-top: 30px;
width: 70%;
}
.mini-btn{
margin-right: 5px;
}
.text_item {
float: right;
display: block;
font-size: 15px;
margin-top: 2rpx;
}
.btn_footer {
margin-bottom: 50px;
}
.group_item {
margin-top: 20px;
}
================================================
FILE: client/pages/detail/detail.js
================================================
// pages/detail/detail.js
var config = require('../../config.js');
var app = getApp();
var haveApplyed = false;
var lat = null;
var lng = null;
var face = null;
var location = null;
var activity_id=null;
Page({
/**
* 页面的初始数据
*/
data: {
detail_info:{},
activity_info:{},
check_date_info:{},
detail_show:false,
show_date:true,
date_info_hidden:true,
apply_msg:"点击报名"
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var activityId = options.activity_id;
activity_id = activityId;
var that = this;
// console.log(activityId);
wx.request({
url: config.url +'/check/details',
data: {
'id':activityId
},
method:'POST',
success:function(res) {
console.log(res.data);
that.setData({
detail_info:res.data
});
}
});
wx.request({
url: config.url + '/activity/actInfo',
data:{
'id':activityId
},
method:'POST',
success: function(res) {
that.setData({
activity_info:res.data
})
console.log(res.data);
lng = res.data.infos[0].F_Lng;
lat = res.data.infos[0].F_Lat;
face = res.data.infos[0].F_IfFace;
location = res.data.infos[0].F_IfLocation;
}
})
//判断是否已经报过名
wx.request({
url: config.url + '/activity/haveApply',
data:{
'userId': app.globalData.user_id,
'activityId':activityId
},
method:'POST',
success: function(res){
console.log(res.data)
if(res.data.code){
haveApplyed = true;
that.setData({
apply_msg:'点击打卡'
})
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
getActivity_detail: function(){
console.log('detail clicked')
var that = this;
var temp = that.data.detail_show;
that.setData({
detail_show:!temp
})
},
getCheckDate: function(){
var that = this;
var temp = that.data.show_date;
that.setData({
show_date:!temp
})
},
/**
* 点击具体的时期时触发操作
* 2018-02-26
*/
getDetailedCheck:function(e){
var that = this;
var date = e.currentTarget.dataset.date;
// console.log(date);
var temp = that.data.date_info_hidden;
wx.request({
url: config.url + '/check/details/date',
method:'POST',
data:{
'activityId': activity_id,
'checkDate':date
},
success:function(res){
that.setData({
check_date_info:res.data.details,
date_info_hidden :!temp
})
console.log(!temp,res.data.details);
}
})
},
submitCheck:function(){
if(haveApplyed){
console.log(activity_id);
wx.redirectTo({
url: '../checkIn/checkIn?lat=' + lat + '&lng=' + lng +'&activityId=' + activity_id
+'&face='+ face +'&location='+location
})
}else{
wx.request({
url:config.url + '/activity/apply',
method:'POST',
data:{
'activityId':activity_id,
'userId':app.globalData.user_id
},
success: function(res){
wx.showToast({
title: '报名成功',
})
}
})
wx.switchTab({
url: '../manage/manage'
})
}
}
})
================================================
FILE: client/pages/detail/detail.json
================================================
{}
================================================
FILE: client/pages/detail/detail.wxml
================================================
{{activity_info.infos[0].F_Caption}}
活动详情
发起人: {{activity_info.infos[0].F_CreaterName}}
活动开始时间: {{activity_info.infos[0].F_StartDate}}
活动结束时间: {{activity_info.infos[0].F_EndDate}}
活动地点: {{activity_info.infos[0].F_Location}}
简介: {{activity_info.infos[0].F_Desc}}
已有{{activity_info.nums}}人报名
打卡记录
{{item.F_CheckDate}}
{{item.F_UserName}}
================================================
FILE: client/pages/detail/detail.wxss
================================================
.page_detail_hd {
padding: 20rpx;
}
.page_detail_title{
font-size: 20px;
text-align: center;
height: 400;
}
.cell_image {
width: 16px;
height: 16px;
}
.cell_image_sm{
width: 14px;
height: 14px;
}
.label_head {
display: inline
}
.label_name {
margin-left:50rpx;
}
.check_image{
padding-left:50rpx;
}
.desc_content {
width: 90%;
float: right;
}
.check_content_date {
width: 90%;
float: right;
}
.check_content_detail {
width: 80%;
float: right;
}
.check_image {
padding: 0;
margin: 0;
width: 240px;
height: 180px;
display: block
}
.button-sp-area{
margin: 0 auto;
padding-top: 15px;
width: 80%;
}
.check_item {
width: 100%;
margin: 0 auto;
display: block;
}
================================================
FILE: client/pages/logs/logs.js
================================================
//logs.js
const util = require('../../utils/util.js')
Page({
data: {
logs: []
},
onLoad: function () {
this.setData({
logs: (wx.getStorageSync('logs') || []).map(log => {
return util.formatTime(new Date(log))
})
})
}
})
================================================
FILE: client/pages/logs/logs.json
================================================
{
"navigationBarTitleText": "查看启动日志"
}
================================================
FILE: client/pages/logs/logs.wxml
================================================
{{index + 1}}. {{log}}
================================================
FILE: client/pages/logs/logs.wxss
================================================
.log-list {
display: flex;
flex-direction: column;
padding: 40rpx;
}
.log-item {
margin: 10rpx;
}
================================================
FILE: client/pages/manage/manage.js
================================================
var sliderWidth = 96; // 需要设置slider的宽度,用于计算中间位置
var config = require('../../config.js');
var app = getApp();
Page({
data: {
tabs: ["进行中", "已结束"],
activeIndex: 1,
sliderOffset: 0,
sliderLeft: 0,
completed: [],
processing: []
},
onLoad: function () {
var that = this;
wx.getSystemInfo({
success: function (res) {
that.setData({
sliderLeft: (res.windowWidth / that.data.tabs.length - sliderWidth) / 2,
sliderOffset: res.windowWidth / that.data.tabs.length * that.data.activeIndex
});
}
});
},
onShow: function () {
var that = this;
wx.request({
url: config.url + '/activity/getall',
data:{
'userId':app.globalData.user_id
},
method: 'POST',
success: function (res) {
console.log(res.data);
that.setData({
completed: res.data.completed,
processing: res.data.processing
});
}
})
},
tabClick: function (e) {
this.setData({
sliderOffset: e.currentTarget.offsetLeft,
activeIndex: e.currentTarget.id
});
}
});
================================================
FILE: client/pages/manage/manage.json
================================================
{}
================================================
FILE: client/pages/manage/manage.wxml
================================================
{{item}}
{{item.F_Caption}}
{{item.F_StartDate}}——{{item.F_EndDate}}
{{item.F_Location}}
今日已打卡
{{item.F_Caption}}
{{item.F_StartDate}}——{{item.F_EndDate}}
{{item.F_Location}}
打卡1次
================================================
FILE: client/pages/manage/manage.wxss
================================================
page,
.page,
.page__bd{
height: 100%;
}
.page__bd{
padding-bottom: 0;
}
.weui-media-box__desc {
padding-bottom: 8rpx;
}
================================================
FILE: client/pages/new/new.js
================================================
// pages/new/new.js
var location = "";
var config = require('../../config.js');
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
start_date: "2018-01-01",
end_date: "2018-01-02",
checkboxItems: [
{ name: '拍照打卡', value: '1', checked: true },
{ name: '地点打卡', value: '2' },
{ name: '人脸打卡', value: '3' }
],
activity_location: ""
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var that = this;
console.log(getApp().data.activity_location);
location = getApp().data.activity_location;
if (location != "") {
that.setData({
activity_location: location
});
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/**
* 选择日期并获取日期
*/
bindStartDateChange: function (e) {
this.setData({
start_date: e.detail.value
});
console.log()
},
bindEndDateChange: function (e) {
this.setData({
end_date: e.detail.value
})
},
checkboxChange: function (e) {
console.log('checkbox发生change事件,携带value值为:', e.detail.value);
var checkboxItems = this.data.checkboxItems, values = e.detail.value;
for (var i = 0, lenI = checkboxItems.length; i < lenI; ++i) {
checkboxItems[i].checked = false;
for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
if (checkboxItems[i].value == values[j]) {
checkboxItems[i].checked = true;
break;
}
}
}
this.setData({
checkboxItems: checkboxItems
});
},
getLocation: function () {
wx.navigateTo({
url: '../addLocation/addLocation',
});
},
formSubmit: function (e) {
var ifPhoto = 0;
var ifLocation = 0;
var ifFace = 0;
var value = e.detail.value
var types = value.checkin_types;
// console.log(types.l);
for (var i = 0; i < types.length; i++) {
if (types[i] == 1) {
ifPhoto = 1;
}
if (types[i] == 2) {
ifLocation = 1;
}
if (types[i] == 3) {
ifFace = 1;
}
}
wx.request({
url: config.url+'/activity/create',
data: {
'createrId': app.globalData.user_id,
'activity_name': value.activity_name,
'activity_desc': value.activity_desc,
'location': value.activity_location,
'lat': app.data.activity_lat,
'lng': app.data.activity_lng,
'startDate':value.start_date,
'endDate':value.end_date,
'ifFace':ifFace,
'ifPhoto':ifPhoto,
'ifLocation':ifLocation
},
method:'POST',
success:function(res) {
// console.log(res.data);
wx.switchTab({
url: '/pages/manage/manage'
})
}
})
}
})
================================================
FILE: client/pages/new/new.json
================================================
{}
================================================
FILE: client/pages/new/new.wxml
================================================
================================================
FILE: client/pages/new/new.wxss
================================================
.weui-btn.btn-green {
background-color: "#2ba245";
}
================================================
FILE: client/pages/search/search.js
================================================
/**
* TODO:onload中加载所有正在进行的活动,在Typing中进行过滤,不用一遍一遍查询服务器
*/
var config = require('../../config.js');
Page({
data: {
inputShowed: false,
inputVal: "",
processing:[]
},
showInput: function () {
this.setData({
inputShowed: true
});
},
hideInput: function () {
this.setData({
inputVal: "",
inputShowed: false
});
},
clearInput: function () {
this.setData({
inputVal: ""
});
},
inputTyping: function (e) {
var that = this;
that.setData({
inputVal: e.detail.value
});
wx.request({
url: config.url + '/activity/like',
method: 'POST',
data:{
'str': e.detail.value
},
success: function (res) {
that.setData({
processing: res.data.processing
});
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// var that = this;
// wx.request({
// url: config.url + '/activity/getall',
// method: 'POST',
// success: function (res) {
// that.setData({
// processing: res.data.processing
// });
// }
// })
},
});
================================================
FILE: client/pages/search/search.json
================================================
{}
================================================
FILE: client/pages/search/search.wxml
================================================
取消
{{item.F_Caption}}
{{item.F_Location}}
================================================
FILE: client/pages/search/search.wxss
================================================
.searchbar-result{
margin-top: 0;
font-size: 14px;
}
.searchbar-result:before{
display: none;
}
.weui-cell{
padding: 12px 15px 12px 35px;
}
.search_title {
font-size: 15px;
color: '#fff'
}
.search_desc{
font-size: 10px;
color: '#eee'
}
================================================
FILE: client/pages/searchDetail/searchDetail.js
================================================
var QQMapWX = require('../../libs/qqmap-wx-jssdk.js');
//key:腾讯地图的key
var demo = new QQMapWX({
key:''
});
Page({
data: {
inputShowed: false,
inputVal: "",
result:[]
},
showInput: function () {
this.setData({
inputShowed: true
});
},
hideInput: function () {
this.setData({
inputVal: "",
inputShowed: false
});
},
clearInput: function () {
this.setData({
inputVal: ""
});
},
/**
* 当每次输入框更改的时候触发此函数
*/
inputTyping: function (e) {
var that = this;
that.setData({
inputVal: e.detail.value
});
demo.getSuggestion({
keyword: e.detail.value,
region:'常州市',
success:function(res){
if(res.status == 0){
that.setData({
result:res.data
})
}
},
fail: function (res) {
console.log(res);
},
complete: function (res) {
console.log(res);
}
});
}
});
================================================
FILE: client/pages/searchDetail/searchDetail.json
================================================
{}
================================================
FILE: client/pages/searchDetail/searchDetail.wxml
================================================
取消
{{item.title}}
================================================
FILE: client/pages/searchDetail/searchDetail.wxss
================================================
.searchbar-result{
margin-top: 0;
font-size: 14px;
}
.searchbar-result:before{
display: none;
}
.weui-cell{
padding: 12px 15px 12px 35px;
}
================================================
FILE: client/pages/user/user.js
================================================
// pages/user/user.js
var uploadFn = require('../../utils/upload.js');
var config = require('../../config.js');
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
user_name: "张三",
user_city: "常州",
// 此时头像的照片是静态的
avator_path: "../../image/avator.jpg",
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {
if (app.globalData.userInfo) {
this.setData({
userInfo: app.globalData.userInfo,
hasUserInfo: true,
avator_path: app.globalData.avator_url
});
} else if (this.data.canIUse) {
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
app.userInfoReadyCallback = res => {
this.setData({
userInfo: res.userInfo,
hasUserInfo: true,
avator_path: app.globalData.avator_url
})
}
} else {
// 在没有 open-type=getUserInfo 版本的兼容处理
wx.getUserInfo({
success: res => {
app.globalData.userInfo = res.userInfo
this.setData({
userInfo: res.userInfo,
hasUserInfo: true,
avator_path: app.globalData.avator_url
})
}
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
changeAvator: function () {
var me = this;
wx.chooseImage({
success: function (res) {
var filePath = res.tempFilePaths[0];
console.log(filePath);
// var fileName = filePath.match(/http.{7}(.*)/);
//fileName = fileName[1];
var fileName = Date.parse(new Date())+'.jpg';
console.log(fileName);
uploadFn(filePath, fileName, me,function(avator_url){
wx.request({
url: config.url + '/person/update',
data:{
'user_id': app.globalData.user_id,
'avator_url': avator_url
},
method: 'POST',
success: function(res) {
console.log(res.data);
app.globalData.avator_url = avator_url;
}
})
});
},
})
}
})
================================================
FILE: client/pages/user/user.json
================================================
{}
================================================
FILE: client/pages/user/user.wxml
================================================
姓名:
{{ userInfo.nickName }}
城市:
{{ userInfo.city }}
================================================
FILE: client/pages/user/user.wxss
================================================
.container {
height: 100%;
}
.avator {
margin-top: 100rpx;
}
.user-info{
padding-top: 50rpx;
margin-left: 250rpx;
}
.user-info .item {
padding-bottom: 20rpx;
}
.item text {
padding-left: 5rpx;
}
.update-info {
margin: 0 auto;
width: 60%;
}
================================================
FILE: client/project.config.json
================================================
{
"description": "项目配置文件。",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true
},
"compileType": "miniprogram",
"libVersion": "1.7.2",
"appid": "wx690dcd5ab42b7e2c",
"projectname": "checkin",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
================================================
FILE: client/utils/getdistance.js
================================================
var PI = Math.PI;
var EARTH_RADIUS = 6378137.0;
function getRad(d) {
return d * PI / 180.0;
}
// (113.52911321166994,22.802929526649727,113.52804032806398,22.803246016075406)
// lat1,lng1,lat2,lng2
function distance(p1,p2,callback) {
console.log(p1,p2);
var f = getRad((p1.lat + p2.lat) / 2);
var g = getRad((p1.lat - p2.lat) / 2);
var l = getRad((p1.lng - p2.lng) / 2);
var sg = Math.sin(g);
var sl = Math.sin(l);
var sf = Math.sin(f);
var s, c, w, r, d, h1, h2;
var a = EARTH_RADIUS;
var fl = 1 / 298.257;
sg = sg * sg;
sl = sl * sl;
sf = sf * sf;
s = sg * (1 - sl) + (1 - sf) * sl;
c = (1 - sg) * (1 - sl) + sf * sl;
w = Math.atan(Math.sqrt(s / c));
r = Math.sqrt(s * c) / w;
d = 2 * w * a;
h1 = (3 * r - 1) / 2 / c;
h2 = (3 * r + 1) / 2 / s;
var dis = d * (1 + fl * (h1 * sf * (1 - sg) - h2 * (1 - sf) * sg));
console.log(dis);
}
module.exports = distance
================================================
FILE: client/utils/upload.js
================================================
/**
* 最终上传到cos的URL
* 把以下字段配置成自己的cos相关信息,详情可看API文档 https://www.qcloud.com/document/product/436/6066
* REGION: cos上传的地区
* APPID: 账号的appid
* BUCKET_NAME: cos bucket的名字
* DIR_NAME: 上传的文件目录
*
*/
var config = require('../config.js');
var cosUrl = "http://" + config.cosRegion + ".file.myqcloud.com/files/v2/" + config.cosAPPID + "/" + config.cosBucketName +'/' + config.cosDirName;
//填写自己的鉴权服务器地址
var cosSignatureUrl = config.cosSignatureUrl;
/**
* 上传方法
* filePath: 上传的文件路径
* fileName: 上传到cos后的文件名
*/
function upload(filePath, fileName, me,callback) {
// console.log(cosUrl+ '/' + fileName)
// 鉴权获取签名
wx.request({
url: cosSignatureUrl,
success: function(cosRes) {
// 签名
var signature = cosRes.data
// 头部带上签名,上传文件至COS
wx.uploadFile({
url: cosUrl + '/' + fileName,
filePath: filePath,
header: {
'Authorization': signature
},
name: 'filecontent',
formData: {
op: 'upload'
},
success: function(uploadRes){
// var data = uploadRes.data;
// console.log('uploadRes', uploadRes.)
//do something
// me.setData({
// avator_path: data.data.source_url
// });
// console.log(me.data);
var upload_res = JSON.parse(uploadRes.data)
me.setData({
avator_path:upload_res.data.source_url
})
callback(upload_res.data.source_url)
},
fail: function(e) {
console.log('e', e)
}
})
}
})
}
module.exports = upload
================================================
FILE: client/utils/util.js
================================================
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
module.exports = {
formatTime: formatTime
}
================================================
FILE: server/checkin/.idea/checkin.iml
================================================
================================================
FILE: server/checkin/.idea/jsLibraryMappings.xml
================================================
================================================
FILE: server/checkin/.idea/modules.xml
================================================
================================================
FILE: server/checkin/.idea/runConfigurations/bin_www.xml
================================================
================================================
FILE: server/checkin/.idea/workspace.xml
================================================
true
DEFINITION_ORDER
1515909390162
1515909390162
================================================
FILE: server/checkin/app.js
================================================
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var index = require('./routes/index');
var activity = require('./routes/activity');
var person = require('./routes/person');
var check = require('./routes/check');
var app = express();
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', index);
app.use('/activity', activity);
app.use('/person', person);
app.use('/check', check);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handler
app.use(function(err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
// render the error page
res.status(err.status || 500);
res.render('error');
});
module.exports = app;
================================================
FILE: server/checkin/bin/www
================================================
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('checkin:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
var addr = server.address();
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
debug('Listening on ' + bind);
}
================================================
FILE: server/checkin/configs/config.js
================================================
var dbhost = 'localhost';
var dbuser = 'root';
var dbpassword = '123456';
var database = 'checkin';
var dbport = '3306'
module.exports = {
dbhost: dbhost,
dbuser: dbuser,
dbpassword: dbpassword,
database: database,
dbport:dbport
}
================================================
FILE: server/checkin/models/activity.js
================================================
var db = require('../utils/dbConnection');
module.exports = {
create: function create (a,callback) {
var sql = 'INSERT INTO T_activity(F_ID,F_CreaterId,F_Caption,F_Desc,F_Location,F_Lat,F_Lng,F_StartDate' +
',F_EndDate,F_IfFace,F_IfPhoto,F_IfLocation)' +
' VALUES(0,?,?,?,?,?,?,?,?,?,?,?)';
var params=[a.F_CreaterId,a.F_Caption,a.F_Desc,a.F_Location,a.F_Lat,a.F_Lng,a.F_StartDate,a.F_EndDate
,a.F_IfFace,a.F_IfPhoto,a.F_IfLocation];
db.connection.query(sql,params,function (err,res) {
if(err) {
console.log('INSERT ACTIVITY:', err.message);
return;
}
callback(res);
console.log('INSERT ACTIVITY SUCCESS');
});
},
getall: function (user_id,callback) {
var sql = 'SELECT * FROM v_apply_activity WHERE F_ApplyerId=? ';
var params = [user_id];
db.connection.query(sql,params,function (err,res) {
if(err){
console.log(err);
return;
}
callback(res);
})
},
getallLike:function (str,callback) {
var sql = 'SELECT * FROM T_activity WHERE F_Caption LIKE ? ';
str = '%' + str + '%';
var params = [str];
db.connection.query(sql,params,function (err,res) {
if(err){
console.log(err);
return;
}
callback(res);
})
},
getInfo:function (activityId,callback) {
var sql = 'SELECT * FROM v_activity_info WHERE F_ActivityId = ?';
var params = [activityId];
db.connection.query(sql,params,function (err,res) {
if(err){
console.log(err.message);
return;
}
callback(res);
})
},
haveApplyed:function (activity_id,user_id,callback) {
var sql = 'SELECT * FROM t_apply WHERE F_ApplyerId = ? AND F_ActivityId = ?';
var params = [user_id,activity_id];
db.connection.query(sql,params,function (err,res) {
if(err){
console.log(err);
return;
}
console.log(res);
callback(res);
})
}
}
================================================
FILE: server/checkin/models/apply.js
================================================
var db = require('../utils/dbConnection');
var moment = require('moment');
module.exports = {
/**
* TODO
* 用户对某个签到活动进行报名
* @param user
*/
apply: function apply(user_id,activity_id,callback) {
var sql = 'INSERT INTO t_apply (F_ID,F_ApplyerId,F_ActivityId,F_ApplyDate)VALUES(0,?,?,?)';
var now = moment().format('YYYY-MM-DD');
var params = [user_id,activity_id,now];
db.connection.query(sql,params,function (err,res) {
var re = true;
if(err){
console.log(err.message);
return;
}
callback(re);
})
},
getApplyNumByActId: function applyNum(activity_id,callback) {
var sql = 'SELECT COUNT(*) AS NUMS FROM t_apply WHERE F_ActivityId = ? GROUP BY F_ActivityId';
var params = [activity_id];
db.connection.query(sql,params,function (err,res) {
if(err){
console.log(err);
return;
}
// console.log(res[0].NUMS);
if(res[0]==null){
callback(0)
}else{
callback(res[0].NUMS);
}
});
}
}
================================================
FILE: server/checkin/models/check.js
================================================
var db = require('../utils/dbConnection');
var moment = require('moment');
module.exports = {
check: function (user_id,activity_id,photo_url,callback) {
var sql = 'INSERT INTO T_check(F_ID,F_ActivityId,F_UserID,F_CheckDate,F_PhotoUrl)VALUES(0,?,?,?,?)';
var now = new Date();
var params = [activity_id, user_id, now, photo_url];
console.log(params);
db.connection.query(sql,params,function (err,result) {
if(err){
console.log(err.message);
return;
}
console.log("INSERT CHECK SUCCESS",result.insertId);
callback(result);
});
},
getDetailById: function getDetailById(activity_id,callback) {
var sql = 'SELECT * FROM v_check_detail WHERE F_ActivityId = ?';
var params = [activity_id];
db.connection.query(sql,params,function (err,res) {
if(err){
console.log(err);
return;
}
// console.log(res);
callback(res);
})
},
getDateById: function getDateById(activity_id,callback) {
var sql = 'SELECT DISTINCT F_CheckDate FROM v_check_detail WHERE F_ActivityId = ?';
var params = [activity_id];
db.connection.query(sql,params,function (err,res) {
if(err){
console.log(err);
return;
}
console.log(res);
callback(res);
})
},
getCheckByDate: function getCheckByDate(check_date,callback) {
var sql = 'SELECT * FROM v_check_detail WHERE F_CheckDate = ?'
var params = [check_date];
db.connection.query(sql,params,function (err,res) {
if(err){
console.log(err);
return;
}
console.log(res);
callback(res);
})
},
getDetailByIdAndDate: function getDetailByIdAndDate(activity_id,date,callback) {
var sql = 'SELECT * FROM v_check_detail WHERE F_ActivityId = ? AND F_CheckDate = ?';
var params = [activity_id,date];
db.connection.query(sql,params,function (err,res) {
if(err){
console.log(err);
return;
}
// console.log(res);
callback(res);
})
},
}
================================================
FILE: server/checkin/models/person.js
================================================
var db = require('../utils/dbConnection');
module.exports = {
/**
* 第一次使用的时候创建用户,通过检索是否在数据库中有记录
* @param user
*/
create: function create(user,callback) {
var sql = 'INSERT INTO T_user(F_ID,F_Name)VALUES(0,?)';
var params = [user];
db.connection.query(sql,params,function (err,result) {
if(err){
console.log(err.message);
return;
}
console.log("INSERT SUCCESS",result.insertId);
callback(result);
});
// connetction.end();
},
/**
* 通过用户名查找用户
* @param name
*/
getUserByName: function getUserByName(name,callback) {
var sql = 'SELECT * FROM T_user WHERE F_Name=?';
var params = [name];
// var sql = 'SELECT * FROM T_user';
db.connection.query(sql,params,function (err,result) {
if(err){
console.log(err.message);
return;
}
// console.log(result);
callback(result);
});
},
/**
* 传入用户名,并将用户的信息更新
* @param name
*/
updateUserById: function updateUserByName(user_id,avator_url,callback) {
var sql = 'UPDATE T_user SET F_PhotoUrl = ? WHERE F_ID = ?';
var params = [avator_url,user_id];
db.connection.query(sql,params,function (err,result) {
if(err){
console.log(err.message);
return;
}
callback(result);
})
}
}
================================================
FILE: server/checkin/package.json
================================================
{
"name": "checkin",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"body-parser": "~1.18.2",
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"ejs": "~2.5.7",
"express": "~4.15.5",
"morgan": "~1.9.0",
"serve-favicon": "~2.4.5",
"mysql": "latest",
"moment": "latest"
}
}
================================================
FILE: server/checkin/public/stylesheets/style.css
================================================
body {
padding: 50px;
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
}
a {
color: #00B7FF;
}
================================================
FILE: server/checkin/routes/activity.js
================================================
var express = require('express');
var activity = require('../models/activity');
var apply = require('../models/apply');
var moment = require('moment');
var router = express.Router();
router.post('/', function (req, res, next) {
var result = {
code: 1
};
res.send(result);
});
/**
* /activity/create
* POST
* 创建新的签到活动
*/
router.post('/create', function (req, res, next) {
var F_CreaterId = req.body.createrId;
var F_Caption = req.body.activity_name;
var F_Desc = req.body.activity_desc;
var F_Location = req.body.location;
var F_Lat = req.body.lat;
var F_Lng = req.body.lng;
var F_SatrtDate = req.body.startDate;
var F_EndDate = req.body.endDate;
var F_IfFace = req.body.ifFace;
var F_IfPhoto = req.body.ifPhoto;
var F_IfLocation = req.body.ifLocation;
var act = {
F_CreaterId: F_CreaterId,
F_Caption: F_Caption,
F_Desc: F_Desc,
F_Location: F_Location,
F_Lat: F_Lat,
F_Lng: F_Lng,
F_StartDate: F_SatrtDate,
F_EndDate: F_EndDate,
F_IfFace: F_IfFace,
F_IfPhoto: F_IfPhoto,
F_IfLocation: F_IfLocation
};
// console.log(act);
activity.create(act,function (act_res) {
console.log(act_res);
apply.apply(F_CreaterId,act_res.insertId,function (apply_res) {
var insert_res = {
code:1
};
res.send(insert_res);
})
});
});
/**
* activity/getall
* 返回所有的活动,结束了则是completed,还在进行中是processing
*/
router.post('/getall',function (req,res,next) {
var user_id = req.body.userId;
var now = moment();
var completed = [];
var processing = [];
console.log(now);
activity.getall(user_id,function (activitys) {
for(var i = 0; i < activitys.length; i ++){
activitys[i].F_StartDate = moment(activitys[i].F_StartDate).format('YYYY-MM-DD');
activitys[i].F_EndDate = moment(activitys[i].F_EndDate).format('YYYY-MM-DD');
//<0说明在endDate在现在之前---已经结束了
if(moment(activitys[i].F_EndDate).diff(now)<0){
completed.push(activitys[i]);
}else {
processing.push(activitys[i]);
}
}
var res_getall = {
'completed':completed,
'processing':processing
};
res.send(res_getall);
})
});
router.get('/getall',function (req,res,next) {
var now = moment();
var completed = [];
var processing = [];
console.log(now);
activity.getall(function (activitys) {
for(var i = 0; i < activitys.length; i ++){
activitys[i].F_StartDate = moment(activitys[i].F_StartDate).format('YYYY-MM-DD');
activitys[i].F_EndDate = moment(activitys[i].F_EndDate).format('YYYY-MM-DD');
//<0说明在endDate在现在之前---已经结束了
if(moment(activitys[i].F_EndDate).diff(now)<=0){
completed.push(activitys[i]);
}else {
processing.push(activitys[i]);
}
}
var res_getall = {
'completed':completed,
'processing':processing
};
res.send(res_getall);
});
});
/**
* 模糊查询所有的活动
*/
router.post('/like',function (req,res,next) {
// var re = {
// code:1
// };
// res.send(re);
var str = req.body.str;
// var str = '火锅';
var now = moment();
var completed = [];
var processing = [];
activity.getallLike(str,function (activitys) {
for(var i = 0; i < activitys.length; i ++){
activitys[i].F_StartDate = moment(activitys[i].F_StartDate).format('YYYY-MM-DD');
activitys[i].F_EndDate = moment(activitys[i].F_EndDate).format('YYYY-MM-DD');
//<0说明在endDate在现在之前---已经结束了
if(moment(activitys[i].F_EndDate).diff(now)<0){
completed.push(activitys[i]);
}else {
processing.push(activitys[i]);
}
}
var res_getall = {
'completed':completed,
'processing':processing
};
res.send(res_getall);
})
});
/**
* /activity/actInfo
*/
router.post('/actInfo',function (req,res,next) {
var id = req.body.id;
// var id = 28;
activity.getInfo(id,function (activitys) {
for(var i = 0;i < activitys.length;i ++){
activitys[i].F_StartDate = moment(activitys[i].F_StartDate).format('YYYY-MM-DD');
activitys[i].F_EndDate = moment(activitys[i].F_EndDate).format('YYYY-MM-DD');
}
apply.getApplyNumByActId(id,function (nums) {
var result = {
'infos':activitys,
'nums':nums
};
res.send(result);
})
});
});
/**
* /activity/haveApply
*/
router.post('/haveApply',function (req,res,next) {
var activity_id = req.body.activityId;
var user_id = req.body.userId;
var have = false;
// var activity_id = 28;
// var user_id = 100;
activity.haveApplyed(activity_id,user_id,function (result) {
if(result.length != 0){
have = true;
}
var response = {
'code':have
};
res.send(response);
})
});
/**
* /activity/apply
*/
router.post('/apply',function (req,res,next) {
var activity_id = req.body.activityId;
var user_id = req.body.userId;
apply.apply(user_id,activity_id,function (result) {
var re = {
'code':result
};
res.send(re);
});
});
module.exports = router;
================================================
FILE: server/checkin/routes/check.js
================================================
var express = require('express');
var router = express.Router();
var check = require('../models/check');
var moment = require('moment');
// router.get('/',function (req,res,next) {
//
// });
/**
* /check
* userid activityid photourl
*/
router.post('/',function (req,res,next) {
var userId = req.body.userId;
var activityId = req.body.activityId;
var photoUrl = req.body.photoUrl;
check.check(userId,activityId,photoUrl,function (insert_res) {
console.log(insert_res);
var result = {
code:1
};
res.send(result);
})
});
router.get('/details',function (req,res,next) {
// var activity_id = req.body.id;
var activity_id = 31;
check.getDetailById(activity_id,function (details) {
check.getDateById(activity_id,function (dates) {
for(var i = 0; i < details.length; i ++) {
details[i].F_CheckDate = moment(details[i].F_CheckDate).format('YYYY-MM-DD');
}
for(var i = 0; i < dates.length; i ++) {
dates[i].F_CheckDate = moment(dates[i].F_CheckDate).format('YYYY-MM-DD');
}
var response = {
'dateNum':dates.length,
'dates':dates,
'details':details
}
res.send(response);
// res.send(details);
// res.send(details)
})
})
});
/**
* /check/details
* activity_id
*/
router.post('/details',function (req,res,next) {
var activity_id = req.body.id;
// var activity_id = 25;
check.getDetailById(activity_id,function (details) {
check.getDateById(activity_id,function (dates) {
for(var i = 0; i < details.length; i ++) {
details[i].F_CheckDate = moment(details[i].F_CheckDate).format('YYYY-MM-DD');
}
for(var i = 0; i < dates.length; i ++) {
dates[i].F_CheckDate = moment(dates[i].F_CheckDate).format('YYYY-MM-DD');
}
var response = {
'dateNum':dates.length,
'dates':dates,
'details':details
}
res.send(response);
// res.send(details);
// res.send(details)
})
})
});
/**
* 查找某个活动某天的签到情况
*/
router.post('/details/date',function (req,res,next) {
var activity_id = req.body.activityId;
var check_date = req.body.checkDate;
// var activity_id = 31;
// var check_date = "2018-01-17";
console.log(activity_id,check_date);
check.getDetailByIdAndDate(activity_id,check_date,function (details) {
for(var i = 0; i < details.length; i ++) {
details[i].F_CheckDate = moment(details[i].F_CheckDate).format('YYYY-MM-DD');
}
var response = {
'details':details
}
console.log(check_date,details);
res.send(response);
})
});
router.post('/dateCheck',function (req,res,next) {
var check_date = req.body.checkDate;
check.getCheckByDate(check_date,function (checks) {
console.log(checks);
})
});
router.get('/test',function (req,res,next) {
var time = moment.unix(1509672700).format('YYYY-MM-DD HH:mm');
res.send(time);
})
module.exports = router;
================================================
FILE: server/checkin/routes/index.js
================================================
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
module.exports = router;
================================================
FILE: server/checkin/routes/person.js
================================================
var express = require('express');
var users = require('../models/person');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
var userId = -1;
var username = '曾曾曾';
users.getUserByName(username,function (userInfos) {
console.log(userInfos);
if(userInfos.length == 0) {
users.create(username,function (add_result) {
userId = add_result.insertId;
})
}else {
userId = userInfos[0].F_ID;
}
var result = {
userId: userId
};
res.send(result);
});
});
/**
* 查找是否有F_User = username
* POST /person/
* username=''
*/
router.post('/',function (req, res) {
var userId = -1;
var avatorUrl = '';
var username = req.body.username;
// console.log(username);
// var username = '李四';
users.getUserByName(username,function (userInfos) {
console.log(userInfos);
if(userInfos.length === 0) {
users.create(username,function (add_result) {
userId = add_result.insertId;
var result = {
userId: userId,
avatorUrl:avatorUrl
};
res.send(result);
})
}else {
userId = userInfos[0].F_ID;
avatorUrl = userInfos[0].F_PhotoUrl;
var result = {
userId: userId,
avatorUrl: avatorUrl
};
res.send(result);
}
console.log(result);
});
});
/**
* 用于更新某个用户的头像使用的
*/
router.post('/update',function (req, res) {
var user_id = req.body.user_id;
var avator_url = req.body.avator_url;
var result = {
code: 1
};
users.updateUserById(user_id,avator_url,function (update_res) {
console.log(update_res);
res.send(result);
})
});
module.exports = router;
================================================
FILE: server/checkin/utils/dbConnection.js
================================================
var config = require('../configs/config');
var mysql = require('mysql');
var connection = mysql.createConnection({
host : config.dbhost,
user : config.dbuser,
password : config.dbpassword,
database : config.database,
port : config.dbport
});
connection.connect();
module.exports = {
connection: connection
}
================================================
FILE: server/checkin/views/error.ejs
================================================
<%= message %>
<%= error.status %>
<%= error.stack %>
================================================
FILE: server/checkin/views/index.ejs
================================================
<%= title %>
<%= title %>
Welcome to <%= title %>