Commit 5d6bbaa8 by jscat

Initial commit

parents
post: 930-test-sh.oss-cn-shanghai.aliyuncs.com
post: 930-test-sh.oss-cn-shanghai.aliyuncs.com
body
form-data
key, upload/${filename}
OSSAccessKeyId, LTAIGOyfpv8ksVvv
policy, eyJleHBpcmF0aW9uIjoiMjExNS0wMS0yN1QxMDo1NjoxOVoiLCJjb25kaXRpb25zIjpbWyJjb250ZW50LWxlbmd0aC1yYW5nZSIsIDAsIDE1MDQ4NTc2XV19
Signature, LWK8TKfklIwjDKK4A5TDQqu3grU=
success_action_redirect, http://oss.aliyun.com
success_action_status, 201
file,
AccessKeyID:
LTAIJdgxp6ejo7Ko
AccessKeySecret:
Kqnf17a0cGTsxaildudNAavLOWuSwj
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
单宁:很涩,有点抓舌头的收缩感就是单宁 Tanin
单宁:很涩,有点抓舌头的收缩感就是单宁 Tanin
仙粉黛红葡萄酒的酒精度比其他红葡萄酒更高——通常是16%,而其他红葡萄酒仅为12-14%
改名称
改名称
nyx_app_key: Java后台主程序
nyx-master: 微信小程序
导入lombok: IDEA下 File—setting—plugin–搜索lombok–安装 重启便可以了
\ No newline at end of file
CREATE DATABASE IF NOT EXISTS rockwell DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
CREATE DATABASE IF NOT EXISTS rockwell DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
CREATE DATABASE IF NOT EXISTS digjob_db_job DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
CREATE DATABASE IF NOT EXISTS rockwell_user DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
CREATE DATABASE IF NOT EXISTS rockwell_key DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
CREATE DATABASE IF NOT EXISTS rockwell_msg DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
\ No newline at end of file
use rockwell;
use rockwell;
grant all privileges on rockwell.* to rockwell_dev@'%' identified by '123456';
grant all privileges on rockwell.* to rockwell_dev@'localhost' identified by '123456';
grant all privileges on rockwell.* to rockwell_dev@'127.0.0.1' identified by '123456';
flush privileges;
use funi_dev;
select User,Host from mysql.user;
insert into mysql.user(Host,User,Password) values("%","funi",password("123456"));
flush privileges;
grant all privileges on funi_dev.* to funi@'%' identified by '123456';
grant all privileges on funi_dev.* to funi@'localhost' identified by '123456';
grant all privileges on funi_dev.* to funi@'127.0.0.1' identified by '123456';
flush privileges;
#centos7
set global validate_password_policy=0;
set global validate_password_length=6;
grant all privileges on digjob_db_job.* to digjob_db_user@'%' identified by '123456';
grant all privileges on digjob_db_job.* to digjob_db_user@'localhost' identified by '123456';
grant all privileges on digjob_db_job.* to digjob_db_user@'127.0.0.1' identified by '123456';
flush privileges;
#centos7
CREATE DATABASE IF NOT EXISTS digjob_db_devel DEFAULT CHARSET utf8 COLLATE utf8_bin;
set global validate_password_policy=0;
set global validate_password_length=6;
grant all privileges on digjob_db_devel.* to digjob_db_user@'%' identified by '123456';
grant all privileges on digjob_db_devel.* to digjob_db_user@'localhost' identified by '123456';
grant all privileges on digjob_db_devel.* to digjob_db_user@'127.0.0.1' identified by '123456';
flush privileges;
#centos7
CREATE DATABASE IF NOT EXISTS digjob_db_test DEFAULT CHARSET utf8 COLLATE utf8_bin;
set global validate_password_policy=0;
set global validate_password_length=6;
grant all privileges on digjob_db_test.* to digjob_db_user@'%' identified by '123456';
grant all privileges on digjob_db_test.* to digjob_db_user@'localhost' identified by '123456';
grant all privileges on digjob_db_test.* to digjob_db_user@'127.0.0.1' identified by '123456';
flush privileges;
#centos7
#db rockwell_user
#db rockwell_key
#db rockwell_act
#db rockwell_msg
#db rockwell_algo
#user rockwell_dev
set global validate_password_policy=0;
set global validate_password_length=6;
grant all privileges on rockwell_user.* to rockwell_dev@'%' identified by '123456';
grant all privileges on rockwell_user.* to rockwell_dev@'localhost' identified by '123456';
grant all privileges on rockwell_user.* to rockwell_dev@'127.0.0.1' identified by '123456';
grant all privileges on rockwell_act.* to rockwell_dev@'%' identified by '123456';
grant all privileges on rockwell_act.* to rockwell_dev@'localhost' identified by '123456';
grant all privileges on rockwell_act.* to rockwell_dev@'127.0.0.1' identified by '123456';
grant all privileges on rockwell_msg.* to rockwell_dev@'%' identified by '123456';
grant all privileges on rockwell_msg.* to rockwell_dev@'localhost' identified by '123456';
grant all privileges on rockwell_msg.* to rockwell_dev@'127.0.0.1' identified by '123456';
grant all privileges on rockwell_key.* to rockwell_dev@'%' identified by '123456';
grant all privileges on rockwell_key.* to rockwell_dev@'localhost' identified by '123456';
grant all privileges on rockwell_key.* to rockwell_dev@'127.0.0.1' identified by '123456';
grant all privileges on rockwell_algo.* to rockwell_dev@'%' identified by '123456';
grant all privileges on rockwell_algo.* to rockwell_dev@'localhost' identified by '123456';
grant all privileges on rockwell_algo.* to rockwell_dev@'127.0.0.1' identified by '123456';
grant all privileges on rockwell_mall.* to rockwell_dev@'%' identified by '123456';
grant all privileges on rockwell_mall.* to rockwell_dev@'localhost' identified by '123456';
grant all privileges on rockwell_mall.* to rockwell_dev@'127.0.0.1' identified by '123456';
grant all privileges on foryou_book.* to foryou_dev@'%' identified by '123456';
grant all privileges on foryou_book.* to foryou_dev@'localhost' identified by '123456';
grant all privileges on foryou_book.* to foryou_dev@'127.0.0.1' identified by '123456';
flush privileges;
USE rockwell_key;
USE rockwell_key;
/*
通过定时程序生成 每小时
match+rank 数据表
key
*/
REPLACE INTO tbl_match_rank
SELECT CONCAT("rid_",match_season,"_",match_type,"_",match_team) AS rank_id , match_season, match_type, match_team, 0 AS default_type, score, rank, total_match, total_quiz, ratio_rank, ratio_finish, NOW() AS create_datetime, NOW() AS update_datetime FROM
(
SELECT objA.match_season, objA.match_type, objA.match_team, objA.score, objA.rank, objB.total AS total_match, objC.total AS total_quiz, FORMAT((objB.total-objA.rank+1)/objB.total,2) AS ratio_rank, FORMAT(objA.score/objC.total,2) AS ratio_finish
FROM
(
SELECT match_season, match_type, match_team, score,
CASE WHEN @p=season_type THEN @row:=@row+1 ELSE @row:=1 END rownum,
IF( @p=season_type,
CASE
WHEN @s=score_minus THEN @r
WHEN @s:=score_minus THEN @r:=@row
END,
@r:=1 ) AS rank,
@s:=score_minus,
@p:=season_type
FROM view_match_score
ORDER BY match_season ASC, match_type ASC, score DESC
) objA
LEFT JOIN view_match_type_total objB ON objA.match_type=objB.match_type AND objA.match_season=objB.match_season
LEFT JOIN view_quiz_type_total objC ON objA.match_type=objC.quiz_type
) aa
WHERE match_season='s01'
\ No newline at end of file
USE rockwell;
USE rockwell;
/*
用于学习的分类
*/
DROP TABLE IF EXISTS tbl_cat;
CREATE TABLE tbl_cat (
`id` VARCHAR(100) COMMENT 'quiz defect的id, uuid format, did_001',
`cat_type_cn` VARCHAR(100) DEFAULT NULL COMMENT '品类类型,比如二级',
`cat_type_en` VARCHAR(100) DEFAULT NULL COMMENT '英文品类类型,比如 level2',
`cat_name_cn` VARCHAR(100) NOT NULL COMMENT '品类名称, wset, 1, wine, 2, Sake',
`cat_name_en` VARCHAR(100) NOT NULL COMMENT '品类名称, wset, 1, wine, 2, Sake',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`update_datetime` DATETIME DEFAULT NULL,
PRIMARY KEY(`id`, `create_datetime`),
KEY `query_key` (`cat_type_en`,`cat_name_en`, `cat_type_cn`,`cat_name_cn`))
ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='rockwell知识竞赛 题目类型';
\ No newline at end of file
USE rockwell_key;
USE rockwell_key;
/*
用于记录竞答结果: daily | 1v1 的比赛结果
针对不同类型的数据解释
daily: 每日测验:
- match_score: 10中答对的个数
- team_type: blue
- match_result: 完成为1, 未完成为0
- quiz_index: 如果match_result为0, 则为已完成的题目个数(<10); 如果match_result为1, 则为10
- rank_score: 同match_score
pk: 竞答:
- match_score: 10中答对的个数
- team_type: blue|read
- match_result: 胜利为1, 失败为0
- quiz_index: 为已完成的题目个数, 如果match_result为0, 则个数<10; 如果match_result为1, 则为10
- rank_score: 段位分数, 胜利+2,失败-1
study: 知识学习:
- match_score: 本次完成的题目个数
- team_type: 默认为blue
- match_result: 默认为1
- quiz_index: 已经学习到的题目id, 便于继续学习
- rank_score: 同match_score,便于统计排名
ps: 更新了tbl_match之后,需要同步运行create_sql_match_rank.sql
以同步更新tbl_match_rank
*/
DROP TABLE IF EXISTS tbl_match;
CREATE TABLE tbl_match (
`match_id` VARCHAR(100) COMMENT '竞答的id, uuid format, mid_001',
`match_season` VARCHAR(10) COMMENT '竞答赛季: s01',
`match_type` VARCHAR(10) COMMENT '竞答类别: 1:daily 2:pk',
`match_team` VARCHAR(200) COMMENT '竞答队伍 uid_001',
`match_score` VARCHAR(10) COMMENT '竞答分数, 比如:10',
`team_type` VARCHAR(200) COMMENT '主队还是客队 blue|red',
`match_result` VARCHAR(200) COMMENT '对于pk来说: win|lose; 对于study来说: 当次答题是否完成',
`quiz_index` VARCHAR(20) COMMENT '竞答|学习进行到第几题',
`rank_score` VARCHAR(10) COMMENT '段位分数, 胜利+2,失败-1',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`update_datetime` DATETIME DEFAULT NULL,
PRIMARY KEY(`match_id`, `match_team`),
KEY `query_key` (`match_season`, `match_type`, `match_team`, `match_result`, `match_score`, `rank_score`))
ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='rockwell 竞答结果';
INSERT INTO `tbl_match`(`match_id`, `match_season`, `match_type`,`match_team`,`match_score`, `team_type`, `match_result`, `quiz_index`, `rank_score`, `create_datetime`,`update_datetime`)
VALUES
('mid_001', 's01', 'daily', 'uid_001', '10', 'blue','1', '10', '10', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_002', 's01', 'pk', 'uid_001', '10', 'blue','1', '10', '2','2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_002', 's01', 'pk', 'uid_002', '9', 'red','0', '10', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_003', 's01', 'pk', 'uid_003', '10', 'blue','0', '10', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_003', 's01', 'pk', 'uid_004', '14', 'red', '1', '10', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_004', 's01', 'daily', 'uid_005', '10', 'blue','1', '10', '10', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_005', 's01', 'pk', 'uid_001', '5', 'blue','0', '10', '-1','2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_005', 's01', 'pk', 'uid_002', '9', 'red','1', '10', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_006', 's01', 'pk', 'uid_003', '7', 'blue','0', '10', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_006', 's01', 'pk', 'uid_004', '14', 'red', '1', '10', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_007', 's01', 'pk', 'uid_001', '1', 'blue','1', '10', '2','2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_007', 's01', 'pk', 'uid_002', '9', 'red','0', '10', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_008', 's01', 'pk', 'uid_003', '18', 'blue','1', '10', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_008', 's01', 'pk', 'uid_004', '14', 'red', '0', '10', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_009', 's01', 'daily', 'uid_001', '10', 'blue','1', '10', '10', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_010', 's01', 'daily', 'uid_001', '10', 'blue','1', '10', '10', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_011', 's01', 'pk', 'uid_004', '18', 'blue','1', '10', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_012', 's01', 'pk', 'uid_002', '16', 'red','0', '10', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_013', 's01', 'pk', 'uid_001', '18', 'blue','1', '10', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_014', 's01', 'pk', 'uid_002', '16', 'red','0', '10', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_015', 's02', 'pk', 'uid_001', '16', 'blue','1', '10', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_016', 's02', 'pk', 'uid_003', '13', 'red','0', '10', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_017', 's03', 'daily', 'uid_001', '6', 'blue','0', '8', '6', '2020-2-20 11:24:45', '2019-11-20 11:24:45'),
('mid_018', 's03', 'wset2', 'uid_002', '20', 'blue','1', '8', '20', '2020-2-20 11:24:45', '2019-11-20 11:24:45'),
('mid_019', 's03', 'whisky', 'uid_002', '3', 'blue','1', '368', '3', '2020-2-20 11:24:45', '2019-11-20 11:24:45'),
('mid_020', 's03', 'whisky', 'uid_001', '1', 'blue','1', '367', '1', '2020-2-20 11:24:45', '2019-11-20 11:24:45'),
('mid_021', 's03', 'whisky', 'uid_001', '1', 'blue','1', '366', '1', '2020-2-23 11:24:45', '2019-11-20 11:24:45'),
('mid_022', 's03', 'wset2', 'uid_001', '11', 'blue','1', '18', '11', '2020-2-20 11:24:45', '2019-11-20 11:24:45'),
('mid_023', 's03', 'wset2', 'uid_001', '6', 'blue','1', '42', '6', '2020-2-21 11:24:45', '2019-11-20 11:24:45')
;
\ No newline at end of file
USE rockwell_key;
USE rockwell_key;
/*
用于记录竞答排名;
流程,每小时计算一次(java) -> save to tbl_match_rank -> read by miniprogram
*/
DROP TABLE IF EXISTS tbl_match_rank;
CREATE TABLE tbl_match_rank (
`rank_id` VARCHAR(100) COMMENT 'rank id',
`match_season` VARCHAR(10) COMMENT '竞答赛季: s01',
`match_type` VARCHAR(10) COMMENT '竞答类别: 1:daily 2:pk',
`match_team` VARCHAR(200) COMMENT '竞答队伍 uid_001',
`default_type` VARCHAR(10) COMMENT '是否默认显示到个人荣誉',
`score` VARCHAR(10) COMMENT '竞答分数, 比如:10',
`rank` VARCHAR(10) COMMENT '主队还是客队 blue|red',
`total_match` VARCHAR(10) COMMENT '总玩家数,按match_season, match_type汇总',
`total_quiz` VARCHAR(10) COMMENT '总的知识数,按quiz_type汇总',
`ratio_rank` VARCHAR(10) COMMENT '排名ratio',
`ratio_finish` VARCHAR(10) COMMENT '完成ratio',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`update_datetime` DATETIME DEFAULT NULL,
PRIMARY KEY(`rank_id`, `match_season`, `match_type`, `match_team`),
KEY `query_key` (`match_season`, `match_type`, `match_team`))
ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='rockwell 排名结果';
INSERT INTO `tbl_match_rank`(`rank_id`, `match_season`, `match_type`,`match_team`,`default_type`, `score`, `rank`, `total_match`, `total_quiz`, `ratio_rank`, `ratio_finish`, `create_datetime`,`update_datetime`)
VALUES
('rid_s01_daily_uid_001', 's01', 'daily', 'uid_001', '1', '30','1', '3', '0.667', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('rid_s01_daily_uid_005', 's01', 'daily', 'uid_005', '1', '1','2', '3', '0.333', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('rid_s01_pk_uid_001', 's01', 'pk', 'uid_002', '1', '13','2', '3', '0.333', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('rid_s01_pk_uid_005', 's01', 'pk', 'uid_005', '0', '11','2', '3', '0.333', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('rid_s01_study_uid_003', 's01', 'study', 'uid_003', '1', '21','2', '3', '0.333', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('rid_s01_study_uid_005', 's01', 'study', 'uid_005', '0', '43','2', '3', '0.333', '2019-11-20 11:24:45', '2019-11-20 11:24:45')
;
\ No newline at end of file
USE rockwell_key;
USE rockwell_key;
/*
用于记录竞答排名, 默认显示位
*/
DROP TABLE IF EXISTS tbl_match_rank_default_type;
CREATE TABLE tbl_match_rank_default_type (
`rank_id` VARCHAR(100) COMMENT 'rank id',
`default_type` VARCHAR(10) COMMENT '是否默认显示到个人荣誉',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`update_datetime` DATETIME DEFAULT NULL,
PRIMARY KEY(`rank_id`),
KEY `query_key` (`rank_id`))
ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='rockwell 排名的默认显示';
\ No newline at end of file
USE rockwell_key;
USE rockwell_key;
/*
用于记录竞答排名;
流程,每小时计算一次(java) -> save to tbl_match_rank -> read by miniprogram
*/
DROP TABLE IF EXISTS tbl_match_title;
CREATE TABLE tbl_match_title (
`match_type` VARCHAR(10) COMMENT '竞答类别: 1:daily 2:pk',
`score` VARCHAR(10) COMMENT '竞答分数, 比如:10',
`title` VARCHAR(10) COMMENT '主队还是客队 blue|red',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`update_datetime` DATETIME DEFAULT NULL,
PRIMARY KEY(`match_type`, `score`),
KEY `query_key` (`match_type`, `score`))
ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='rockwell 排名结果';
INSERT INTO `tbl_match_title`(`match_type`, `score`, `title`, `create_datetime`,`update_datetime`)
VALUES
('daily', '0', '一学王者', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('daily', '10', '一学星耀', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('daily', '20', '一学钻石', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('daily', '30', '一学钻石', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('daily', '40', '一学钻石', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('daily', '50', '一学钻石', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('daily', '60', '一学钻石', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('daily', '70', '一学钻石', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('daily', '80', '一学钻石', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('wset1', '0', '知识达人', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('wset1', '10', '知识专家', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('wset1', '20', '知识行家', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('pk', '0', '竞答王者', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('pk', '10', '竞答星耀', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('pk', '20', '竞答钻石', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('wset2', '0', '知识达人', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('wset2', '10', '知识专家', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('wset2', '20', '知识行家', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('whisky', '0', '知识达人', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('whisky', '10', '知识专家', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('whisky', '20', '知识行家', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('sake', '0', '知识达人', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('sake', '10', '知识专家', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('sake', '20', '知识行家', '2019-11-20 11:24:45', '2019-11-20 11:24:45')
;
\ No newline at end of file
USE rockwell_key;
USE rockwell_key;
/*
用于记录竞答排名;
流程,每小时计算一次(java) -> save to tbl_match_rank -> read by miniprogram
*/
DROP TABLE IF EXISTS tbl_match_type;
CREATE TABLE tbl_match_type (
`match_type` VARCHAR(10) COMMENT '竞答类别: 1:daily 2:pk',
`match_name` VARCHAR(10) COMMENT 'type的名称',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`update_datetime` DATETIME DEFAULT NULL,
PRIMARY KEY(`match_type`, `match_name`),
KEY `query_key` (`match_type`, `match_name`))
ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='rockwell match类型的名称';
INSERT INTO `tbl_match_type`(`match_type`, `match_name`, `create_datetime`,`update_datetime`)
VALUES
('daily', '一学', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('pk', '竞答', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('wset1', 'WSET1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('wset2', 'WSET2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('wset3', 'WSET3', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('wset4', 'WSET4', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('sake', '清酒', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('whisky', '威士忌', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('wine', '红酒', '2019-11-20 11:24:45', '2019-11-20 11:24:45')
;
\ No newline at end of file
USE rockwell_key;
USE rockwell_key;
/*
竞答的题目
key
*/
DROP TABLE IF EXISTS tbl_quiz;
CREATE TABLE `tbl_quiz` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT "quiz id, uuid format",
`quiz_type` VARCHAR(10) DEFAULT 'wset2' COMMENT '题目类型, whisky:0, wset, 1, wine, 2, Sake',
`question_name` VARCHAR(500) NOT NULL COMMENT 'quiz名称',
`choice_string` VARCHAR(500) DEFAULT '' COMMENT '以;;双分号作为分隔',
`answer` VARCHAR(10) NOT NULL COMMENT 'quiz正确答案',
`question_level` VARCHAR(10) DEFAULT '1' COMMENT 'quiz难度,1简单;2较难;3很难;4变态',
`user_id` VARCHAR(100) DEFAULT '0' COMMENT 'quiz提交人',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`update_datetime` DATETIME DEFAULT NULL,
PRIMARY KEY (`id`,`create_datetime`),
KEY `query_key` (`id`, `quiz_type`,`user_fk_id`, `question_name`,`question_level`)
) ENGINE=INNODB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='rockwell知识竞赛quiz'
USE rockwell_key;
USE rockwell_key;
/*
用于记录有问题的quiz
*/
DROP TABLE IF EXISTS tbl_quiz_defect;
CREATE TABLE `tbl_quiz_defect` (
`id` VARCHAR(100) COMMENT 'quiz defect的id, uuid format, did_001',
`status` VARCHAR(5) DEFAULT '0' COMMENT '题目是否解决; 1-已解决; 0-未解决',
`question_fk_id` VARCHAR(100) NOT NULL COMMENT '题目的编号',
`user_fk_id` VARCHAR(100) NOT NULL DEFAULT '0' COMMENT 'quiz提交人',
`user_comment` VARCHAR(500) COMMENT 'defect 用户描述',
`sys_comment` VARCHAR(500) COMMENT 'defect 系统描述',
`create_datetime` DATETIME DEFAULT '0000-00-00 00:00:00',
`sys_comment_datetime` DATETIME DEFAULT '0000-00-00 00:00:00',
`update_datetime` DATETIME DEFAULT NULL,
PRIMARY KEY (`id`,`create_datetime`),
KEY `query_key` (`id`, `status`, `question_fk_id`,`user_fk_id`)
) ENGINE=INNODB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='rockwell知识竞赛quiz的报错信息'
USE rockwell_key;
USE rockwell_key;
/*
用于记录竞答结果: daily | 1v1 的比赛结果
*/
DROP TABLE IF EXISTS tbl_match;
CREATE TABLE tbl_match (
`match_id` VARCHAR(100) COMMENT '竞答的id, uuid format, mid_001',
`match_season` VARCHAR(10) COMMENT '竞答赛季: s01',
`match_type` VARCHAR(10) COMMENT '竞答类别: 1:daily 2:pk',
`match_team` VARCHAR(200) COMMENT '竞答队伍 uid_001',
`match_score` VARCHAR(10) COMMENT '竞答分数, 比如:10',
`team_type` VARCHAR(200) COMMENT '主队还是客队 blue|red',
`match_result` VARCHAR(200) COMMENT 'win|lose, 1',
`rank_score` VARCHAR(10) COMMENT '段位分数, 胜利+2,失败-1',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`update_datetime` DATETIME DEFAULT NULL,
PRIMARY KEY(`match_id`, `match_team`),
KEY `query_key` (`match_id`, `match_season`, `match_type`, `match_team`, `match_result`, `match_score`, `rank_score`))
ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='rockwell 竞答结果';
INSERT INTO `tbl_match`(`match_id`, `match_season`, `match_type`,`match_team`,`match_score`, `team_type`, `match_result`, `rank_score`, `create_datetime`,`update_datetime`)
VALUES
('mid_001', 's01', 'daily', 'uid_001', '10', '','', '1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_002', 's01', 'pk', 'uid_001', '10', 'blue','1', '2','2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_002', 's01', 'pk', 'uid_002', '9', 'red','0', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_003', 's01', 'pk', 'uid_003', '10', 'blue','0', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_003', 's01', 'pk', 'uid_004', '14', 'red', '1', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_004', 's01', 'daily', 'uid_005', '10', '','', '1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_005', 's01', 'pk', 'uid_001', '5', 'blue','0', '-1','2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_005', 's01', 'pk', 'uid_002', '9', 'red','1', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_006', 's01', 'pk', 'uid_003', '7', 'blue','0', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_006', 's01', 'pk', 'uid_004', '14', 'red', '1', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_007', 's01', 'pk', 'uid_001', '1', 'blue','1', '2','2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_007', 's01', 'pk', 'uid_002', '9', 'red','0', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_008', 's01', 'pk', 'uid_003', '18', 'blue','1', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_008', 's01', 'pk', 'uid_004', '14', 'red', '0', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_009', 's01', 'daily', 'uid_001', '10', '','', '1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_010', 's01', 'daily', 'uid_001', '10', '','', '1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_011', 's01', 'pk', 'uid_004', '18', 'blue','1', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_011', 's01', 'pk', 'uid_002', '16', 'red','0', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_012', 's01', 'pk', 'uid_001', '18', 'blue','1', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_012', 's01', 'pk', 'uid_002', '16', 'red','0', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_013', 's02', 'pk', 'uid_001', '16', 'blue','1', '2', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_013', 's02', 'pk', 'uid_003', '13', 'red','0', '-1', '2019-11-20 11:24:45', '2019-11-20 11:24:45'),
('mid_014', 's03', 'daily', 'uid_003', '10', '','', '1', '2019-11-20 11:24:45', '2019-11-20 11:24:45')
;
\ No newline at end of file
USE rockwell_key;
USE rockwell_key;
/*
match+score 视图
key
计算排名
tbl_match_rank 提供比赛排名
tbl_match_title 提供中文名称
tbl_match_type 提供类型中文名称
*/
DROP VIEW IF EXISTS view_match_rank;
CREATE VIEW view_match_rank
AS
SELECT aa.rank_id, aa.match_season, aa.match_type, cc.match_name, aa.match_team, IF(dd.default_type=1,dd.default_type,0) AS default_type, aa.score, aa.rank, aa.total_match, aa.total_quiz, aa.ratio_rank, aa.ratio_finish, aa.create_datetime, aa.update_datetime, bb.title FROM tbl_match_rank aa
LEFT JOIN tbl_match_title bb ON CAST(aa.score/10 AS UNSIGNED)*10=bb.score AND aa.match_type=bb.match_type
LEFT JOIN tbl_match_type cc ON aa.match_type=cc.match_type
LEFT JOIN tbl_match_rank_default_type dd ON aa.rank_id=dd.rank_id
USE rockwell_key;
USE rockwell_key;
/*
match+score 视图 (中间视图)
key
自动根据tbl_match计算分数
使用:
- view_match_type_total
- java 后台Rockwell_keyMapper.genT_match_rank 用于生成tbl_match_rank
*/
DROP VIEW IF EXISTS view_match_score;
CREATE VIEW view_match_score
AS
SELECT match_season, match_type, match_team, CONCAT(match_season,"_",match_type) as season_type, SUM(rank_score) AS score, IF(SUM(rank_score)=0, 0.1, SUM(rank_score) * -1) AS score_minus
FROM tbl_match
GROUP BY match_season, match_type,match_team
USE rockwell_key;
USE rockwell_key;
/*
match_type+total 视图
key
计算每赛季 每类型的用户参与人数
*/
DROP VIEW IF EXISTS view_match_type_total;
CREATE VIEW view_match_type_total
AS
select aa.match_season AS match_season, aa.match_type AS match_type, count(0) AS total
from
view_match_score aa
group by aa.match_season,aa.match_type
\ No newline at end of file
USE rockwell_key;
USE rockwell_key;
/*
每一类quiz的总个数 视图
key
*/
DROP VIEW IF EXISTS view_quiz_type_total;
CREATE VIEW view_quiz_type_total
AS
SELECT bb.quiz_type, aa.match_name as quiz_name, bb.total FROM tbl_match_type aa
LEFT JOIN
(
SELECT quiz_type, COUNT(*) AS total
FROM tbl_quiz
GROUP BY quiz_type
) bb ON aa.match_type=bb.quiz_type
USE rockwell_msg;
/*
评论的内容
包括了评论(comment)和回复(reply)
*/
DROP TABLE IF EXISTS tbl_comment;
CREATE TABLE `tbl_comment` (
`comment_id` VARCHAR(100) COMMENT '发文的id, uuid format',
`comment_type` VARCHAR(10) DEFAULT 'quiz' COMMENT '评论类型: quiz|post|goods',
`object_id` VARCHAR(100) COMMENT '回复对象的id, oid, 比如qiz, aid, gid, 等等, uuid format',
`object_name` VARCHAR(1000) DEFAULT NULL COMMENT '题目名称',
`content` VARCHAR(1000) DEFAULT NULL COMMENT '针对post_id的评论',
`userid_from` VARCHAR(100) NOT NULL COMMENT '针对发文做评论的id, uuid format',
`userid_to` VARCHAR(100) DEFAULT NULL COMMENT '针对某一片发文的userid, uuid format',
`content_to` VARCHAR(1000) DEFAULT NULL COMMENT '针对回复的内容,当userid_to存在时,而存在',
`num_like` INT(11) DEFAULT '0' COMMENT '针对每条comment的点赞次数,每点一次,则累加',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`update_datetime` DATETIME DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`comment_id`,`create_datetime`,`comment_type`),
KEY `query_key` (`comment_id`,`comment_type`,`object_id`, `create_datetime`, `num_like`, `userid_from`, `userid_to`))
ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT='rockwell 用户回复表';
INSERT INTO tbl_comment(comment_id, comment_type, object_id, object_name, content, userid_from, userid_to, content_to, num_like, create_datetime)
VALUES
( "cid_001","quiz", "186", "1、对于红葡萄酒来说,什么颜色代表着葡萄酒是年轻的?", "这款是最好的whisky", "uid_001", "", "", "10", "2020-01-02 16:00:00"),
( "cid_002","quiz", "186", "1、对于红葡萄酒来说,什么颜色代表着葡萄酒是年轻的?", "我也喝过", "uid_002", "uid_001", "这款是最好的whisky", "10", "2020-01-02 16:00:01"),
( "cid_003","quiz", "186", "1、对于红葡萄酒来说,什么颜色代表着葡萄酒是年轻的?", "哪里可以买到呀", "uid_003", "uid_002", "我也喝过", "10", "2020-01-02 16:00:02"),
( "cid_004","quiz", "186", "1、对于红葡萄酒来说,什么颜色代表着葡萄酒是年轻的?", "上海都有的嘛", "uid_001", "", "", "10", "2020-01-02 16:00:03"),
( "cid_005","quiz", "186", "1、对于红葡萄酒来说,什么颜色代表着葡萄酒是年轻的?", "我也好喜欢", "uid_004", "", "", "10", "2020-01-02 16:00:04"),
( "cid_006","quiz", "186", "1、对于红葡萄酒来说,什么颜色代表着葡萄酒是年轻的?", "+1", "uid_005", "", "", "10", "2020-01-02 16:00:05");
\ No newline at end of file
use rockwell_user;
DROP TABLE IF EXISTS tbl_credit;
CREATE TABLE `tbl_credit` (
`credit_id` VARCHAR(100) COMMENT '信用id: uuid format',
`credit_name` varchar(100) DEFAULT NULL COMMENT '信用名称',
`credit_level` varchar(100) DEFAULT NULL COMMENT '信用等级',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '标签的创建时间',
`update_datetime` DATETIME DEFAULT NULL,
PRIMARY KEY (`credit_id`),
KEY `query_key` (`credit_id`,`credit_name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='用户信用表'
use rockwell_user;
DROP TABLE IF EXISTS tbl_user;
CREATE TABLE `tbl_user` (
`id` varchar(100) COMMENT '用户id',
`auth_status` varchar(10) COMMENT '授权状态: 0-未授权, 1-已授权',
`openid` varchar(100) DEFAULT NULL COMMENT 'wx openid',
`last_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '上一次登陆时间',
PRIMARY KEY (`id`),
KEY `id_name` (`openid`,`auth_status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表'
USE rockwell_user;
USE rockwell_user;
/*
竞答key+活动act+商品good+评论comment+搜索search
key: key_daily_finish 每日, key_daily_score 每日得分, key_study_finish 学习题目, key_study_score 学习得分, key_pk_finish pk完成, key_pk_score
act: act_check 点击, act_attend 参加, act_fav 收藏,
goods: goods_check 点击, goods_buy购买, goods_fav 收藏,
comment: comment_finish, comment_like
search: num_search
目标: 统计用户每天的操作
- 参加了多少次竞答,多少次pk,
- 浏览了多少次活动,参加了多少次,
- 搜索了多少次,搜索了那些关键词
- 点了那些标签,及标签点击次数
- 点击了那些商品,购买了哪些商品,多少在购物车
1. 每日结算 or 每小时结算
内容属性(泥煤, 除夕活动, devar): num_pv, num_win, num_like, num_search, num_purchase, total_cost
事件属性: 点击活动, 参加活动,参加竞答,点击商品,购买商品 ,购买金额
key
*/
DROP TABLE IF EXISTS tbl_user_data;
CREATE TABLE tbl_user_data (
`user_id` VARCHAR(100) COMMENT '用户的id, uuid format',
`period` VARCHAR(10) NOT NULL COMMENT '时间类别: 按月 2020-01-08',
`key_daily_finish` VARCHAR(20) NOT NULL COMMENT '每日推荐',
`key_daily_score` VARCHAR(20) NOT NULL COMMENT '每日推荐得分',
`key_study_finish` VARCHAR(20) NOT NULL COMMENT '每日学习个数',
`key_study_score` VARCHAR(20) NOT NULL COMMENT '每日学习得分',
`key_pk_finish` VARCHAR(20) NOT NULL COMMENT '每日pk个数',
`key_pk_score` VARCHAR(20) NOT NULL COMMENT '每日pk得分',
`act_check` VARCHAR(20) NOT NULL COMMENT '活动点击',
`act_attend` VARCHAR(20) NOT NULL COMMENT '活动参加',
`act_fav` VARCHAR(20) NOT NULL COMMENT '活动收藏',
`goods_check` VARCHAR(20) NOT NULL COMMENT '活动点击',
`goods_buy` VARCHAR(20) NOT NULL COMMENT '活动点击',
`goods_fav` VARCHAR(20) NOT NULL COMMENT '活动点击',
`comment_finish` VARCHAR(20) NOT NULL COMMENT '评论次数',
`comment_like` VARCHAR(20) NOT NULL COMMENT '获赞次数',
`num_search` VARCHAR(20) NOT NULL COMMENT '查询次数',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`update_datetime` DATETIME DEFAULT NULL,
PRIMARY KEY(`user_id`, `period`),
KEY `query_key` (`user_id`, `period`))
ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='rockwell 记录用户的访问(点击)数据';
insert into `tbl_user_data`(`user_id`,`period`,`key_daily_finish`,`key_daily_score`,`key_study_finish`,`key_study_score`,`key_pk_finish`,`key_pk_score`,
`act_check`, `act_attend`, `act_fav`, `comment_finish`,`comment_like`,`num_search`,
`create_datetime`,`update_datetime`)
values ('uid_123',
'2020-01-08',
'10','10','10','10','10','10',
'10','10','10','10','10','10',
'2019-11-20 11:24:45',
'2019-11-20 11:24:45');
use rockwell_user;
DROP TABLE IF EXISTS tbl_login_log;
CREATE TABLE `tbl_login_log` (
`id` varchar(100) COMMENT '用户id',
`user_id` varchar(100) DEFAULT NULL COMMENT 'user_id具体指什么值',
`wxcode` varchar(100) DEFAULT NULL COMMENT '是传值的code吗',
`login_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '上一次登陆时间',
PRIMARY KEY (`id`),
KEY `id_name` (`id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户登陆日志表'
\ No newline at end of file
USE rockwell_user;
USE rockwell_user;
/*
备注:
1. 表示用户画像,及用户关注的tag及关注的次数,每小时更新一次
2. 建议用tag_name表示, 因为可以直接用Like进行模糊查找
*/
DROP TABLE IF EXISTS tbl_user_tag;
CREATE TABLE tbl_user_tag (
`user_id` VARCHAR(100) COMMENT '标签的id, uuid format',
`period` VARCHAR(10) NOT NULL COMMENT '时间类别: 按日+每小时更新 2020-01-08',
`tag_id` VARCHAR(100) COMMENT '标签的id, uuid format',
`tag_name` VARCHAR(100) COMMENT '标签的名称',
`num_pv` VARCHAR(20) NOT NULL COMMENT '点击量',
`num_search` VARCHAR(20) NOT NULL COMMENT '搜索量',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
`update_datetime` DATETIME DEFAULT NULL,
PRIMARY KEY(`user_id`, `tag_id`, `period`),
KEY `query_key` (`user_id`, `tag_id`, `period`, `tag_name`))
ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT='rockwell 用户标签画像表,说明用户偏好';
insert into `tbl_user_tag`(`user_id`, `period`, `tag_id`,`tag_name`,`num_pv`, `num_search`,`create_datetime`,`update_datetime`)
values ('uid_123',
'2020-01-08',
'tid_123',
'泥煤whisky',
'100',
'40',
'2019-11-20 11:24:45',
'2019-11-20 11:24:45');
use rockwell_user;
DROP TABLE IF EXISTS tbl_userinfo;
CREATE TABLE `tbl_userinfo` (
`userid` varchar(100) COMMENT '用户id, uuid format',
`nickName` varchar(100) DEFAULT NULL COMMENT 'nickName',
`avatarUrl` varchar(500) DEFAULT NULL COMMENT 'avatarUrl',
`gender` varchar(100) DEFAULT NULL COMMENT 'gender',
`province` varchar(100) DEFAULT NULL COMMENT 'province',
`city` varchar(100) DEFAULT NULL COMMENT 'city',
`country` varchar(100) DEFAULT NULL COMMENT 'country',
`create_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
`update_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
PRIMARY KEY (`userid`),
KEY `id_name` (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户信息表';
insert into `tbl_userinfo`(`userid`, `nickName`, `gender`, `unionid`, `province`, `city`, `country`, `avatarUrl`, `create_datetime`)
values
("uid_001", "张三", "男", "上海市", "上海市", "中国", "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/u_image/icon_avatar1.png", "2020-02-17 16:00:00"),
("uid_002", "xyz", "男", "上海市", "上海市", "中国", "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/u_image/icon_avatar2.png", "2020-02-17 16:00:00"),
("uid_003", "西西", "男", "上海市", "上海市", "中国", "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/u_image/icon_avatar3.png", "2020-02-17 16:00:00"),
("uid_004", "李四", "男", "上海市", "上海市", "中国", "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/u_image/icon_avatar4.png", "2020-02-17 16:00:00"),
("uid_005", "王五 ", "男", "上海市", "上海市", "中国", "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/u_image/icon_avatar5.png", "2020-02-17 16:00:00");
USE rockwell_msg;
USE rockwell_msg;
/*
user+msg 视图
key
*/
DROP VIEW IF EXISTS view_user_comment;
CREATE VIEW view_user_comment
AS
SELECT aa.comment_id, aa.comment_type, aa.object_id, aa.object_name, aa.content, aa.num_like, aa.userid_from, bb1.nickName AS nickname_from, aa.userid_to, bb2.nickName AS nickname_to, aa.content_to, aa.create_datetime, bb1.avatarUrl AS avatarUrlFrom, bb2.avatarUrl AS avatarUrlTo
FROM rockwell_msg.tbl_comment aa
LEFT JOIN rockwell_user.tbl_userinfo bb1 ON aa.userid_from=bb1.userid
LEFT JOIN rockwell_user.tbl_userinfo bb2 ON aa.userid_to=bb2.userid
\ No newline at end of file
单宁:很涩,有点抓舌头的收缩感就是单宁 Tanin
单宁:很涩,有点抓舌头的收缩感就是单宁 Tanin
仙粉黛红葡萄酒的酒精度比其他红葡萄酒更高——通常是16%,而其他红葡萄酒仅为12-14%
//app.js
//app.js
var config=require('./config.js');
App({
globalData: {
// userInfo setting
nyxCode: "", //userId, 唯一识别码
authStatus: "", //授权状态, 0表示未授权, 1表示已授权
userInfo : {}, //用户信息
matchSeason : "",
emotionHost : "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/emoji/",
onOpenOp : {},
// socket setting jscat 2020/03/12
// webSocket的readyState属性用来定义连接状态,该属性的值有下面几种:
// 0 :对应常量CONNECTING(numeric value 0) ,
// 正在建立连接连接,还没有完成。The connection has not yet been established.
// 1 :对应常量OPEN(numeric value 1) ,
// 连接成功建立,可以进行通信。The WebSocket connection is established and communication is possible.
// 2 :对应常量CLOSING(numeric value 2)
// 连接正在进行关闭握手,即将关闭。The connection is going through the closing handshake.
// 3: 对应常量CLOSED(numeric value 3)
// 连接已经关闭或者根本没有建立。The connection has been closed or could not be opened.
socketTask : {},
callback: function () { },
// socket发送的消息队列
socketMsgQueue : [],
heart : '',
// 心跳失败次数
heartBeatFailCount : 0,
// 终止心跳
heartBeatTimeOut : null,
// 终止重新连接
connectSocketTimeOut : null,
socketClose: false,
socketOpen: false,
},
onLaunch: function () {
//将config存储到本地存储
wx.setStorageSync("config", config);
//调用API从本地缓存中获取数据
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
},
// 用户自定义函数
//初始化socket
initSocket(sid, uid, msg) {
let _this = this
var strUrl = ""
if(config.local == 1)
{
strUrl = config.socket_url + "?sid=" + sid + "&uid=" + uid + "&msg=" + msg
}
else
{
strUrl = config.socket_url + "/wss?sid=" + sid + "&uid=" + uid + "&msg=" + msg
}
config.debug == 1 ? console.log("===initSocket_strUrl_" + strUrl) : ""
_this.globalData.socketTask = wx.connectSocket({
//此处 url 可以用来测试
url: strUrl,
success: function (res) {
console.log('===initSocket 创建成功', res)
},
fail: function (err) {
console.log('===initSocket 创建失败', err)
},
})
//版本库需要在 1.7.0 以上
// _this.globalData.socketTask.onOpen(function (res) {
// console.log('app-onOpen webSocket连接已打开! readyState=' + _this.globalData.socketTask.readyState)
// })
// _this.globalData.socketTask.onError(function (res) {
// console.log('app-WebSocket连接错误! 错误信息', res)
// })
// _this.globalData.socketTask.onClose(function (res) {
// console.log('app-WebSocket连接已关闭! readyState=' + _this.globalData.socketTask.readyState)
// _this.initSocket(_this.globalData.sid, _this.globalData.uid)
// })
_this.globalData.socketTask.onMessage(function (res) {
// 用于在其他页面监听 websocket 返回的消息
_this.globalData.callback(res)
})
},
//统一发送消息,可以在其他页面调用此方法发送消息
sendSocketMessage: function (options) {
let _this = this
var msg = typeof options == "string" ? options : options.msg
return new Promise((resolve, reject) => {
if (_this.globalData.socketTask.readyState === 1) {
console.log('===通过 webSocket onMessage() 连接发送数据', msg)
_this.globalData.socketTask.send({
data: msg,
success: function (res) {
console.log('===sendSocketMessage 已发送', res);
resolve(res)
if (typeof options =='object') {
options.success && options.success(res);
}
},
fail: function (res) {
reject(res)
if (typeof msg == 'object') {
options.fail && options.fail(res);
}
}
})
} else {
console.log('已断开, msg_', msg)
_this.globalData.socketMsgQueue.push(msg)
}
})
},
/**
* 关闭 webSocket 连接
*/
closeSocket: function (options) {
console.log("===app closeSocket")
let _this = this
if (_this.globalData.connectSocketTimeOut) {
clearTimeout(_this.globalData.connectSocketTimeOut);
_this.globalData.connectSocketTimeOut = null;
}
_this.globalData.socketClose = true;
_this.stopHeartBeat();
wx.closeSocket({
success: function (res) {
console.log('===webSocket 已关闭!');
},
fail: function (res) {
}
})
},
// 开始心跳
startHeartBeat: function () {
console.log('===app socket开始心跳')
var _this = this;
_this.globalData.heart = 'heart';
_this.heartBeat();
},
// 结束心跳
stopHeartBeat: function () {
console.log('socket结束心跳')
var _this = this;
_this.globalData.heart = '';
if (_this.globalData.heartBeatTimeOut) {
clearTimeout(_this.globalData.heartBeatTimeOut);
_this.globalData.heartBeatTimeOut = null;
}
if (_this.globalData.connectSocketTimeOut) {
clearTimeout(_this.globalData.connectSocketTimeOut);
_this.globalData.connectSocketTimeOut = null;
}
},
// 心跳
heartBeat: function () {
var _this = this;
if (!_this.globalData.heart) {
return;
}
_this.sendSocketMessage({
msg: JSON.stringify({
'cmd': 'onHeart',
'uid': _this.globalData.nyxCode,
'msg': 'heart'
}),
success: function (res) {
console.log('===app socket心跳成功');
if (_this.globalData.heart) {
_this.globalData.heartBeatTimeOut = setTimeout(() => {
_this.heartBeat();
}, 7000);
}
},
fail: function (res) {
console.log('===app socket心跳失败');
if (_this.globalData.heartBeatFailCount > 2) {
// 重连
_this.connectSocket();
}
if (_this.globalData.heart) {
_this.globalData.heartBeatTimeOut = setTimeout(() => {
_this.heartBeat();
}, 7000);
}
_this.globalData.heartBeatFailCount++;
},
});
},
regUser: function () {
var _this = this;
var strUrl = config.user_reg_url
config.debug == 1 ? console.log("===regUser_strUrl_" + strUrl) : ""
wx.request({
url: strUrl,
method: 'GET',
success: function (res) {
config.debug == 1 ? console.info("===regUser_data_", res) : ""
wx.setStorageSync('nyxCode', res.data.data.id)
wx.setStorageSync('authStatus', "0")
wx.setStorageSync('matchSeason', _this.getSeason())
var userInfo = {}
userInfo['userId'] = res.data.data.id
userInfo['nickName'] = "匿名用户"
userInfo['avatarUrl'] = "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/u_image/icon_avatar1.png"
wx.setStorageSync('userInfo', userInfo)
},
fail: function () {
console.log('系统错误')
}
})
},
//计算赛季
getSeason: function () {
var date = new Date();
var year = date.getFullYear(); //获取完整的年份(4位)
var month = date.getMonth(); //获取当前月份(0-11,0代表1月)
var str = parseInt(year) % 2020 * 4 + parseInt(month / 3) + 1
str = str[1] ? str : '0' + str
return "s" + str
},
})
\ No newline at end of file
{
{
"pages": [
"pages/discover/note-info/note-info",
"pages/key/key",
"pages/my/my",
"pages/discover/discover",
"pages/discover/note-writer/note-writer",
"pages/discover/searchbar/searchbar",
"pages/map/map",
"pages/key/matchDaily/matchDaily",
"pages/key/matchStudy/matchStudy",
"pages/key/matchStudy/matchStudyDetail/matchStudyDetail",
"pages/my/rank/rank",
"pages/my/user/user",
"pages/my/myposts/myposts",
"pages/logs/logs"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#000",
"navigationBarTitleText": "我",
"navigationBarTextStyle": "white"
},
"tabBar": {
"borderStyle": "white",
"color": "#a0a0a0",
"selectedColor": "#333333",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/key/key",
"text": "竞答",
"iconPath": "./icon/key.png",
"selectedIconPath": "./icon/key.png"
},
{
"pagePath": "pages/discover/discover",
"text": "发现",
"iconPath": "./icon/discover2.png",
"selectedIconPath": "./icon/discover2.png"
},
{
"pagePath": "pages/map/map",
"text": "地图",
"iconPath": "./icon/map1.png",
"selectedIconPath": "./icon/map1.png"
},
{
"pagePath": "pages/my/my",
"text": "我的",
"iconPath": "./icon/my.png",
"selectedIconPath": "./icon/my.png"
}
]
},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
@import 'style/weui.wxss';
@import 'style/weui.wxss';
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
// components/tag/tag.js
// components/tag/tag.js
Component({
/**
* 组件的属性列表
*/
properties: {
img: String,
name: String,
typeid: String
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
onTap: function (event) {
this.triggerEvent('tapping', {
idx: this.properties.typeid
})
}
}
})
{
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class='type-container' bind:tap="onTap" data-typeid="{{typeid}}">
<view class='type-container' bind:tap="onTap" data-typeid="{{typeid}}">
<view class='circle'>
<image src='{{img}}'></image>
</view>
<text>{{name}}</text>
</view>
\ No newline at end of file
.type-container{
.type-container{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.type-container .circle{
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 13rpx;
width: 100rpx;
height: 100rpx;
border-radius: 50%;
background-color: #444446;
}
.type-container .circle image{
width: 50rpx;
height: 50rpx;
}
.type-container text{
font-size: 20rpx;
font-weight: bold;
color: #767676;
}
\ No newline at end of file
//config.js API全局域名配置
//config.js API全局域名配置
var prod = 0;
var local = 0;
var test = 1;
var debug = 0; //是否打印调试信息
var host_key = "https://fun.hisuhong.com";
var login_url = "https://fun.hisuhong.com";
var socket_url = ""
if(prod == 1)
{
host_key = "https://fun.hisuhong.com";
login_url = "https://fun.hisuhong.com";
socket_url = "wss://wssfun.hisuhong.com"
}
else if(test == 1)
{
debug = 1
host_key = "https://wx.hisuhong.com";
login_url = "https://wx.hisuhong.com";
socket_url = "wss://wsswx.hisuhong.com"
}else if(local == 1)
{
debug = 1
host_key = "http://localhost:8085";
login_url = "https://wx.hisuhong.com";
socket_url = "ws://localhost:8085/websocket/chat"
}
var config={
local,
debug,
host_key,
rand_url : host_key + "/api/nyx/quiz/query/rand",
bug_url : host_key + "/api/nyx/quiz/defect/add",
data_url : host_key + "/api/nyx/quiz/query/item",
msg_query_url: host_key + "/api/nyx/msg/query",
msg_add_url: host_key + "/api/nyx/msg/add",
msg_like_url: host_key + "/api/nyx/msg/like",
user_login_url: login_url+"/api/nyx/user/wxLogin",
test_url : host_key + "/api/nyx/match/test",
match_rank_query_url: host_key + "/api/nyx/match/rank/query",
quiz_total_query_url: host_key + "/api/nyx/quiz/total/query",
match_rank_update_url: host_key + "/api/nyx/match/rank/update",
quiz_study_query_url: host_key + "/api/nyx/quiz/query/study",
match_add_item_url: host_key + "/api/nyx/match/add/item",
user_reg_url: host_key + "/api/nyx/user/reg",
userinfo_query_url: host_key + "/api/nyx/userinfo/query",
socket_url: socket_url,
}
module.exports=config;
\ No newline at end of file
[
[
{"name": "Expression_1","text": "[微笑]"},
{"name": "Expression_2","text": "[撇嘴]"},
{"name": "Expression_3","text": "[色]"},
{"name": "Expression_4","text": "[发呆]"},
{"name": "Expression_5","text": "[得意]"},
{"name": "Expression_6","text": "[流泪]"},
{"name": "Expression_7","text": "[害羞]"},
{"name": "Expression_8","text": "[闭嘴]"},
{"name": "Expression_9","text": "[睡]"},
{"name": "Expression_10","text": "[大哭]"},
{"name": "Expression_11","text": "[尴尬]"},
{"name": "Expression_12","text": "[发怒]"},
{"name": "Expression_13","text": "[调皮]"},
{"name": "Expression_14","text": "[呲牙]"},
{"name": "Expression_15","text": "[惊讶]"},
{"name": "Expression_16","text": "[难过]"},
{"name": "Expression_17","text": "[酷]"},
{"name": "Expression_18","text": "[冷汗]"},
{"name": "Expression_19","text": "[抓狂]"},
{"name": "Expression_20","text": "[吐]"},
{"name": "Expression_21","text": "[偷笑]"},
{"name": "Expression_22","text": "[愉快]"},
{"name": "Expression_23","text": "[白眼]"},
{"name": "Expression_24","text": "[傲慢]"},
{"name": "Expression_25","text": "[饥饿]"},
{"name": "Expression_26","text": "[困]"},
{"name": "Expression_27","text": "[恐惧]"},
{"name": "Expression_28","text": "[流汗]"},
{"name": "Expression_29","text": "[憨笑]"},
{"name": "Expression_30","text": "[悠闲]"},
{"name": "Expression_31","text": "[奋斗]"},
{"name": "Expression_32","text": "[咒骂]"},
{"name": "Expression_33","text": "[疑问]"},
{"name": "Expression_34","text": "[嘘]"},
{"name": "Expression_35","text": "[晕]"},
{"name": "Expression_36","text": "[疯了]"},
{"name": "Expression_37","text": "[衰]"},
{"name": "Expression_38","text": "[骷髅]"},
{"name": "Expression_39","text": "[敲打]"},
{"name": "Expression_40","text": "[再见]"},
{"name": "Expression_41","text": "[擦汗]"},
{"name": "Expression_42","text": "[抠鼻]"},
{"name": "Expression_43","text": "[鼓掌]"},
{"name": "Expression_44","text": "[糗大了]"},
{"name": "Expression_45","text": "[坏笑]"},
{"name": "Expression_46","text": "[左哼哼]"},
{"name": "Expression_47","text": "[右哼哼]"},
{"name": "Expression_48","text": "[哈欠]"},
{"name": "Expression_49","text": "[鄙视]"},
{"name": "Expression_50","text": "[委屈]"},
{"name": "Expression_51","text": "[快哭了]"},
{"name": "Expression_52","text": "[阴险]"},
{"name": "Expression_53","text": "[亲亲]"},
{"name": "Expression_54","text": "[吓]"},
{"name": "Expression_55","text": "[可怜]"},
{"name": "Expression_56","text": "[菜刀]"},
{"name": "Expression_57","text": "[西瓜]"},
{"name": "Expression_58","text": "[啤酒]"},
{"name": "Expression_59","text": "[篮球]"},
{"name": "Expression_60","text": "[乒乓]"},
{"name": "Expression_61","text": "[咖啡]"},
{"name": "Expression_62","text": "[饭]"},
{"name": "Expression_63","text": "[猪头]"},
{"name": "Expression_64","text": "[玫瑰]"},
{"name": "Expression_65","text": "[凋谢]"},
{"name": "Expression_66","text": "[嘴唇]"},
{"name": "Expression_67","text": "[爱心]"},
{"name": "Expression_68","text": "[心碎]"},
{"name": "Expression_69","text": "[蛋糕]"},
{"name": "Expression_70","text": "[闪电]"},
{"name": "Expression_71","text": "[炸弹]"},
{"name": "Expression_72","text": "[刀]"},
{"name": "Expression_73","text": "[足球]"},
{"name": "Expression_74","text": "[瓢虫]"},
{"name": "Expression_75","text": "[便便]"},
{"name": "Expression_76","text": "[月亮]"},
{"name": "Expression_77","text": "[太阳]"},
{"name": "Expression_78","text": "[礼物]"},
{"name": "Expression_79","text": "[拥抱]"},
{"name": "Expression_80","text": "[强]"},
{"name": "Expression_81","text": "[弱]"},
{"name": "Expression_82","text": "[握手]"},
{"name": "Expression_83","text": "[胜利]"},
{"name": "Expression_84","text": "[抱拳]"},
{"name": "Expression_85","text": "[勾引]"},
{"name": "Expression_86","text": "[拳头]"},
{"name": "Expression_87","text": "[差劲]"},
{"name": "Expression_88","text": "[爱你]"},
{"name": "Expression_89","text": "[NO]"},
{"name": "Expression_90","text": "[OK]"},
{"name": "Expression_91","text": "[爱情]"},
{"name": "Expression_92","text": "[飞吻]"},
{"name": "Expression_93","text": "[跳跳]"},
{"name": "Expression_94","text": "[发抖]"},
{"name": "Expression_95","text": "[怄火]"},
{"name": "Expression_96","text": "[转圈]"},
{"name": "Expression_97","text": "[磕头]"},
{"name": "Expression_98","text": "[回头]"},
{"name": "Expression_99","text": "[跳绳]"},
{"name": "Expression_100","text": "[投降]"},
{"name": "Expression_101","text": "[激动]"},
{"name": "Expression_102","text": "[街舞]"},
{"name": "Expression_103","text": "[献吻]"},
{"name": "Expression_104","text": "[左太极]"},
{"name": "Expression_105","text": "[右太极]"}
]
\ No newline at end of file
// pages/kinds/kinds.js
// pages/kinds/kinds.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
category: [ // 导航栏内容数据
{ name: '推荐', id: 'tuijian' },
{ name: '附近', id: 'fujin' },
{ name: '复工', id: 'fugong' },
{ name: '酒单', id: 'jiudan' },
{ name: 'DJ', id: 'dj' },
{ name: '饮事', id: 'yinshi' },
],
curIndex: 0,
detail: [
{
id : "tuijian",
notes: [
{
note_image: "https://img.xiaohongshu.com/items/c1a0056ba9ba17b30446a0e040dc9e30@800w_90Q_1x_2o.jpg",
title: "便携香水加香一天",
writer: "无敌花木兰",
like: 10,
writer_image: "../../icon/icon_avatar3.png"
},
{
note_image: "https://img.xiaohongshu.com/items/c1a0056ba9ba17b30446a0e040dc9e30@800w_90Q_1x_2o.jpg",
title: "便携香水加香一天",
writer: "无敌花木兰",
like: 10,
writer_image: "../../icon/icon_avatar3.png"
}
]
},
{
id: "fujin",
notes: [
{
note_image: "https://img.xiaohongshu.com/items/c1a0056ba9ba17b30446a0e040dc9e30@800w_90Q_1x_2o.jpg",
title: "便携香水加香一天",
writer: "大小姐嫁到",
like: 10,
writer_image: "https://img.xiaohongshu.com/seller/0d1b063d887360fc5a3779bd6784a453"
},
{
note_image: "https://img.xiaohongshu.com/items/c1a0056ba9ba17b30446a0e040dc9e30@800w_90Q_1x_2o.jpg",
title: "便携香水加香一天",
writer: "百里玄策",
like: 10,
writer_image: "https://img.xiaohongshu.com/seller/0d1b063d887360fc5a3779bd6784a453"
}
]
}
],
toView: 'tuijian',
scroll: true
},
switchCategory(e) {
this.setData({
curIndex: e.currentTarget.dataset.index?e.currentTarget.dataset.index:0,
toView: e.currentTarget.dataset.index,
})
},
// 搜索点击事件
entrySearch(e) {
wx.navigateTo({
url: '../index/searchbar/searchbar',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.setNavigationBarTitle({
title: '发现',
})
// 请求数据
// wx.request({
// url: 'https://www.easy-mock.com/mock/5b1e17a0d4a14a3247a6cd6b/',
// success: (res) => {
// this.setData({
// detail: res.data.data
// })
// }
// })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
{
{
"usingComponents": {}
}
\ No newline at end of file
<view class="page">
<view class="page">
<!-- 搜索框 -->
<view class="search">
<view class="searchBar">
<icon class="weui-icon-search" type="search" size="14"></icon>
<input class="input" placeholder="大家都在搜" bindtap="entrySearch" disabled />
</view>
</view>
<!-- 导航栏 -->
<view class="navBar">
<scroll-view class="navBar-box" scroll-x="true" style="white-space: nowrap; display:flex ">
<view class="cate-list {{curIndex==index?'on':''}}" wx:for="{{category}}"
wx:key="{{item.id}}" data-id="{{item.id}}" data-index="{{index}}"
bindtap="switchCategory">{{item.name}}</view>
</scroll-view>
</view>
<!-- 文章列表 -->
<swiper class="notes" current="{{toView}}">
<swiper-item class="category" wx:for="{{detail}}" wx:key="{{item.id}}">
<scroll-view class="cate-box" id="{{item.id}}" scroll-y>
<!-- 文章封面内容 -->
<view class="note" wx:for="{{item.notes}}" wx:for-item="notes" wx:key="{{index}}">
<view class="note-info">
<navigator url="../discover/note-info/note-info" >
<view class="home-note-img">
<image src="{{notes.note_image}}"/>
</view>
<span>{{notes.title}}</span>
</navigator>
</view>
<!-- 作者信息 -->
<view class="note-handle">
<navigator class="writer" url="../discover/note-writer/note-writer">
<image class="photo-img" src="{{notes.writer_image}}"/>
<span class="name">{{notes.writer}}</span>
</navigator>
<view class="like">
<image class="like-icon" src="../../icon/discover/like.png"/>
<span>{{notes.like}}</span>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
.page{
.page{
height:100%;
display:flex;
flex-direction:column;
box-sizing:border-box;
position:relative;
top:0;
left:0;
bottom:0;
right:0;
background-color:#f5f8fa;
}
.search{
background: #fff;
}
.searchBar{
margin: 20rpx 30rpx;
border-radius: 30px;
border:1px solid #f5f5f5;
background: #f5f5f5;
}
.weui-icon-search{
margin-left: 15rpx;
float: left;
}
.navBar{
height: 60rpx;
background: #fff;
border-top: 1px solid #fafafa;
}
.navBar-box{
width: 100%;
height: 60rpx;
}
.cate-list{
display: inline;
margin: 15rpx 22rpx;
text-align: center;
font-size: 14px;
color: #9d9d9d;
}
.navBar-box .cate-list.on {
color: #000000;
font-weight: bold;
}
.notes{
height:2800rpx;
}
.category{
height: auto;
overflow: hidden;
}
.category-title{
height: auto;
line-height: 72rpx;
font-size: 35rpx;
text-align: center;
margin: 20rpx;
border-radius: 20px;
background: #ffffff;
}
.note{
width: 45%;
margin: 15rpx;
background: #fff;
border-radius: 5px;
float: left;
}
.note-info span{
font-size: 13px;
overflow : hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
margin: 5px;
}
.home-note-img image{
width: 100%;
height: 170px;
border-radius: 5px;
}
.note-handle, .writer{
display: flex;
flex-direction: row;
}
.name{
margin-left: 0px;
text-align: center;
line-height: 38px;
font-size: 12px;
}
.writer image{
width: 30px;
height: 30px;
border-radius: 50%;
}
.like{
margin-left: 15px;
display: flex;
}
.like image{
width: 20px;
height: 20px;
margin: auto;
}
.like span{
font-size: 12px;
color: #9f9f9f;
margin: auto;
}
// pages/index/note-info/note-info.js
// pages/index/note-info/note-info.js
Page({
/**
* 页面的初始数据
*/
data: {
windowHeight: "",
windowWidth: "",
scrollLeft: 0, //切换栏的滚动条位置
curIndex : 0,
toView: 'tag1',
proList : [
{
tag : "tag1",
selected: "",
proUrl: "https://www.youmeitu.com/Upload/20200122/1579681098726876.jpg",
proTitle: "1st-lalalal",
proDec : "best of best",
proPrice: "100",
},
{
tag: "tag2",
selected: "",
proUrl: "https://www.youmeitu.com/Upload/20200302/1583123627387901.jpg",
proTitle: "2nd-hhh",
proDec: "都要买",
proPrice: "100",
},
{
tag: "tag3",
selected: "",
proUrl: "https://www.youmeitu.com/Upload/20200122/1579680900787352.jpg",
proTitle: "3rd-哇咔咔",
proDec: "都要买",
proPrice: "100",
},
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var windowHeight = wx.getSystemInfoSync().windowHeight;//获取设备高度,小程序自带的方法
var windowWidth = wx.getSystemInfoSync().windowWidth;//获取设备高度,小程序自带的方法
this.setData({
windowHeight: windowHeight,
windowWidth: windowWidth,
})
wx.setNavigationBarTitle({
title: '发现',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/**
*
* 用户自定义函数
*/
//滑动获取选中商品
getSelectItem: function (e) {
var that = this;
var preCurIndex = that.data.curIndex;
var itemWidth = e.detail.scrollWidth / that.data.proList.length;//每个商品的宽度
var scrollLeft = e.detail.scrollLeft;//滚动宽度
var curIndex = Math.round(scrollLeft / itemWidth);//通过Math.round方法对滚动大于一半的位置进行进位
var newScrollLeft = 0
// 目标: 始终让图片居中显示
if (curIndex != preCurIndex
|| (curIndex == that.data.proList.length - 1 && scrollLeft > that.data.windowWidth * (that.data.proList.length - 1))
)
{
newScrollLeft = that.data.windowWidth * curIndex
that.setData({
scrollLeft : newScrollLeft,
curIndex : curIndex,
});
}
console.log("itemWidth: ",itemWidth)
console.log("scrollLeft: ", scrollLeft)
console.log("curIndex: ", curIndex)
console.log("newScrollLeft: ", newScrollLeft)
for (var i = 0, len = that.data.proList.length; i < len; ++i) {
that.data.proList[i].selected = false;
}
that.data.proList[curIndex].selected = true;
that.setData({
proList: that.data.proList,
giftNo: this.data.proList[curIndex].id,
});
},
})
\ No newline at end of file
<view class="page">
<view class="page">
<scroll-view class="scroll-view_H" scroll-x scroll-with-animation style="width: 100%;height:{{windowHeight}}px" bindscroll="getSelectItem" scroll-left="{{scrollLeft}}">
<block wx:for="{{proList}}" wx:key="unique" wx:for-index="id" wx:for-item="item">
<view class="scroll_item {{item.selected ? 'selected' : ''}}" data-index='{{item.index}}' bindtap='selectProItem'>
<view class='proImg'><image src="{{item.proUrl}}" mode="widthFix"/></view>
<!-- <view class='detailBox'>
<view class='proTitle'>{{item.proTitle}}</view>
<view class='proDec'>{{item.proDec}}</view>
<view class='proPrice'>¥{{item.proPrice}}</view>
<navigator class='detailLink' url="../detail/detail?id={{item.id}}">查看详情 ></navigator>
</view> -->
</view>
</block>
</scroll-view>
</view>
.scroll-view_H{
.scroll-view_H{
width: 100%;
text-align: center;
white-space: nowrap;
}
.scroll_item {
position: relative;
width: 100%;
margin: 0;
left: 0%;
display: inline-block;
border-radius: 20rpx !important ;
overflow: hidden;
transform: scale(0.9);
box-shadow: 0 0 10px #ccc;
vertical-align: top;
top: 5%;
height: 72%;
background-color: #fff;
}
.scroll_item:first-child{
margin-left: 0%;
left: 0;
}
.scroll_item:last-child{
margin-right: 10%;
left: 0;
}
.scroll_item.selected{
transform: scale(0.9);
border: solid 1px #ffcd54;
}
.scroll_item .proImg{
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
width: 100%;
max-height: 200rpx;
position: absolute;
top: 0;
left: 0;
z-index: 0;
}
.scroll_item image {
width: 100%;
float: left;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
}
.detailBox {
padding: 30rpx 5% 30rpx 5%;
float: left;
width: 100%;
border-bottom-left-radius: 20rpx;
border-bottom-right-radius: 20rpx;
position: absolute;
bottom: 0;
left: 0;
z-index: 1;
background: #fff;
}
.proTitle {
font-size: 36rpx;
color: #666;
line-height: 50rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.proDec {
font-size: 30rpx;
color: #999;
line-height: 50rpx;
}
.proPrice {
font-size: 48rpx;
color: #CA414C;
line-height: 90rpx;
}
.detailLink{
color: #666;
font-size: 30rpx;
}
\ No newline at end of file
// pages/index/note-writer/note-writer.js
// pages/index/note-writer/note-writer.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
<view class="page">
<view class="page">
<span>尚未完成</span>
</view>
.page span{
.page span{
font-size: 45rpx;
}
\ No newline at end of file
Page({
Page({
/**
* 页面的初始数据
*/
data: {
historyRecord:[{
id: '0',
recordItem:' '
}],
hots:[{
id:'01',
text:'上海',
hotStatus:132
},{
id:'02',
text:'父亲节礼物',
hotStatus:103
},{
id:'03',
text:'cos',
hotStatus:43
},{
id:'04',
text:'vc水',
hotStatus:38
},{
id:'05',
text:'丸子头',
hotStatus:45
},{
id:'06',
text:'景甜',
hotStatus:92
},{
id:'07',
hotImg:'/images/hot.png',
text:'来小红书看世界杯',
hotStatus:156
},{
id:'08',
text:'APP',
hotStatus:85
}],
searchContext:'',
haveSerachLike: false,
searchLikeList: [],
searchLikeAllList: [{
text: '2018世界杯'
}, {
text: '世界杯赛程'
}, {
text: '世界杯狂欢色'
}, {
text: '为世界杯干杯'
}, {
text: '世界杯球迷上线'
}, {
text: '世界杯没有时差'
},{
text:'...'
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var hots = this.data.hots;
var hots2 = hots.sort((x, y) => y.hotStatus - x.hotStatus);
// reverse()方法会反转数组项的顺序
// hots.reverse();
console.log(hots2);
this.setData({
hots: hots2
})
wx.getStorage({
key: 'historyRecord',
success: (res) => {
// success
this.setData({
historyRecord: res.data
})
},
fail: function() {
// fail
},
complete: function() {
// complete
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
bindconfirm: function(e){
console.log(e);
var recordItem = e.detail.value;
this.saveHistory({
id: 0,
recordItem
})
wx.navigateTo({
url: '../searchbar/searchbar',
})
this.setData({
searchContext:''
})
},
changeSearch (e) {
let value = e.detail.value
if (value === '') {
this.setData({
haveSerachLike: false
})
return
}
let arr = this.data.searchLikeAllList.filter(item => item.text.indexOf(value) > -1)
console.log(arr)
this.setData({
haveSerachLike: true,
searchLikeList: arr,
})
},
backTo () {
wx.navigateBack({
delta: 1
})
},
deleteRecord: function(e){
console.log(e);
let filterArr = this.data.historyRecord.filter((item, index) => {
return index !== e.target.dataset.index
})
this.setData({
historyRecord: filterArr
})
wx.setStorage({
key: 'historyRecord',
data: filterArr
})
},
saveHistory (param) {
let arr = this.data.historyRecord
arr.unshift(param)
wx.setStorage({
key: 'historyRecord',
data: arr
})
this.setData({
historyRecord: arr
})
}
})
\ No newline at end of file
<view class="search">
<view class="search">
<view class="header">
<view class="header-top">
<view class="nav-search">
<icon class="weui-icon-search" type="search" size="14"></icon>
<input type="text" placeholder="來小红书看世界杯" class="text-search" bindinput="changeSearch" bindconfirm="bindconfirm" value="{{searchContext}}"/>
</view>
</view>
</view>
<view class="container">
<view class="content" wx:if="{{!haveSerachLike}}">
<view class="search-history">
<text class="history-record">历史记录</text>
<view class="search-history-item" wx:for="{{historyRecord}}" wx:key="{{index}}">
<text>{{item.recordItem}}</text>
</view>
</view>
<view class="hot-search">
<text class="search-hot">热门搜索</text>
<view class="search-item">
<view class="hot-search-item" wx:for="{{hots}}" wx:key="{{item.id}}">
<view class="hot-item">
<view class="text">
<image class="hot-img" src="{{item.hotImg}}" wx:if="{{item.hotImg}}"></image>
<text>{{item.text}}</text>
</view>
<view class="hot-status" >{{hotStatus}}</view>
</view>
</view>
</view>
</view>
</view>
<view wx:else class="search-like">
<view class="search-like-item" data-param="{{item.text}}" wx:for="{{searchLikeList}}" wx:key="{{index}}">
<icon class="weui-icon-search" type="search" size="14"></icon>
<text>{{item.text}}</text>
</view>
</view>
</view>
</view>
.header-top{
.header-top{
width: 100%;
height: 100rpx;
top: 0;
left: 0;
}
.nav-search{
margin: 20rpx 30rpx;
border-radius: 30px;
border:1px solid #f5f5f5;
background: #f5f5f5;
}
.weui-icon-search{
margin-left: 15rpx;
float: left;
}
.text-search{
padding-top: 10rpx;
}
.container{
width: 100%;
}
.content{
width: 90%;
height: 600rpx;
position: absolute;
top: 130rpx;
}
.search-history-item{
border-bottom: 1px solid #f5f5f5;
}
.search-history, .search-like{
width: 90%;
display: inline-block;
overflow: hidden;
}
.search-like{
position: absolute;
top: 100rpx;
}
.search-like-item{
border-bottom: 1px solid #f5f5f5;
}
.hot-search{
margin-top: 60rpx;
}
.hot-img{
width: 26rpx;
height: 26rpx;
padding-right: 20rpx;
}
.hot-search-icon{
width: 28rpx;
height: 28rpx;
}
.history-record{
font-weight: bold;
}
.search-item{
display: flex;
flex-wrap:wrap;
line-height: 80rpx;
}
.search-hot{
font-weight: bold;
}
.hot-status{
display: none;
}
.hot-search-item .text{
font-size: 30rpx;
height: 50rpx;
line-height: 50rpx;
color: #888;
background: #f5f5f5;
padding: 6rpx 14rpx;
border-radius: 46rpx;
margin: 16rpx 20rpx;
}
\ No newline at end of file
// pages/key/key.js
// pages/key/key.js
var config = wx.getStorageSync("config");
var app = getApp();
var log = require('./../../utils/log.js')
Page({
/**
* 系统配置:主要用于置底页面设置 step1
*/
keyHeight: '',
chatHeight: "",
/**
* 页面的初始数据
*/
data: {
// 主要是公屏内容
autoplay: false,
interval: 3000,
duration: 1200,
indicatorDots: true,
emotionArr: [],
messageInputVal: '',
emotionHost: null,
nodes: [{
name: 'img'
}],
// {
// nickName : "张三"",
// type: 'L',
// messageType: 'txt',
// con: '微软开发者大会',
// avater: '../../imgs/avater.jpg'
// },
messageList: [],
isMedia: false,
isEmotion: false,
isShowAdd: false,
// socket
user_input_text: '',//用户输入文字
inputValue: '',
returnValue: '',
addImg: false,
//格式示例数据,可为空
allContentList: [],
num: 0,
sid: "key",
chatUserInfo: {},
scrollTop: 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
console.log('===onLoad, options...', JSON.stringify(options));
/*step1 先确定用户信息 */
if (!wx.getStorageSync('nyxCode'))
{
//注册新用户
wx.clearStorageSync();
app.regUser();
}
else
{
//更新用户信息
var strUrl = config.userinfo_query_url + "?userid=" + wx.getStorageSync('nyxCode')
config.debug == 1 ? console.log("===getLatestUserInfo strUrl_" + strUrl) : 1
getData(strUrl, "").then(res => {
console.log(res.data)
var list = res.data[0]
//wx.setStorageSync('authStatus', "0")
wx.setStorageSync('userInfo', list)
app.globalData.userInfo = list
})
}
//每次重置matchSeason
wx.setStorageSync('matchSeason', app.getSeason())
//1. 从local storage里读取最新的数据
//2. 存储到globalData供所有页面使用
app.globalData.nyxCode = wx.getStorageSync('nyxCode')
app.globalData.authStatus = wx.getStorageSync('authStatus')
app.globalData.userInfo = wx.getStorageSync('userInfo')
app.globalData.matchSeason = wx.getStorageSync('matchSeason')
log.info("key_onLoad_nyxCode", app.globalData.nyxCode)
log.info("key_onLoad_authStatus", app.globalData.authStatus)
log.info("key_onLoad_userInfo", app.globalData.userInfo)
log.info("key_onLoad_matchSeason", app.globalData.matchSeason)
wx.setNavigationBarTitle({
title: "发现有趣的你"
})
/**
* 系统配置:主要用于置底页面设置 step2
let h = 750 * res.windowHeight/res.windowWidth
*/
//获取设备高度,小程序自带的方法
var windowHeight = wx.getSystemInfoSync().windowHeight;
var keyHeight = windowHeight*0.4
var chatHeight = windowHeight - keyHeight
console.log("keyHeight_"+keyHeight)
console.log("chatHeight_" + chatHeight)
_this.setData({
keyHeight: keyHeight,
chatHeight: chatHeight,
})
//模拟表情数据
let emotion = emotionFun();
this.setData({
emotionArr: emotion,
emotionHost: app.globalData.emotionHost
})
},
// 初始化socket, 监听socket
onShow: function () {
var _this = this;
if (app.globalData.socketTask.readyState != 1) {
var sid = _this.data.sid
var uid = wx.getStorageSync('nyxCode')
if (sid != undefined && uid != undefined && sid != "" && uid != "") {
app.initSocket(sid, uid, "进入竞答环节")
app.globalData.socketClose = false
}
}
// 最好放在onShow
app.globalData.socketTask.onOpen(function (res) {
console.log('chat-onOpen webSocket连接已打开! readyState=' + app.globalData.socketTask.readyState)
console.log("chat-open res_", res)
if (app.globalData.socketClose) {
app.closeSocket();
}
else
{
app.globalData.socketOpen = true;
// 发送答题积分消息
var sendMsg = wx.getStorageSync('sendMsg')
if (sendMsg) {
_this.sendSocketMessage(sendMsg)
}
for (var i = 0; i < app.globalData.socketMsgQueue.length; i++) {
_this.sendSocketMessage(app.globalData.socketMsgQueue[i])
}
app.globalData.socketMsgQueue = []
app.startHeartBeat();
}
})
app.globalData.socketTask.onError(function (res) {
console.log('chat-WebSocket连接错误! 错误信息', res)
})
/*
两种情形,注意区分
case1. 用户跳转到其他页面, 触发onHide, 则正式退出
case2. socket掉线,则需要重连
*/
app.globalData.socketTask.onClose(function (res) {
console.log('chat-WebSocket连接已关闭! readyState=' + app.globalData.socketTask.readyState)
//对应case1
if(!app.globalData.socketClose)
{
clearTimeout(app.globalData.connectSocketTimeOut)
app.globalData.connectSocketTimeOut = setTimeout(() => {
app.initSocket(_this.data.sid, app.globalData.nyxCode, "进入竞答环节")
}, 3000);
}
})
app.globalData.socketTask.onMessage(onMessage => {
console.log('监听WebSocket接受到服务器的消息事件。服务器返回的消息', onMessage.data)
log.info('监听WebSocket接受到服务器的消息事件。服务器返回的消息', onMessage.data)
var json = JSON.parse(onMessage.data);
// uid
var uid = json["uid"];
if(json["cmd"]!="onHeart")
{
console.log("json: ", json)
var strUrl = config.userinfo_query_url + "?userid=" + uid
config.debug == 1 ? console.log("===getData strUrl_" + strUrl) : 1
getData(strUrl, "").then(res => {
console.log(res.data)
var list = res.data
_this.setData({
chatUserInfo: list[0]
})
_this.processData(json)
})
}
})
},
onType: function (e) {
console.log(e)
switch (e.detail.idx) {
case '1':
wx.navigateTo({
url: '/pages/key/matchTest/matchTest'
})
break;
case '2':
wx.navigateTo({
url: '/pages/key/matchTest/matchTest'
})
break;
case '3':
wx.navigateTo({
url: '/pages/key/matchOne/matchOne'
})
break;
case '4':
wx.navigateTo({
url: '/pages/key/matchTwo/matchTwo'
})
break;
default:
break;
}
},
/*
*/
//点击空白页,隐藏表情和图片选择
cancelShow() {
this.setData({
isEmotion: false,
isMedia: false
})
},
//打开表情选择
openEmotion() {
this.scrollBottom();
this.setData({
isEmotion: !this.data.isEmotion,
isMedia: false
})
},
//选择表情
selectEmotion(e) {
let inputEmotion = this.data.messageInputVal.concat(e.currentTarget.dataset.txt);
this.setData({
messageInputVal: inputEmotion
})
this.isShowAddFun();
},
//删除输入的值
deleteVal() {
// console.log(this.data.messageInputVal.length)
let newVal = this.data.messageInputVal.substring(0, this.data.messageInputVal.length - 1);
this.setData({
messageInputVal: newVal
})
this.isShowAddFun();
},
//分享(带参数),在onLoad接收参数
onShareAppMessage: function () {
return {
title: 'xx小程序',
path: 'pages/index/index?id=123&name="zansan"&age=23', // 路径,传递参数到指定页面。
imageUrl: '../../imgs/avater.jpg' //自定义分享封面
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
//app.closeSocket();
console.log('===onUnload webSocket 连接关闭事件。')
},
//发送消息
messageSend: function () {
let self = this;
let messageVal = self.data.messageInputVal;
if (!messageVal) {
wx.showToast({
title: '请输入内容',
icon: 'none',
duration: 2000
})
return false;
}
//表情处理
var reg = /\[.+?\]/g;
let newVal = messageVal.replace(reg, function (a, b) {
return face(a) ? face(a) : a;
});
//发送的消息
let objR = {
nickName: app.globalData.userInfo.nickName,
type: 'R',
messageType: 'txt',
con: newVal,
avater: app.globalData.userInfo.avatarUrl,
};
let messageArr = [];
messageArr.push(objR);
let newMessageArr = self.data.messageList.concat(messageArr);
self.submitTo(messageVal)
//更新数据(模拟请求历史数据)
self.setData({
messageInputVal: "",
messageList: newMessageArr,
isEmotion: false,
isMedia: false
})
self.scrollBottom();
},
//使页面滚动到底部
//tofix 应该需要一些优化 jscat 2020/03/13
scrollBottom: function () {
// wx.createSelectorQuery().select('#wrapperCon').boundingClientRect(function (rect) {
// wx.pageScrollTo({
// scrollTop: rect.bottom * 1000 //加整数的目的是消息数量多的时候,解决滚动会出现不到底部,并且抖动的问题
// })
// }).exec();
this.setData({
scrollTop: 1000 * 10 // 这里我们的单对话区域最高1000,取了最大值,应该有方法取到精确的
});
},
//获取输入内容
messageInput: function (e) {
let inputVal = e.detail.value;
this.setData({
messageInputVal: inputVal
})
//this.isShowAddFun();
},
//是否显示添加按钮
isShowAddFun() {
//如果有输入显示发送按钮,隐藏加号添加图片功能
if (this.data.messageInputVal) {
this.setData({
isShowAdd: false
})
} else {
this.setData({
isShowAdd: true
})
}
},
// 提交文字
submitTo: function (inputValue) {
let _this = this;
if (app.globalData.socketTask.readyState == 1) {
// 如果打开了socket就发送数据给服务器
var msg = JSON.stringify({
'cmd': 'onData',
'uid': app.globalData.nyxCode,
'msg': inputValue
})
_this.sendSocketMessage(msg)
}
},
bindKeyInput: function (e) {
this.setData({
inputValue: e.detail.value
})
},
/*
mark: tabbar 切换之后触发onHide()
*/
onHide: function () {
app.closeSocket();
console.log('===onHide WebSocket 连接关闭')
},
// 发送和接收 socket 消息
sendSocketMessage: function (msg) {
let _this = this
return new Promise((resolve, reject) => {
app.sendSocketMessage(msg)
app.globalData.callback = function (res) {
console.log('===webSocket 收到服务器内容: ', res)
resolve(res)
}
})
},
//获取到了socket广播的消息 => 通过userid获取userInfo => 小程序端处理获取到的msg
processData(json) {
var _this = this;
/*
cmd==onOpen, text = "欢迎" + map.uid + "进入竞答游戏"
cmd==onData, text = map.msg
if(chatUserinfo.nickName == app.globalData.userInfo.nickName) 不添加
*/
var text = ""
var nickName = ""
var avater = ""
if (json["cmd"] == "onOpen" || json["cmd"] == "onScore") {
text = " " + _this.data.chatUserInfo.nickName + " " +json["msg"]
nickName = "系统"
avater = "../../icon/mall.png"
}
else if (json["cmd"] == "onData") {
text = json["msg"]
nickName = _this.data.chatUserInfo.nickName
avater = _this.data.chatUserInfo.avatarUrl
}
//表情处理
var reg = /\[.+?\]/g;
let newVal = text.replace(reg, function (a, b) {
return face(a) ? face(a) : a;
});
//回复
let objL = {
nickName: nickName,
type: 'L',
messageType: 'txt',
con: newVal,
avater: avater,
};
let messageArr = [];
//jscat 20200314 most important!
// 判断内容是否显示
// 1. 发送data,同时非自己
// 2. (自己登陆,不需要重复发送),
// 3. (竞答完成后,需要发送内容)
// 4. (别人登陆, 需要发送)
if (
(json["cmd"] == "onData" && _this.data.chatUserInfo.userid != app.globalData.nyxCode)
|| (json["cmd"] == "onOpen" && app.globalData.onOpenOp.key!=true)
|| (json["cmd"] == "onOpen" && _this.data.chatUserInfo.userid != app.globalData.nyxCode)
|| (json["cmd"] == "onScore")
)
{
messageArr.push(objL);
}
if ((json["cmd"] == "onScore" && wx.getStorageSync("sendMsg") != ""))
{
wx.setStorageSync('sendMsg', '');
}
if (json["cmd"] == "onOpen")
{
app.globalData.onOpenOp.key = true;
}
let newMessageArr = _this.data.messageList.concat(messageArr);
//更新数据(模拟请求历史数据)
_this.setData({
messageInputVal: "",
messageList: newMessageArr,
isEmotion: false,
isMedia: false,
})
_this.scrollBottom();
},
})
//通过Promise方式为wx.request添加同步操作
const getData = (url, param) => {
return new Promise((resolve, reject) => {
wx.request({
url: url,
method: 'GET',
data: param,
success(res) {
resolve(res.data)
},
fail(err) {
reject(err)
}
})
})
}
//表情文件
function emotionFun() {
let emoArr = [
{ "name": "Expression_1", "text": "[微笑]" },
{ "name": "Expression_2", "text": "[撇嘴]" },
{ "name": "Expression_3", "text": "[色]" },
{ "name": "Expression_4", "text": "[发呆]" },
{ "name": "Expression_5", "text": "[得意]" },
{ "name": "Expression_6", "text": "[流泪]" },
{ "name": "Expression_7", "text": "[害羞]" },
{ "name": "Expression_8", "text": "[闭嘴]" },
{ "name": "Expression_9", "text": "[睡]" },
{ "name": "Expression_10", "text": "[大哭]" },
{ "name": "Expression_11", "text": "[尴尬]" },
{ "name": "Expression_12", "text": "[发怒]" },
{ "name": "Expression_13", "text": "[调皮]" },
{ "name": "Expression_14", "text": "[呲牙]" },
{ "name": "Expression_15", "text": "[惊讶]" },
{ "name": "Expression_16", "text": "[难过]" },
{ "name": "Expression_17", "text": "[酷]" },
{ "name": "Expression_18", "text": "[冷汗]" },
{ "name": "Expression_19", "text": "[抓狂]" },
{ "name": "Expression_20", "text": "[吐]" },
{ "name": "Expression_21", "text": "[偷笑]" },
{ "name": "Expression_22", "text": "[愉快]" },
{ "name": "Expression_23", "text": "[白眼]" },
{ "name": "Expression_24", "text": "[傲慢]" },
{ "name": "Expression_25", "text": "[饥饿]" },
{ "name": "Expression_26", "text": "[困]" },
{ "name": "Expression_27", "text": "[恐惧]" },
{ "name": "Expression_28", "text": "[流汗]" },
{ "name": "Expression_29", "text": "[憨笑]" },
{ "name": "Expression_30", "text": "[悠闲]" },
{ "name": "Expression_31", "text": "[奋斗]" },
{ "name": "Expression_32", "text": "[咒骂]" },
{ "name": "Expression_33", "text": "[疑问]" },
{ "name": "Expression_34", "text": "[嘘]" },
{ "name": "Expression_35", "text": "[晕]" },
{ "name": "Expression_36", "text": "[疯了]" },
{ "name": "Expression_37", "text": "[衰]" },
{ "name": "Expression_38", "text": "[骷髅]" },
{ "name": "Expression_39", "text": "[敲打]" },
{ "name": "Expression_40", "text": "[再见]" },
{ "name": "Expression_41", "text": "[擦汗]" },
{ "name": "Expression_42", "text": "[抠鼻]" },
{ "name": "Expression_43", "text": "[鼓掌]" },
{ "name": "Expression_44", "text": "[糗大了]" },
{ "name": "Expression_45", "text": "[坏笑]" },
{ "name": "Expression_46", "text": "[左哼哼]" },
{ "name": "Expression_47", "text": "[右哼哼]" },
{ "name": "Expression_48", "text": "[哈欠]" },
{ "name": "Expression_49", "text": "[鄙视]" },
{ "name": "Expression_50", "text": "[委屈]" },
{ "name": "Expression_51", "text": "[快哭了]" },
{ "name": "Expression_52", "text": "[阴险]" },
{ "name": "Expression_53", "text": "[亲亲]" },
{ "name": "Expression_54", "text": "[吓]" },
{ "name": "Expression_55", "text": "[可怜]" },
{ "name": "Expression_56", "text": "[菜刀]" },
{ "name": "Expression_57", "text": "[西瓜]" },
{ "name": "Expression_58", "text": "[啤酒]" },
{ "name": "Expression_59", "text": "[篮球]" },
{ "name": "Expression_60", "text": "[乒乓]" },
{ "name": "Expression_61", "text": "[咖啡]" },
{ "name": "Expression_62", "text": "[饭]" },
{ "name": "Expression_63", "text": "[猪头]" },
{ "name": "Expression_64", "text": "[玫瑰]" },
{ "name": "Expression_65", "text": "[凋谢]" },
{ "name": "Expression_66", "text": "[嘴唇]" },
{ "name": "Expression_67", "text": "[爱心]" },
{ "name": "Expression_68", "text": "[心碎]" },
{ "name": "Expression_69", "text": "[蛋糕]" },
{ "name": "Expression_70", "text": "[闪电]" },
{ "name": "Expression_71", "text": "[炸弹]" },
{ "name": "Expression_72", "text": "[刀]" },
{ "name": "Expression_73", "text": "[足球]" },
{ "name": "Expression_74", "text": "[瓢虫]" },
{ "name": "Expression_75", "text": "[便便]" },
{ "name": "Expression_76", "text": "[月亮]" },
{ "name": "Expression_77", "text": "[太阳]" },
{ "name": "Expression_78", "text": "[礼物]" },
{ "name": "Expression_79", "text": "[拥抱]" },
{ "name": "Expression_80", "text": "[强]" },
{ "name": "Expression_81", "text": "[弱]" },
{ "name": "Expression_82", "text": "[握手]" },
{ "name": "Expression_83", "text": "[胜利]" },
{ "name": "Expression_84", "text": "[抱拳]" },
{ "name": "Expression_85", "text": "[勾引]" },
{ "name": "Expression_86", "text": "[拳头]" },
{ "name": "Expression_87", "text": "[差劲]" },
{ "name": "Expression_88", "text": "[爱你]" },
{ "name": "Expression_89", "text": "[NO]" },
{ "name": "Expression_90", "text": "[OK]" },
{ "name": "Expression_91", "text": "[爱情]" },
{ "name": "Expression_92", "text": "[飞吻]" },
{ "name": "Expression_93", "text": "[跳跳]" },
{ "name": "Expression_94", "text": "[发抖]" },
{ "name": "Expression_95", "text": "[怄火]" },
{ "name": "Expression_96", "text": "[转圈]" },
{ "name": "Expression_97", "text": "[磕头]" },
{ "name": "Expression_98", "text": "[回头]" },
{ "name": "Expression_99", "text": "[跳绳]" },
{ "name": "Expression_100", "text": "[投降]" },
{ "name": "Expression_101", "text": "[激动]" },
{ "name": "Expression_102", "text": "[街舞]" },
{ "name": "Expression_103", "text": "[献吻]" },
{ "name": "Expression_104", "text": "[左太极]" },
{ "name": "Expression_105", "text": "[右太极]" }
];
return emoArr;
}
//表情转换
function face(obj) {
let emotion = emotionFun();
let emotionHost = "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/emoji/";
let face = {};
for (let i = 0; i < emotion.length; i++) {
face[emotion[i].text] = '<img src="' + emotionHost + emotion[i].name + '.png" style="widht:20px;height:20px;vertical-align: middle;"/>'
}
return face[obj];
}
\ No newline at end of file
{
{
"usingComponents": {
"type-cmp": "/components/type/type"
},
"navigationBarTitleText": "让有趣被发现 - 酒肆"
}
\ No newline at end of file
<!--pages/key/key.wxml-->
<!--pages/key/key.wxml-->
<view class="page">
<!-- start key view -->
<view class="weui-cells">
<scroll-view scroll-y="true" style="height:{{keyHeight}}px;position:fixed; top:0;">
<navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/key/matchDaily/matchDaily">
<view class="weui-cell__hd">
<image src="/icon/daily.png" />
</view>
<view class="weui-cell__bd">每日一学</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
<navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/key/matchStudy/matchStudy">
<view class="weui-cell__hd">
<image src="/icon/study.png"/>
</view>
<view class="weui-cell__bd">知识学习</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
</scroll-view>
</view>
<!--end key view -->
<!--公屏view-->
<view style="height:{{chatHeight+40}}px;position:fixed; bottom:0;">
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd">公屏发言</view>
</view>
<scroll-view scroll-y="true" scroll-top="{{scrollTop}}" style="height:{{chatHeight}}px;position:fixed; bottom:0;">
<view class="wrapper {{isShowAdd?'media-padd':''}} {{isEmotion?'emotion-padd':''}}" id="wrapperCon" bindtap="cancelShow" >
<!-- 消息列表 -->
<view class="chat {{item.type=='L'?'chat-l':'chat-r'}}" wx:for="{{messageList}}" wx:for-item="item">
<!-- <view class="c-date">2019年3月23日 15:33</view> -->
<view class="message-list">
<view class="avater {{item.type=='R'?'avater-r':''}}">
<image src='{{item.avater}}'></image>
<view class="{{item.type=='R'?'nick-name-r':'nick-name-l'}}" wx:if="{{item.type=='L'}}">{{item.nickName}}</view>
<view class="{{item.type=='R'?'nick-name-r':'nick-name-l'}}" wx:if="{{item.type=='R'}}">{{item.nickName}}</view>
</view>
<view class="chat-con {{item.type=='L'?'chat-con-l':'chat-con-r'}} ">
<rich-text wx:if="{{item.messageType=='txt'}}" nodes="{{item.con}}"></rich-text>
<image class="message-img" mode="widthFix" bindtap="imagePreview" data-src="{{item.con}}" wx:if="{{item.messageType=='img'}}" src="{{item.con}}"></image>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<!-- 消息输入 -->
<view class="message-input">
<input class="{{isShowAdd?'':'showSend'}}" placeholder="请输入内容" type="text" value="{{messageInputVal}}" cursor-spacing="10" bindinput='messageInput' confirm-type="send" bindconfirm="messageSend" />
<button bindtap="messageSend">发送</button>
<image mode="widthFix" class="input-img {{isShowAdd?'':'showAdd'}}" src='../../icon/chat/face1.png' id="face" bindtap="openEmotion"></image>
<!-- 表情文件 -->
<view class="emotion-box" wx:if="{{isEmotion}}">
<swiper class="home-swiper" indicator-dots="true" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-dots="{{indicatorDots}}">
<swiper-item class="emotion-list">
<block wx:for-items="{{emotionArr}}" wx:key='index' wx:if="{{index<23}}">
<image bindtap="selectEmotion" data-txt="{{item.text}}" src="{{emotionHost+item.name}}.png" class="slide-image" />
</block>
<image src="../../imgs/emotion/delete.png" bindtap="deleteVal" class="slide-image" />
</swiper-item>
<swiper-item class="emotion-list">
<block wx:for-items="{{emotionArr}}" wx:key='index' wx:if="{{index>=23&&index<46}}">
<image bindtap="selectEmotion" data-txt="{{item.text}}" src="{{emotionHost+item.name}}.png" class="slide-image" />
</block>
<image src="../../../icon/chat/delete.png" bindtap="deleteVal" class="slide-image" />
</swiper-item>
<swiper-item class="emotion-list">
<block wx:for-items="{{emotionArr}}" wx:key='index' wx:if="{{index>=46&&index<69}}">
<image bindtap="selectEmotion" data-txt="{{item.text}}" src="{{emotionHost+item.name}}.png" class="slide-image" />
</block>
<image src="../../../icon/chat/delete.png" bindtap="deleteVal" class="slide-image" />
</swiper-item>
<swiper-item class="emotion-list">
<block wx:for-items="{{emotionArr}}" wx:key='index' wx:if="{{index>=69&&index<92}}">
<image bindtap="selectEmotion" data-txt="{{item.text}}" src="{{emotionHost+item.name}}.png" class="slide-image" />
</block>
<image src="../../../icon/chat/delete.png" bindtap="deleteVal" class="slide-image" />
</swiper-item>
</swiper>
</view>
</view>
</view>
.page{
.page{
height: 100vh;
background: #F4F8FB;
}
.weui-cell__hd {
font-size: 0;
}
.weui-cell__hd image {
width: 100rpx;
height: 100rpx;
margin-right: 18px;
margin-left: 5px;
vertical-align: middle;
}
.weui-cell__ft_in-access {
padding-right:13px;
position:relative;
}
.userInfo{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
}
.thumb{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
overflow: hidden;
}
.name{
margin: 30rpx;
}
/* 公屏 */
/*轮播控件 - start*/
.home-swiper {
width: 100%;
height: 400rpx;
}
.slide-image {
width: 100%;
height: 100%;
}
/*轮播控件 - end*/
.wrapper {
padding-top: 20rpx;
padding-bottom: 100rpx;
}
.message-list {
margin: 10rpx 30rpx 30rpx;
}
.chat {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
box-sizing: border-box;
}
.chat-con {
padding: 20rpx;
border-radius: 8rpx;
font-size: 30rpx;
color: #333;
position: relative;
}
/* left-message */
.chat-l {
align-items: flex-start;
}
.avater {
width: 90rpx;
height: 90rpx;
position: relative;
}
.avater>image {
width: 100%;
height: 100%;
display: block;
border-radius: 10%;
}
.chat-con-l {
background-color: #fff;
margin-left: 120rpx;
margin-top: -50rpx;
}
.chat-con-l::after {
content: '';
border-width: 20rpx;
border-style: solid;
border-color: transparent #fff transparent transparent;
position: absolute;
top: 18rpx;
left: -28rpx;
}
/* right-message */
.chat-r {
align-items: flex-end;
}
.chat-con-r {
background-color: #7dca4a;
margin-right: 120rpx;
margin-top: 35rpx;
}
.chat-con-r::after {
content: '';
border-width: 20rpx;
border-style: solid;
border-color: transparent transparent transparent #7dca4a;
position: absolute;
top: 18rpx;
right: -28rpx;
}
.avater-r {
float: right;
}
/* input-message */
.message-input {
position: fixed;
bottom: 0;
width: 100%;
background-color: #efefef;
padding: 20rpx 0 0;
z-index: 99;
}
.message-input>input {
font-size: 30rpx;
border: solid #ddd 1rpx;
width: 71%;
min-height: 60rpx;
height: 100%;
margin-left: 20rpx;
padding: 5rpx 10rpx;
border-radius: 8rpx;
margin-bottom: 15rpx;
color: #333;
background-color: #fff;
}
.showSend{
width:65% !important;
}
.showAdd {
left:73% !important;
}
.message-input>button {
width: 100rpx;
height: 60rpx;
background-color: #7dca4a;
font-size: 28rpx;
color: #fff;
margin-top: -82rpx;
float: right;
margin-right: 20rpx;
padding: 0;
line-height: 60rpx;
}
.input-m {
width: 500rpx;
max-width: 500rpx;
height: 70rpx;
max-height: 70rpx;
border: solid red 1px;
margin-left: 80rpx;
position: relative;
display: inline-block;
top: -80rpx;
overflow-y: scroll;
background-color: #fff;
}
.c-date {
font-size: 26rpx;
color: #999;
padding: 10rpx 0 30rpx;
text-align: center;
width: 100%;
}
.message-input .input-img {
width: 60rpx;
height: 60rpx;
}
#rec {
position: absolute;
top: 26rpx;
left: 10rpx;
}
#face {
position: absolute;
top: 20rpx;
left: 80%;
}
#add {
position: absolute;
top: 20rpx;
left: 90%;
}
.nick-name-l {
position: absolute;
top: -2%;
left: 138%;
z-index: 2;
font-size: 24rpx;
color: #666;
width: 200rpx;
}
.nick-name-r {
position: absolute;
top: -10%;
right: -25%;
z-index: 2;
font-size: 24rpx;
color: #666;
width: 200rpx;
}
.media-img {
width: 120rpx;
height: 120rpx;
display: inline-block;
}
.media-box {
background-color: #f0f0f0;
border-top: solid #e1e1e1 1rpx;
}
.media-list {
width: 150rpx;
height: 150rpx;
padding: 10px;
text-align: center;
display: inline-block;
}
.media-list>view {
font-size: 26rpx;
color: #666;
}
.emotion-box {
background-color: #f0f0f0;
padding-bottom: 40rpx;
border-top: solid #e1e1e1 1rpx;
}
.emotion-list {
margin: 20rpx auto 0;
text-align: center;
}
.emotion-list>image {
width: 55rpx;
height: 55rpx;
margin: 15rpx 30rpx;
}
.emotion-padd {
padding-bottom: 77% !important;
}
.media-padd{
padding-bottom: 42% !important;
}
.message-img {
width: 300rpx;
height: 200rpx;
display: inline-block;
vertical-align: middle;
}
// pages/key/matchDaily/matchDaily.js
// pages/key/matchDaily/matchDaily.js
var item_list = [];
var choiceString = [];
var config=wx.getStorageSync("config");
var app = getApp();
Page({
/**
* 系统配置:主要用于置底页面设置 step1
*/
windowHeight: '',
/**
* 页面的初始数据
*/
data: {
//用户信息初始化
nyxCode: "",
authStatus: "",
userInfo: {},
matchSeason: "", // 学习赛季
matchType: "", // 学习类别
isStudyDone: false, //是否已经完成该项学习
/*
jscat 20200303
注意upload和显示的差异
显示永远是当前题的questionId
而upload永远是下一题的item_index, 正好跟数量对应
也就是show question和comment需要从questionId来获取
*/
/* 问题列表 */
item_list : [],
item_index : 0 , //注意和questionId的差异,指向下一个item的index, 在onTypeNext里增加
score : 0, // 表示回答正确的分数
questionId : 0, //注意和item_index的差异,指向当前题的questionId,在点击onTypeNext之前都出于未保存状态
item_index_done : 0, //表示已经完成的(经过onClick)的题数
/* 某一个问题的当前选项 */
current_item: 10, /* 指向当前button的item */
hidden_type: 1, /* 表明icon的可见程度,0表示可见 1=hidden默认 */
button_disabled : 0, /* 表明button的可用程度, 0表示可用,1表示不可用*/
operateResult: "", // default "/icon/icon_success.png"
/* 数据初始化 */
// answer: 5,
// questionId: "",
// questionName: "",
// choiceString: []
quizResult : {},
/* 评论 */
bGetCommentOp : false,
comment_hidden_type : 1,
commentList : [],
likeDict : {},
inputContentValue: null,
isHideLoadMore: false,
pageIndex: 1, //分页搜索的page index
inputHolderValue : "评论才叫真诚",
inputUseridToValue: "",
inputContentToValue: "",
autoFocus: true, //对话框默认为focus
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
matchSeason: wx.getStorageSync('matchSeason'),
matchType: "daily", // 学习类型
})
}
//随机获取10条数据的id
/**
* 系统配置:主要用于置底页面设置 step2
*/
var windowHeight = wx.getSystemInfoSync().windowHeight;//获取设备高度,小程序自带的方法
this.setData({
windowHeight: windowHeight,
})
/* end */
if (_this.__data__.item_list.length == 0)
{
_this.getRand();
_this.setData({
isStudyDone: false, //每次进来从新操作
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
var _this = this;
let updateStatus = wx.getStorageSync('updateStatus');
if(updateStatus)
{
var score = JSON.stringify({
'cmd': 'onScore',
'uid': app.globalData.nyxCode,
'msg': "完成每日一学,喜提" + _this.data.score + "分"
})
wx.setStorageSync('sendMsg', score);
_this.uploadDaily()
}
wx.setStorageSync('updateStatus', false);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
console.log('页面上拉触底')
var _this = this;
var isHideLoadMore = _this.__data__.isHideLoadMore;
var objectId = _this.__data__.questionId;;//获取index值
var pageIndex = _this.__data__.pageIndex;
//控制逻辑, 在onClick之后或者onGetComment事件之后再允许下拉更新操作
//避免下拉更新发生在之前
var bGetCommentOp = _this.__data__.bGetCommentOp
if (bGetCommentOp == true) {
//判断是否已经全部加载完毕
//没有则加载更多
if (!isHideLoadMore) {
console.log('加载更多')
setTimeout(() => {
_this.getComment(1, pageIndex, 4, objectId);
}, 1000)
}
else {
console.log('没有更多')
}
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/*
* 动态的高亮选中的button
* disable未选中的button
*/
onClick: function (e) {
var _this = this;
let cuu = e.target.id;//获取index值
console.log(cuu);
var operateResult = "";
var answer = _this.__data__.quizResult.answer;
var score = _this.__data__.score;
//拿到已经回答的题目数
var item_index_done = _this.__data__.item_index_done;
if(cuu == answer-1)
{
operateResult = "/icon/icon_success.png"
score = score + 1
}
else{
operateResult = "/icon/icon_fail.png"
}
var selected = parseInt(cuu) + 1
console.log("current choice is: \"" + selected + "\"");
console.log("correct answer is: \"" + answer + "\"");
console.log("current button_disabled is: \"" + 1 + "\"");
//设置为已更新状态
wx.setStorageSync('updateStatus', true)
//优先获取comment
//避免使用onGetComment, 因为此处没有onGetComment的点击事件
var bGetCommentOp = _this.__data__.bGetCommentOp
if (bGetCommentOp == false || bGetCommentOp == undefined) {
//获取第一页数据,每页四条
_this.getComment(0, 1, 4, _this.data.questionId)
}
//ps: jscat 20200303 最后重置状态
_this.setData({
item_index_done: parseInt(item_index_done)+1,
current_item: cuu,
operateResult : operateResult,
hidden_type : 0,
button_disabled : 1,
score : score,
comment_hidden_type : 0, /* 点击按钮之后,评论自动弹出 */
})
},
/* 点击 进入下一题 */
// item_index要增加,需要在进入下一题时候进行
onTypeNext: function (e) {
var _this = this;
//拿到下一个item_index
var current_index = _this.__data__.item_index;
//指向下一题, 获取数据
current_index = current_index + 1
/*
未按下button,在"查看评论"和"隐藏评论"中切换
已按下button,则直接显示评论,同时显示"下一题"
*/
//重置数据状态
_this.setData({
item_index: current_index,
hidden_type: 1,
button_disabled: 0,
current_item: 10, /* 指向当前button的item */
comment_hidden_type: 1, /* 默认隐藏comment */
commentList: [], /* 重置comment列表 */
bGetCommentOp: false,
inputContentValue: "", //清除提交内容
inputHolderValue: "评论才叫真诚",
inputUseridToValue: "",
inputContentToValue: "",
})
//功能实现
//逻辑判断
//超过了10题,溢出了,直接进入doneDaily
if(current_index >= 10)
{
_this.doneDaily()
}
else
{
config.debug==1?console.log("===onTypeNext item_index \"" + current_index + "\""):""
var questionId = _this.__data__.item_list[current_index]
_this.getData(questionId)
}
//载入页面
getCurrentPages()[getCurrentPages().length - 1].onLoad()
},
// 获取随机数据
getRand : function (e) {
var _this = this;
wx.request({
url: config.rand_url,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
console.log(res.data);
var itemList = [];
for (var k = 0; k < res.data.totalCount; k++) {
itemList.push(res.data.data[k].id)
}
item_list = itemList
_this.setData({
item_list: item_list,
item_index: 0 //初始化item_index
})
var wid = itemList[0]
_this.getData(wid)
}
})
},
// 获取真实数据
getData: function (questionId) {
var _this = this;
config.debug==1?console.log("===getData questionId is: \""+questionId+"\""):""
wx.request({
url: config.data_url + '?questionId=' + questionId,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.data.resultCode == 200) {
//表示上传成功(可以在阿里云服务器查看上传的图片)
console.log(res.data);
var result = {}
result["questionId"] = res.data.data["0"].id
result["questionName"] = res.data.data["0"].questionName
result["answer"] = res.data.data["0"].answer
var list = res.data.data["0"].choiceString.split("::")
for (var j = 0; j < list.length; j++) {
var str = "A";
list[j] = (String.fromCharCode(str.charCodeAt()+j)) +". "+ list[j];
}
result["choiceString"] = list
_this.setData({
quizResult : result,
questionId: questionId,
})
}
}
})
},
// 如果完成了10道题
doneDaily: function (res) {
var _this = this
wx.showModal({
title: '恭喜你完成本次学习',
content: '正确率'+_this.__data__.score + '/10',
showCancel: false, // 将cancel按钮disable掉
confirmText: '谢谢老师',
success(res) {
if (res.confirm) {
// 用户点击了确定属性的按钮,于是跳转到tabbar /pages/key/key
// wx.navigateTo 和 wx.redirectto都无法跳转到tabbar
_this.setData({
isStudyDone: true,
item_index : 9,
})
// 基于用户交互原则,不直接跳转到/pages/key/key页面, 让用户自主选择
// wx.switchTab({
// url: '/pages/key/key'
// });
}
}
})
},
// 这题有问题; report bug
onReportBug: function (e) {
var _this = this
/* 调用接口新增bug记录 2019-12-13
通过x-www-form-urlencoded 格式调用,可以兼容swagger的前端请求
*/
config.debug==1?console.log("===onReportBug questionId is: " + _this.__data__.questionId):""
wx.request({
url: config.bug_url,
method: 'POST',
data: {
questionId: _this.__data__.questionId,
userId: _this.__data__.nyxCode, //获取userid
userComment : "格式错误"
},
header: {
"Content-Type": "application/x-www-form-urlencoded",
'Cookie': wx.getStorageSync('cookieKey'),
},
dataType : "json",
success: function (res) {
console.log(res.data);
var score = _this.__data__.score + 1;
//拿到已经回答的题目数
var item_index_done = parseInt(_this.__data__.item_index_done) + 1 //用于更新已完成题数
_this.setData({
score: score,
button_disabled : 1,
item_index_done : item_index_done,
})
config.debug == 1 ? console.log("===onBug score_" + score + "_quizDone_" + item_index_done) : ""
//设置为已更新状态
wx.setStorageSync('updateStatus', true)
/*通过弹窗方式确认 */
// begin showModal
wx.showModal({
title: '谢谢你反馈问题',
content: '此题已判定为正确',
showCancel: false, // 将cancel按钮disable掉
confirmText: '下一题',
success(res) {
if (res.confirm) {
// 用户点击了确定属性的按钮,于是跳转到tabbar /pages/key/key
// wx.navigator 和 wx.redirectto都无法跳转到tabbar
console.log("showModal success");
console.log(res)
}
},
fail: function (res) {
console.log("showModal failed");
console.log(res)
},//接口调用失败的回调函数
complete: function (res) {
console.log("showModal complete");
console.log(res)
},//接口调用结束的回调函数(调用成功、失败都会执行)
}) // end showModal
//载入页面
_this.onTypeNext();
} // end success
}) // end wx.request
console.log("show modal");
},
/*
* 用户自定义函数
* 查看评论
* 输入值为quiz id
* 默认返回5条
*/
// 获取评论 per quiz id
getComment(scrollType, pageNum, pageCount, objectId)
{
var _this = this;
var strUrl = "";
if (pageNum != 0 && pageCount != 0) {
strUrl = config.msg_query_url + "?pageCount=" + pageCount
+ "&pageNum=" + pageNum
+ "&objectId=" + objectId
}
config.debug==1?console.log("===getComment strUrl " + strUrl):""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.data.resultCode == 200) {
//表示查询成功
console.log(res.data);
var list = res.data.data
var bisHideLoadMoreType = false;
if (list.length < pageCount) {
bisHideLoadMoreType = true;
}
//进行翻页设置(加载更多)
if (scrollType == 1) {
var commentList = _this.__data__.commentList;
list = commentList.concat(list)
}
_this.setData({
commentList: list,
isHideLoadMore: bisHideLoadMoreType,
pageIndex: pageNum + 1,
bGetCommentOp: true,
})
}
}
})
},
/*
*/
onGetComment: function (e) {
var _this = this;
var objectId = _this.__data__.questionId;//获取index值
var commentList = _this.__data__.commentList
var bGetCommentOp = _this.__data__.bGetCommentOp
config.debug==1?console.log("===onGetComment objectId is: \"" + objectId + "\""):""
if (bGetCommentOp == false || bGetCommentOp == undefined)
{
//获取第一页数据,每页四条
_this.getComment(0, 1, 4, objectId)
}
_this.setData({
comment_hidden_type: _this.data.comment_hidden_type==1?0:1,
})
},
/*
* 提交评论
*/
submitComment: function (objectId, objectName, useridFrom, useridTo, content, contentTo)
{
var _this = this
var strUrl = config.msg_add_url
config.debug==1?console.log("===submitComment strUrl_" + strUrl + "_objectId_"+objectId
+ "_useridFrom_"+useridFrom
+ "_useridTo_" + useridTo
+ "_content_" + content
+ "_contentTo_" + contentTo
):""
wx.request({
url: strUrl,
method: 'POST',
data: {
commentType: '每日一学',
objectId: objectId,
objectName: objectName,
useridFrom: useridFrom,
useridTo : useridTo,
content :content,
contentTo: contentTo,
},
header: {
"Content-Type": "application/x-www-form-urlencoded",
'Cookie': wx.getStorageSync('cookieKey'),
},
dataType: "json",
success: function (res) {
if (res.data.resultCode == 200) {
//表示提交成功
console.log(res.data);
var list = res.data.data['0']
var commentList = _this.data.commentList
commentList.push(list)
_this.setData({
commentList: commentList,
inputContentValue : "", //清除提交内容
inputHolderValue: "评论才叫真诚" ,
inputUseridToValue: "",
inputContentToValue: "",
})
}
}
})
},
onSubmitComment: function (e) {
var _this = this;
var objectId = _this.__data__.questionId //获取index值
var objectName = _this.__data__.quizResult.questionName //获取index值
let content = e.detail.value.content;//获取评论内容
var useridFrom = _this.__data__.nyxCode;//获取userid
var useridTo = e.detail.value.useridTo;//获取reply id
var contentTo = e.detail.value.contentTo;//获取reply content
if(content != undefined && content != "")
{
_this.submitComment(objectId, objectName, useridFrom, useridTo, content, contentTo)
}
},
/*
* 提交点赞
*/
submitLike:function(commentId)
{
var _this = this;
var strUrl = config.msg_like_url + '?commentId=' + commentId
config.debug==1?console.log("===submitLike strUrl is: " +strUrl):""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.statusCode == 200) {
//表示查询成功
console.log(res.data);
var commentList = _this.data.commentList
var likeDict = _this.data.likeDict
for (var j = 0; j < commentList.length; j++) {
if(commentList[j].commentId == commentId)
commentList[j].numLike = parseInt(commentList[j].numLike) + 1
likeDict[commentId] = 1
}
_this.setData({
likeDict: likeDict,
commentList : commentList,
})
}
}
})
},
onSubmitLike: function (e) {
var _this = this;
let commentId = e.currentTarget.dataset.commentId;//获取评论内容
var useridFrom = _this.__data__.nyxCode;//获取userid
var likeDict = _this.__data__.likeDict;//获取userid
if(likeDict[commentId] == 0 || likeDict[commentId] == undefined)
{
_this.submitLike(commentId)
}
},
/*
* 回复里@某人
* 先通过dataset的方式将数据存入setData
* 然后通过前端的hidden input存入具体的值
* 最后在onSubmitComment里同过e.detail.value获取
*/
onReplyUser : function (e)
{
var _this = this;
let nickname = e.currentTarget.dataset.nickname; //获取nickname的值
let useridTo = e.currentTarget.dataset.userid; //获取useridTo的值
let contentTo = e.currentTarget.dataset.contentTo; //获取contentTo的值
_this.setData({
inputHolderValue: "@" + nickname,
inputUseridToValue: useridTo,
inputContentToValue: contentTo,
autoFocus: true,
})
},
onCancelReply: function (e) {
var _this = this;
var content = e.detail.value
if (content == "" && _this.__data__.inputUseridToValue != "")
{
this.setData({
inputHolderValue: "评论才叫真诚",
inputUseridToValue: "",
inputContentToValue: "",
});
}
},
/*
更新daily的记录到tbl_match表
*/
uploadDaily: function(e){
var _this = this;
var strUrl = config.match_add_item_url
var quizIndex = _this.data.item_index_done
var score = _this.data.score
config.debug == 1?console.log("===upload strUrl "+strUrl+"_quizIndex_"+quizIndex+"_socre_"+score):""
wx.request({
url: strUrl,
method: 'POST',
data: {
matchSeason: _this.data.matchSeason,
matchType: _this.data.matchType,
matchTeam: _this.data.nyxCode,
matchScore: _this.data.score,
teamType: "blue",
matchResult: _this.data.item_index_done==10 ? 1 : 0, //item_index永远指向下一题
quizIndex : _this.data.item_index_done, //已完成的quiz数目, 范围是1...10
rankScore: _this.data.score,
},
header: {
"Content-Type": "application/x-www-form-urlencoded",
'Cookie': wx.getStorageSync('cookieKey'),
},
dataType: "json",
success: function (res) {
if (res.statusCode == 200) {
//表示提交成功
console.log("成绩记录成功");
}
}
})
},
})
\ No newline at end of file
{
{
"usingComponents": {},
"navigationBarTitleText": "每日一学"
}
\ No newline at end of file
<!--pages/key/matchTest/matchTest.wxml-->
<!--pages/key/matchTest/matchTest.wxml-->
<wxs module="tutil" src="./../../../utils/date.wxs"></wxs>
<view class="page bottom_fixed_page" style="min-height:{{ windowHeight }}px">
<view class="weui-flex">
<view class="weui-flex__item"><view class="placeholder">题目:{{item_index+1}}/10题</view></view>
<view class="weui-flex__item"><view class="placeholder">分数:{{score}}</view></view>
</view>
<view class="weui-loadmore" hidden="{{!isStudyDone}}">
<view class="weui-loadmore__tips">好牛哦, 恭喜你已完成本次学习 {{'>'}}_{{'<'}} </view>
</view>
<view hidden="{{isStudyDone}}"> <!-- start of isStudyDone flag -->
<view class="page__hd">
<!-- 标题 -->
<view class="page__desc">{{quizResult.questionName}}</view>
</view>
<view class="page__bd " wx:for-items="{{quizResult.choiceString}}" >
<button class="weui-btn button-sp-area {{current_item == index?'btn-selected':'btn-not-selected'}}" bind:tap="onClick" disabled="{{button_disabled==1?true:false}}" id="{{index}}">
<image src="{{operateResult}}" style="vertical-align:middle;width:60rpx;height:60rpx" hidden="{{hidden_type==1?true:(current_item == index?false:true)}}" />
{{item}}
</button>
</view>
<view class="page__hd" hidden="{{button_disabled==0}}">
<!-- 优化: 直接显示正确答案 -->
<view class="page__desc">推荐答案: {{tutil.formatAnswer(quizResult.answer)}}</view>
</view>
<!-- <text>\n</text> -->
<view class="weui-flex">
<view class="weui-flex__item" bindtap="{{button_disabled==0?'onGetComment':'onTypeNext'}}">
<view class="placeholder-button">
<image src="{{button_disabled==0?(comment_hidden_type==1?'/icon/matchDaily/checkComment.png':'/icon/matchDaily/checkComment.png'):'/icon/matchDaily/next.png'}}" style="vertical-align:middle;width:60rpx;height:60rpx" />
{{button_disabled==0?(comment_hidden_type==1?"查看评论":"隐藏评论"):"下一题"}}</view>
</view>
<view class="weui-flex__item"><view class="{{button_disabled==0?'placeholder-button':'placeholder-button-disabled'}}" bind:tap="onReportBug">
<image src="{{button_disabled==0?'/icon/matchDaily/question.png':'/icon/matchDaily/question_0.png'}}" style="vertical-align:middle;width:60rpx;height:60rpx" />这题有问题</view>
</view>
</view>
<!-- 评论区 -->
<view class="page__bd" hidden="{{comment_hidden_type==1?true:false}}">
<view class="weui-panel weui-panel_access" wx:for="{{commentList}}" wx:key="commentList">
<view class="weui-panel__bd weui-media-box weui-media-box_appmsg" bind:tap="onReplyUser" data-nickname="{{item.nicknameFrom}}" data-userid="{{item.useridFrom}}" data-content-to="{{item.content}}">
<view class="weui-media-box__hd weui-media-box__hd_in-appmsg">
<image class="weui-media-box__thumb" src="{{item.avatarUrlFrom}}" />
</view>
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell" style="height:20rpx;text-align:left;padding-left:0rpx;margin:0rpx">
<view class="weui-cell__bd" style="text-align:left;padding:rpx;margin:0rpx">
<!-- start id+日期 -->
<view class="workbench">
<view class="items weui-media-box__desc">
<text>{{item.nicknameFrom}}</text>
<text class="bottom">{{tutil.formatDate_ymd(item.createDatetime)}}</text>
</view>
</view>
<!-- end id+date -->
</view>
<!-- start 点赞数 + 图标 -->
<view class="weui-media-box__desc" style="font-size:30rpx">
{{item.numLike}}
<view bindtap="onSubmitLike" data-comment-id="{{item.commentId}}">
<image src="/icon/matchDaily/like.png" style="width:30rpx;height:30rpx" />
</view>
</view>
<!-- end 点赞数 + 图标 -->
</view>
</view>
<view class="weui-media-box__desc">{{item.nicknameTo==null?"":"@"+item.nicknameTo+" "}}{{item.content}}</view>
</view>
</view>
</view>
<view class="weui-loadmore" hidden="{{isHideLoadMore}}">
<view class="weui-loading"></view>
<view class="weui-loadmore__tips">正在加载</view>
</view>
<view class="weui-loadmore" hidden="{{!isHideLoadMore}}">
<view class="weui-loadmore__tips">没有更多啦 {{'>'}}_{{'<'}} </view>
</view>
<!-- <view class="page__bd page__bd_spacing text-align: center;" style="text-align: center;">
-- the end --
</view> -->
<!-- 评论栏置底 -->
<view class="page__hd bottom_fixed_view" style="position:fixed; bottom:0;width: 750rpx;">
<view class="weui-panel weui-panel_access">
<view class="weui-panel__ft">
<form catchsubmit="onSubmitComment" >
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd">
<input class="weui-input" type="text" name="content" focus="{{autoFocus}}" value='{{inputContentValue}}' pattern="" placeholder="{{inputHolderValue}}" bindblur="onCancelReply" />
<input type="text" style="display:none" name="useridTo" value='{{inputUseridToValue}}'/>
<input type="text" style="display:none" name="contentTo" value='{{inputContentToValue}}'/>
</view>
<view class="weui-cell__ft">
<button type="default" formType="submit">发送</button>
</view>
</view>
</form>
</view>
</view>
</view>
</view>
</view> <!-- end of isStudyDone flag -->
</view>
page{background-color:#EDEDED;}
page{background-color:#EDEDED;}
.button-sp-area{
margin-top: 20rpx; /* 用于表示button与button之间的间隔 */
padding-top: 0px;
margin-left: 0rpx;
padding-left: 100rpx;
text-align:left;
line-height: 60rpx; /*缩小行间距 */
font-size: 40rpx;
}
.mini-btn{
margin: 0 4px;
}
.btn-selected{
/* background-color: #ffffff; */
color: rgb(105, 72, 16);
border-color: #00ff00;
border-style:solid;
border-width:2px;
}
.btn-not-selected{
/* background-color: #111111; */
color: rgb(105, 72, 16);
}
.icon-success{
color: greenyellow;
size: 21px;
margin-top: 20rpx; /* 用于表示button与button之间的间隔 */
}
.icon-cancel{
color: red;
size: 21px;
margin-top: 20rpx; /* 用于表示button与button之间的间隔 */
}
.text{
font-size: 6px;
line-height: 0.5em;
}
.container {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
width: 100%;
line-height: 80rpx;
height: 100rpx;
}
.left {
color: #888;
}
.right {
color: #ff0000;
}
.placeholder{
margin: 5px;
padding: 0 10px;
text-align: center;
background-color: #F7F7F7;
height: 2.3em;
line-height: 2.3em;
color: rgba(0,0,0,.3);
}
.placeholder-button{
margin: 5px;
padding: 0 10px;
text-align: center;
background-color: #F7F7F7;
height: 2.3em;
line-height: 2.3em;
color: rgba(198, 133, 36);
font-size: 35rpx;
font-weight: bold;
}
.placeholder-button-disabled{
margin: 5px;
padding: 0 10px;
text-align: center;
background-color: #F7F7F7;
height: 2.3em;
line-height: 2.3em;
color: rgba(0,0,0,.3);
font-size: 35rpx;
font-weight: bold;
pointer-events: none;
}
/**
* 系统配置:主要用于置底页面设置 step3
*/
.bottom_fixed_page{
position: relative;
padding-bottom: 56px; /* 需要定位的盒子的高度 */
box-sizing: border-box;
}
.bottom_fixed_view {
position: fixed;
bottom:0;
}
/*
id+date css
*/
.workbench{
font-size: 25rpx;
padding-bottom: 0rpx;
margin-bottom: 0rpx;
}
.workbench .items{
width: 200rpx;
flex:1;
text-align: left;
}
.workbench .items text{
display: block;
text-align: left;
margin-top: 0rpx;
margin-bottom: 0rpx;
}
.workbench .items text.bottom{
font-size: 25rpx;
display: block;
text-align: left;
margin-top: 3rpx;
}
/* end */
/* 加载更多 */
.weui-loading {
margin: 0 5px;
width: 20px;
height: 20px;
display: inline-block;
vertical-align: middle;
-webkit-animation: weuiLoading 1s steps(12, end) infinite;
animation: weuiLoading 1s steps(12, end) infinite;
background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;
background-size: 100%;
}
.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;
}
// pages/key/matchStudy/matchStudy.js
// pages/key/matchStudy/matchStudy.js
var config = wx.getStorageSync("config");
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
//用户信息初始化
nyxCode: "",
authStatus: "",
userInfo: {},
matchSeason: "", // 学习赛季
studyResult: {
"wset1" : "0",
"wset2": "0",
"wset3": "0",
"wset4": "0",
"wine": "0",
"whisky": "0",
"sake": "0",
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
matchSeason: wx.getStorageSync('matchSeason'),
matchType: "daily", // 学习类型
})
}
/**
* 系统配置:主要用于置底页面设置 step2
*/
var windowHeight = wx.getSystemInfoSync().windowHeight;//获取设备高度,小程序自带的方法
this.setData({
windowHeight: windowHeight
})
/* end */
//tips:每次进入都重新更新
var matchSeason = _this.data.matchSeason
var nyxCode = _this.data.nyxCode
_this.getMatchRank(matchSeason, nyxCode);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
var _this = this;
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
// 用户自定义函数
// 获取真实数据
getMatchRank: function (matchSeason, matchTeam) {
var _this = this;
var strUrl = config.match_rank_query_url + '?matchSeason=' + matchSeason + '&matchTeam=' + matchTeam
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.data.resultCode == 200) {
//表示上传成功(可以在阿里云服务器查看上传的图片)
console.log(res.data);
var result = _this.data.studyResult
var list = res.data.data
for (var j = 0; j < list.length; j++) {
var matchType = list[j].matchType
result[matchType] = list[j].ratioFinish == null ? 0 : list[j].ratioFinish
}
wx.setStorageSync('studyResult', result)
_this.setData({
studyResult: result,
})
}
}
})
},
})
\ No newline at end of file
{
{
"usingComponents": {},
"navigationBarTitleText": "知识学习"
}
\ No newline at end of file
<!--pages/key/matchStudy/matchStudy.wxml-->
<!--pages/key/matchStudy/matchStudy.wxml-->
<wxs module="tutil" src="../../../utils/date.wxs"></wxs>
<view class="page">
<view class="workbench">
<text class="title">认证</text>
<view class="list">
<view class="items">
<text>Level-1</text>
<navigator url="matchStudyDetail/matchStudyDetail?studyType=wset1">
<image src="/icon/study/wset2.jpg"></image>
</navigator>
<text>已完成 {{tutil.toFix(studyResult.wset1)}}%</text>
</view>
<view class="items">
<text>Level-2</text>
<navigator url="matchStudyDetail/matchStudyDetail?studyType=wset2">
<image src="/icon/study/wset2.jpg"></image>
</navigator>
<text>已完成 {{tutil.toFix(studyResult.wset2)}}%</text>
</view>
<view class="items">
<text>Level-3</text>
<navigator url="matchStudyDetail/matchStudyDetail?studyType=wset3">
<image src="/icon/study/wset2.jpg"></image>
</navigator>
<text>已完成 {{tutil.toFix(studyResult.wset3)}}%</text>
</view>
<view class="items">
<text>Level-4</text>
<navigator url="matchStudyDetail/matchStudyDetail?studyType=wset4">
<image src="/icon/study/wset2.jpg"></image>
</navigator>
<text>已完成 {{tutil.toFix(studyResult.wset4)}}%</text>
</view>
</view>
</view>
<view class="workbench">
<text class="title">品类</text>
<view class="list">
<view class="items">
<text class="top">红酒</text>
<navigator url="matchStudyDetail/matchStudyDetail?studyType=wine">
<image src="/icon/study/wine.png"></image>
</navigator>
<text class="bottom">已完成 {{tutil.toFix(studyResult.wine)}}%</text>
</view>
<view class="items">
<text >威士忌</text>
<navigator url="matchStudyDetail/matchStudyDetail?studyType=whisky">
<image src="/icon/study/whisky.png"></image>
</navigator>
<text >已完成 {{tutil.toFix(studyResult.whisky)}}%</text>
</view>
</view>
<text>\n</text>
<view class="list">
<!-- start view -->
<view class="items">
<text class="top">清酒</text>
<navigator url="matchStudyDetail/matchStudyDetail?studyType=sake">
<image src="/icon/study/sake.png"></image>
</navigator>
<text class="bottom">已完成 {{tutil.toFix(studyResult.wine)}}%</text>
</view>
<!-- end view -->
<!-- start view -->
<view class="items">
<text class="top">精酿</text>
<navigator url="matchStudyDetail/matchStudyDetail?studyType=beer">
<image src="/icon/study/beer.png"></image>
</navigator>
<text class="bottom">已完成 {{tutil.toFix(studyResult.wine)}}%</text>
</view>
<!-- end view -->
</view>
</view>
</view>
.workbench{
.workbench{
font-size: 30rpx;
background: #fff;
padding-bottom: 30rpx;
margin-bottom:10rpx;
color: #333;
}
.workbench .title{
font-size: 35rpx;
padding: 20rpx 20rpx;
margin-bottom: 40rpx;
display: block;
}
.workbench .items{
width: 100rpx;
flex:1;
text-align: center;
}
.workbench .items image{
width: 100rpx;
height: 100rpx;
}
.workbench .items image.service-icon{
width: 50rpx;
height: 50rpx;
}
.workbench .items text{
display: block;
text-align: center;
margin-top: 0rpx;
margin-bottom: 0rpx;
}
.workbench .items text.top{
display: block;
text-align: center;
margin-bottom: 0rpx;
}
.workbench .items text.bottom{
display: block;
text-align: center;
margin-top: 0rpx;
}
.workbench .list{
display: flex;
flex-direction: row;
flex:1;
}
/* end */
\ No newline at end of file
// pages/key/matchStudy/matchStudyDetail/matchStudyDetail.js
// pages/key/matchStudy/matchStudyDetail/matchStudyDetail.js
var config=wx.getStorageSync("config");
var app=getApp();
Page({
/**
* 系统配置:主要用于置底页面设置 step1
*/
windowHeight: '',
/**
* 页面的初始数据
*/
data: {
//用户信息初始化
nyxCode: "",
authStatus: "",
userInfo: {},
matchSeason: "", // 学习赛季
studyType : "",
/* study 相关 */
/* 学习状态 */
studyStatus :
{
init_score : "0", //初始值,用于计算本次学习的题目数量
total_score : "0", // 已学习的题目数量
total_quiz : "0", // 某一类match_type的总的题目数量
},
isQuizReady : false, //如果该类题目的总数量为0, 则显示此view
isStudyDone : false, //是否已经完成该项学习
studyResult: {
"wset1": "0",
"wset2": "0",
"wset3": "0",
"wset4": "0",
"wine": "0",
"whisky": "0",
"sake": "0",
},
rankList : [],
/*
jscat 20200303
注意upload上传数据和显示数据的差异
显示永远是当前题的questionId,在onClick之前都是未完成状态
而upload永远是OnClick之后的已完成的题的questionId_done
也就是show question和comment需要从questionId来获取
而upload保存的时候需要从questionId_done来获取
此questionId还不能从item_list和item_index来获取,因为获取后10题的时候,item_list也已经随之改变了
*/
/* 问题列表 */
item_list : [],
item_index : 0 ,
score : 0,
questionId : 0, //当前的questionId, 未完成
questionId_done : 0, //上一个questionId, 已完成,用于保存学习状态
/* 某一个问题的当前选项 */
current_item: 10, /* 指向当前button的item */
hidden_type: 1, /* 表明icon的可见程度,0表示可见 1=hidden默认 */
button_disabled : 0, /* 表明button的可用程度, 0表示可用,1表示不可用*/
operateResult : "/icon/icon_success.png",
/* 数据初始化 */
// answer: 5,
// questionId: "",
// questionName: "",
// choiceString: []
quizResult : {},
/* 评论 */
bGetCommentOp : false,
comment_hidden_type : 1,
commentList : [],
likeDict : {},
inputContentValue: null,
isHideLoadMore: false,
pageIndex: 1, //分页搜索的page index
inputHolderValue : "评论才叫真诚",
inputUseridToValue: "",
inputContentToValue: "",
autoFocus: true, //对话框默认为focus
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
matchSeason: wx.getStorageSync('matchSeason'),
})
}
var studyType = _this.data.studyType
if(studyType == "")
{
studyType = options.studyType;
}
wx.setNavigationBarTitle({
title: "知识学习-" + studyType,
})
/**
* 系统配置:主要用于置底页面设置 step2
*/
var windowHeight = wx.getSystemInfoSync().windowHeight;//获取设备高度,小程序自带的方法
this.setData({
windowHeight: windowHeight,
studyType: studyType,
})
/* end */
//如果未拿到数据
if (_this.__data__.item_list.length == 0) {
// 获取总的学习状态: 比如wset2 题目 1/10 表示 已完成/总题数
// 从tbl_match_rank读取, 需要先运行genMatchRank
var matchSeason = _this.data.matchSeason
var nyxCode = _this.data.nyxCode
_this.getStudyStatus(matchSeason, studyType, nyxCode);
// 获取学习的题目, 需要从tbl_match读取
_this.getStudyQuiz(matchSeason, studyType, nyxCode, 0);
wx.setStorageSync('updateStatus', false);
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
var _this = this;
let updateStatus = wx.getStorageSync('updateStatus');
if (updateStatus) {
var score = parseInt(_this.data.studyStatus.total_score) - parseInt(_this.data.studyStatus.init_score)
var sendMsg = JSON.stringify({
'cmd': 'onScore',
'uid': app.globalData.nyxCode,
'msg': "完成" + _this.data.studyType + "栏目,喜提" + score + "分"
})
wx.setStorageSync('sendMsg', sendMsg);
_this.uploadStudy()
}
wx.setStorageSync('updateStatus', false);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
console.log('页面上拉触底')
var _this = this;
var isHideLoadMore = _this.__data__.isHideLoadMore;
var objectId = _this.__data__.questionId;;//获取当前questionId的值,未完成的题
var pageIndex = _this.__data__.pageIndex;
//控制逻辑, 在onClick之后或者onGetComment事件之后再允许下拉更新操作
//避免下拉更新发生在之前
var bGetCommentOp = _this.__data__.bGetCommentOp
if (bGetCommentOp == true) {
//判断是否已经全部加载完毕
//没有则加载更多
if (!isHideLoadMore) {
console.log('加载更多')
setTimeout(() => {
_this.getComment(1, pageIndex, 4, objectId);
}, 1000)
}
else {
console.log('没有更多')
}
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/*
* 动态的高亮选中的button
* disable未选中的button
* 点击选项说明已经学习完该题
*/
onClick: function (e) {
var _this = this;
let cuu = e.target.id;//获取index值
console.log(cuu);
var operateResult = "";
var answer = _this.__data__.quizResult.answer;
var score = _this.__data__.score;
var questionId_done = _this.__data__.questionId; //如果点击, 则默认此题已学习完毕
var studyStatus = _this.__data__.studyStatus;
studyStatus.total_score = parseInt(studyStatus.total_score) + 1 //同时总的学习题数+1
if(cuu == answer-1)
{
operateResult = "/icon/icon_success.png"
score = score + 1
}
else{
operateResult = "/icon/icon_fail.png"
}
var selected = parseInt(cuu) + 1
console.log("current choice is: \"" + selected + "\"");
console.log("correct answer is: \"" + answer + "\"");
console.log("current button_disabled is: \"" + 1 + "\"");
//设置为已更新状态
wx.setStorageSync('updateStatus', true)
//优先获取comment
//避免使用onGetComment, 因为此处没有onGetComment的点击事件
var bGetCommentOp = _this.__data__.bGetCommentOp
if (bGetCommentOp == false) {
//获取第一页数据,每页四条
_this.getComment(0, 1, 4, _this.data.questionId)
}
//ps: jscat 20200303 最后重置状态
_this.setData({
questionId_done: questionId_done, //用于存储题号 select * from tbl where id > questionId_done;
current_item: cuu,
operateResult: operateResult,
hidden_type: 0,
button_disabled: 1,
score: score,
comment_hidden_type: 0, /* 点击按钮之后,评论自动弹出 */
studyStatus: studyStatus, //用于本地更新学习成绩
})
},
/* 点击 进入下一题 */
// item_index要增加,需要在进入下一题时候进行
onTypeNext: function (e) {
var _this = this;
//拿到当前的index
var current_index = _this.__data__.item_index;
var button_disabled = _this.__data__.button_disabled;
var matchSeason = _this.__data__.matchSeason
var studyType = _this.__data__.studyType
var matchTeam = _this.__data__.nyxCode
//将指针指向下一题,与questionId对应
current_index = current_index + 1
/*
未按下button,在"查看评论"和"隐藏评论"中切换
已按下button,则直接显示评论,同时显示"下一题"
*/
//具体功能实现
//首先重置数据状态
_this.setData({
item_index: current_index, //已经指向下一题
hidden_type: 1,
button_disabled: 0,
current_item: 10, /* 指向当前button的item */
comment_hidden_type: 1, /* 默认隐藏comment */
commentList: [],
bGetCommentOp: false,
inputContentValue: "", //清除提交内容
inputHolderValue: "评论才叫真诚",
inputUseridToValue: "",
inputContentToValue: "",
})
// 如果已完成所有的题目
// 判断: 当前获取的题目length<10, 比如只有5个
// 而指向下一题current_index的已经=5,则表明所有题目都已经学习完毕
if (_this.__data__.item_list.length < 10 && current_index >= _this.__data__.item_list.length)
{
config.debug==1?console.log("=== length_"+_this.__data__.item_list.length+"_item_index"+current_index):""
_this.doneStudy()
}
else
{
//如果超过了10题, 重置数据, 重新获取数据
//说明当前十组题回答完毕了
//获取下10题 (current_index from [0...9])
if (current_index >= 10)
{
var questionId_done = _this.__data__.questionId_done
_this.getStudyQuiz(matchSeason, studyType, matchTeam, questionId);
}
else //继续获取下一题
{
var questionId = _this.__data__.item_list[current_index]
_this.getData(questionId)
}
}
//载入页面
getCurrentPages()[getCurrentPages().length - 1].onLoad()
},
// 获取学习部分的Quiz
getStudyQuiz: function (matchSeason, studyType, matchTeam, quizId) {
var _this = this;
var strUrl = config.quiz_study_query_url + '?matchSeason=' + matchSeason + '&matchType=' + studyType
+ '&matchTeam=' + matchTeam + '&quizId=' + quizId
config.debug==1?console.log("===getStudyQuiz strUrl_" +strUrl):""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
console.log(res.data);
var itemList = [];
for (var k = 0; k < res.data.totalCount; k++) {
itemList.push(res.data.data[k].id)
}
_this.setData({
item_list: itemList,
item_index: 0, //默认从0开始
})
var wid = itemList[0]
if(wid!= null)
{
_this.getData(wid)
}
}
})
},
// 获取真实数据
getData: function (questionId) {
var _this = this;
var strUrl = config.data_url + '?questionId=' + questionId
config.debug==1?console.log("===getData strUrl_"+strUrl):""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.data.resultCode == 200) {
//表示查询成功
console.log(res.data);
var result = {}
result["questionId"] = res.data.data["0"].id
result["questionName"] = res.data.data["0"].questionName
result["answer"] = res.data.data["0"].answer
var list = res.data.data["0"].choiceString.split("::")
for (var j = 0; j < list.length; j++) {
var str = "A";
list[j] = (String.fromCharCode(str.charCodeAt()+j)) +". "+ list[j];
}
result["choiceString"] = list
_this.setData({
quizResult : result,
questionId: questionId,
})
}
}
})
},
// 如果完成了学习
doneStudy: function (res) {
var _this = this
wx.showModal({
title: '恭喜你完成该项学习',
content: '正确率'+_this.__data__.score + '/10',
showCancel: false, // 将cancel按钮disable掉
confirmText: '谢谢老师',
success(res) {
if (res.confirm) {
// 用户点击了确定属性的按钮,于是跳转到tabbar /pages/key/key
// wx.navigateTo 和 wx.redirectto都无法跳转到tabbar
_this.setData({
isStudyDone: _this.data.isQuizReady==true ? true: false,
})
// 基于用户交互原则,不直接跳转到/pages/key/key页面, 让用户自主选择
// wx.switchTab({
// url: '/pages/key/key'
// });
}
}
})
},
// 这题有问题; report bug
onReportBug: function (e) {
var _this = this
/* 调用接口新增bug记录 2019-12-13
通过x-www-form-urlencoded 格式调用,可以兼容swagger的前端请求
*/
var questionId = _this.__data__.questionId
config.debug == 1 ? console.log("===onReportBug strUrl_" + config.bug_url + "_id_" + questionId):""
wx.request({
url: config.bug_url,
method: 'POST',
data: {
questionId: _this.__data__.questionId,
userId: _this.__data__.nyxCode, //获取userid
userComment : "格式错误"
},
header: {
"Content-Type": "application/x-www-form-urlencoded",
'Cookie': wx.getStorageSync('cookieKey'),
},
dataType : "json",
success: function (res) {
var score = parseInt(_this.__data__.score) + 1;
var studyStatus = _this.__data__.studyStatus;
studyStatus.total_score = parseInt(studyStatus.total_score) + 1 //同时总的学习题数+1
_this.setData({
score: score, //更新正确得分
button_disabled : 1,
questionId_done: questionId, //用于存储已完成题号 select * from tbl where id > questionId_done;
studyStatus: studyStatus, //用于更新已完成题数
})
config.debug == 1 ? console.log("===onBug score_" + score + "_idDone_" + questionId + "_total_score_" + studyStatus.total_score):""
//设置为已更新状态
wx.setStorageSync('updateStatus', true)
/*通过弹窗方式确认 */
// begin showModal
wx.showModal({
title: '谢谢你反馈问题',
content: '此题已判定为正确',
showCancel: false, // 将cancel按钮disable掉
confirmText: '下一题',
success(res) {
if (res.confirm) {
// 用户点击了确定属性的按钮,于是跳转到tabbar /pages/key/key
// wx.navigator 和 wx.redirectto都无法跳转到tabbar
console.log("showModal success");
console.log(res)
}
},
fail: function (res) {
console.log("showModal failed");
console.log(res)
},//接口调用失败的回调函数
complete: function (res) {
console.log("showModal complete");
console.log(res)
},//接口调用结束的回调函数(调用成功、失败都会执行)
}) // end showModal
//载入页面
_this.onTypeNext();
} // end success
}) // end wx.request
console.log("show modal");
},
/*
* 用户自定义函数
* 查看评论
* 输入值为quiz id
* 默认返回5条
*/
// 获取评论 per quiz id
getComment(scrollType, pageNum, pageCount, objectId)
{
var _this = this;
var strUrl = "";
if (pageNum != 0 && pageCount != 0) {
strUrl = config.msg_query_url + "?pageCount=" + pageCount
+ "&pageNum=" + pageNum
+ "&objectId=" + objectId
}
config.debug==1?console.log("===getComment strUrl_" + strUrl):1
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.data.resultCode == 200) {
//表示查询成功
console.log(res.data);
var list = res.data.data
var bisHideLoadMoreType = false;
if (list.length < pageCount) {
bisHideLoadMoreType = true;
}
//进行翻页设置(加载更多)
if (scrollType == 1) {
var commentList = _this.__data__.commentList;
list = commentList.concat(list)
}
_this.setData({
commentList: list,
isHideLoadMore: bisHideLoadMoreType,
pageIndex: pageNum + 1,
bGetCommentOp: true,
})
}
}
})
},
onGetComment: function (e) {
var _this = this;
var objectId = _this.__data__.questionId;//获取index值
var commentList = _this.__data__.commentList
var bGetCommentOp = _this.__data__.bGetCommentOp
config.debug==1?console.log("===onGetComment objectId is_" + objectId):""
if (bGetCommentOp == false || bGetCommentOp == undefined)
{
//获取第一页数据,每页四条
_this.getComment(0, 1, 4, objectId)
}
_this.setData({
comment_hidden_type: _this.data.comment_hidden_type == 1 ? 0 : 1,
})
},
/*
* 提交评论
*/
submitComment: function (objectId, objectName, useridFrom, useridTo, content, contentTo)
{
var _this = this
var strUrl = config.msg_add_url
config.debug == 1 ? console.log("===submitComment strUrl_" + strUrl + "_objectId_" + objectId
+ "_useridFrom_" + useridFrom
+ "_useridTo_" + useridTo
+ "_content_" + content
+ "_contentTo_" + contentTo
) : ""
wx.request({
url: strUrl,
method: 'POST',
data: {
commentType: '知识学习',
objectId: objectId,
objectName: objectName,
useridFrom: useridFrom,
useridTo : useridTo,
content :content,
contentTo: contentTo,
},
header: {
"Content-Type": "application/x-www-form-urlencoded",
'Cookie': wx.getStorageSync('cookieKey'),
},
dataType: "json",
success: function (res) {
if (res.data.resultCode == 200) {
//表示提交成功
console.log(res.data);
var list = res.data.data['0']
var commentList = _this.data.commentList
commentList.push(list)
_this.setData({
commentList: commentList,
inputContentValue: "", //清除提交内容
inputHolderValue: "评论才叫真诚",
inputUseridToValue: "",
inputContentToValue: "",
})
}
}
})
},
onSubmitComment: function (e) {
var _this = this;
var objectId = _this.__data__.questionId //获取index值
var objectName = _this.__data__.quizResult.questionName //获取index值
let content = e.detail.value.content;//获取评论内容
var useridFrom = _this.__data__.nyxCode;//获取userid
var useridTo = e.detail.value.useridTo;//获取评论内容
var contentTo = e.detail.value.contentTo;//获取reply content
if(content != undefined && content != "")
{
_this.submitComment(objectId, objectName, useridFrom, useridTo, content, contentTo)
}
},
/*
* 提交点赞
*/
submitLike:function(commentId)
{
var _this = this;
var strUrl = config.msg_like_url + '?commentId=' + commentId
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.statusCode == 200) {
//表示查询成功
console.log(res.data);
var commentList = _this.data.commentList
var likeDict = _this.data.likeDict
for (var j = 0; j < commentList.length; j++) {
if(commentList[j].commentId == commentId)
commentList[j].numLike = parseInt(commentList[j].numLike) + 1
likeDict[commentId] = 1
}
_this.setData({
likeDict: likeDict,
commentList : commentList,
})
}
}
})
},
onSubmitLike: function (e) {
var _this = this;
let commentId = e.currentTarget.dataset.commentId;//获取评论内容
var useridFrom = _this.__data__.nyxCode;//获取userid
var likeDict = _this.__data__.likeDict;//获取userid
if(likeDict[commentId] == 0 || likeDict[commentId] == undefined)
{
_this.submitLike(commentId)
}
},
/*
* 回复里@某人
*/
onReplyUser : function (e)
{
var _this = this;
let nickname = e.currentTarget.dataset.nickname; //获取nickname的值
let useridTo = e.currentTarget.dataset.userid; //获取useridTo的值
let contentTo = e.currentTarget.dataset.contentTo; //获取contentTo的值
_this.setData({
inputHolderValue: "@" + nickname,
inputUseridToValue: useridTo,
inputContentToValue: contentTo,
autoFocus: true,
})
},
onCancelReply: function (e) {
var _this = this;
var content = e.detail.value
if (content == "" && _this.__data__.inputUseridToValue != "")
{
this.setData({
inputHolderValue: "评论才叫真诚",
inputUseridToValue: "",
inputContentToValue: "",
});
}
},
getStudyStatus: function(matchSeason, studyType, yourname)
{
var _this = this;
var strUrl = config.match_rank_query_url + '?matchSeason=' + matchSeason
+ '&matchType=' + studyType
+ '&matchTeam=' + yourname
config.debug==1?console.log("===getStudyStatus strUrl_"+strUrl):""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.statusCode == 200) {
//表示查询成功
console.log(res.data);
var rankResult = res.data.data
// 如果match_rank表有记录
if(rankResult.length > 0)
{
var studyStatus = {}
studyStatus['init_score'] = rankResult['0'].score
studyStatus['total_score'] = rankResult['0'].score
studyStatus['total_quiz'] = rankResult['0'].totalQuiz
_this.setData({
rankList: rankResult,
studyStatus : studyStatus,
isQuizReady: rankResult['0'].totalQuiz>0 ? true: false,
isStudyDone: parseInt(rankResult['0'].ratioFinish)==1 ? true : false,
})
}
else
{
_this.getTotalQuiz(studyType)
}
}
}
})
},
getTotalQuiz: function (studyType) {
var _this = this;
var strUrl = config.quiz_total_query_url + '?matchType=' + studyType
config.debug == 1 ? console.log("===getTotalQuiz strUrl_" + strUrl) : ""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.statusCode == 200) {
//表示查询成功
console.log(res.data);
var totalResult = res.data.data
// 如果match_rank表有记录
if (totalResult.length > 0) {
var studyStatus = {}
studyStatus['init_score'] = '0'
studyStatus['total_score'] = '0'
studyStatus['total_quiz'] = totalResult['0'].total == null ? '0' : totalResult['0'].total
_this.setData({
studyStatus: studyStatus,
isQuizReady: totalResult['0'].total != "0" ? true : false,
})
}
}
}
})
},
/*
* 更新tbl_match_rank的记录
*/
updateRankDefault() {
var _this = this;
var strUrl = config.match_rank_update_url;
var rankList = _this.data.rankList
var rankId = "rid_" + _this.data.matchSeason + "_" + _this.data.studyType + "_"+_this.data.nyxCode
var score = _this.data.studyStatus.total_score
var total = _this.data.studyStatus.total_quiz
var ratioFinish = (parseInt(_this.data.studyStatus.total_score) / parseInt(_this.data.studyStatus.total_quiz)).toFixed(2) + ''
config.debug == 1 ? console.log("===updateRankDefault strUrl_" + strUrl + "_score_" + score +"_ratioFinish_"+ratioFinish) : ""
if (rankList.length == 0) {
var result = {}
result['rankId'] = rankId
result['matchSeason'] = _this.data.matchSeason
result['matchType'] = _this.data.studyType
result['matchTeam'] = _this.data.nyxCode
result['defaultType'] = "0"
result['score'] = _this.data.studyStatus.total_score
result['rank'] = "0"
result['totalMatch'] = "0"
result['totalQuiz'] = _this.data.studyStatus.total_quiz
result['ratioRank'] = "0"
result['ratioFinish'] = ratioFinish
result['createDatetime'] = _this.formatDate(new Date())
rankList.push(result)
}
else
{
rankList['0']['rankId'] = rankId
rankList['0']['matchSeason'] = _this.data.matchSeason
rankList['0']['matchType'] = _this.data.studyType
rankList['0']['matchTeam'] = _this.data.nyxCode
rankList['0']['score'] = _this.data.studyStatus.total_score
rankList['0']['ratioFinish'] = ratioFinish
rankList['0']['createDatetime'] = _this.formatDate(new Date())
}
//暂存数据
if (wx.getStorageSync('studyResult')) {
var result = wx.getStorageSync('studyResult')
result[_this.data.studyType] = ratioFinish
wx.setStorageSync('studyResult', result)
_this.setData({
studyResult: result,
})
}
wx.request({
url: strUrl,
method: 'POST',
data: JSON.stringify(rankList),
header: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Cookie': wx.getStorageSync('cookieKey'),
},
dataType: "json",
success: function (res) {
console.log("排名记录成功");
} // end success
}) // end wx.request
},
/*
更新tbl_match的记录
*/
updateMatch() {
var _this = this;
var strUrl = config.match_add_item_url
var score = parseInt(_this.data.studyStatus.total_score) - parseInt(_this.data.studyStatus.init_score)
var id = _this.data.questionId_done
config.debug==1?console.log("===updateMatch strUrl_"+strUrl+"_id_"+id+"_score_"+score):""
wx.request({
url: strUrl,
method: 'POST',
data: {
matchSeason: _this.data.matchSeason,
matchType: _this.data.studyType,
matchTeam: _this.data.nyxCode,
matchScore: parseInt(_this.data.studyStatus.total_score)-parseInt(_this.data.studyStatus.init_score),
teamType: "blue",
matchResult: "1",
quizIndex: _this.data.questionId_done,
rankScore: parseInt(_this.data.studyStatus.total_score)-parseInt(_this.data.studyStatus.init_score),
},
header: {
"Content-Type": "application/x-www-form-urlencoded",
'Cookie': wx.getStorageSync('cookieKey'),
},
dataType: "json",
success: function (res) {
if (res.statusCode == 200) {
//表示提交成功
console.log("比赛记录成功");
}
}
})
},
/*更新学习记录 */
uploadStudy: function (e) {
var _this = this;
_this.updateMatch();
_this.updateRankDefault();
getCurrentPages()[getCurrentPages().length - 2].onLoad()
},
//inputTime 参数是毫秒级时间戳
formatDate(inputTime) {
var date = new Date(inputTime);
var y = date.getFullYear();
var m = date.getMonth() + 1;
m = m < 10 ? ('0' + m) : m;
var d = date.getDate();
d = d < 10 ? ('0' + d) : d;
var h = date.getHours();
h = h < 10 ? ('0' + h) : h;
var minute = date.getMinutes();
var second = date.getSeconds();
minute = minute < 10 ? ('0' + minute) : minute;
second = second < 10 ? ('0' + second) : second;
return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
},
})
\ No newline at end of file
{
{
"usingComponents": {},
"navigationBarTitleText": "知识学习"
}
\ No newline at end of file
<!--pages/key/matchStudyDetail/matchStudyDetail.wxml-->
<!--pages/key/matchStudyDetail/matchStudyDetail.wxml-->
<wxs module="tutil" src="../../../../utils/date.wxs"></wxs>
<view class="page bottom_fixed_page" style="min-height:{{ windowHeight }}px">
<view class="weui-flex">
<view class="weui-flex__item"><view class="placeholder">题目:{{studyStatus.total_score}}/{{studyStatus.total_quiz}}题</view></view>
<view class="weui-flex__item"><view class="placeholder">分数:{{score}}</view></view>
</view>
<view class="weui-loadmore" hidden="{{isQuizReady}}">
<view class="weui-loadmore__tips">题目准备中, 敬请期待 {{'>'}}_{{'<'}} </view>
</view>
<view class="weui-loadmore" hidden="{{!isStudyDone}}">
<view class="weui-loadmore__tips">好牛哦, 恭喜你已完成该项挑战 {{'>'}}_{{'<'}} </view>
</view>
<view hidden="{{isStudyDone}}"> <!-- start of isStudyDone flag -->
<view class="page__hd">
<!-- 标题 -->
<view class="page__desc">{{quizResult.questionName}}</view>
</view>
<view class="page__bd " wx:for-items="{{quizResult.choiceString}}" >
<button class="weui-btn button-sp-area {{current_item == index?'btn-selected':'btn-not-selected'}}" bind:tap="onClick" disabled="{{button_disabled==1?true:false}}" id="{{index}}">
<image src="{{operateResult}}" style="vertical-align:middle;width:60rpx;height:60rpx" hidden="{{hidden_type==1?true:(current_item == index?false:true)}}" />
{{item}}
</button>
</view>
<view class="page__hd" hidden="{{button_disabled==0}}">
<!-- 优化: 直接显示正确答案 -->
<view class="page__desc">推荐答案: {{tutil.formatAnswer(quizResult.answer)}}</view>
</view>
<!-- <text>\n</text> -->
<view class="weui-flex" hidden="{{!isQuizReady}}" >
<view class="weui-flex__item" bindtap="{{button_disabled==0?'onGetComment':'onTypeNext'}}">
<view class="placeholder-button">
<image src="{{button_disabled==0?(comment_hidden_type==1?'/icon/matchDaily/checkComment.png':'/icon/matchDaily/checkComment.png'):'/icon/matchDaily/next.png'}}" style="vertical-align:middle;width:60rpx;height:60rpx" />
{{button_disabled==0?(comment_hidden_type==1?"查看评论":"隐藏评论"):"下一题"}}</view>
</view>
<view class="weui-flex__item"><view class="{{button_disabled==0?'placeholder-button':'placeholder-button-disabled'}}" bind:tap="onReportBug">
<image src="{{button_disabled==0?'/icon/matchDaily/question.png':'/icon/matchDaily/question_0.png'}}" style="vertical-align:middle;width:60rpx;height:60rpx" />这题有问题</view>
</view>
</view>
<!-- 评论区 -->
<view class="page__bd" hidden="{{comment_hidden_type==1?true:false}}">
<view class="weui-panel weui-panel_access" wx:for="{{commentList}}" wx:key="commentList">
<view class="weui-panel__bd weui-media-box weui-media-box_appmsg" bind:tap="onReplyUser" data-nickname="{{item.nicknameFrom}}" data-userid="{{item.useridFrom}}" data-content-to="{{item.content}}">
<view class="weui-media-box__hd weui-media-box__hd_in-appmsg">
<image class="weui-media-box__thumb" src="{{item.avatarUrlFrom}}" />
</view>
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell" style="height:20rpx;text-align:left;padding-left:0rpx;margin:0rpx">
<view class="weui-cell__bd" style="text-align:left;padding:rpx;margin:0rpx">
<!-- start id+日期 -->
<view class="workbench">
<view class="items weui-media-box__desc">
<text>{{item.nicknameFrom}}</text>
<text class="bottom">{{tutil.formatDate_ymd(item.createDatetime)}}</text>
</view>
</view>
<!-- end id+date -->
</view>
<!-- start 点赞数 + 图标 -->
<view class="weui-media-box__desc" style="font-size:30rpx">
{{item.numLike}}
<view bindtap="onSubmitLike" data-comment-id="{{item.commentId}}">
<image src="/icon/matchDaily/like.png" style="width:30rpx;height:30rpx" />
</view>
</view>
<!-- end 点赞数 + 图标 -->
</view>
</view>
<view class="weui-media-box__desc">{{item.nicknameTo==null?"":"@"+item.nicknameTo+" "}}{{item.content}}</view>
</view>
</view>
</view>
<view class="weui-loadmore" hidden="{{isHideLoadMore}}">
<view class="weui-loading"></view>
<view class="weui-loadmore__tips">正在加载</view>
</view>
<view class="weui-loadmore" hidden="{{!isHideLoadMore}}">
<view class="weui-loadmore__tips">没有更多啦 {{'>'}}_{{'<'}} </view>
</view>
<!-- 评论栏置底 -->
<view class="page__hd bottom_fixed_view" style="position:fixed; bottom:0;width: 750rpx;" >
<view class="weui-panel weui-panel_access">
<view class="weui-panel__ft">
<form catchsubmit="onSubmitComment" >
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd">
<input class="weui-input" type="text" name="content" focus="{{autoFocus}}" value='{{inputContentValue}}' pattern="" placeholder="{{inputHolderValue}}" bindblur="onCancelReply" />
<input type="text" style="display:none" name="useridTo" value='{{inputUseridToValue}}'/>
<input type="text" style="display:none" name="contentTo" value='{{inputContentToValue}}'/>
</view>
<view class="weui-cell__ft">
<button type="default" formType="submit">发送</button>
</view>
</view>
</form>
</view>
</view>
</view>
</view>
</view> <!-- end of isStudyDone flag -->
</view>
page{background-color:#EDEDED;}
page{background-color:#EDEDED;}
.button-sp-area{
margin-top: 20rpx; /* 用于表示button与button之间的间隔 */
padding-top: 0px;
margin-left: 0rpx;
padding-left: 100rpx;
text-align:left;
line-height: 60rpx; /*缩小行间距 */
font-size: 40rpx;
}
.mini-btn{
margin: 0 4px;
}
.btn-selected{
/* background-color: #ffffff; */
color: rgb(105, 72, 16);
border-color: #00ff00;
border-style:solid;
border-width:2px;
}
.btn-not-selected{
/* background-color: #111111; */
color: rgb(105, 72, 16);
}
.icon-success{
color: greenyellow;
size: 21px;
margin-top: 20rpx; /* 用于表示button与button之间的间隔 */
}
.icon-cancel{
color: red;
size: 21px;
margin-top: 20rpx; /* 用于表示button与button之间的间隔 */
}
.text{
font-size: 6px;
line-height: 0.5em;
}
.container {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
width: 100%;
line-height: 80rpx;
height: 100rpx;
}
.left {
color: #888;
}
.right {
color: #ff0000;
}
.placeholder{
margin: 5px;
padding: 0 10px;
text-align: center;
background-color: #F7F7F7;
height: 2.3em;
line-height: 2.3em;
color: rgba(0,0,0,.3);
}
.placeholder-button{
margin: 5px;
padding: 0 10px;
text-align: center;
background-color: #F7F7F7;
height: 2.3em;
line-height: 2.3em;
color: rgba(198, 133, 36);
font-size: 35rpx;
font-weight: bold;
}
.placeholder-button-disabled{
margin: 5px;
padding: 0 10px;
text-align: center;
background-color: #F7F7F7;
height: 2.3em;
line-height: 2.3em;
color: rgba(0,0,0,.3);
font-size: 35rpx;
font-weight: bold;
pointer-events: none;
}
/**
* 系统配置:主要用于置底页面设置 step3
*/
.bottom_fixed_page{
position: relative;
padding-bottom: 56px; /* 需要定位的盒子的高度 */
box-sizing: border-box;
}
.bottom_fixed_view {
position: fixed;
bottom:0;
}
/*
id+date css
*/
.workbench{
font-size: 25rpx;
padding-bottom: 0rpx;
margin-bottom: 0rpx;
}
.workbench .items{
width: 200rpx;
flex:1;
text-align: left;
}
.workbench .items text{
display: block;
text-align: left;
margin-top: 0rpx;
margin-bottom: 0rpx;
}
.workbench .items text.bottom{
font-size: 25rpx;
display: block;
text-align: left;
margin-top: 3rpx;
}
/* end */
/* 加载更多 */
.weui-loading {
margin: 0 5px;
width: 20px;
height: 20px;
display: inline-block;
vertical-align: middle;
-webkit-animation: weuiLoading 1s steps(12, end) infinite;
animation: weuiLoading 1s steps(12, end) infinite;
background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;
background-size: 100%;
}
.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;
}
//logs.js
//logs.js
var util = require('../../utils/util.js')
Page({
data: {
logs: []
},onShareAppMessage: function () {
return {
title: '自定义分享标题',
path: '/page/user?id=123',
success: function(res) {
// 分享成功
},
fail: function(res) {
// 分享失败
}
}
},
onLoad: function () {
this.setData({
logs: (wx.getStorageSync('logs') || []).map(function (log) {
return util.formatTime(new Date(log))
})
})
},
fenxiang:function(){
wx.showShareMenu({
success:function(res){
console.log(res);
}
})
}
})
{
{
"navigationBarTitleText": "查看启动日志"
}
\ No newline at end of file
<!--logs.wxml-->
<!--logs.wxml-->
<view class="container log-list">
<button bindtap="fenxiang">
点我
</button>
</view>
.log-list {
.log-list {
display: flex;
flex-direction: column;
padding: 40rpx;
}
.log-item {
margin: 10rpx;
}
var config = wx.getStorageSync("config");
var config = wx.getStorageSync("config");
var app = getApp();
Page({
data: {
tempCanvasWidth: 0,
tempCanvasHeight: 0,
imgViewHeight: 0,
page: 'mainPage',
imageNotChoosed: false,
minScale: 0.5,
maxScale: 2.5,
doodleImageSrc: '',
//tempImageSrc: '../../icon/sakura.jpg',
tempImageSrc: 'https://930-test-sh.oss-cn-shanghai.aliyuncs.com/nyx_map/jingan.jpg',
originImageSrc: '../../icon/sakura.jpg',
imgWidth: 0,
imgHeight: 0,
imgTop: 0,
imgLeft: 0,
initImgTop: 0,
initImgLeft: 0,
// 裁剪框 宽高
imgTagWidth : 60, //in rpx
imgTagHeigth: 60, //in rpx
deviceRatio: 1,
allText : [
{
id: "mid_001",
name: "Renaissance Bar",
address: "愚园路610号",
textL: 0, // 参照图是可视的原点
textT: 0,
initTextL: 0,
initTextT: 0,
},
{
id: "mid_123",
name: "CinCin Wine Cellar",
address: "五原路610号",
textL: 50,
textT: 100,
initTextL: 50,
initTextT: 100,
},
],
// texted:false,
indexTagSelected: -1,
indexTagAdd: false,
newTag : {},
//start - address selector
province: [],
city: ['上海'],
district: ['静安区'],
provinceIndex: 0,
cityIndex: 0,
districtIndex: 0,
provinceCode: '',
cityCode: '',
districtCode: '',
numBar: '5',
//end - address selector
//start - long press event
touchStart : 0,
touchEnd: 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {
var self = this
self.device = wx.getSystemInfoSync()
//self.device = app.globalData.myDevice
// jscat miniprogram default width is 750rpx
self.deviceRatio = self.device.windowWidth / 750
// 地址栏留了80rpx: 用于选择地址
// 操作栏留了160rpx(responsive pixel): 裁剪+添加文字+涂鸦
self.toolBarHeight = (160 + 80) * self.deviceRatio // in px
self.imgViewHeight = self.device.windowHeight - self.toolBarHeight
self.setData({
imgViewHeight: self.imgViewHeight,
deviceRatio: self.deviceRatio,
// tempCanvasHeight: self.imgViewHeight,
page: 'mainPage',
})
//chooseImage(self)
loadImgOnImage(self)
},
chooseOneImage() {
chooseImage(this)
},
toMainPage() {
loadImgOnImage(this)
this.setData({
page: 'mainPage'
})
},
bestShow() {
loadImgOnImage(this)
},
uploadScaleStart(e) { //缩放图片
let self = this
let xDistance, yDistance
let [touch0, touch1] = e.touches
//self.touchNum = 0 //初始化,用于控制旋转结束时,旋转动作只执行一次
//计算第一个触摸点的位置,并参照该点进行缩放
self.touchX = touch0.clientX
self.touchY = touch0.clientY
//每次触摸开始时图片左上角坐标
self.imgLeft = self.startX
self.imgTop = self.startY
// 两指手势触发
if (e.touches.length >= 2) {
//坐标转换,从左上角为原点->可视范围center为原点,便于计算scale
self.initLeft = (self.deviceRatio * 750 / 2 - self.imgLeft) / self.oldScale
self.initTop = (self.imgViewHeight / 2 - self.imgTop) / self.oldScale
//计算两指距离
xDistance = touch1.clientX - touch0.clientX
yDistance = touch1.clientY - touch0.clientY
self.oldDistance = Math.sqrt(xDistance * xDistance + yDistance * yDistance)
}
self.setData({
touchStart: e.timeStamp
})
},
uploadScaleMove(e) {
fn(this, e)
},
uploadScaleEnd(e) {
let self = this
// 确定img的位置
self.oldScale = self.newScale || self.oldScale
self.startX = self.imgLeft || self.startX
self.startY = self.imgTop || self.startY
self.setData({
touchEnd: e.timeStamp
})
// 确定标记的位置
},
//长按事件
//1. 不是平移事件: Math.abs(xMove) < 1 && Math.abs(yMove)<1
//2. 不是缩放事件: e.touches.length==2
//3. 时长>=1000ms, 默认的350ms太短了
//4. 时长<1000ms, 将未入库的allText清除
uploadLongPress(e) { //缩放图片
let self = this
let xDistance, yDistance
let [touch0, touch1] = e.touches
var allText = self.data.allText
var touchTime = self.data.touchEnd - self.data.touchStart;
var xMove = touch0.clientX - self.touchX
var yMove = touch0.clientY - self.touchY
//longPress只允许单指操作
if (touchTime >= 1000 && e.touches.length == 1 && Math.abs(xMove) < 1 && Math.abs(yMove)<1) {
//计算第一个触摸点的位置,并参照该点进行缩放
var scaleL = touch0.clientX
var scaleT = touch0.clientY - 80 * self.deviceRatio
//坐标转换,从左上角为原点->可视范围center为原点,便于计算scale
//step1: 计算放大比例
//如果尺寸已经最大, 则newScale==1
var newScale = self.scaleWidth / self.initScaleWidth
//step2: 计算img新坐标
let { initImgLeft, initImgTop } = self.data
var imgPos = genScalePos(self, initImgLeft, initImgTop, newScale)
var deltaL = self.imgLeft - imgPos.left
var deltaT = self.imgTop - imgPos.top
//step3: 计算tag初始坐标
var initPos = genInitPos(self, scaleL-deltaL, scaleT-deltaT, newScale)
var strUrl = config.msg_add_url
var tmp = {
id: "",
name: "",
address: "",
textL: scaleL,
textT: scaleT,
initTextL: initPos.initL,
initTextT: initPos.initT,
}
allText.push(tmp)
self.setData(
{
allText: allText,
newTag: tmp,
indexTagAdd: true,
indexTagSelected: -1,
}
)
}
else //清除addText里未入库的数据
{
var list = []
for(let i = 0; i < allText.length; i++)
{
if(allText[i].id != "")
{
list.push(allText[i])
}
}
self.setData(
{
allText: list,
indexTagAdd: false,
indexTagSelected: -1,
}
)
}
},
/*
选中某一个tag
*/
onSelectTap: function (e) {
var _this = this;
let cuu = e.target.id;//获取index值
_this.setData(
{
indexTagSelected : parseInt(cuu),
indexTagAdd: false,
}
)
},
//处理addMember功能
addMember: function (name, address) {
var _this = this
var allText = _this.data.allText
var strUrl = config.msg_add_url
config.debug == 1 ? console.log("===addMember strUrl_" + strUrl
+ "_name_" + name
+ "_address_" + address
) : ""
//拿到新标注的tag
//要确认是最后一个: 或者是id==""那个
allText[allText.length - 1].id = "mid_002";
allText[allText.length - 1].name = name
allText[allText.length - 1].address = address
_this.setData(
{
allText: allText,
indexTagAdd: false,
}
)
},
//接受addMenber的click
onAddMember: function (e) {
var _this = this;
let name = e.detail.value.name;//获取名称
var address = e.detail.value.address;//获取地址
// var initTextL = parseFloat(e.detail.value.initTextL);//获取地址
// var initTextT = parseFloat(e.detail.value.initTextT);//获取地址
// var textL = parseFloat(e.detail.value.textL);//获取地址
// var textT = parseFloat(e.detail.value.textT);//获取地址
if (name != "" && address != "") {
_this.addMember(name, address)
}
}
})
function loadImgOnImage(self) {
wx.getImageInfo({
src: self.data.tempImageSrc,
success: function (res) {
self.oldScale = 1
self.initRatio = res.height / self.imgViewHeight //已转换为px 图片原始大小/显示大小
//jscat 取一个最大的ratio, max(ratio_height, ratio_width),以避免溢出
if (self.initRatio < res.width / (750 * self.deviceRatio)) {
self.initRatio = res.width / (750 * self.deviceRatio)
}
//图片显示大小
//jscat 为了更好显示, 这里放大了图片
self.scaleWidth = (res.width / self.initRatio) * 2
self.scaleHeight = (res.height / self.initRatio) * 2
self.initScaleWidth = self.scaleWidth
self.initScaleHeight = self.scaleHeight
self.initWidth = res.width
self.initHeight = res.height
self.startX = 750 * self.deviceRatio / 2 - self.scaleWidth / 2;
self.startY = self.imgViewHeight / 2 - self.scaleHeight / 2;
self.setData({
imgWidth: self.scaleWidth,
imgHeight: self.scaleHeight,
imgTop: self.startY,
imgLeft: self.startX,
initImgTop: self.startY,
initImgLeft: self.startX
})
wx.hideLoading();
}
})
}
function throttle(fn, miniTimeCell) {
var timer = null,
previous = null;
return function () {
var now = +new Date(),
context = this,
args = arguments;
if (!previous) previous = now;
var remaining = now - previous;
if (miniTimeCell && remaining >= miniTimeCell) {
fn.apply(context, args);
previous = now;
}
}
}
const fn = throttle(drawOnTouchMove, 100)
function drawOnTouchMove(self, e) {
let { minScale, maxScale } = self.data
let [touch0, touch1] = e.touches
let xMove, yMove, newDistance, xDistance, yDistance
if (e.timeStamp - self.timeOneFinger < 100) {//touch时长过短,忽略
return
}
// 单指手势时触发
if (e.touches.length === 1) {
//计算单指移动的距离
xMove = touch0.clientX - self.touchX
yMove = touch0.clientY - self.touchY
//转换移动距离到正确的坐标系下
// console.log("===windowHeight_", self.device.windowHeight)
// console.log("===imgHeight_", self.scaleHeight)
// console.log("min imgTop_", self.device.windowHeight - self.toolBarHeight - self.scaleHeight)
// console.log("ymove_",self.startY + yMove)
self.imgLeft = self.startX + xMove > 0 ? 0 : (self.startX + xMove < (self.device.windowWidth - self.scaleWidth) ? (self.device.windowWidth - self.scaleWidth) : self.startX + xMove)
self.imgTop = self.startY + yMove > 0 ? 0 : (self.startY + yMove < (self.device.windowHeight - self.toolBarHeight - self.scaleHeight) ? (self.device.windowHeight - self.toolBarHeight - self.scaleHeight) : self.startY + yMove)
// console.log("===imgLeft_", self.imgLeft)
// console.log("===imgTop_", self.imgTop)
self.setData({
imgTop: self.imgTop,
imgLeft: self.imgLeft,
})
}
// 两指手势触发
if (e.touches.length >= 2) {
// self.timeMoveTwo = e.timeStamp
var oldScaleWidth = self.data.imgWidth
var oldScaleHeight = self.data.imgHeight
// 计算二指最新距离
xDistance = touch1.clientX - touch0.clientX
yDistance = touch1.clientY - touch0.clientY
newDistance = Math.sqrt(xDistance * xDistance + yDistance * yDistance)
// 使用0.005的缩放倍数具有良好的缩放体验
self.newScale = self.oldScale + 0.005 * (newDistance - self.oldDistance)
// 设定缩放范围 [0.5, 2.5]之间
self.newScale <= minScale && (self.newScale = minScale)
self.newScale >= maxScale && (self.newScale = maxScale)
// 设定最小范围 [不超出设定的windows范围]
var tmpScaleWidth = self.newScale * self.initScaleWidth
var tmpScaleHeight = self.newScale * self.initScaleHeight
var tmpScaleRatio = self.initScaleHeight/self.initScaleWidth
var winHeight = self.device.windowHeight - self.toolBarHeight
var winWidth = self.device.windowWidth
var tmpWinRatio = winHeight / winWidth
//scaleWidth, scaleHeight 当前图片的尺寸
//地图高宽比>幕布高宽比, 地图以width为准, 其minWidth以winWidth为准
if (tmpScaleRatio >= tmpWinRatio )
{
self.scaleWidth = tmpScaleWidth <= winWidth ? winWidth : tmpScaleWidth
self.scaleHeight = tmpScaleWidth <= winWidth ? tmpScaleHeight * winWidth / tmpScaleWidth : tmpScaleHeight
}
//地图高宽比<幕布高宽比, 地图以height为准, 其minHeight以winHeight为准
else // example.
{
//计算出来的height<可显示的height,则赋值为可显示的height
self.scaleHeight = tmpScaleHeight <= winHeight ? winHeight : tmpScaleHeight
self.scaleWidth = tmpScaleHeight <= winHeight ? tmpScaleWidth * winHeight / tmpScaleHeight : tmpScaleWidth
}
//不超过图像最大尺寸
if(self.scaleWidth > self.initWidth ||self.scaleHeight > self.initHeight)
{
self.scaleWidth = self.initWidth;
self.scaleHeight = self.initHeight;
}
// console.log("tmpScaleRatio_",tmpScaleRatio)
// console.log("tmpScaleWidth_",tmpScaleWidth)
// console.log("tmpScaleRatio_",tmpScaleRatio)
// console.log("minHeight_",minHeight)
// console.log("minWidth_",minWidth)
// console.log("scaleWidth_",self.scaleWidth)
// console.log("scaleHeight_",self.scaleHeight)
// self.imgLeft = self.deviceRatio * 750 / 2 - self.newScale * self.initLeft
// self.imgTop = self.imgViewHeight / 2 - self.newScale * self.initTop
//不考虑scale超过windows边界的算法
var imgLeft = self.deviceRatio * 750 / 2 - self.newScale * self.initLeft
var imgTop = self.imgViewHeight / 2 - self.newScale * self.initTop
// console.log("===imgLeft_", imgLeft)
// console.log("===sysLeft_", self.device.windowWidth - self.scaleWidth)
// console.log("===imgTop_", imgTop)
// console.log("===sysTop_", self.device.windowHeight - self.toolBarHeight - self.scaleHeight)
// 考虑windows的边界
self.imgLeft = imgLeft >= 0 ? 0 : (imgLeft < (self.device.windowWidth - self.scaleWidth) ? (self.device.windowWidth - self.scaleWidth) : imgLeft)
self.imgTop = imgTop >= 0 ? 0 : (imgTop < (self.device.windowHeight - self.toolBarHeight - self.scaleHeight) ? (self.device.windowHeight - self.toolBarHeight - self.scaleHeight) : imgTop)
self.setData({
imgTop: self.imgTop,
imgLeft: self.imgLeft,
imgWidth: self.scaleWidth, //新尺寸
imgHeight: self.scaleHeight,
})
}
// 计算标记点Tag的位置 = 平移 + scale 两部分
// 计算标记点新坐标的位置, 同时包括scale和translate
let { initImgLeft, initImgTop } = self.data
var allText = self.data.allText
//坐标转换,从左上角为原点->可视范围center为原点,便于计算scale
//step1: 计算放大比例
//如果尺寸已经最大, 则newScale==1
var newScale = self.scaleWidth / self.initScaleWidth
//step2: 计算img新坐标
var imgPos = genScalePos(self, initImgLeft, initImgTop, newScale)
var deltaL = self.imgLeft - imgPos.left
var deltaT = self.imgTop - imgPos.top
var textPos = {}
for (let i = 0; i < allText.length; i++) {
//step3: 计算tag点新坐标
textPos = genScalePos(self, allText[i].initTextL, allText[i].initTextT, newScale)
// step4新的tag点坐标
allText[i].textL = textPos.left + deltaL
allText[i].textT = textPos.top + deltaT
}
self.setData({
allText: allText
})
}
/*
将初始
*/
function genScalePos(self, initL, initT, scale)
{
var tmpL = (self.deviceRatio * 750 / 2 - initL)
var tmpT = (self.imgViewHeight / 2 - initT)
var left = self.deviceRatio * 750 / 2 - scale * tmpL
var top = self.imgViewHeight / 2 - scale * tmpT
return { left, top }
}
/*
通过平移+缩放后的坐标转为初始坐标
*/
function genInitPos(self, scaleL, scaleT, scale) {
var tmpL = (self.deviceRatio * 750 / 2 - scaleL)/scale
var tmpT = (self.imgViewHeight / 2 - scaleT)/scale
var initL = (self.deviceRatio * 750 / 2 - tmpL)
var initT = (self.imgViewHeight / 2 - tmpT)
return { initL, initT }
}
{
{
"usingComponents": {},
"navigationBarTitleText": "酒肆地图"
}
\ No newline at end of file
<view class="page">
<view class="page">
<!-- 城市选择view -->
<view class="container">
<view class='address'>
<view class='selectAddress'>
<picker mode="selector" range="{{city}}" value="{{cityIndex}}" bindchange="cityPicker" class='address_province'
data-citycode="{{cityCode}}">
<text>{{city[cityIndex]}}</text>
<image src='../../icon/down.png' style='width: 56rpx;height: 56rpx;' class='selecrtImg'></image>
</picker>
<picker mode="selector" range="{{district}}" value="{{districtIndex}}" bindchange="districtPicker" class='address_province'
data-councode="{{districtCode}}">
<text>{{district[districtIndex]}}</text>
<image src='../../icon/down.png' style='width: 56rpx;height: 56rpx;' class='selecrtImg'></image>
</picker>
<view class='address_province'>
<text>已复工{{numBar}}家</text>
</view>
</view>
</view>
</view>
<!-- 地图显示view -->
<view class="imageView" style="height:{{imgViewHeight}}px;position:fixed; top:80rpx;">
<image src="{{tempImageSrc}}" style="width:{{imgWidth}}px;height:{{imgHeight}}px;top:{{imgTop}}px;left:{{imgLeft}}px" disable-scroll="true" bindtouchstart="uploadScaleStart" bindtouchmove="uploadScaleMove" bindtouchend="uploadScaleEnd" bindtap='uploadLongPress'></image>
<block wx:for="{{allText}}" >
<!-- 添加文字页面 -->
<!-- image left:textL-15px;top:textT-15;width:60rps;height:60rpx -->
<!-- text left:textL+15px;top:textT-15; -->
<image src="../../icon/tag.png" style="left:{{item.textL-imgTagWidth*deviceRatio/2}}px;top:{{item.textT-imgTagWidth*deviceRatio/2}}px;position:absolute;width:{{imgTagWidth}}rpx;height:{{imgTagWidth}}rpx" bind:tap="onSelectTap" id="{{index}}"></image>
<text class="active-text" style="left:{{item.textL+imgTagWidth*deviceRatio/2}}px;top:{{item.textT-imgTagWidth*deviceRatio/2}}px;">{{item.name}}</text>
</block>
</view>
<!-- 主页面-底部-->
<view class="toolbar-bottom" hidden="{{indexTagSelected==-1}}">
<view class="weui-cell__bd" style="padding-left:60rpx;">
<view class="weui-media-box__desc" style="font-family:'Microsoft YaHei';font-size:20px;color:rgba(0,0,0,1);">{{allText[indexTagSelected].name}}
</view>
<view class="weui-flex__item" >
<image style="width:25rpx;height:25rpx" src="/icon/discover2.png" />
<span style="font-size:15px;color:rgba(120, 120, 120);">
{{allText[indexTagSelected].address}}
</span>
</view>
</view>
</view>
<block wx:if="{{indexTagAdd==true}}">
<form catchsubmit="onAddMember" >
<view class="message-input">
<input class="showSend" placeholder="请输入店名" name="name" type="text" />
<input class="showSend" placeholder="请输入地址" name="address" type="text"/>
<input type="text" style="display:none" name="initTextL" value='{{newTag.initTextL}}'/>
<input type="text" style="display:none" name="initTextT" value='{{newTag.initTextT}}'/>
<input type="text" style="display:none" name="textL" value='{{newTag.textL}}'/>
<input type="text" style="display:none" name="textT" value='{{newTag.textT}}'/>
<button type="default" formType="submit">添加</button>
</view>
</form>
</block>
</view>
\ No newline at end of file
.page{
.page{
height: 100vh;
background: #F4F8FB;
}
.top{
width:100%;
overflow: hidden;
height:60rpx;
}
.imageView{
width:750rpx;
text-align: center;
position: absolute;
overflow: hidden;
}
.noImageBox{
width:100%;
height:100%;
text-align: center;
line-height: 1000rpx;
}
.saveButton{
position:absolute;
top:30rpx;
right:40rpx;
padding: 10rpx;
font-size: 0;
opacity: 0.7;
z-index: 5;
}
.saveButton .icon-save{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Ctitle%3Esave%3C/title%3E %3Cpath d='M21.7 7.3l-5-5c-0.2-0.2-0.4-0.3-0.7-0.3h-11c-1.7 0-3 1.3-3 3v14c0 1.7 1.3 3 3 3h14c1.7 0 3-1.3 3-3v-11c0-0.3-0.1-0.5-0.3-0.7zM16 20h-8v-6h8v6zM20 19c0 0.6-0.4 1-1 1h-1v-7c0-0.6-0.4-1-1-1h-10c-0.6 0-1 0.4-1 1v7h-1c-0.6 0-1-0.4-1-1v-14c0-0.6 0.4-1 1-1h1v4c0 0.6 0.4 1 1 1h8c0.6 0 1-0.4 1-1s-0.4-1-1-1h-7v-3h7.6l4.4 4.4v10.6z'%3E%3C/path%3E %3C/svg%3E");
background-size: cover;
display: inline-block;
width: 60rpx;
height: 60rpx;
}
.saveButton:active .icon-save{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Ctitle%3Esave%3C/title%3E %3Cpath d='M21.7 7.3l-5-5c-0.2-0.2-0.4-0.3-0.7-0.3h-11c-1.7 0-3 1.3-3 3v14c0 1.7 1.3 3 3 3h14c1.7 0 3-1.3 3-3v-11c0-0.3-0.1-0.5-0.3-0.7zM16 20h-8v-6h8v6zM20 19c0 0.6-0.4 1-1 1h-1v-7c0-0.6-0.4-1-1-1h-10c-0.6 0-1 0.4-1 1v7h-1c-0.6 0-1-0.4-1-1v-14c0-0.6 0.4-1 1-1h1v4c0 0.6 0.4 1 1 1h8c0.6 0 1-0.4 1-1s-0.4-1-1-1h-7v-3h7.6l4.4 4.4v10.6z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E");
}
.imageView image{
position: absolute;
display: block;
margin: 0 auto;
}
.corpper-view-box{
position: absolute;
z-index: 2;
box-shadow: 0 0 0 9999px rgba(204,204,204,0.8);
}
/* 横向虚线 */
.cropper-dashed-h{
position: absolute;
top: 33.33333333%;
left: 0;
width: 100%;
height: 33.33333333%;
border-top: 1px dashed rgba(255,255,255,0.5);
border-bottom: 1px dashed rgba(255,255,255,0.5);
}
/* 纵向虚线 */
.cropper-dashed-v{
position: absolute;
left: 33.33333333%;
top: 0;
width: 33.33333333%;
height: 100%;
border-left: 1px dashed rgba(255,255,255,0.5);
border-right: 1px dashed rgba(255,255,255,0.5);
}
/* 四个方向的线 为了之后的拖动事件*/
.cropper-line-t{
position: absolute;
display: block;
width: 100%;
background-color: #69f;
top: 0;
left: 0;
height: 1px;
opacity: 0.1;
}
.cropper-line-r{
position: absolute;
display: block;
background-color: #69f;
top: 0;
right: 0px;
width: 1px;
opacity: 0.1;
height: 100%;
}
.cropper-line-b{
position: absolute;
display: block;
width: 100%;
background-color: #69f;
bottom: 0;
left: 0;
height: 1px;
opacity: 0.1;
}
.cropper-line-l{
position: absolute;
display: block;
background-color: #69f;
top: 0;
left: 0;
width: 1px;
opacity: 0.1;
height: 100%;
}
/* 剪裁框的点 */
.cropper-point{
width: 5px;
height: 5px;
background-color: #69f;
opacity: .75;
position: absolute;
z-index: 3;
}
.point-tr{
top: -3px;
left: 100%;
margin-left: -3px;
}
.point-rb{
left: 100%;
top: 100%;
transform: translate3d(-50%,-50%,0);
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background-color: #69f;
position: absolute;
z-index: 3;
opacity: 1;
}
.point-bl{
left:0%;
top: 100%;
margin-left: -3px;
margin-top: -3px;
}
.point-lt{
left:0%;
top: 0%;
margin-left: -3px;
margin-top: -3px;
}
.cropper-wraper{
position: absolute;
width:100%;
height:100%;
background-color: transparent;
}
/* 涂鸦窗口 */
.toolbar-bottom{
display: flex;
justify-content: center;
align-items:center;
width:100%;
position: fixed;
bottom: 0;
height: 160rpx;
border-top: 1px solid #8b8b8b27;
border-bottom: 1px solid #8b8b8b27;
background-color: rgb(255, 255, 255);
}
@keyframes toolbar
{
0% {bottom:-100rpx;}
100% {bottom:100rpx;}
}
.toolbar-top{
width:100%;
height:200rpx;
position: absolute;
bottom: 160rpx;
border-top: 1rpx solid #b17a7e;
border-top-left-radius:20rpx;
border-top-right-radius:20rpx;
animation-name:toolbar;
animation-duration: 0.2s;
animation-timing-function: ease;
}
.toolbar-width{
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
}
.slider-box{
width:80%;
}
.color-box{
width:750rpx;
height:100%;
display: flex;
flex-direction: row;
justify-content: space-around;
flex-wrap :wrap;
align-content: space-around;
}
.color-point{
width:60rpx;
height:60rpx;
margin: 20rpx 30rpx;
border-radius: 50%;
box-shadow: 0 0 0 4rpx transparent;
}
.color-point:active{
box-shadow: 0 0 0 4rpx #fff;
}
.toolbar-back,.toolbar-font-style{
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
}
.icon-cutter{
background-size: cover;
display: inline-block;
width: 50rpx;
height: 50rpx;
position: absolute;
left:50%;
transform: translateX(-50%);
bottom: 50rpx;
}
.icon-text{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Ctitle%3Etype%3C/title%3E %3Cpath d='M20 3h-16c-0.6 0-1 0.4-1 1v3c0 0.6 0.4 1 1 1s1-0.4 1-1v-2h6v14h-2c-0.6 0-1 0.4-1 1s0.4 1 1 1h6c0.6 0 1-0.4 1-1s-0.4-1-1-1h-2v-14h6v2c0 0.6 0.4 1 1 1s1-0.4 1-1v-3c0-0.6-0.4-1-1-1z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E ");
background-size: cover;
display: inline-block;
width: 50rpx;
height: 50rpx;
position: absolute;
left:50%;
transform: translateX(-50%);
bottom: 50rpx;
}
.icon-pen{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E %3Ctitle%3Eedit-pencil%3C/title%3E %3Cpath d='M12.3 3.7l4 4-12.3 12.3h-4v-4l12.3-12.3zM13.7 2.3l2.3-2.3 4 4-2.3 2.3-4-4z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E");
background-size: cover;
display: inline-block;
width: 40rpx;
height: 40rpx;
position: absolute;
left:50%;
transform: translateX(-50%);
bottom: 55rpx;
}
.icon-back{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E %3Ctitle%3Eundo2%3C/title%3E %3Cpath d='M23.808 32c3.554-6.439 4.153-16.26-9.808-15.932v7.932l-12-12 12-12v7.762c16.718-0.436 18.58 14.757 9.808 24.238z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E ");
background-size: cover;
display: inline-block;
width: 50rpx;
height: 50rpx;
position: absolute;
left:50%;
transform: translateX(-50%);
bottom: 50rpx;
}
.icon-cutbox{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Ctitle%3Ecrop%3C/title%3E %3Cpath d='M23 17h-4v-9c0-1.7-1.3-3-3-3l-8.9 0.1v-4.1c0-0.6-0.4-1-1-1 0 0 0 0 0 0-0.5 0-1 0.4-1 1v4.1h-4.1c-0.6 0-1 0.5-1 1s0.5 1 1 1c0 0 0 0 0 0h4.1l-0.1 8.9c0 1.7 1.3 3 3 3h9v4c0 0.6 0.4 1 1 1s1-0.4 1-1v-4h4c0.6 0 1-0.4 1-1s-0.4-1-1-1zM8 17c-0.6 0-1-0.4-1-1l0.1-8.9 8.9-0.1c0.6 0 1 0.4 1 1v9h-9z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E ");
background-size: cover;
display: inline-block;
width: 50rpx;
height: 50rpx;
position: absolute;
left:50%;
transform: translateX(-50%);
bottom: 50rpx;
}
.icon-bestshow{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Ctitle%3Emaximize-2%3C/title%3E %3Cpath d='M21.9 2.6c-0.1-0.2-0.3-0.4-0.5-0.5-0.1-0.1-0.3-0.1-0.4-0.1h-6c-0.6 0-1 0.4-1 1s0.4 1 1 1h3.6l-5.3 5.3c-0.4 0.4-0.4 1 0 1.4 0.2 0.2 0.5 0.3 0.7 0.3s0.5-0.1 0.7-0.3l5.3-5.3v3.6c0 0.6 0.4 1 1 1s1-0.4 1-1v-6c0-0.1 0-0.3-0.1-0.4z' fill='%23d6204b'%3E%3C/path%3E %3Cpath d='M9.3 13.3l-5.3 5.3v-3.6c0-0.6-0.4-1-1-1s-1 0.4-1 1v6c0 0.1 0 0.3 0.1 0.4 0.1 0.2 0.3 0.4 0.5 0.5 0.1 0.1 0.3 0.1 0.4 0.1h6c0.6 0 1-0.4 1-1s-0.4-1-1-1h-3.6l5.3-5.3c0.4-0.4 0.4-1 0-1.4s-1-0.4-1.4 0z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E ");
background-size: cover;
display: inline-block;
width: 50rpx;
height: 50rpx;
position: absolute;
left:50%;
transform: translateX(-50%);
bottom: 50rpx;
}
.icon-linewidth{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E %3Ctitle%3Estroke-width%3C/title%3E %3Cpath d='M0 0h20v5h-20v-5zM0 7h20v4h-20v-4zM0 13h20v3h-20v-3zM0 18h20v2h-20v-2z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E");
background-size: cover;
display: inline-block;
width: 40rpx;
height: 40rpx;
position: absolute;
bottom: 55rpx;
left:50%;
transform: translateX(-50%);
}
.icon-color{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Ctitle%3Epalette%3C/title%3E %3Cpath d='M17.484 12c0.844 0 1.5-0.656 1.5-1.5s-0.656-1.5-1.5-1.5-1.5 0.656-1.5 1.5 0.656 1.5 1.5 1.5zM14.484 8.016c0.844 0 1.5-0.656 1.5-1.5s-0.656-1.5-1.5-1.5-1.5 0.656-1.5 1.5 0.656 1.5 1.5 1.5zM9.516 8.016c0.844 0 1.5-0.656 1.5-1.5s-0.656-1.5-1.5-1.5-1.5 0.656-1.5 1.5 0.656 1.5 1.5 1.5zM6.516 12c0.844 0 1.5-0.656 1.5-1.5s-0.656-1.5-1.5-1.5-1.5 0.656-1.5 1.5 0.656 1.5 1.5 1.5zM12 3c4.969 0 9 3.609 9 8.016 0 2.766-2.25 4.969-5.016 4.969h-1.734c-0.844 0-1.5 0.656-1.5 1.5 0 0.375 0.141 0.703 0.375 0.984s0.375 0.656 0.375 1.031c0 0.844-0.656 1.5-1.5 1.5-4.969 0-9-4.031-9-9s4.031-9 9-9z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E ");
background-size: cover;
display: inline-block;
width: 55rpx;
height: 55rpx;
position: absolute;
bottom: 50rpx;
left:50%;
transform: translateX(-50%);
}
.icon-eraser{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E %3Ctitle%3Eeraser%3C/title%3E %3Cpath d='M16.998 4.18l-3.154-2.425c-0.872-0.671-2.135-0.506-2.807 0.365l-8.4 10.897c-0.671 0.871-0.507 2.132 0.365 2.803l3.153 2.425c0.872 0.671 2.135 0.506 2.807-0.365l8.401-10.897c0.671-0.871 0.507-2.132-0.365-2.803zM8.548 16.467l-0.537 0.681c-0.152 0.197-0.385 0.31-0.639 0.31-0.124 0-0.309-0.029-0.485-0.164l-3.153-2.425c-0.168-0.129-0.275-0.317-0.303-0.53s0.028-0.422 0.157-0.589l0.537-0.681c0.152-0.197 0.385-0.311 0.64-0.311 0.124 0 0.309 0.029 0.485 0.164l3.154 2.425c0.168 0.129 0.275 0.317 0.303 0.53 0.026 0.213-0.030 0.422-0.159 0.59z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E ");
background-size: cover;
display: inline-block;
width: 50rpx;
height: 50rpx;
position: absolute;
bottom: 50rpx;
left:50%;
transform: translateX(-50%);
}
.icon-clear{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Ctitle%3Etrash-2%3C/title%3E %3Cpath d='M21 5h-4v-1c0-1.7-1.3-3-3-3h-4c-1.7 0-3 1.3-3 3v1h-4c-0.6 0-1 0.4-1 1s0.4 1 1 1h1v13c0 1.7 1.3 3 3 3h10c1.7 0 3-1.3 3-3v-13h1c0.6 0 1-0.4 1-1s-0.4-1-1-1zM9 4c0-0.6 0.4-1 1-1h4c0.6 0 1 0.4 1 1v1h-6v-1zM18 20c0 0.6-0.4 1-1 1h-10c-0.6 0-1-0.4-1-1v-13h12v13z' fill='%23d6204b'%3E%3C/path%3E %3Cpath d='M10 10c-0.6 0-1 0.4-1 1v6c0 0.6 0.4 1 1 1s1-0.4 1-1v-6c0-0.6-0.4-1-1-1z' fill='%23d6204b'%3E%3C/path%3E %3Cpath d='M14 10c-0.6 0-1 0.4-1 1v6c0 0.6 0.4 1 1 1s1-0.4 1-1v-6c0-0.6-0.4-1-1-1z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E ");
background-size: cover;
display: inline-block;
width: 45rpx;
height: 45rpx;
position: absolute;
bottom: 50rpx;
left:50%;
transform: translateX(-50%);
}
.icon-add{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Ctitle%3Eplus%3C/title%3E %3Cpath d='M19 11h-6v-6c0-0.6-0.4-1-1-1s-1 0.4-1 1v6h-6c-0.6 0-1 0.4-1 1s0.4 1 1 1h6v6c0 0.6 0.4 1 1 1s1-0.4 1-1v-6h6c0.6 0 1-0.4 1-1s-0.4-1-1-1z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E");
background-size: cover;
display: inline-block;
width: 50rpx;
height: 50rpx;
position: absolute;
bottom: 50rpx;
left:50%;
transform: translateX(-50%);
}
.icon-size{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E %3Ctitle%3Eformat-font-size%3C/title%3E %3Cpath d='M16 9v8h-2v-8h-4v-2h10v2h-4zM8 5v12h-2v-12h-6v-2h15v2h-7z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E ");
background-size: cover;
display: inline-block;
width: 50rpx;
height: 50rpx;
position: absolute;
bottom: 50rpx;
left:50%;
transform: translateX(-50%);
}
.icon-style{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E %3Ctitle%3Efont%3C/title%3E %3Cpath d='M24.987 0.506c-2.829 0-4.644-0.506-7.558-0.506-9.415 0-13.806 5.362-13.806 10.809 0 3.209 1.52 4.264 4.518 4.264-0.211-0.464-0.591-0.971-0.591-3.251 0-6.375 2.406-8.233 5.489-8.36 0 0-2.529 24.793-9.868 27.767v0.771h9.894l3.376-16h6.183l1.377-4h-6.716l1.623-7.693c1.858 0.38 3.673 0.76 5.235 0.76 1.942 0 3.715-0.591 4.686-5.066-1.182 0.38-2.449 0.506-3.842 0.506z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E");
background-size: cover;
display: inline-block;
width: 45rpx;
height: 45rpx;
position: absolute;
bottom: 50rpx;
left:50%;
transform: translateX(-50%);
}
/* 添加文字 */
.active-text{
position:absolute;
border: 4rpx solid rgba(180,180,180,0.8);
border-radius: 20rpx;
background-color: rgba(255,255,255,0.6);
color: '#000000';
font-size: 18;
font-style: 'normal';
font-weight: 'normal';
}
.compete-text{
border: 4rpx solid transparent;
position:absolute;
}
.confirm-bar1{
position:absolute;
top:20rpx;
left:40rpx;
width:60rpx;
height:60rpx;
z-index: 5;
background-color: #eee;
opacity: 0.7;
border-radius: 10rpx;
}
.confirm-bar2{
position:absolute;
top:20rpx;
right:40rpx;
width:60rpx;
height:60rpx;
z-index: 5;
background-color: #eee;
opacity: 0.7;
border-radius: 10rpx;
}
.confirm-bar1 .icon-cross{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Ctitle%3Ex%3C/title%3E %3Cpath d='M13.4 12l5.3-5.3c0.4-0.4 0.4-1 0-1.4s-1-0.4-1.4 0l-5.3 5.3-5.3-5.3c-0.4-0.4-1-0.4-1.4 0s-0.4 1 0 1.4l5.3 5.3-5.3 5.3c-0.4 0.4-0.4 1 0 1.4 0.2 0.2 0.4 0.3 0.7 0.3s0.5-0.1 0.7-0.3l5.3-5.3 5.3 5.3c0.2 0.2 0.5 0.3 0.7 0.3s0.5-0.1 0.7-0.3c0.4-0.4 0.4-1 0-1.4l-5.3-5.3z'%3E%3C/path%3E %3C/svg%3E");
background-size: cover;
display: block;
width: 50rpx;
height: 50rpx;
position: absolute;
top: 50%;
left:50%;
transform: translate(-50%,-50%);
}
.confirm-bar2 .icon-checkmark{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Ctitle%3Echeck%3C/title%3E %3Cpath d='M20.7 5.3c-0.4-0.4-1-0.4-1.4 0l-10.3 10.3-4.3-4.3c-0.4-0.4-1-0.4-1.4 0s-0.4 1 0 1.4l5 5c0.2 0.2 0.4 0.3 0.7 0.3s0.5-0.1 0.7-0.3l11-11c0.4-0.4 0.4-1 0-1.4z'%3E%3C/path%3E %3C/svg%3E");
background-size: cover;
display: block;
width: 50rpx;
height: 50rpx;
position: absolute;
top: 50%;
left:50%;
transform: translate(-50%,-50%);
}
.confirm-bar1:active .icon-cross{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Ctitle%3Ex%3C/title%3E %3Cpath d='M13.4 12l5.3-5.3c0.4-0.4 0.4-1 0-1.4s-1-0.4-1.4 0l-5.3 5.3-5.3-5.3c-0.4-0.4-1-0.4-1.4 0s-0.4 1 0 1.4l5.3 5.3-5.3 5.3c-0.4 0.4-0.4 1 0 1.4 0.2 0.2 0.4 0.3 0.7 0.3s0.5-0.1 0.7-0.3l5.3-5.3 5.3 5.3c0.2 0.2 0.5 0.3 0.7 0.3s0.5-0.1 0.7-0.3c0.4-0.4 0.4-1 0-1.4l-5.3-5.3z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E");
}
.confirm-bar2:active .icon-checkmark{
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Ctitle%3Echeck%3C/title%3E %3Cpath d='M20.7 5.3c-0.4-0.4-1-0.4-1.4 0l-10.3 10.3-4.3-4.3c-0.4-0.4-1-0.4-1.4 0s-0.4 1 0 1.4l5 5c0.2 0.2 0.4 0.3 0.7 0.3s0.5-0.1 0.7-0.3l11-11c0.4-0.4 0.4-1 0-1.4z' fill='%23d6204b'%3E%3C/path%3E %3C/svg%3E");
}
.container{
padding: 0;
}
.installForm{
width: 100%;
height: 100%;
}
.address{
width: 100%;
margin: 0rpx 10rpx 0rpx 10rpx;
border-radius: 5px;
box-shadow: 5px 5px 5px #ccc;
position:fixed;
top:0;
}
.selectAddress{
width: 100%;
height: 80rpx;
background: #fff;
border-bottom: 1px solid #F2F2F2;
}
.address_province{
width: 33%;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
background: #fff;
float:left;
text-align: center;
}
.address_city{
width: 50%;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
background: #fff;
float:left;
text-align: center;
}
.address_number{
width: 100%;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
background: #fff;
float:left;
text-align: center;
}
.selecrtImg{
float:right;
margin-top: 10rpx;
}
.installTable{
width: 94%;
height: 200rpx;
background: #fff;
margin: 50rpx 0 0 3%;
box-shadow: 0px 2px 5px #ccc;
}
.devEui{
width: 100%;
height: 100rpx;
border-bottom: 1px solid #F2F2F2;
}
.devText{
width: 20%;
height: 102rpx;
line-height: 100rpx;
font-size: 28rpx;
padding-left: 10rpx;
float:left;
}
.devCode{
width: 65%;
height: 100rpx;
line-height: 100rpx;
font-size: 28rpx;
color: #ccc;
float:left;
}
.codeImg{
float:right;
margin: 26rpx 26rpx 0 0;
}
.status{
width: 100%;
height: 100rpx;
}
.status_btn{
width: 75%;
height: 100rpx;
line-height: 100rpx;
font-size: 28rpx;
float: left;
}
/* 绑定成功 */
.status_success{
padding: 5rpx 20rpx;
line-height: 60rpx;
margin-top: 15rpx;
background: #17D436;
border-radius: 20px;
color: #fff;
float: left;
}
/* 待绑定 */
.status_waiting{
padding: 5rpx 20rpx;
line-height: 60rpx;
margin-top: 15rpx;
background: #BCBCBC;
border-radius: 20px;
color: #fff;
float: left;
}
/* 绑定中.. */
.status_ing{
padding: 5rpx 20rpx;
line-height: 60rpx;
margin-top: 15rpx;
background: #FFB14B;
border-radius: 20px;
color: #fff;
float: left;
}
/* 绑定失败 */
.status_fail{
padding: 5rpx 20rpx;
line-height: 60rpx;
margin-top: 15rpx;
background: #FF5C5C;
border-radius: 20px;
color: #fff;
float: left;
}
.sure{
width: 94%;
height: 80rpx;
line-height: 80rpx;
margin: 50rpx 0 0 3%;
}
.sureBtn{
width: 100%;
background: #2B9CED;
font-size: 28rpx;
color: #fff;
box-shadow: 0px 2px 5px #ccc;
}
.message-input {
position: fixed;
bottom: 0;
width: 100%;
background-color: #efefef;
padding: 20rpx 0 0;
z-index: 99;
}
.message-input>input {
font-size: 30rpx;
border: solid #ddd 1rpx;
width: 71%;
min-height: 60rpx;
height: 100%;
margin-left: 20rpx;
padding: 5rpx 10rpx;
border-radius: 8rpx;
margin-bottom: 15rpx;
color: #333;
background-color: #fff;
}
.showSend{
width:65% !important;
}
.message-input>button {
width: 100rpx;
height: 60rpx;
background-color: #7dca4a;
font-size: 28rpx;
color: #fff;
margin-top: -82rpx;
float: right;
margin-right: 20rpx;
padding: 0;
line-height: 60rpx;
}
\ No newline at end of file
// pages/my/my.js
// pages/my/my.js
var config = wx.getStorageSync("config");
var app = getApp();
var log = require('./../../utils/log.js')
Page({
/**
* 页面的初始数据
*/
data: {
/* 用于判断是否已经登陆 */
nyxCode : "",
authStatus : "0",
userInfo : {},
matchSeason : "",
bGetUserInfo : false,
bUpdateUserData: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
matchSeason: wx.getStorageSync('matchSeason'),
})
}
wx.setNavigationBarTitle({
title: '我的',
});
log.info("my_onLoad_nyxCode", _this.data.nyxCode)
log.info("my_onLoad_authStatus", _this.data.authStatus)
log.info("my_onLoad_userInfo", _this.data.userInfo)
log.info("my_onLoad_matchSeason", _this.data.matchSeason)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var _this = this
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
matchSeason: wx.getStorageSync('matchSeason'),
})
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
onToUser :function(e){
wx.navigateTo({
url: '/pages/my/user/user',
})
},
//具体的登陆及授权功能 - 在用户信息加密后(encryptedData)传到java后台, 后台进一步处理
login: function (e) {
config.debug==1?console.log("==login_登陆及授权"):""
var _this = this;
wx.login({
success: function (res) {
var code = res.code;
config.debug==1? console.log("===login_code_", code):""
wx.getUserInfo({
success: function (res) {
config.debug == 1 ? console.log("===wx.getUserInfo_res_获取用户信息成功", res) : ""
log.info("===wx.getUserInfo_res_获取用户信息成功", res)
//userInfo直接获取
/* userInfo
- nickName
- avatarUrl
- gender
- province
- city
- country
*/
wx.setStorageSync('userInfo', res.userInfo)
_this.setData({
userInfo: res.userInfo,
bGetUserInfo: false,
})
//通过openid换取唯一的nyxCode
//同时更新userInfo
var nyxCode = _this.data.nyxCode
wx.request({
url: config.user_login_url,
method: 'post',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
data: { encryptedData: res.encryptedData, iv: res.iv, code: code, userId : nyxCode },
success: function (res) {
config.debug==1?console.info("===wx.login_data_", res):""
log.info("===wx.login_data_", res)
wx.setStorageSync('nyxCode', res.data.data.id)
wx.setStorageSync('authStatus', res.data.data.authStatus)
_this.setData({
nyxCode: res.data.data.id,
authStatus: res.data.data.authStatus,
})
log.info("my_onLoad_nyxCode", _this.data.nyxCode)
log.info("my_onLoad_authStatus", _this.data.authStatus)
log.info("my_onLoad_userInfo", _this.data.userInfo)
log.info("my_onLoad_matchSeason", _this.data.matchSeason)
//载入页面
getCurrentPages()[getCurrentPages().length - 1].onLoad()
},
fail: function () {
console.log('系统错误')
}
})
//平台登录
},
fail: function (res) {
config.debug == 1 ? console.log("获取用户信息失败", res) : ""
_this.setData({
bGetUserInfo: false,
})
}
})
}
})
},
//跳转设置页面授权
openSetting: function () {
var _this = this
if (wx.openSetting) {
wx.openSetting({
success: function (res) {
//尝试再次登录并授权
_this.login()
}
})
} else {
wx.showModal({
title: '授权提示',
content: '小程序需要您的微信授权才能使用哦~'
})
}
},
// 获取用户授权信息
getUserInfo: function (e) {
let _this = this;
config.debug==1?console.log("===getUserInfo_e_"+e):""
// 获取用户信息
wx.getSetting({
success(res) {
config.debug == 1 ? console.log("===getUserInfo_res_" + res) : ""
if (res.authSetting['scope.userInfo']) { // 判断获取用户信息是否授权
config.debug == 1 ? console.log("已授权=====") : ""
// 已经授权, 可以直接调用 getUserInfo 获取用户信息
_this.login()
} else {
config.debug == 1 ? console.log("未授权=====") : ""
//重新进行授权
_this.openSetting()
}
}
})
},
// 打开权限设置页提示框
showSettingToast: function (e) {
wx.showModal({
title: '酒肆提示',
confirmText: "授权后即可访问'我的'功能哦",
showCancel: false,
content: e,
success: function (res) {
if (res.confirm) {
wx.navigateTo({
url: './setting/setting',
})
}
}
})
},
})
\ No newline at end of file
<view class="page">
<view class="page">
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_access">
<view class="userInfo">
<block wx:if="{{authStatus=='1'}}" >
<!-- 已登录 -->
<view class="userInfo" bindtap="onToUser">
<image class="avatar" src="{{userInfo.avatarUrl}}"></image>
<view>{{userInfo.nickName}}</view>
</view>
</block>
<block wx:else>
<!-- 未登陆 -->
<button open-type="getUserInfo" bindgetuserinfo="getUserInfo" style="border:0px solid red;background-color:#fff;font-size:17px" plain='true'>
<image class="avatar" src="{{userInfo.avatarUrl}}"></image>
<view style="line-height:1; font-size:14px">{{userInfo.nickName}}</view>
<view style="line-height:1">立即登录</view>
</button>
</block>
</view>
</view>
</view>
<view class="weui-cells">
<navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/my/rank/rank">
<view class="weui-cell__hd">
<image src="/icon/rank1.png" />
</view>
<view class="weui-cell__bd">我的排名</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
<!-- <navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/my/record/record">
<view class="weui-cell__hd">
<image src="/icon/match.png"/>
</view>
<view class="weui-cell__bd">我的挑战</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator> -->
<navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/my/myposts/myposts">
<view class="weui-cell__hd">
<image src="/icon/comment.png"/>
</view>
<view class="weui-cell__bd">我的评论</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
</view>
</view>
\ No newline at end of file
.page{
.page{
height: 100vh;
background: #F4F8FB;
}
.weui-cell__hd {
font-size: 0;
}
.weui-cell__hd image {
width: 100rpx;
height: 100rpx;
margin-right: 18px;
margin-left: 5px;
vertical-align: middle;
}
.weui-cell__ft_in-access {
padding-right:13px;
position:relative;
}
.userInfo{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
}
.thumb{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
overflow: hidden;
}
.name{
margin: 30rpx;
}
.avatar{
width: 100rpx;
height: 100rpx;
overflow:hidden;
border-radius: 50%;
}
// pages/collect/collect.js
// pages/collect/collect.js
var config = wx.getStorageSync("config");
Page({
/**
* 页面的初始数据
*/
data: {
//用户信息初始化
nyxCode: "",
authStatus: "",
userInfo: {},
matchSeason: "",
/* 评论 */
isHideLoadMore: false,
pageIndex: 1, //分页搜索的page index
// {
// commentType: "quiz",
// objectName : "对于红葡萄酒来说",
// createDatetime : "Feb 02",
// nicknameTo : "张三",
// contentTo : "在哪里可以买到",
// content : "上海大悦城",
// },
commentList: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
wx.setNavigationBarTitle({
title: '我的评论',
})
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
matchSeason: wx.getStorageSync('matchSeason'),
})
}
//注册用户则显示comment列表
if (_this.data.authStatus == '1') {
_this.getComment(0, 1, 4, '0', _this.data.nyxCode)
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
var _this = this;
//注册用户则显示comment列表
if (_this.data.authStatus == '1') {
console.log('页面上拉触底')
var isHideLoadMore = _this.__data__.isHideLoadMore;
var objectId = '0' //获取objectId的值
var userId = _this.__data__.nyxCode;//获取userId值
var pageIndex = _this.__data__.pageIndex;
//判断是否已经全部加载完毕
//没有则加载更多
if (!isHideLoadMore) {
console.log('加载更多')
setTimeout(() => {
_this.getComment(1, pageIndex, 4, objectId, userId);
}, 1000)
}
else {
console.log('没有更多')
}
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/*
* 用户自定义函数
* 查看评论
* 输入值为quiz id
* 默认返回5条
*/
// 获取评论 per quiz id
getCommentFunc(scrollType, pageNum, pageCount, objectId, userId)
{
var _this = this;
var strUrl = "";
if (pageNum != 0 && pageCount != 0) {
strUrl = config.msg_query_url + "?pageCount=" + pageCount
+ "&pageNum=" + pageNum
+ "&objectId=" + objectId
+ "&userId=" + userId
}
config.local==1?console.log("==getCommentFunc strUrl_"+strUrl):""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.data.resultCode == 200) {
//表示查询成功
console.log(res.data);
var list = res.data.data
var bisHideLoadMoreType = false;
if (list.length < pageCount) {
bisHideLoadMoreType = true;
}
//进行翻页设置(加载更多)
if (scrollType == 1) {
var commentList = _this.__data__.commentList;
list = commentList.concat(list)
}
_this.setData({
commentList: list,
isHideLoadMore: bisHideLoadMoreType,
pageIndex: pageNum + 1,
})
config.debug==1?console.log("commentList", list):""
}
}
})
},
getComment(scrollType, pageNum, pageCount, objectId, userId) {
var _this = this;
if(objectId != "0" || userId != "0")
{
_this.getCommentFunc(scrollType, pageNum, pageCount, objectId, userId);
}
else
{
_this.setData({
isHideLoadMore: true,
})
}
},
})
\ No newline at end of file
<!-- 我的评论-->
<!-- 我的评论-->
<!-- ./pages/my/myposts/myposts.wxml -->
<wxs module="tutil" src="../../../utils/date.wxs"></wxs>
<view class="page" >
<view wx:for="{{commentList}}">
<view class="weui-panel__hd">知识竞答: {{item.objectName}}</view>
<!-- <view class="page__title" style="padding-left: 20px">知识竞答: {{item.objectName}}</view> -->
<!-- <view class="weui-cells weui-cells_after-title">
<navigator url="" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
<view class="weui-cell__bd">知识竞答: {{item.objectName}}</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
</view> -->
<view class="weui-flex" style="padding-left: 15px">
<view class="weui-flex__item">
<view class="placeholder_left">
<view class="weui-media-box weui-media-box_small-appmsg">
<view class="weui-cells weui-cells_in-small-appmsg">
<view class="weui-cell weui-cell_example weui-cell_access">
<view class="weui-cell__hd">
{{tutil.formatDate_md(item.createDatetime)}}
</view>
<view class="weui-cell__bd" style="text-align:left;padding-left:20rpx;">
<block wx:if="{{item.nicknameTo==null}}" >
<!-- 评论 -->
<view class="weui-media-box__desc;" style="padding-top: 0px">评论: {{item.content}}
</view>
</block>
<block wx:else>
<!-- 回复 -->
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-media-box__desc">@{{item.nicknameTo}}: {{item.contentTo}}
</view>
<view class="weui-media-box__desc">回复: {{item.content}}
</view>
</view>
</block>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view hidden="authStatus=='0'">
<view class="weui-loadmore" hidden="{{isHideLoadMore}}">
<view class="weui-loading"></view>
<view class="weui-loadmore__tips">正在加载</view>
</view>
<view class="weui-loadmore" hidden="{{!isHideLoadMore}}">
<view class="weui-loadmore__tips">没有更多啦 {{'>'}}_{{'<'}} </view>
</view>
</view>
<block wx:if="{{authStatus=='1'}}" >
<view class="weui-loadmore" hidden="{{commentList.length!=0}}">
<view class="weui-loadmore__tips">您还未进行评论 {{'>'}}_{{'<'}} </view>
</view>
</block>
<block wx:else>
<view hidden="{{false}}">
<view class="userInfo">请先登录, 以显示您的评论信息~</view>
</view>
</block>
</view>
\ No newline at end of file
.page span{
.page span{
font-size: 45rpx;
}
.userInfo{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
}
/* 加载更多 */
.weui-loading {
margin: 0 5px;
width: 20px;
height: 20px;
display: inline-block;
vertical-align: middle;
-webkit-animation: weuiLoading 1s steps(12, end) infinite;
animation: weuiLoading 1s steps(12, end) infinite;
background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;
background-size: 100%;
}
.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;
}
// pages/my/rank/rank.js
// pages/my/rank/rank.js
var config = wx.getStorageSync("config");
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
//用户信息初始化
nyxCode: "",
authStatus: "",
userInfo: {},
matchSeason: "",
// {
// rankId : "rid_001",
// defaultType : "1",
// matchType : "竞答",
// title : "泥煤怪兽",
// rank : "1",
// score : "200",
// ratio : "96%",
// },
rankList : [],
isHideLoadMore: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
wx.setNavigationBarTitle({
title: '我的排名',
})
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
matchSeason: wx.getStorageSync('matchSeason'),
})
}
//注册用户则显示rank值
if(_this.data.authStatus=='1')
{
_this.getMatchRank(0, 1, 4, _this.data.nyxCode);
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
// 用户自定义函数
/*
* 更新match rank list
*/
updateRankDefault(rankList)
{
var _this = this;
var strUrl = config.match_rank_update_url;
wx.request({
url: strUrl,
method: 'POST',
data: JSON.stringify(rankList),
header: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Cookie': wx.getStorageSync('cookieKey'),
},
dataType: "json",
success: function (res) {
console.log(res.data);
//载入页面
//that.onTypeNext();
} // end success
}) // end wx.request
},
onUpdateDefault: function (e) {
var _this = this;
let rankId = e.currentTarget.dataset.rankid; //获取rankid的值
let selectValue = e.currentTarget.dataset.defaulttype; //获取defaultType的值
//被选中项如果是"0",则将选中项置为defaultType "1"
if(selectValue == "0")
{
var rankList = _this.__data__.rankList;//获取userid
var updateValue = selectValue == "1" ? "0" : "1";
for (var j = 0; j < rankList.length; j++) {
if (rankList[j].rankId == rankId) { rankList[j].defaultType = updateValue }
else { rankList[j].defaultType = selectValue }
}
//排序, 默认将defaultType=="1"至于最前
rankList.sort(function (a, b) {
return b.defaultType - a.defaultType
});
_this.setData({
rankList: rankList,
})
_this.updateRankDefault(rankList);
}
},
// 获取随机数据
getMatchRank(scrollType, pageNum, pageCount, userId) {
var _this = this;
var strUrl = "";
if (pageNum != 0 && pageCount != 0) {
strUrl = config.match_rank_query_url + "?pageCount=" + pageCount
+ "&pageNum=" + pageNum
+ "&matchTeam=" + userId
}
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.data.resultCode == 200) {
//表示查询成功
console.log(res.data);
var list = res.data.data
var bisHideLoadMoreType = false;
if (list.length < pageCount) {
bisHideLoadMoreType = true;
}
//进行翻页设置(加载更多)
if (scrollType == 1) {
var rankList = _this.__data__.rankList;
list = rankList.concat(list)
}
//排序, 默认将defaultType=="1"至于最前
list.sort(function (a, b) {
return b.defaultType - a.defaultType
});
_this.setData({
rankList: list,
isHideLoadMore: bisHideLoadMoreType,
pageIndex: pageNum + 1,
})
}
}
})
},
})
\ No newline at end of file
<wxs module="tutil" src="../../../utils/date.wxs"></wxs>
<wxs module="tutil" src="../../../utils/date.wxs"></wxs>
<view class="page">
<!-- start of for -->
<view wx:for="{{rankList}}" wx:key="{{rankList}}">
<view class="weui-cells" >
<view class="weui-cell weui-cell_access">
<view class="weui-cell__hd" bind:tap="onUpdateDefault" data-rankid="{{item.rankId}}" data-defaulttype="{{item.defaultType}}">
<image src="{{item.defaultType=='1'?'/icon/my/honor.png':'/icon/my/honor_0.png'}}" />
</view>
<!-- start of bd -->
<view class="weui-cell__hd">
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-media-box__desc" style="font-size:17px;color:rgba(0,0,0,1);">{{item.title}}
</view>
<view class="weui-media-box__desc" style="font-size:14px;color:rgba(0,0,0,1);">{{item.matchName}} · {{item.score}}分
</view>
</view>
</view>
<!-- end of bd -->
<!-- start of bd -->
<view class="weui-cell__bd" style="padding-left:10px">
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-media-box__desc" style="font-size:17px;color:rgba(0,0,0,1);">排名: 第{{item.rank}}
</view>
<view class="weui-media-box__desc" style="font-size:14px;color:rgba(0,0,0,1);">恭喜超越{{tutil.toFix(item.ratioRank)}}%的酒友
</view>
</view>
</view>
<!-- end of bd -->
</view>
</view>
</view>
<!-- end of for -->
<block wx:if="{{authStatus=='1'}}" >
<view class="weui-loadmore" hidden="{{rankList.length!=0}}">
<view class="weui-loadmore__tips">您还未进行竞答 {{'>'}}_{{'<'}} </view>
</view>
</block>
<block wx:else>
<view hidden="{{false}}">
<view class="userInfo">请先登录, 以显示您的排名信息~</view>
</view>
</block>
</view>
\ No newline at end of file
.page{
.page{
height: 100vh;
background: #F4F8FB;
}
.weui-cell__hd {
font-size: 0;
}
.weui-cell__hd image {
width: 100rpx;
height: 100rpx;
margin-right: 18px;
margin-left: 5px;
vertical-align: middle;
}
.weui-cell__ft_in-access {
padding-right:13px;
position:relative;
}
.userInfo{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
}
.thumb{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
overflow: hidden;
}
.name{
margin: 30rpx;
}
.avatar{
width: 100rpx;
height: 100rpx;
overflow:hidden;
border-radius: 50%;
}
// pages/user/user.js
// pages/user/user.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
<view class="page">
<view class="page">
<view class="userInfo">
<view class="userinfo">
<view class="head-img">
<open-data class="thumb"type="userAvatarUrl"></open-data>
<open-data class="name" lang="zh_CN" type="userNickName"></open-data>
</view>
<view class="userMessage">
<view class="messageBox">
<view class="focus">
<span class="focusNum">0</span>
<span>关注</span>
</view>
<view class="border">|</view>
<view class="fans">
<span class="fansNum">1</span>
<span>粉丝</span>
</view>
<view class="border">|</view>
<view class="praise-collect">
<span class="colllectNum">0</span>
<span>赞与收藏</span>
</view>
</view>
</view>
</view>
<view class="grade">
<image class="grade-icon" src="/icon/grade-img.png"></image>
<span>等级:</span>
</view>
<view class="userDesc">
<span>还没有简介</span>
</view>
</view>
</view>
.page{
.page{
height: 100vh;
background: #f5f8fa;
}
.userinfo{
width: 100%;
height: 450rpx;
background: rgb(185, 172, 155);
}
.head-img{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
padding-top: 30px;
}
.thumb{
width: 120rpx;
height: 120rpx;
border: 1px solid #ffffff;
border-radius: 50%;
overflow: hidden;
}
.name{
margin: 30rpx;
color: #ffffff;
}
.userMessage{
display: flex;
justify-content: center; /*子元素水平居中*/
align-items: center; /*子元素垂直居中*/
}
.messageBox{
width: 650rpx;
height: 150rpx;
}
.focus, .fans, .praise-collect{
width: 200rpx;
color: #ffffff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
float: left;
}
.border{
color: #ffffff;
width: 20rpx;
height: 150rpx;
float: left;
}
.grade{
height: 70rpx;
color: #6d6d6d;
background: #ffffff;
display: flex;
justify-content: center; /*子元素水平居中*/
align-items: center; /*子元素垂直居中*/
}
.grade-icon{
width: 50rpx;
height: 50rpx;
margin-right: 10rpx;
}
.userDesc{
height: 120rpx;
color: #6d6d6d;
background: #ffffff;
}
.userDesc span{
margin-left: 30rpx;
}
{
{
"description": "项目配置文件。",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"coverView": true,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"libVersion": "2.9.4",
"appid": "wx72555e77d9e5cee2",
"projectname": "nyx-master",
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
\ No newline at end of file
{
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 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}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 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:8px;background-color:#fff;line-height:1.41176471;font-size:17px}.weui-cells:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-cells:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-cells__title{margin-top:16px;margin-bottom:3px;padding-left:16px;padding-right:16px;color:rgba(0,0,0,.5);font-size:14px}.weui-cells_after-title{margin-top:0}.weui-cells__tips{margin-top:3px;color:rgba(0,0,0,.5);padding-left:16px;padding-right:16px;font-size:14px}.weui-cell{padding:16px;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 rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.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:rgba(0,0,0,.5)}.weui-cell_label-block,.weui-cell_wxss.weui-cell_wxss:before{display:block}.weui-cell_label-block .weui-label{width:auto;word-break:normal;-webkit-hyphens:auto;hyphens:auto}.weui-cell_access{color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-cell__ft_in-access{padding-right:16px;position:relative}.weui-cell__ft_in-access:after{content:" ";display:inline-block;height:8px;width:8px;border-width:2px 2px 0 0;border-color:#b2b2b2;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:-5px;right:0}.weui-cell_link{color:#576b95;font-size:17px}.weui-cell_link:active{background-color:#ececec}.weui-cell_link:first-child:before{display:block}.weui-cells_checkbox .weui-check__label:before{left:55px}.weui-check__label:active{background-color:#ececec}.weui-check{position:absolute;left:-9999px}.weui-check__hd_in-checkbox{padding-right:16px}.weui-cell__ft_in-radio{padding-left:16px}.weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:1.41176471em;min-height:1.41176471em;line-height:1.41176471}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:rgba(0,0,0,.3);text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#fa5151}.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:16px;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 rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-form-preview__bd{padding:16px;font-size:.9em;text-align:right;color:rgba(0,0,0,.5);line-height:2}.weui-form-preview__ft{position:relative;line-height:56px;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 rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:rgba(0,0,0,.5);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:#576b95;text-align:center;font-weight:700;font-size:17px}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#ececec}.weui-form-preview__btn_default{color:rgba(0,0,0,.9)}.weui-form-preview__btn_primary{color:#576b95}.weui-cell_select{padding:0;overflow:hidden}.weui-cell_select .weui-select{padding-right:30px}.weui-cell_select .weui-cell__bd:after{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-select{-webkit-appearance:none;border:0;outline:0;background-color:transparent;width:100%;font-size:inherit;height:56px;line-height:56px;position:relative;z-index:1;padding-left:16px}.weui-cell_select-before{padding-right:16px}.weui-cell_select-before .weui-select{width:105px;box-sizing:border-box}.weui-cell_select-before .weui-cell__hd{position:relative}.weui-cell_select-before .weui-cell__hd:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-cell_select-before .weui-cell__hd:before{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-cell_select-before .weui-cell__bd{padding-left:16px}.weui-cell_select-before .weui-cell__bd:after{display:none}.weui-cell_select-before.weui-cell_access .weui-cell__hd{line-height:56px;padding-left:32px}.weui-cell_select-after{padding-left:16px}.weui-cell_select-after .weui-select{padding-left:0}.weui-cell_select-after.weui-cell_access .weui-cell__bd{line-height:56px}.weui-cell_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:3.29411765em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1rpx solid rgba(0,0,0,.1);line-height:3.29411765em;font-size:17px;color:#576b95;white-space:nowrap}button.weui-vcode-btn{min-height:0;background-color:transparent;border:0;outline:0}.weui-vcode-btn:active{color:#767676}.weui-cell_switch{padding-top:12px;padding-bottom:12px}.weui-uploader{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__hd{padding-bottom:16px}.weui-uploader__overview{display:-webkit-box;display:-webkit-flex;display:flex;-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__tips{color:rgba(0,0,0,.3);font-size:14px;line-height:1.4;padding-top:4px}.weui-uploader__info{color:rgba(0,0,0,.3)}.weui-uploader__bd{margin-bottom:-8px;margin-right:-8px;overflow:hidden}.weui-uploader__file{float:left;margin-right:8px;margin-bottom:8px}.weui-uploader__img{display:block;width:96px;height:96px}.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:8px;margin-bottom:8px;width:96px;height:96px;box-sizing:border-box;background-color:#ededed}.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:#a3a3a3}.weui-uploader__input-box:before{width:2px;height:32px}.weui-uploader__input-box:after{width:32px;height:2px}.weui-uploader__input-box:active{border-color:#8b8b8b}.weui-uploader__input-box:active:after,.weui-uploader__input-box:active:before{background-color:#8b8b8b}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0}.weui-article{padding:24px 16px;padding:24px calc(16px + constant(safe-area-inset-right)) calc(24px + constant(safe-area-inset-bottom)) calc(16px + constant(safe-area-inset-left));padding:24px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));font-size:17px;color:rgba(0,0,0,.9)}.weui-article__section{margin-bottom:1.5em}.weui-article__h1{font-size:22px;font-weight:700;margin-bottom:.9em;line-height:1.4}.weui-article__h2{font-size:17px}.weui-article__h2,.weui-article__h3{font-weight:700;margin-bottom:.34em;line-height:1.4}.weui-article__h3{font-size:15px}.weui-article__p{margin:0 0 .8em}.weui-msg{padding-top:36px;padding:calc(36px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(36px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);text-align:center;line-height:1.4;min-height:100%;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;background-color:#fff}.weui-msg__link{color:#576b95;display:inline-block;vertical-align:baseline}.weui-msg__icon-area{margin-bottom:32px}.weui-msg__text-area{margin-bottom:32px;padding:0 32px;-webkit-box-flex:1;-webkit-flex:1;flex:1;line-height:1.6}.weui-msg__text-area:first-child{padding-top:96px}.weui-msg__title{margin-bottom:5px;font-weight:700;font-size:22px;word-wrap:break-word;word-break:break-all}.weui-msg__desc{font-size:17px;color:rgba(0,0,0,.9)}.weui-msg__desc,.weui-msg__desc-primary{word-wrap:break-word;word-break:break-all;margin-bottom:16px}.weui-msg__desc-primary{font-size:14px;color:rgba(0,0,0,.5)}.weui-msg__opr-area{margin-bottom:16px}.weui-msg__opr-area .weui-btn-area{margin:0 16px}.weui-msg__opr-area .weui-btn+.weui-btn{margin-bottom:16px}.weui-msg__opr-area:last-child{margin-bottom:96px}.weui-msg__opr-area+.weui-msg__extra-area{margin-top:48px}.weui-msg__tips-area{margin-bottom:16px;padding:0 40px}.weui-msg__opr-area+.weui-msg__tips-area{margin-bottom:48px}.weui-msg__tips-area:last-child{margin-bottom:64px}.weui-msg__extra-area,.weui-msg__tips{font-size:12px;color:rgba(0,0,0,.5)}.weui-msg__extra-area{position:static;margin-bottom:24px}.weui-cells__group_form:first-child .weui-cells__title{margin-top:0}.weui-cells__group_form .weui-cells__title{margin-top:24px;margin-bottom:8px;padding:0 32px}.weui-cells__group_form .weui-cell:before,.weui-cells__group_form .weui-cells:before{left:32px;right:32px}.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before{left:72px}.weui-cells__group_form .weui-cells:after{left:32px;right:32px}.weui-cells__group_form .weui-cell{padding:16px 32px;color:rgba(0,0,0,.9)}.weui-cells__group_form .weui-cell__hd{padding-right:16px}.weui-cells__group_form .weui-cell__ft{padding-left:16px}.weui-cells__group_form .weui-cell_warn input{color:#fa5151}.weui-cells__group_form .weui-label{max-width:5em;margin-right:8px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:rgba(0,0,0,.3)}.weui-cells__group_form .weui-cells__tips a{font-weight:700}.weui-cells__group_form .weui-cell_vcode{padding:12px 32px}.weui-cells__group_form .weui-vcode-btn{font-size:16px;padding:0 12px;margin-left:0;height:auto;width:auto;line-height:2em;color:#06ae56;background-color:#f2f2f2}.weui-cells__group_form .weui-vcode-btn:before{display:none}.weui-cells__group_form .weui-cell_select{padding:0}.weui-cells__group_form .weui-cell_select .weui-select{padding:0 32px}.weui-cells__group_form .weui-cell_select .weui-cell__bd:after{right:32px}.weui-cells__group_form .weui-cell_select-before .weui-label{margin-right:24px}.weui-cells__group_form .weui-cell_select-before .weui-select{padding-right:24px;box-sizing:initial}.weui-cells__group_form .weui-cell_select-after{padding-left:32px}.weui-cells__group_form .weui-cell_select-after .weui-select{padding-left:0}.weui-cells__group_form .weui-cell_switch{padding:12px 32px}.weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}.weui-form{padding:56px 0 0;padding:calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;min-height:100%;box-sizing:border-box;line-height:1.4;background-color:#fff}.weui-form a:not(.weui-btn){color:#576b95}.weui-form .weui-footer,.weui-form .weui-footer__link{font-size:12px}.weui-form .weui-agree{padding:0}.weui-form__text-area{padding:0 32px;color:rgba(0,0,0,.9);text-align:center}.weui-form__control-area{-webkit-box-flex:1;-webkit-flex:1;flex:1;margin:48px 0}.weui-form__extra-area,.weui-form__tips-area{margin-bottom:24px;text-align:center}.weui-form__opr-area{margin-bottom:64px}.weui-form__opr-area:last-child{margin-bottom:96px}.weui-form__title{font-size:22px;font-weight:700;line-height:1.36}.weui-form__desc{font-size:17px;margin-top:16px}.weui-form__tips{color:rgba(0,0,0,.5);font-size:12px}.weui-flex{display:-webkit-box;display:-webkit-flex;display:flex}.weui-flex__item{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn+.weui-btn{margin-top:16px}.weui-btn.weui-btn_inline+.weui-btn.weui-btn_inline{margin-top:auto;margin-left:16px}.weui-btn-area{margin:48px 16px 8px}.weui-btn-area_inline{display:-webkit-box;display:-webkit-flex;display:flex}.weui-btn-area_inline .weui-btn{margin-top:auto;margin-right:16px;width:100%;-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn-area_inline .weui-btn:last-child{margin-right:0}.weui-agree{display:block;padding:.5em 15px;font-size:13px}.weui-agree__text{color:rgba(0,0,0,.5)}.weui-agree__link{display:inline;color:#576b95}.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:rgba(0,0,0,.3);font-size:14px;line-height:1.4;text-align:center}.weui-footer_fixed-bottom{position:fixed;bottom:16px;bottom:calc(16px + constant(safe-area-inset-bottom));bottom:calc(16px + env(safe-area-inset-bottom));left:0;right:0}.weui-footer__links{font-size:0}.weui-footer__link{display:inline-block;vertical-align:top;margin:0 8px;position:relative;font-size:14px;color:#576b95}.weui-footer__link:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #c7c7c7;color:#c7c7c7;left:-8px;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 rgba(0,0,0,.1);border-left:1rpx solid rgba(0,0,0,.1);overflow:hidden}.weui-grid{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid rgba(0,0,0,.1);border-bottom:1rpx solid rgba(0,0,0,.1)}.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:rgba(0,0,0,.9);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)}}.wx_dot_loading,.wx_dot_loading:after,.wx_dot_loading:before{display:inline-block;vertical-align:middle;width:6px;height:6px;border-radius:50%;background-color:rgba(0,0,0,.3);font-size:0;-webkit-animation:c 1.6s step-start infinite;animation:c 1.6s step-start infinite}.wx_dot_loading{position:relative}.wx_dot_loading:before{content:"";position:absolute;left:-12px;background-color:rgba(0,0,0,.1);-webkit-animation:b 1.6s step-start infinite;animation:b 1.6s step-start infinite}.wx_dot_loading:after{content:"";position:absolute;right:-12px;background-color:rgba(0,0,0,.5);-webkit-animation:d 1.6s step-start infinite;animation:d 1.6s step-start infinite}@-webkit-keyframes b{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@keyframes b{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@-webkit-keyframes c{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@keyframes c{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@-webkit-keyframes d{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}@keyframes d{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}.wx_dot_loading_white{background-color:hsla(0,0%,100%,.3);-webkit-animation:f 1.6s step-start infinite;animation:f 1.6s step-start infinite}.wx_dot_loading_white:before{background-color:hsla(0,0%,100%,.5);-webkit-animation:e 1.6s step-start infinite;animation:e 1.6s step-start infinite}.wx_dot_loading_white:after{background-color:hsla(0,0%,100%,.1);-webkit-animation:g 1.6s step-start infinite;animation:g 1.6s step-start infinite}@-webkit-keyframes e{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@keyframes e{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@-webkit-keyframes f{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@keyframes f{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@-webkit-keyframes g{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}@keyframes g{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}.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 rgba(0,0,0,.1);margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-.9em;padding:0 .55em;background-color:#fff;color:rgba(0,0,0,.5)}.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:rgba(0,0,0,.1)}.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#fa5151;color:#fff;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}.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 rgba(0,0,0,.1)}.weui-panel:after,.weui-panel:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-panel:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-panel__hd{padding:16px 16px 13px;color:rgba(0,0,0,.9);font-size:15px;font-weight:700;position:relative}.weui-panel__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-media-box{padding:16px;position:relative}.weui-media-box:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:1s6px}.weui-media-box:first-child:before{display:none}.weui-media-box__title{font-weight:400;font-size:17px;color:rgba(0,0,0,.9);width:auto;white-space:nowrap;word-wrap:normal;word-wrap:break-word;word-break:break-all}.weui-media-box__desc,.weui-media-box__title{line-height:1.4;overflow:hidden;text-overflow:ellipsis}.weui-media-box__desc{color:rgba(0,0,0,.5);font-size:14px;padding-top:4px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-media-box__info{margin-top:16px;padding-bottom:4px;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:16px;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:relative;z-index:500;background-color:#fff;border-bottom:1rpx solid rgba(0,0,0,.1);padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.weui-navbar+.weui-tab__panel{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:16px;padding:calc(16px + constant(safe-area-inset-top)) 16px 16px;padding:calc(16px + env(safe-area-inset-top)) 16px 16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-navbar__item:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-navbar__item.weui-bar__item_on{background-color:#ececec}.weui-navbar__item:first-child{padding-left:calc(16px + constant(safe-area-inset-left));padding-left:calc(16px + env(safe-area-inset-left))}.weui-navbar__item:last-child{padding-right:calc(16px + constant(safe-area-inset-right));padding-right:calc(16px + env(safe-area-inset-right))}.weui-navbar__item:last-child:after{display:none}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:2px;background-color:#07c160;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;display:none}.weui-navbar__title{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.weui-tabbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#f7f7f7}.weui-tabbar:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-tabbar__item{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:8px 0 4px;padding-bottom:calc(8px + constant(safe-area-inset-bottom));padding-bottom:calc(8px + env(safe-area-inset-bottom));font-size:0;color:rgba(0,0,0,.5);text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-tabbar__item:first-child{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-tabbar__item:last-child{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#07c160}.weui-tabbar__icon{display:inline-block;width:28px;height:28px;margin-bottom:2px}.weui-tabbar__icon>i,i.weui-tabbar__icon{font-size:24px;color:rgba(0,0,0,.5)}.weui-tabbar__icon image{width:100%;height:100%}.weui-tabbar__label{color:rgba(0,0,0,.9);font-size:10px;line-height:1.4}.weui-tab{display:-webkit-box;display:-webkit-flex;display:flex;height:100%;box-sizing:border-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.weui-tab__panel{box-sizing:border-box;-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}:host{width:100%}.weui-slideview{overflow:hidden;position:relative}.weui-slideview__left{position:relative;z-index:10}.weui-slideview__right{position:absolute;z-index:1;left:100%;top:0;height:100%}.weui-slideview__btn__wrp{position:absolute;left:0;bottom:0;text-align:center;min-width:69px;height:100%;white-space:nowrap}.weui-slideview__btn{color:#fff;padding:0 17px}.weui-slideview__btn-group_default .weui-slideview__btn{background:#c7c7cc}.weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #fff;color:#fff}.weui-slideview__btn-group_default:first-child:before{display:none}.weui-slideview__btn-group_warn .weui-slideview__btn{background:#fe3b30}.weui-slideview__btn-group_warn~.weui-slideview__btn-group_warn:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #fff;color:#fff}.weui-slideview__btn-group_warn:first-child:before{display:none}.weui-slideview_icon .weui-slideview__btn__wrp{background:transparent;font-size:0}.weui-slideview_icon .weui-slideview__btn__wrp:after{content:"";width:0;height:100%;vertical-align:middle;display:inline-block}.weui-slideview_icon .weui-slideview__btn__wrp:first-child{padding-left:16px}.weui-slideview_icon .weui-slideview__btn__wrp:last-child{padding-right:8px}.weui-slideview_icon .weui-slideview__btn{width:48px;height:48px;line-height:48px;padding:0;display:inline-block;vertical-align:middle;border-radius:50%;background-color:#fff}.weui-slideview_icon .weui-slideview__btn__icon{display:inline-block;vertical-align:middle;width:22px;height:22px}.weui-gallery{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;z-index:1000;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;opacity:0;visibility:hidden;-webkit-transition:opacity .3s;transition:opacity .3s}.weui-gallery_show{display:-webkit-box;display:-webkit-flex;display:flex;visibility:visible;opacity:1}.weui-gallery__img__wrp{-webkit-box-flex:1;-webkit-flex:1;flex:1;position:relative;font-size:0}.weui-gallery__img{background:50% no-repeat;background-size:contain;position:absoulte;width:100%;height:100%}.weui-gallery__opr{background-color:#0d0d0d;color:#fff;line-height:60px;min-height:60px;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);text-align:center}.weui-gallery__opr navigator{color:#fff}.weui-gallery__del{display:block}.weui-gallery__info{color:#fff;font-size:17px;line-height:60px;min-height:60px;text-align:center}.weui-search-bar{position:relative;padding:8px;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;background-color:#ededed;-webkit-text-size-adjust:100%;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-icon-search{margin-right:8px;font-size:14px;vertical-align:top;margin-top:.64em;height:1em;line-height:1em}.weui-icon-search_in-box{position:absolute;left:12px;top:50%;margin-top:-8px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:top}.weui-search-bar__form{position:relative;-webkit-box-flex:1;-webkit-flex:auto;flex:auto;border-radius:4px;background:#fff}.weui-search-bar__box{position:relative;padding-left:32px;padding-right:32px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:32px;line-height:32px;font-size:14px;caret-color:#07c160}.weui-icon-clear{position:absolute;top:0;right:0;bottom:0;padding:0 12px;font-size:0}.weui-icon-clear:after{content:"";height:100%;vertical-align:middle;display:inline-block;width:0;overflow:hidden}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:4px;text-align:center;color:rgba(0,0,0,.5);background:#fff;line-height:32px}.weui-search-bar__cancel-btn{margin-left:8px;line-height:32px;color:#576b95;white-space:nowrap}icon[type=success]:after,icon[type=success]:before{color:#07c160!important}.weui-mask{background:rgba(0,0,0,.6)}.weui-mask,.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-dialog__wrp{position:fixed;z-index:5000;top:16px;bottom:16px;left:16px;right:16px;text-align:center;font-size:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__wrp .weui-dialog{max-height:100%}.weui-dialog{background-color:#fff;text-align:center;border-radius:12px;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;max-height:90%}.weui-dialog__hd{padding:32px 24px 16px}.weui-dialog__title{font-weight:700;font-size:17px;line-height:1.4}.weui-dialog__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 24px;margin-bottom:32px;min-height:40px;font-size:17px;line-height:1.4;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;color:rgba(0,0,0,.5)}.weui-dialog__bd:first-child{padding:32px 24px 0;font-weight:700;color:rgba(0,0,0,.9);-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__bd:first-child,.weui-dialog__ft{display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft{position:relative;line-height:64px;min-height:64px;font-size:17px}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#576b95;font-weight:700;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:relative}.weui-dialog__btn:active{background-color:#ececec}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:rgba(0,0,0,.9)}@media screen and (min-width:352px){.weui-dialog{width:320px;margin:0 auto}}.weui-actionsheet{position:fixed;left:0;bottom:0;-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:5000;width:100%;background-color:#eae7e8;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden}.weui-actionsheet__title{position:relative;height:56px;padding:0 24px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;text-align:center;font-size:12px;color:rgba(0,0,0,.5);line-height:1.4;background:#fff}.weui-actionsheet__title:before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-actionsheet__title .weui-actionsheet__title-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-actionsheet__menu{color:rgba(0,0,0,.9);background-color:#fff}.weui-actionsheet__action{margin-top:8px;background-color:#fff;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-actionsheet__cell{position:relative;padding:16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-actionsheet__cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-actionsheet__cell:active{background-color:#ececec}.weui-actionsheet__cell:first-child:before{display:none}.weui-actionsheet__cell_warn{color:#fa5151}.weui-skin_android .weui-actionsheet{position:fixed;left:50%;top:50%;bottom:auto;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:274px;box-sizing:border-box;-webkit-backface-visibility:hidden;backface-visibility:hidden;background:transparent;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-radius:2px}.weui-skin_android .weui-actionsheet__action{display:none}.weui-skin_android .weui-actionsheet__menu{border-radius:2px;box-shadow:0 6px 30px 0 rgba(0,0,0,.1)}.weui-skin_android .weui-actionsheet__cell{padding:16px;font-size:17px;line-height:1.41176471;color:rgba(0,0,0,.9);text-align:left}.weui-skin_android .weui-actionsheet__cell:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.weui-skin_android .weui-actionsheet__cell:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.weui-actionsheet_toggle{-webkit-transform:translate(0);transform:translate(0)}.weui-half-screen-dialog{position:fixed;left:0;right:0;bottom:0;max-height:75%;z-index:5000;line-height:1.4;background-color:#fff;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden;padding:0 24px;padding:0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));padding:0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))}.weui-half-screen-dialog__hd{font-size:8px;height:8em;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-half-screen-dialog__hd .weui-icon-btn{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.weui-half-screen-dialog__hd__side{position:relative;left:-8px}.weui-half-screen-dialog__hd__main{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main{text-align:center;padding:0 40px}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side{right:-8px;left:auto}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn{right:0}.weui-half-screen-dialog__title{display:block;color:rgba(0,0,0,.9);font-weight:700;font-size:15px}.weui-half-screen-dialog__subtitle{display:block;color:rgba(0,0,0,.5);font-size:10px}.weui-half-screen-dialog__bd{word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;overflow-y:auto}.weui-half-screen-dialog__desc{padding-top:4px;font-size:17px;font-weight:700;color:rgba(0,0,0,.9);line-height:1.4}.weui-half-screen-dialog__tips{padding-top:16px;font-size:14px;color:rgba(0,0,0,.3);line-height:1.4}.weui-half-screen-dialog__ft{padding:40px 24px 32px;text-align:center}.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn{display:inline-block;vertical-align:top;margin:0 8px;width:120px}.weui-icon-btn{background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;background-size:100%;border:0;outline:0;font-size:0}.weui-icon-btn_goback{width:12px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M26 39.438L24.955 40.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42l7.666-7.79L26 24.563 18.682 32 26 39.438z'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_close{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E %3Cdefs%3E %3Cpath id='33cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a' d='M8 6.943L1.807.75.75 1.807 6.943 8 .75 14.193l1.057 1.057L8 9.057l6.193 6.193 1.057-1.057L9.057 8l6.193-6.193L14.193.75z'/%3E %3C/defs%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cuse fill='%23000' fill-opacity='.9' transform='translate(20 24)' xlink:href='%2333cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_more{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-374 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M380.75 32a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0zm5.25-1.75a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E %3C/g%3E%3C/svg%3E")}.weui-toptips{position:fixed;-webkit-transform:translateZ(0) translateY(-108%);transform:translateZ(0) translateY(-108%);text-align:center;top:8px;left:16px;right:16px;border-radius:4px;padding:8px;-webkit-border-radius:4px;color:hsla(0,0%,100%,.9);font-size:17px;line-height:1.4;background:rgba(250,81,81,.9);z-index:5000;word-wrap:break-word;word-break:break-all;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_warn{background-color:#fa5151}.weui-toptips_success{background-color:#09bb07}.weui-toptips_error{background-color:#fa5151}.weui-toptips_info{background-color:#10aeff}page{--height:44px;--right:190rpx}.weui-navigation-bar{overflow:hidden}.weui-navigation-bar .android{--height:48px;--right:222rpx}.weui-navigation-bar__inner{position:fixed;top:0;left:0;z-index:5001;height:var(--height);padding-right:var(--right);width:calc(100% - var(--right))}.weui-navigation-bar__inner,.weui-navigation-bar__inner .weui-navigation-bar__left{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-navigation-bar__inner .weui-navigation-bar__left{position:relative;width:var(--right);padding-left:16px;-webkit-box-pack:center}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn{display:inline-block;vertical-align:middle;background-repeat:no-repeat}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback{font-size:12px;width:1em;height:2em;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E");background-position:50% 50%;background-size:cover}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback:active{opacity:.5}.weui-navigation-bar__inner .weui-navigation-bar__center{font-size:17px;text-align:center;position:relative;-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-navigation-bar__inner .weui-navigation-bar__loading{font-size:0}.weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading{margin-left:0}.weui-navigation-bar__inner .weui-navigation-bar__right{margin-right:16px}.weui-navigation-bar__placeholder{height:var(--height);background:#f8f8f8;position:relative;z-index:50}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-agree{display:block;padding:.5em 15px;font-size:13px}.weui-agree__text{color:rgba(0,0,0,.5)}.weui-agree__link{display:inline;color:#576b95}.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}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 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}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_cell{position:relative;display:block;margin-left:auto;margin-right:auto;box-sizing:border-box;font-weight:700;font-size:17px;text-align:center;text-decoration:none;color:#fff;line-height:1.41176471;padding:16px;-webkit-tap-highlight-color:rgba(0,0,0,0);overflow:hidden;background-color:#fff}.weui-btn_cell+.weui-btn_cell{margin-top:16px}.weui-btn_cell:active{background-color:#ececec}.weui-btn_cell__icon{display:inline-block;vertical-align:middle;width:24px;height:24px;margin:-.2em .34em 0 0}.weui-btn_cell-default{color:rgba(0,0,0,.9)}.weui-btn_cell-primary{color:#576b95}.weui-btn_cell-warn{color:#fa5151}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_default{color:#06ae56;background-color:#f2f2f2}.weui-btn_default:not(.weui-btn_disabled):visited{color:#06ae56}.weui-btn_default:not(.weui-btn_disabled):active{color:#06ae56;background-color:#d9d9d9}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_disabled{color:rgba(0,0,0,.18);background-color:#fafafa}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn{position:relative;display:block;width:184px;margin-left:auto;margin-right:auto;padding:8px 24px;box-sizing:border-box;font-weight:700;font-size:17px;text-align:center;text-decoration:none;color:#fff;line-height:1.41176471;border-radius:4px;-webkit-tap-highlight-color:rgba(0,0,0,0);overflow:hidden}.weui-btn_block{width:auto}.weui-btn_inline{display:inline-block}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_loading .weui-loading{margin:-.2em .34em 0 0}.weui-btn_loading.weui-btn_primary{color:#fff}.weui-btn_loading.weui-btn_default{background-color:#d9d9d9}.weui-btn_loading.weui-btn_primary{background-color:#06ad56}.weui-btn_loading.weui-btn_warn{background-color:#d9d9d9}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_plain-primary{color:#07c160;border:1px solid #1aad19}.weui-btn_plain-primary:not(.weui-btn_plain-disabled):active{color:#06ae56;border-color:#179c16;background-color:rgba(0,0,0,.1)}.weui-btn_plain-primary:after{border-width:0}.weui-btn_plain-default{color:#353535;border:1px solid #353535}.weui-btn_plain-default:not(.weui-btn_plain-disabled):active{color:#323232;border-color:#323232;background-color:rgba(0,0,0,.1)}.weui-btn_plain-default:after{border-width:0}.weui-btn_plain-disabled{color:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2)}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_primary{background-color:#07c160}.weui-btn_primary:not(.weui-btn_disabled):visited{color:#fff}.weui-btn_primary:not(.weui-btn_disabled):active{color:#fff;background-color:#06ad56}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_warn{color:#fa5151;background-color:#f2f2f2}.weui-btn_warn:not(.weui-btn_disabled):visited{color:#fa5151}.weui-btn_warn:not(.weui-btn_disabled):active{color:#fa5151;background-color:#d9d9d9}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn+.weui-btn{margin-top:16px}.weui-btn.weui-btn_inline+.weui-btn.weui-btn_inline{margin-top:auto;margin-left:16px}.weui-btn-area{margin:48px 16px 8px}.weui-btn-area_inline{display:-webkit-box;display:-webkit-flex;display:flex}.weui-btn-area_inline .weui-btn{margin-top:auto;margin-right:16px;width:100%;-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn-area_inline .weui-btn:last-child{margin-right:0}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_access{color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-cell__ft_in-access{padding-right:16px;position:relative}.weui-cell__ft_in-access:after{content:" ";display:inline-block;height:8px;width:8px;border-width:2px 2px 0 0;border-color:#b2b2b2;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:-5px;right:0}.weui-cell_link{color:#576b95;font-size:17px}.weui-cell_link:active{background-color:#ececec}.weui-cell_link:first-child:before{display:block}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cells{position:relative;margin-top:8px;background-color:#fff;line-height:1.41176471;font-size:17px}.weui-cells:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-cells:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-cells__title{margin-top:16px;margin-bottom:3px;padding-left:16px;padding-right:16px;color:rgba(0,0,0,.5);font-size:14px}.weui-cells_after-title{margin-top:0}.weui-cells__tips{margin-top:3px;color:rgba(0,0,0,.5);padding-left:16px;padding-right:16px;font-size:14px}.weui-cell{padding:16px;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 rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.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:rgba(0,0,0,.5)}.weui-cell_label-block,.weui-cell_wxss.weui-cell_wxss:before{display:block}.weui-cell_label-block .weui-label{width:auto;word-break:normal;-webkit-hyphens:auto;hyphens:auto}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cells__group_form:first-child .weui-cells__title{margin-top:0}.weui-cells__group_form .weui-cells__title{margin-top:24px;margin-bottom:8px;padding:0 32px}.weui-cells__group_form .weui-cell:before,.weui-cells__group_form .weui-cells:before{left:32px;right:32px}.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before{left:72px}.weui-cells__group_form .weui-cells:after{left:32px;right:32px}.weui-cells__group_form .weui-cell{padding:16px 32px;color:rgba(0,0,0,.9)}.weui-cells__group_form .weui-cell__hd{padding-right:16px}.weui-cells__group_form .weui-cell__ft{padding-left:16px}.weui-cells__group_form .weui-cell_warn input{color:#fa5151}.weui-cells__group_form .weui-label{max-width:5em;margin-right:8px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:rgba(0,0,0,.3)}.weui-cells__group_form .weui-cells__tips a{font-weight:700}.weui-cells__group_form .weui-cell_vcode{padding:12px 32px}.weui-cells__group_form .weui-vcode-btn{font-size:16px;padding:0 12px;margin-left:0;height:auto;width:auto;line-height:2em;color:#06ae56;background-color:#f2f2f2}.weui-cells__group_form .weui-vcode-btn:before{display:none}.weui-cells__group_form .weui-cell_select{padding:0}.weui-cells__group_form .weui-cell_select .weui-select{padding:0 32px}.weui-cells__group_form .weui-cell_select .weui-cell__bd:after{right:32px}.weui-cells__group_form .weui-cell_select-before .weui-label{margin-right:24px}.weui-cells__group_form .weui-cell_select-before .weui-select{padding-right:24px;box-sizing:initial}.weui-cells__group_form .weui-cell_select-after{padding-left:32px}.weui-cells__group_form .weui-cell_select-after .weui-select{padding-left:0}.weui-cells__group_form .weui-cell_switch{padding:12px 32px}.weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cells_checkbox .weui-check__label:before{left:55px}.weui-check__label:active{background-color:#ececec}.weui-check{position:absolute;left:-9999px}.weui-check__hd_in-checkbox{padding-right:16px}.weui-cell__ft_in-radio{padding-left:16px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-toptips{position:fixed;-webkit-transform:translateZ(0) translateY(-108%);transform:translateZ(0) translateY(-108%);text-align:center;top:8px;left:16px;right:16px;border-radius:4px;padding:8px;-webkit-border-radius:4px;color:hsla(0,0%,100%,.9);font-size:17px;line-height:1.4;background:rgba(250,81,81,.9);z-index:5000;word-wrap:break-word;word-break:break-all;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_warn{background-color:#fa5151}.weui-toptips_success{background-color:#09bb07}.weui-toptips_error{background-color:#fa5151}.weui-toptips_info{background-color:#10aeff}.weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:1.41176471em;min-height:1.41176471em;line-height:1.41176471}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:rgba(0,0,0,.3);text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#fa5151}.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:16px;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 rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-form-preview__bd{padding:16px;font-size:.9em;text-align:right;color:rgba(0,0,0,.5);line-height:2}.weui-form-preview__ft{position:relative;line-height:56px;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 rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:rgba(0,0,0,.5);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:#576b95;text-align:center;font-weight:700;font-size:17px}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#ececec}.weui-form-preview__btn_default{color:rgba(0,0,0,.9)}.weui-form-preview__btn_primary{color:#576b95}.weui-cell_select{padding:0;overflow:hidden}.weui-cell_select .weui-select{padding-right:30px}.weui-cell_select .weui-cell__bd:after{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-select{-webkit-appearance:none;border:0;outline:0;background-color:transparent;width:100%;font-size:inherit;height:56px;line-height:56px;position:relative;z-index:1;padding-left:16px}.weui-cell_select-before{padding-right:16px}.weui-cell_select-before .weui-select{width:105px;box-sizing:border-box}.weui-cell_select-before .weui-cell__hd{position:relative}.weui-cell_select-before .weui-cell__hd:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-cell_select-before .weui-cell__hd:before{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-cell_select-before .weui-cell__bd{padding-left:16px}.weui-cell_select-before .weui-cell__bd:after{display:none}.weui-cell_select-before.weui-cell_access .weui-cell__hd{line-height:56px;padding-left:32px}.weui-cell_select-after{padding-left:16px}.weui-cell_select-after .weui-select{padding-left:0}.weui-cell_select-after.weui-cell_access .weui-cell__bd{line-height:56px}.weui-cell_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:3.29411765em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1rpx solid rgba(0,0,0,.1);line-height:3.29411765em;font-size:17px;color:#576b95;white-space:nowrap}button.weui-vcode-btn{min-height:0;background-color:transparent;border:0;outline:0}.weui-vcode-btn:active{color:#767676}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 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 rgba(0,0,0,.1)}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:16px;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 rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-form-preview__bd{padding:16px;font-size:.9em;text-align:right;color:rgba(0,0,0,.5);line-height:2}.weui-form-preview__ft{position:relative;line-height:56px;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 rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:rgba(0,0,0,.5);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:#576b95;text-align:center;font-weight:700;font-size:17px}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#ececec}.weui-form-preview__btn_default{color:rgba(0,0,0,.9)}.weui-form-preview__btn_primary{color:#576b95}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-toptips{position:fixed;-webkit-transform:translateZ(0) translateY(-108%);transform:translateZ(0) translateY(-108%);text-align:center;top:8px;left:16px;right:16px;border-radius:4px;padding:8px;-webkit-border-radius:4px;color:hsla(0,0%,100%,.9);font-size:17px;line-height:1.4;background:rgba(250,81,81,.9);z-index:5000;word-wrap:break-word;word-break:break-all;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_warn{background-color:#fa5151}.weui-toptips_success{background-color:#09bb07}.weui-toptips_error{background-color:#fa5151}.weui-toptips_info{background-color:#10aeff}.weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:1.41176471em;min-height:1.41176471em;line-height:1.41176471}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:rgba(0,0,0,.3);text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#fa5151}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_select{padding:0;overflow:hidden}.weui-cell_select .weui-select{padding-right:30px}.weui-cell_select .weui-cell__bd:after{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-select{-webkit-appearance:none;border:0;outline:0;background-color:transparent;width:100%;font-size:inherit;height:56px;line-height:56px;position:relative;z-index:1;padding-left:16px}.weui-cell_select-before{padding-right:16px}.weui-cell_select-before .weui-select{width:105px;box-sizing:border-box}.weui-cell_select-before .weui-cell__hd{position:relative}.weui-cell_select-before .weui-cell__hd:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-cell_select-before .weui-cell__hd:before{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-cell_select-before .weui-cell__bd{padding-left:16px}.weui-cell_select-before .weui-cell__bd:after{display:none}.weui-cell_select-before.weui-cell_access .weui-cell__hd{line-height:56px;padding-left:32px}.weui-cell_select-after{padding-left:16px}.weui-cell_select-after .weui-select{padding-left:0}.weui-cell_select-after.weui-cell_access .weui-cell__bd{line-height:56px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:3.29411765em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1rpx solid rgba(0,0,0,.1);line-height:3.29411765em;font-size:17px;color:#576b95;white-space:nowrap}button.weui-vcode-btn{min-height:0;background-color:transparent;border:0;outline:0}.weui-vcode-btn:active{color:#767676}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-gallery{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;z-index:1000;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;opacity:0;visibility:hidden;-webkit-transition:opacity .3s;transition:opacity .3s}.weui-gallery_show{display:-webkit-box;display:-webkit-flex;display:flex;visibility:visible;opacity:1}.weui-gallery__img__wrp{-webkit-box-flex:1;-webkit-flex:1;flex:1;position:relative;font-size:0}.weui-gallery__img{background:50% no-repeat;background-size:contain;position:absoulte;width:100%;height:100%}.weui-gallery__opr{background-color:#0d0d0d;color:#fff;line-height:60px;min-height:60px;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);text-align:center}.weui-gallery__opr navigator{color:#fff}.weui-gallery__del{display:block}.weui-gallery__info{color:#fff;font-size:17px;line-height:60px;min-height:60px;text-align:center}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
:host{width:100%}.weui-slideview{overflow:hidden;position:relative}.weui-slideview__left{position:relative;z-index:10}.weui-slideview__right{position:absolute;z-index:1;left:100%;top:0;height:100%}.weui-slideview__btn__wrp{position:absolute;left:0;bottom:0;text-align:center;min-width:69px;height:100%;white-space:nowrap}.weui-slideview__btn{color:#fff;padding:0 17px}.weui-slideview__btn-group_default .weui-slideview__btn{background:#c7c7cc}.weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #fff;color:#fff}.weui-slideview__btn-group_default:first-child:before{display:none}.weui-slideview__btn-group_warn .weui-slideview__btn{background:#fe3b30}.weui-slideview__btn-group_warn~.weui-slideview__btn-group_warn:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #fff;color:#fff}.weui-slideview__btn-group_warn:first-child:before{display:none}.weui-slideview_icon .weui-slideview__btn__wrp{background:transparent;font-size:0}.weui-slideview_icon .weui-slideview__btn__wrp:after{content:"";width:0;height:100%;vertical-align:middle;display:inline-block}.weui-slideview_icon .weui-slideview__btn__wrp:first-child{padding-left:16px}.weui-slideview_icon .weui-slideview__btn__wrp:last-child{padding-right:8px}.weui-slideview_icon .weui-slideview__btn{width:48px;height:48px;line-height:48px;padding:0;display:inline-block;vertical-align:middle;border-radius:50%;background-color:#fff}.weui-slideview_icon .weui-slideview__btn__icon{display:inline-block;vertical-align:middle;width:22px;height:22px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_switch{padding-top:12px;padding-bottom:12px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-uploader{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__hd{padding-bottom:16px}.weui-uploader__overview{display:-webkit-box;display:-webkit-flex;display:flex;-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__tips{color:rgba(0,0,0,.3);font-size:14px;line-height:1.4;padding-top:4px}.weui-uploader__info{color:rgba(0,0,0,.3)}.weui-uploader__bd{margin-bottom:-8px;margin-right:-8px;overflow:hidden}.weui-uploader__file{float:left;margin-right:8px;margin-bottom:8px}.weui-uploader__img{display:block;width:96px;height:96px}.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:8px;margin-bottom:8px;width:96px;height:96px;box-sizing:border-box;background-color:#ededed}.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:#a3a3a3}.weui-uploader__input-box:before{width:2px;height:32px}.weui-uploader__input-box:after{width:32px;height:2px}.weui-uploader__input-box:active{border-color:#8b8b8b}.weui-uploader__input-box:active:after,.weui-uploader__input-box:active:before{background-color:#8b8b8b}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 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}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-footer{color:rgba(0,0,0,.3);font-size:14px;line-height:1.4;text-align:center}.weui-footer_fixed-bottom{position:fixed;bottom:16px;bottom:calc(16px + constant(safe-area-inset-bottom));bottom:calc(16px + env(safe-area-inset-bottom));left:0;right:0}.weui-footer__links{font-size:0}.weui-footer__link{display:inline-block;vertical-align:top;margin:0 8px;position:relative;font-size:14px;color:#576b95}.weui-footer__link:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #c7c7c7;color:#c7c7c7;left:-8px;top:.36em;bottom:.36em}.weui-footer__link:first-child:before{display:none}.weui-footer__text{padding:0 .34em;font-size:12px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-grids{border-top:1rpx solid rgba(0,0,0,.1);border-left:1rpx solid rgba(0,0,0,.1);overflow:hidden}.weui-grid{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid rgba(0,0,0,.1);border-bottom:1rpx solid rgba(0,0,0,.1)}.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:rgba(0,0,0,.9);font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
icon[type=success]:after,icon[type=success]:before{color:#07c160!important}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.wx_dot_loading,.wx_dot_loading:after,.wx_dot_loading:before{display:inline-block;vertical-align:middle;width:6px;height:6px;border-radius:50%;background-color:rgba(0,0,0,.3);font-size:0;-webkit-animation:b 1.6s step-start infinite;animation:b 1.6s step-start infinite}.wx_dot_loading{position:relative}.wx_dot_loading:before{content:"";position:absolute;left:-12px;background-color:rgba(0,0,0,.1);-webkit-animation:a 1.6s step-start infinite;animation:a 1.6s step-start infinite}.wx_dot_loading:after{content:"";position:absolute;right:-12px;background-color:rgba(0,0,0,.5);-webkit-animation:c 1.6s step-start infinite;animation:c 1.6s step-start infinite}@-webkit-keyframes a{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@keyframes a{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@-webkit-keyframes b{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@keyframes b{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@-webkit-keyframes c{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}@keyframes c{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}.wx_dot_loading_white{background-color:hsla(0,0%,100%,.3);-webkit-animation:e 1.6s step-start infinite;animation:e 1.6s step-start infinite}.wx_dot_loading_white:before{background-color:hsla(0,0%,100%,.5);-webkit-animation:d 1.6s step-start infinite;animation:d 1.6s step-start infinite}.wx_dot_loading_white:after{background-color:hsla(0,0%,100%,.1);-webkit-animation:f 1.6s step-start infinite;animation:f 1.6s step-start infinite}@-webkit-keyframes d{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@keyframes d{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@-webkit-keyframes e{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@keyframes e{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@-webkit-keyframes f{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}@keyframes f{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 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)}}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-media-box{padding:16px;position:relative}.weui-media-box:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:1s6px}.weui-media-box:first-child:before{display:none}.weui-media-box__title{font-weight:400;font-size:17px;color:rgba(0,0,0,.9);width:auto;white-space:nowrap;word-wrap:normal;word-wrap:break-word;word-break:break-all}.weui-media-box__desc,.weui-media-box__title{line-height:1.4;overflow:hidden;text-overflow:ellipsis}.weui-media-box__desc{color:rgba(0,0,0,.5);font-size:14px;padding-top:4px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-media-box__info{margin-top:16px;padding-bottom:4px;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:16px;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}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
page{--height:44px;--right:190rpx}.weui-navigation-bar{overflow:hidden}.weui-navigation-bar .android{--height:48px;--right:222rpx}.weui-navigation-bar__inner{position:fixed;top:0;left:0;z-index:5001;height:var(--height);padding-right:var(--right);width:calc(100% - var(--right))}.weui-navigation-bar__inner,.weui-navigation-bar__inner .weui-navigation-bar__left{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-navigation-bar__inner .weui-navigation-bar__left{position:relative;width:var(--right);padding-left:16px;-webkit-box-pack:center}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn{display:inline-block;vertical-align:middle;background-repeat:no-repeat}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback{font-size:12px;width:1em;height:2em;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E");background-position:50% 50%;background-size:cover}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback:active{opacity:.5}.weui-navigation-bar__inner .weui-navigation-bar__center{font-size:17px;text-align:center;position:relative;-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-navigation-bar__inner .weui-navigation-bar__loading{font-size:0}.weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading{margin-left:0}.weui-navigation-bar__inner .weui-navigation-bar__right{margin-right:16px}.weui-navigation-bar__placeholder{height:var(--height);background:#f8f8f8;position:relative;z-index:50}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-article{padding:24px 16px;padding:24px calc(16px + constant(safe-area-inset-right)) calc(24px + constant(safe-area-inset-bottom)) calc(16px + constant(safe-area-inset-left));padding:24px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));font-size:17px;color:rgba(0,0,0,.9)}.weui-article__section{margin-bottom:1.5em}.weui-article__h1{font-size:22px;font-weight:700;margin-bottom:.9em;line-height:1.4}.weui-article__h2{font-size:17px}.weui-article__h2,.weui-article__h3{font-weight:700;margin-bottom:.34em;line-height:1.4}.weui-article__h3{font-size:15px}.weui-article__p{margin:0 0 .8em}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cells__group_form:first-child .weui-cells__title{margin-top:0}.weui-cells__group_form .weui-cells__title{margin-top:24px;margin-bottom:8px;padding:0 32px}.weui-cells__group_form .weui-cell:before,.weui-cells__group_form .weui-cells:before{left:32px;right:32px}.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before{left:72px}.weui-cells__group_form .weui-cells:after{left:32px;right:32px}.weui-cells__group_form .weui-cell{padding:16px 32px;color:rgba(0,0,0,.9)}.weui-cells__group_form .weui-cell__hd{padding-right:16px}.weui-cells__group_form .weui-cell__ft{padding-left:16px}.weui-cells__group_form .weui-cell_warn input{color:#fa5151}.weui-cells__group_form .weui-label{max-width:5em;margin-right:8px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:rgba(0,0,0,.3)}.weui-cells__group_form .weui-cells__tips a{font-weight:700}.weui-cells__group_form .weui-cell_vcode{padding:12px 32px}.weui-cells__group_form .weui-vcode-btn{font-size:16px;padding:0 12px;margin-left:0;height:auto;width:auto;line-height:2em;color:#06ae56;background-color:#f2f2f2}.weui-cells__group_form .weui-vcode-btn:before{display:none}.weui-cells__group_form .weui-cell_select{padding:0}.weui-cells__group_form .weui-cell_select .weui-select{padding:0 32px}.weui-cells__group_form .weui-cell_select .weui-cell__bd:after{right:32px}.weui-cells__group_form .weui-cell_select-before .weui-label{margin-right:24px}.weui-cells__group_form .weui-cell_select-before .weui-select{padding-right:24px;box-sizing:initial}.weui-cells__group_form .weui-cell_select-after{padding-left:32px}.weui-cells__group_form .weui-cell_select-after .weui-select{padding-left:0}.weui-cells__group_form .weui-cell_switch{padding:12px 32px}.weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}.weui-form{padding:56px 0 0;padding:calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;min-height:100%;box-sizing:border-box;line-height:1.4;background-color:#fff}.weui-form a:not(.weui-btn){color:#576b95}.weui-form .weui-footer,.weui-form .weui-footer__link{font-size:12px}.weui-form .weui-agree{padding:0}.weui-form__text-area{padding:0 32px;color:rgba(0,0,0,.9);text-align:center}.weui-form__control-area{-webkit-box-flex:1;-webkit-flex:1;flex:1;margin:48px 0}.weui-form__extra-area,.weui-form__tips-area{margin-bottom:24px;text-align:center}.weui-form__opr-area{margin-bottom:64px}.weui-form__opr-area:last-child{margin-bottom:96px}.weui-form__title{font-size:22px;font-weight:700;line-height:1.36}.weui-form__desc{font-size:17px;margin-top:16px}.weui-form__tips{color:rgba(0,0,0,.5);font-size:12px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-msg{padding-top:36px;padding:calc(36px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(36px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);text-align:center;line-height:1.4;min-height:100%;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;background-color:#fff}.weui-msg__link{color:#576b95;display:inline-block;vertical-align:baseline}.weui-msg__icon-area{margin-bottom:32px}.weui-msg__text-area{margin-bottom:32px;padding:0 32px;-webkit-box-flex:1;-webkit-flex:1;flex:1;line-height:1.6}.weui-msg__text-area:first-child{padding-top:96px}.weui-msg__title{margin-bottom:5px;font-weight:700;font-size:22px;word-wrap:break-word;word-break:break-all}.weui-msg__desc{font-size:17px;color:rgba(0,0,0,.9)}.weui-msg__desc,.weui-msg__desc-primary{word-wrap:break-word;word-break:break-all;margin-bottom:16px}.weui-msg__desc-primary{font-size:14px;color:rgba(0,0,0,.5)}.weui-msg__opr-area{margin-bottom:16px}.weui-msg__opr-area .weui-btn-area{margin:0 16px}.weui-msg__opr-area .weui-btn+.weui-btn{margin-bottom:16px}.weui-msg__opr-area:last-child{margin-bottom:96px}.weui-msg__opr-area+.weui-msg__extra-area{margin-top:48px}.weui-msg__tips-area{margin-bottom:16px;padding:0 40px}.weui-msg__opr-area+.weui-msg__tips-area{margin-bottom:48px}.weui-msg__tips-area:last-child{margin-bottom:64px}.weui-msg__extra-area,.weui-msg__tips{font-size:12px;color:rgba(0,0,0,.5)}.weui-msg__extra-area{position:static;margin-bottom:24px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 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 rgba(0,0,0,.1)}.weui-panel:after,.weui-panel:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-panel:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-panel__hd{padding:16px 16px 13px;color:rgba(0,0,0,.9);font-size:15px;font-weight:700;position:relative}.weui-panel__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 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}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-search-bar{position:relative;padding:8px;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;background-color:#ededed;-webkit-text-size-adjust:100%;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-icon-search{margin-right:8px;font-size:14px;vertical-align:top;margin-top:.64em;height:1em;line-height:1em}.weui-icon-search_in-box{position:absolute;left:12px;top:50%;margin-top:-8px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:top}.weui-search-bar__form{position:relative;-webkit-box-flex:1;-webkit-flex:auto;flex:auto;border-radius:4px;background:#fff}.weui-search-bar__box{position:relative;padding-left:32px;padding-right:32px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:32px;line-height:32px;font-size:14px;caret-color:#07c160}.weui-icon-clear{position:absolute;top:0;right:0;bottom:0;padding:0 12px;font-size:0}.weui-icon-clear:after{content:"";height:100%;vertical-align:middle;display:inline-block;width:0;overflow:hidden}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:4px;text-align:center;color:rgba(0,0,0,.5);background:#fff;line-height:32px}.weui-search-bar__cancel-btn{margin-left:8px;line-height:32px;color:#576b95;white-space:nowrap}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#fff;border-bottom:1rpx solid rgba(0,0,0,.1);padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.weui-navbar+.weui-tab__panel{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:16px;padding:calc(16px + constant(safe-area-inset-top)) 16px 16px;padding:calc(16px + env(safe-area-inset-top)) 16px 16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-navbar__item:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-navbar__item.weui-bar__item_on{background-color:#ececec}.weui-navbar__item:first-child{padding-left:calc(16px + constant(safe-area-inset-left));padding-left:calc(16px + env(safe-area-inset-left))}.weui-navbar__item:last-child{padding-right:calc(16px + constant(safe-area-inset-right));padding-right:calc(16px + env(safe-area-inset-right))}.weui-navbar__item:last-child:after{display:none}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:2px;background-color:#07c160;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;display:none}.weui-navbar__title{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#fff;border-bottom:1rpx solid rgba(0,0,0,.1);padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.weui-navbar+.weui-tab__panel{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:16px;padding:calc(16px + constant(safe-area-inset-top)) 16px 16px;padding:calc(16px + env(safe-area-inset-top)) 16px 16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-navbar__item:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-navbar__item.weui-bar__item_on{background-color:#ececec}.weui-navbar__item:first-child{padding-left:calc(16px + constant(safe-area-inset-left));padding-left:calc(16px + env(safe-area-inset-left))}.weui-navbar__item:last-child{padding-right:calc(16px + constant(safe-area-inset-right));padding-right:calc(16px + env(safe-area-inset-right))}.weui-navbar__item:last-child:after{display:none}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:2px;background-color:#07c160;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;display:none}.weui-navbar__title{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.weui-tabbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#f7f7f7}.weui-tabbar:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-tabbar__item{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:8px 0 4px;padding-bottom:calc(8px + constant(safe-area-inset-bottom));padding-bottom:calc(8px + env(safe-area-inset-bottom));font-size:0;color:rgba(0,0,0,.5);text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-tabbar__item:first-child{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-tabbar__item:last-child{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#07c160}.weui-tabbar__icon{display:inline-block;width:28px;height:28px;margin-bottom:2px}.weui-tabbar__icon>i,i.weui-tabbar__icon{font-size:24px;color:rgba(0,0,0,.5)}.weui-tabbar__icon image{width:100%;height:100%}.weui-tabbar__label{color:rgba(0,0,0,.9);font-size:10px;line-height:1.4}.weui-tab{display:-webkit-box;display:-webkit-flex;display:flex;height:100%;box-sizing:border-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.weui-tab__panel{box-sizing:border-box;-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-tabbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#f7f7f7}.weui-tabbar:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-tabbar__item{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:8px 0 4px;padding-bottom:calc(8px + constant(safe-area-inset-bottom));padding-bottom:calc(8px + env(safe-area-inset-bottom));font-size:0;color:rgba(0,0,0,.5);text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-tabbar__item:first-child{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-tabbar__item:last-child{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#07c160}.weui-tabbar__icon{display:inline-block;width:28px;height:28px;margin-bottom:2px}.weui-tabbar__icon>i,i.weui-tabbar__icon{font-size:24px;color:rgba(0,0,0,.5)}.weui-tabbar__icon image{width:100%;height:100%}.weui-tabbar__label{color:rgba(0,0,0,.9);font-size:10px;line-height:1.4}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-actionsheet{position:fixed;left:0;bottom:0;-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:5000;width:100%;background-color:#eae7e8;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden}.weui-actionsheet__title{position:relative;height:56px;padding:0 24px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;text-align:center;font-size:12px;color:rgba(0,0,0,.5);line-height:1.4;background:#fff}.weui-actionsheet__title:before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-actionsheet__title .weui-actionsheet__title-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-actionsheet__menu{color:rgba(0,0,0,.9);background-color:#fff}.weui-actionsheet__action{margin-top:8px;background-color:#fff;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-actionsheet__cell{position:relative;padding:16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-actionsheet__cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-actionsheet__cell:active{background-color:#ececec}.weui-actionsheet__cell:first-child:before{display:none}.weui-actionsheet__cell_warn{color:#fa5151}.weui-skin_android .weui-actionsheet{position:fixed;left:50%;top:50%;bottom:auto;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:274px;box-sizing:border-box;-webkit-backface-visibility:hidden;backface-visibility:hidden;background:transparent;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-radius:2px}.weui-skin_android .weui-actionsheet__action{display:none}.weui-skin_android .weui-actionsheet__menu{border-radius:2px;box-shadow:0 6px 30px 0 rgba(0,0,0,.1)}.weui-skin_android .weui-actionsheet__cell{padding:16px;font-size:17px;line-height:1.41176471;color:rgba(0,0,0,.9);text-align:left}.weui-skin_android .weui-actionsheet__cell:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.weui-skin_android .weui-actionsheet__cell:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.weui-actionsheet_toggle{-webkit-transform:translate(0);transform:translate(0)}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#fa5151;color:#fff;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-dialog__wrp{position:fixed;z-index:5000;top:16px;bottom:16px;left:16px;right:16px;text-align:center;font-size:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__wrp .weui-dialog{max-height:100%}.weui-dialog{background-color:#fff;text-align:center;border-radius:12px;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;max-height:90%}.weui-dialog__hd{padding:32px 24px 16px}.weui-dialog__title{font-weight:700;font-size:17px;line-height:1.4}.weui-dialog__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 24px;margin-bottom:32px;min-height:40px;font-size:17px;line-height:1.4;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;color:rgba(0,0,0,.5)}.weui-dialog__bd:first-child{padding:32px 24px 0;font-weight:700;color:rgba(0,0,0,.9);-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__bd:first-child,.weui-dialog__ft{display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft{position:relative;line-height:64px;min-height:64px;font-size:17px}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#576b95;font-weight:700;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:relative}.weui-dialog__btn:active{background-color:#ececec}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:rgba(0,0,0,.9)}@media screen and (min-width:352px){.weui-dialog{width:320px;margin:0 auto}}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-half-screen-dialog{position:fixed;left:0;right:0;bottom:0;max-height:75%;z-index:5000;line-height:1.4;background-color:#fff;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden;padding:0 24px;padding:0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));padding:0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))}.weui-half-screen-dialog__hd{font-size:8px;height:8em;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-half-screen-dialog__hd .weui-icon-btn{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.weui-half-screen-dialog__hd__side{position:relative;left:-8px}.weui-half-screen-dialog__hd__main{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main{text-align:center;padding:0 40px}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side{right:-8px;left:auto}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn{right:0}.weui-half-screen-dialog__title{display:block;color:rgba(0,0,0,.9);font-weight:700;font-size:15px}.weui-half-screen-dialog__subtitle{display:block;color:rgba(0,0,0,.5);font-size:10px}.weui-half-screen-dialog__bd{word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;overflow-y:auto}.weui-half-screen-dialog__desc{padding-top:4px;font-size:17px;font-weight:700;color:rgba(0,0,0,.9);line-height:1.4}.weui-half-screen-dialog__tips{padding-top:16px;font-size:14px;color:rgba(0,0,0,.3);line-height:1.4}.weui-half-screen-dialog__ft{padding:40px 24px 32px;text-align:center}.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn{display:inline-block;vertical-align:top;margin:0 8px;width:120px}.weui-icon-btn{background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;background-size:100%;border:0;outline:0;font-size:0}.weui-icon-btn_goback{width:12px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M26 39.438L24.955 40.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42l7.666-7.79L26 24.563 18.682 32 26 39.438z'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_close{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E %3Cdefs%3E %3Cpath id='33cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a' d='M8 6.943L1.807.75.75 1.807 6.943 8 .75 14.193l1.057 1.057L8 9.057l6.193 6.193 1.057-1.057L9.057 8l6.193-6.193L14.193.75z'/%3E %3C/defs%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cuse fill='%23000' fill-opacity='.9' transform='translate(20 24)' xlink:href='%2333cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_more{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-374 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M380.75 32a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0zm5.25-1.75a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E %3C/g%3E%3C/svg%3E")}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 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 rgba(0,0,0,.1);margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-.9em;padding:0 .55em;background-color:#fff;color:rgba(0,0,0,.5)}.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:rgba(0,0,0,.1)}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-mask{background:rgba(0,0,0,.6)}.weui-mask,.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-toptips{position:fixed;-webkit-transform:translateZ(0) translateY(-108%);transform:translateZ(0) translateY(-108%);text-align:center;top:8px;left:16px;right:16px;border-radius:4px;padding:8px;-webkit-border-radius:4px;color:hsla(0,0%,100%,.9);font-size:17px;line-height:1.4;background:rgba(250,81,81,.9);z-index:5000;word-wrap:break-word;word-break:break-all;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_warn{background-color:#fa5151}.weui-toptips_success{background-color:#09bb07}.weui-toptips_error{background-color:#fa5151}.weui-toptips_info{background-color:#10aeff}
\ No newline at end of file
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var base64DecodeChars = new Array(
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
function encode(str) {
var out, i, len;
var c1, c2, c3;
len = str.length;
i = 0;
out = "";
while (i < len) {
c1 = str.charCodeAt(i++) & 0xff;
if (i == len) {
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt((c1 & 0x3) << 4);
out += "==";
break;
}
c2 = str.charCodeAt(i++);
if (i == len) {
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
out += base64EncodeChars.charAt((c2 & 0xF) << 2);
out += "=";
break;
}
c3 = str.charCodeAt(i++);
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
out += base64EncodeChars.charAt(c3 & 0x3F);
}
return out;
}
function decode(str) {
var c1, c2, c3, c4;
var i, len, out;
len = str.length;
i = 0;
out = "";
while (i < len) {
/* c1 */
do {
c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
} while (i < len && c1 == -1);
if (c1 == -1)
break;
/* c2 */
do {
c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
} while (i < len && c2 == -1);
if (c2 == -1)
break;
out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));
/* c3 */
do {
c3 = str.charCodeAt(i++) & 0xff;
if (c3 == 61)
return out;
c3 = base64DecodeChars[c3];
} while (i < len && c3 == -1);
if (c3 == -1)
break;
out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
/* c4 */
do {
c4 = str.charCodeAt(i++) & 0xff;
if (c4 == 61)
return out;
c4 = base64DecodeChars[c4];
} while (i < len && c4 == -1);
if (c4 == -1)
break;
out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
}
return out;
}
function utf16to8(str) {
var out, i, len, c;
out = "";
len = str.length;
for (i = 0; i < len; i++) {
c = str.charCodeAt(i);
if ((c >= 0x0001) && (c <= 0x007F)) {
out += str.charAt(i);
} else if (c > 0x07FF) {
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
} else {
out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
}
}
return out;
}
function utf8to16(str) {
var out, i, len, c;
var char2, char3;
out = "";
len = str.length;
i = 0;
while (i < len) {
c = str.charCodeAt(i++);
switch (c >> 4) {
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
// 0xxxxxxx
out += str.charAt(i - 1);
break;
case 12: case 13:
// 110x xxxx 10xx xxxx
char2 = str.charCodeAt(i++);
out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));
break;
case 14:
// 1110 xxxx 10xx xxxx 10xx xxxx
char2 = str.charCodeAt(i++);
char3 = str.charCodeAt(i++);
out += String.fromCharCode(((c & 0x0F) << 12) |
((char2 & 0x3F) << 6) |
((char3 & 0x3F) << 0));
break;
}
}
return out;
}
module.exports = {
encode: encode,
decode: decode,
utf16to8: utf16to8,
utf8to16: utf8to16
}
\ No newline at end of file
var formatTime = function (date) {
var formatTime = function (date) {
var date = getDate(date)
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
var formatDate_md = function (date) {
// 输入 2020-02-04 19:33:00
// 返回 02-04
var str = date.toString().substring(5, 10)
return str
}
var formatDate_ymd = function (date) {
// 输入 2020-02-04 19:33:00
// 返回 02-04
var str = date.toString().substring(0, 10)
return str
}
var formatNumber = function(n) {
n = n.toString()
console.log(n)
return n[1] ? n : '0' + n
}
var toFix = function (value) {
return value*100 //此处由小数0.25变成25
}
//jscat 2020/03/03 将数字1234转为ABCD
var formatAnswer = function (n) {
answer = ""
switch (n) {
case "1":
answer = "A"
console.log("input is 1")
break;
case "2":
answer = "B"
console.log("input is 2")
break;
case "3":
answer = "C"
console.log("input is 3")
break;
case "4":
answer = "D"
console.log("input is 4")
break;
case "5":
answer = "E"
break;
default:
console.log("input is n")
}
return answer
}
module.exports = {
formatDate_ymd: formatDate_ymd,
formatDate_md: formatDate_md,
formatTime: formatTime,
formatNumber: formatNumber,
toFix: toFix,
formatAnswer: formatAnswer
}
\ No newline at end of file
var log = wx.getRealtimeLogManager ? wx.getRealtimeLogManager() : null
var log = wx.getRealtimeLogManager ? wx.getRealtimeLogManager() : null
module.exports = {
info() {
if (!log) return
log.info.apply(log, arguments)
},
warn() {
if (!log) return
log.warn.apply(log, arguments)
},
error() {
if (!log) return
log.error.apply(log, arguments)
},
setFilterMsg(msg) { // 从基础库2.7.3开始支持
if (!log || !log.setFilterMsg) return
if (typeof msg !== 'string') return
log.setFilterMsg(msg)
},
addFilterMsg(msg) { // 从基础库2.8.1开始支持
if (!log || !log.addFilterMsg) return
if (typeof msg !== 'string') return
log.addFilterMsg(msg)
}
}
\ No newline at end of file
function formatTime(date) {
function formatTime(date) {
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
function formatNumber(n) {
n = n.toString()
return n[1] ? n : '0' + n
}
module.exports = {
formatTime: formatTime
}
nyxkey
nyxkey
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="nyx-api" />
<module name="nyx-key-api" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="nyx-api" options="-parameters" />
<module name="nyx-key-api" options="-parameters" />
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/api" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="9b179758-4209-4ab1-be42-0af6387f7ba2" name="Default Changelist" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DatabaseView">
<option name="SHOW_INTERMEDIATE" value="true" />
<option name="GROUP_DATA_SOURCES" value="true" />
<option name="GROUP_SCHEMA" value="true" />
<option name="GROUP_CONTENTS" value="false" />
<option name="SORT_POSITIONED" value="false" />
<option name="SHOW_EMPTY_GROUPS" value="false" />
<option name="AUTO_SCROLL_FROM_SOURCE" value="false" />
<option name="HIDDEN_KINDS">
<set />
</option>
<expand />
<select />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="MavenImportPreferences">
<option name="enabledProfiles">
<list>
<option value="tomcat" />
<option value="dev" />
</list>
</option>
</component>
<component name="ProjectId" id="1SzzP9FDmCoT2Zm826Pe0NEu35P" />
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/api" />
<property name="settings.editor.selected.configurable" value="reference.projectsettings.compiler.javacompiler" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager" selected="Maven.mvn_package">
<configuration name="nyx_key_api" type="Application" factoryName="Application">
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<envs>
<env name="LOG_LEVEL" value="DEBUG" />
</envs>
<option name="MAIN_CLASS_NAME" value="cn.com.fun.nyxkey.api.NyxkeyApplication" />
<module name="nyx-key-api" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="DemoApplicationTests" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="nyx-key-api" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="cn.com.fun.nyxkey.api.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="cn.com.fun.nyxkey.api" />
<option name="MAIN_CLASS_NAME" value="cn.com.fun.nyxkey.api.DemoApplicationTests" />
<option name="TEST_OBJECT" value="class" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="mvn_clean" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="-DskipTests" />
<option value="-P" />
<option value="dev,tomcat" />
</list>
</option>
<option name="pomFileName" />
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$/api" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
<configuration name="mvn_package" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="package" />
<option value="-DskipTests" />
<option value="-P" />
<option value="dev,tomcat" />
</list>
</option>
<option name="pomFileName" />
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
<list>
<item itemvalue="Application.nyx_key_api" />
<item itemvalue="JUnit.DemoApplicationTests" />
<item itemvalue="Maven.mvn_package" />
<item itemvalue="Maven.mvn_clean" />
</list>
<recent_temporary>
<list>
<item itemvalue="JUnit.DemoApplicationTests" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="9b179758-4209-4ab1-be42-0af6387f7ba2" name="Default Changelist" comment="" />
<created>1572581185855</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1572581185855</updated>
<workItem from="1572581189331" duration="1911000" />
<workItem from="1572587428217" duration="2076000" />
<workItem from="1572884245322" duration="569000" />
<workItem from="1572920512258" duration="451000" />
<workItem from="1572925613341" duration="233000" />
<workItem from="1572925959842" duration="280000" />
<workItem from="1572931999055" duration="15000" />
<workItem from="1572932098824" duration="98000" />
<workItem from="1573361400050" duration="1022000" />
<workItem from="1573440052208" duration="2597000" />
<workItem from="1573443900246" duration="1470000" />
<workItem from="1573460546939" duration="2299000" />
<workItem from="1573527990665" duration="9430000" />
<workItem from="1573612679648" duration="918000" />
<workItem from="1573629488482" duration="2819000" />
<workItem from="1573660242936" duration="577000" />
<workItem from="1573696573386" duration="1435000" />
<workItem from="1573734827017" duration="4634000" />
<workItem from="1573781548127" duration="12066000" />
<workItem from="1573829937814" duration="1175000" />
<workItem from="1573891126875" duration="555000" />
<workItem from="1574063152589" duration="2139000" />
<workItem from="1574072280620" duration="711000" />
<workItem from="1574130349338" duration="3992000" />
<workItem from="1574220463260" duration="1222000" />
<workItem from="1574226389204" duration="3838000" />
<workItem from="1574400454660" duration="586000" />
<workItem from="1575447562202" duration="11269000" />
<workItem from="1575551950624" duration="594000" />
<workItem from="1575862048229" duration="1199000" />
<workItem from="1575945132003" duration="2730000" />
<workItem from="1576032316910" duration="1177000" />
<workItem from="1576124483646" duration="584000" />
<workItem from="1576144509029" duration="5768000" />
<workItem from="1576158554877" duration="1269000" />
<workItem from="1576212215845" duration="2690000" />
<workItem from="1576227126659" duration="2287000" />
<workItem from="1576231469964" duration="6516000" />
<workItem from="1576467329445" duration="886000" />
<workItem from="1576473561488" duration="3623000" />
<workItem from="1576564412398" duration="1222000" />
<workItem from="1576637095137" duration="1180000" />
<workItem from="1576818303941" duration="3304000" />
<workItem from="1576909995207" duration="2601000" />
<workItem from="1577069605079" duration="8599000" />
<workItem from="1577106941738" duration="1386000" />
<workItem from="1577177644432" duration="216000" />
<workItem from="1577178993592" duration="2376000" />
<workItem from="1577186824939" duration="18000" />
<workItem from="1577687020889" duration="1430000" />
<workItem from="1577761956579" duration="1225000" />
<workItem from="1577805983565" duration="612000" />
<workItem from="1577936583461" duration="6674000" />
<workItem from="1577984391504" duration="1305000" />
<workItem from="1578018101391" duration="10233000" />
<workItem from="1578300948684" duration="5320000" />
<workItem from="1578323798220" duration="3790000" />
<workItem from="1578364647824" duration="14295000" />
<workItem from="1578382979726" duration="7571000" />
<workItem from="1578450379564" duration="818000" />
<workItem from="1578497623841" duration="1612000" />
<workItem from="1578550976931" duration="586000" />
<workItem from="1578580802247" duration="3304000" />
<workItem from="1578649449281" duration="763000" />
<workItem from="1579164239866" duration="2000" />
<workItem from="1579164496291" duration="938000" />
<workItem from="1579165583031" duration="769000" />
<workItem from="1579677240368" duration="1238000" />
<workItem from="1579787185781" duration="599000" />
<workItem from="1580474667086" duration="18000" />
<workItem from="1580476661906" duration="24000" />
<workItem from="1580887598407" duration="5013000" />
<workItem from="1581917142496" duration="25897000" />
<workItem from="1582008845986" duration="12050000" />
<workItem from="1582074278108" duration="9108000" />
<workItem from="1582149813923" duration="18056000" />
<workItem from="1582251787529" duration="12890000" />
<workItem from="1582342736985" duration="6433000" />
<workItem from="1582355085042" duration="2134000" />
<workItem from="1582478644515" duration="619000" />
<workItem from="1582479508841" duration="1510000" />
<workItem from="1582482643218" duration="1585000" />
<workItem from="1582510655065" duration="11216000" />
<workItem from="1582666006010" duration="25934000" />
<workItem from="1582768230015" duration="11327000" />
<workItem from="1582841679070" duration="12648000" />
<workItem from="1582942342352" duration="31414000" />
<workItem from="1583126775060" duration="11477000" />
<workItem from="1583285288842" duration="16167000" />
<workItem from="1583460747141" duration="12973000" />
<workItem from="1583543849103" duration="13747000" />
<workItem from="1583808010714" duration="16281000" />
<workItem from="1583893810255" duration="9844000" />
<workItem from="1583979036973" duration="23860000" />
<workItem from="1584110922415" duration="5964000" />
<workItem from="1584142969994" duration="25217000" />
<workItem from="1584215169845" duration="416000" />
<workItem from="1584326887777" duration="3703000" />
<workItem from="1584590180653" duration="854000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/api/src/main/java/cn/com/fun/nyxkey/api/web/controller/NyxApiController.java</url>
<line>254</line>
<option name="timeStamp" value="12" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/api/src/main/java/cn/com/fun/nyxkey/api/service/impl/Rockwell_keyServiceImpl.java</url>
<line>204</line>
<option name="timeStamp" value="26" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/api/src/main/java/cn/com/fun/nyxkey/api/etl/DataProcessor.java</url>
<line>44</line>
<option name="timeStamp" value="42" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>
\ No newline at end of file
## nyx项目
## nyx项目
1. nyx-key-api
主要用于知识中心的相关api
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>nyxkey</artifactId>
<groupId>cn.com.fun</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>nyx-key-api</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--
MyBatis-Spring-Boot-Starter will:
* Autodetect an existing DataSource.
* Will create and register an instance of a SqlSessionFactory passing that DataSource as an input using the SqlSessionFactoryBean.
* Will create and register an instance of a SqlSessionTemplate got out of the SqlSessionFactory.
* Autoscan your mappers, link them to the SqlSessionTemplate and register them to Spring context so they can be injected into your beans.
-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.48</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper</artifactId>
<version>${mapper.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka -->
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
<!--<version>${spring.boot.version}</version>-->
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.yaml/snakeyaml -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.23</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mortbay.jetty/jetty-util -->
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>6.1.26</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Package as an executable jar -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package cn.com.fun.nyxkey.api;
package cn.com.fun.nyxkey.api;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* Created by jscat on 2019-11-11.
*/
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
@EnableCaching
@ComponentScan(basePackages={"cn.com.fun"})
@SpringBootApplication
@EnableScheduling
@EnableSwagger2
@MapperScan("cn.com.fun.nyxkey.api.repository")
public class NyxkeyApplication {
private static final Logger LOGGER = LoggerFactory.getLogger(NyxkeyApplication.class);
@Bean
protected ServletContextListener listener() {
return new ServletContextListener() {
@Override
public void contextInitialized(ServletContextEvent sce) {
LOGGER.debug("ServletContext initialized");
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
LOGGER.debug("ServletContext destroyed");
}
};
}
public static void main(String[] args) {
SpringApplication.run(NyxkeyApplication.class, args);
}
@Configuration
public static class ApplicationWebMvcConfiger extends WebMvcConfigurerAdapter {
/**
* 支持跨域访问
*
* @see org.springframework.web.servlet.config.annotation.WebMvcConfigurer#addCorsMappings
*
* @param registry
*/
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/api/**")
.allowedOrigins("*")
.allowCredentials(true)
.allowedMethods("GET", "POST", "DELETE", "PUT")
.maxAge(3600);
}
}
}
package cn.com.fun.nyxkey.api.common;
package cn.com.fun.nyxkey.api.common;
import cn.com.fun.nyxkey.api.config.TestType;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Arrays;
import java.util.List;
public class CommonParameter {
}
package cn.com.fun.nyxkey.api.common;
package cn.com.fun.nyxkey.api.common;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Created by jscat on 2017-05-24.
*/
public class Constants {
public static final String DATE_PATTERN = "yyyy-MM-dd";
public static final String DATETIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
public static final String DATE_LABEL_PATTERN = "MM.dd";
public static final String TOP_NAME_UNKNOWN = "未知";
public static final String DEFAULT_NOT_EXISTS = "无";
public static final int T_SUBTRAHEND_2 = 2;
public enum DataSetEnum {
OPENHIGH("日期", "093000", "早盘高开"),
NOONHIGH("日期", "130000", "午盘高开"),
OPENTEXT("日期", "093000", "早盘黑嘴文本"),
NOONTEXT("日期", "130000", "午盘黑嘴文本");
private String eventDate;
private String eventTime;
private String eventType;
DataSetEnum(String eventDate, String eventTime, String eventType) {
this.eventDate = eventDate;
this.eventTime = eventTime;
this.eventType = eventType;
}
public String eventDate() {
return eventDate;
}
public String eventTime() {
return eventTime;
}
public String eventType() {
return eventType;
}
}
}
package cn.com.fun.nyxkey.api.common;
package cn.com.fun.nyxkey.api.common;
/**
* Created by jscat on 2017-05-24.
*/
public enum CronJobType
{
/// <summary>
/// 理财 浏览量
/// </summary>
financing_browser_stat_pv,
/// <summary>
/// 理财 浏览量 按员工号分类
/// </summary>
financing_browser_stat_purchase,
/// <summary>
/// 理财 购买量 按员工号分类
/// </summary>
financing_browser_stat_ryxx_purchase,
/// <summary>
/// 个股 访问统计 PV浏览量 Purchase购买量
/// </summary>
stock_browser_stat,
/// <summary>
/// 理财 每日0时将ryxx stat表清空
/// </summary>
truncate_ryxx_table_perday
}
package cn.com.fun.nyxkey.api.common;
package cn.com.fun.nyxkey.api.common;
import cn.com.fun.nyxkey.api.config.DatabaseType;
import org.springframework.beans.factory.annotation.Autowired;
/**
* 作用:
* 1、保存一个线程安全的DatabaseType容器
*/
public class DatabaseContextHolder {
private static final ThreadLocal<DatabaseType> contextHolder = new ThreadLocal<>();
public static DatabaseType getDatabaseType(){
return contextHolder.get();
}
public static void setDatabaseType(DatabaseType type) {
contextHolder.set(type);
}
}
package cn.com.fun.nyxkey.api.common;
package cn.com.fun.nyxkey.api.common;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
/**
* 动态数据源(需要继承AbstractRoutingDataSource)
*/
public class DynamicDataSource extends AbstractRoutingDataSource {
protected Object determineCurrentLookupKey() {
return DatabaseContextHolder.getDatabaseType().toString();
}
}
\ No newline at end of file
package cn.com.fun.nyxkey.api.common;
package cn.com.fun.nyxkey.api.common;
import java.util.List;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* @Title: LeeJSONResult.java
* @Package com.lee.utils
* @Description: 自定义响应数据结构
* 这个类是提供给门户,ios,安卓,微信商城用的
* 门户接受此类数据后需要使用本类的方法转换成对于的数据类型格式(类,或者list)
* 其他自行处理
* 200:表示成功
* 500:表示错误,错误信息在resultMsg字段中
* 501:bean验证错误,不管多少个错误都以map形式返回
* 502:拦截器拦截到用户token出错
* 555:异常抛出信息
* Copyright: Copyright (c) 2016
* Company:Nathan.Lee.Salvatore
* @author leechenxiang
* @date 2016年4月22日 下午8:33:36
* @version V1.0
*/
public class JSONResult {
// 定义jackson对象
private static final ObjectMapper MAPPER = new ObjectMapper();
// 响应业务状态
private Integer resultCode;
// 总数
private Integer totalCount;
// 响应消息
private String resultMsg;
// 响应中的数据
private Object data;
public static JSONResult build(Integer resultCode, String resultMsg, Integer totalCount, Object data) {
return new JSONResult(resultCode, resultMsg, totalCount, data);
}
// public static JSONResult ok(Object data) {
// return new JSONResult(data);
// }
//
// public static JSONResult ok() {
// return new JSONResult(null);
// }
public static JSONResult errorresultMsg(String resultMsg) {
return new JSONResult(500, resultMsg, null, null);
}
public static JSONResult errorMap(Object data) {
return new JSONResult(501, "error", null, data);
}
public static JSONResult errorTokenresultMsg(String resultMsg) {
return new JSONResult(502, resultMsg, null, null);
}
public static JSONResult errorException(String resultMsg) {
return new JSONResult(555, resultMsg, null, null);
}
public JSONResult() {
}
// public static LeeJSONResult build(Integer resultCode, String resultMsg) {
// return new LeeJSONResult(resultCode, resultMsg, null);
// }
public JSONResult(Integer resultCode, String resultMsg, Integer totalCount, Object data) {
this.resultCode = resultCode;
this.resultMsg = resultMsg;
this.totalCount = totalCount;
this.data = data;
}
public JSONResult(Integer totalCount, Object data) {
this.resultCode = 200;
this.resultMsg = "OK";
this.totalCount = totalCount;
this.data = data;
}
//
// public Boolean isOK() {
// return this.resultCode == 200;
// }
public Integer getresultCode() {
return resultCode;
}
public void setresultCode(Integer resultCode) {
this.resultCode = resultCode;
}
public String getresultMsg() {
return resultMsg;
}
public void setresultMsg(String resultMsg) {
this.resultMsg = resultMsg;
}
public Integer getTotalCount() {
return totalCount;
}
public void setTotalCount(Integer totalCount) {
this.totalCount = totalCount;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
/**
* @Description: 将json结果集转化为LeeJSONResult对象
* 需要转换的对象是一个类
* @param jsonData
* @param clazz
* @return
* @author leechenxiang
* @date 2016年4月22日 下午8:34:58
*/
public static JSONResult formatToPojo(Integer totalCount, String jsonData, Class<?> clazz) {
try {
if (clazz == null) {
return MAPPER.readValue(jsonData, JSONResult.class);
}
JsonNode jsonNode = MAPPER.readTree(jsonData);
JsonNode data = jsonNode.get("data");
Object obj = null;
if (clazz != null) {
if (data.isObject()) {
obj = MAPPER.readValue(data.traverse(), clazz);
} else if (data.isTextual()) {
obj = MAPPER.readValue(data.asText(), clazz);
}
}
return build(jsonNode.get("resultCode").intValue(), jsonNode.get("resultMsg")
.asText(), totalCount, obj);
} catch (Exception e) {
return null;
}
}
/**
* @Description: 没有object对象的转化
* @param json
* @return
* @author leechenxiang
* @date 2016年4月22日 下午8:35:21
*/
public static JSONResult format(String json) {
try {
return MAPPER.readValue(json, JSONResult.class);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* @Description: Object是集合转化
* 需要转换的对象是一个list
* @param jsonData
* @param clazz
* @return
* @author leechenxiang
* @date 2016年4月22日 下午8:35:31
*/
public static JSONResult formatToList(Integer totalCount, String jsonData, Class<?> clazz) {
try {
JsonNode jsonNode = MAPPER.readTree(jsonData);
JsonNode data = jsonNode.get("data");
Object obj = null;
if (data.isArray() && data.size() > 0) {
obj = MAPPER.readValue(
data.traverse(),
MAPPER.getTypeFactory().constructCollectionType(
List.class, clazz));
}
return build(jsonNode.get("resultCode").intValue(), jsonNode.get("resultMsg")
.asText(), totalCount, obj);
} catch (Exception e) {
return null;
}
}
}
package cn.com.fun.nyxkey.api.common;
package cn.com.fun.nyxkey.api.common;
/**
* Created by jscat on 2017-05-24.
* 语句1:select * from student limit 9(offset),4(size)
* 语句2:select * from student limit 4(size) offset 9(offset)
* // 语句1和2均返回表student的第10、11、12、13行 ,第一个参数表示从该参数的下一条数据开始,第二个参数表示每次返回的数据条数。
* //语句2中的4表示返回4行,9表示从表的第十行开始
*/
public class Pagination {
private Long offset;
private Integer page; // 表示页码
private Integer size; // 表示每页要显示的条数
public Pagination(Integer limit) {
this(Integer.valueOf(1), limit);
}
public Pagination(Integer page, Integer size) {
setPage(page);
setSize(size);
setOffset(Long.valueOf(size * (page-1)));
}
public Long getOffset() {
return offset;
}
public void setOffset(Long offset) {
if (offset == null || offset < 0) {
this.offset = Long.valueOf(0);
} else {
this.offset = offset;
}
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
if (page == null || page < 1) {
this.page = Integer.valueOf(0);
} else {
this.page = page;
}
}
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
if (size == null || size < 1) {
this.size = Integer.valueOf(5);
} else {
this.size = size;
}
}
@Override
public String toString() {
return "Pagination{" +
"offset=" + offset +
", page=" + page +
", size=" + size +
'}';
}
}
package cn.com.fun.nyxkey.api.config;
package cn.com.fun.nyxkey.api.config;
import cn.com.fun.nyxkey.api.common.DatabaseContextHolder;
import cn.com.fun.nyxkey.api.service.*;
import cn.com.fun.nyxkey.api.service.impl.*;
import cn.com.fun.nyxkey.api.utils.SpringContextUtil;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Aspect
@Component
public class DataSourceAspect {
@Autowired
private TestType testType;
/**
* 使用空方法定义切点表达式
*/
@Pointcut("execution(* cn.com.fun.nyxkey.api.service.*.**.*(..))")
public void declareJointPointExpression() {
}
@Before("declareJointPointExpression()")
public void setDataSourceKey(JoinPoint point){
//testType.getMessage();
for (DatabaseType enumT:DatabaseType.values()){
System.out.println(enumT.toString());
}
System.out.print(DatabaseType.values());
// Object tt = SpringContextUtil.getBean("userAuthTestDestServiceImpl");
//
//
// if(point.getTarget().getClass().isInstance(tt))
// {
// System.out.print("================success");
// }
//
// if (point.getTarget() instanceof UserAuthTestDestService ||
// point.getTarget() instanceof UserAuthTestDestServiceImpl){
// DatabaseContextHolder.setDatabaseType(DatabaseType.valueOf( DatabaseType.class, "user-auth-test-dest" ));
// }
for (DatabaseType s : DatabaseType.values())
{
System.out.println(s + ", ordinal " + s.ordinal());
System.out.println(s + ", toString " + s.toString());
String str = s.toString()+"ServiceImpl";
String str_lower = s.toString().toLowerCase()+"serviceimpl";
boolean bBean = SpringContextUtil.containsBean(str);
Class<?> target = point.getTarget().getClass();
int aa = target.getName().toLowerCase().indexOf(str_lower);
if(bBean && aa>0)
{
DatabaseContextHolder.setDatabaseType(DatabaseType.valueOf( DatabaseType.class, s.toString()));
}
}
// //根据连接点所属的类实例,动态切换数据源
// //FIXME, adding datasource here step02
// if (point.getTarget() instanceof tt ||
// point.getTarget() instanceof UserAuthTestSourceServiceImpl) {
// DatabaseContextHolder.setDatabaseType(DatabaseType.userAuthTestSource);
// } else if (point.getTarget() instanceof UserAuthTestDestService ||
// point.getTarget() instanceof UserAuthTestDestServiceImpl){
// DatabaseContextHolder.setDatabaseType(DatabaseType.userAuthTestDest);
// } else if (point.getTarget() instanceof ReportingProdSourceService ||
// point.getTarget() instanceof ReportingProdSourceServiceImpl){
// DatabaseContextHolder.setDatabaseType(DatabaseType.reportingProdSource);
// }
}
}
\ No newline at end of file
package cn.com.fun.nyxkey.api.config;
package cn.com.fun.nyxkey.api.config;
import com.zaxxer.hikari.HikariDataSource;
import lombok.AllArgsConstructor;
import org.springframework.boot.env.PropertySourceLoader;
import org.springframework.boot.env.YamlPropertySourceLoader;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.EnumerablePropertySource;
import org.springframework.core.env.PropertySource;
import org.springframework.core.io.ClassPathResource;
import javax.sql.DataSource;
import java.io.*;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.yaml.snakeyaml.Yaml;
@AllArgsConstructor
@Configuration
public class DataSourceConfig {
private EnumerablePropertySource loadProperties(PropertySourceLoader propertySourceLoader, String path) throws IOException {
List<PropertySource<?>> source = new ArrayList<>();
try{
source = propertySourceLoader.load("hocon", new ClassPathResource(path));
} catch (Exception e){
System.out.print("One property source expected");
}
return (EnumerablePropertySource) source.get(0);
}
private Map<String,Object> loadPropertiesToMap(String path) throws IOException {
String filePath = System.getProperty("user.dir") + "/" + path;
//InputStream is = this.getClass().getClassLoader().getResourceAsStream(filePath);
File file = new File(filePath);
InputStream is = this.getClass().getClassLoader().getResourceAsStream(path);
if(file .exists())
{
System.out.print(path+" 外部路径=================="+filePath+"==================\n\n");
//优先使用用户外部配置文件
System.out.print("从外部获取配置文件====================================\n\n");
is = new BufferedInputStream( new FileInputStream(filePath));
}
System.out.print("is为===================================\n\n");
System.out.print(is);
Yaml yaml = new Yaml();
// String yamlString = new FileInputStream(file.getPath()).toString();
Map<String,Object> map = (Map<String,Object>) yaml.load(is);
Map<String,Object> map1= (Map<String, Object>) map.get("spring");
Map<String,Object> map2= (Map<String, Object>) map1.get("datasource");
Map<String,Object> map3= (Map<String, Object>) map1.get("hikari");
return map2;
}
/**
* Yaml转Map
* @param yamlString
* @return
*/
@SuppressWarnings("unchecked")
public static Map<String,Object> convertToMap(String yamlString) {
if(yamlString.startsWith("---\n")){
yamlString = yamlString.replaceAll("---\n","");
}if(yamlString.contains("!ruby/hash")){
yamlString = yamlString.replaceAll("(?i)!ruby/.*\n","\n");
}
Yaml yaml= new Yaml();
Map<String,Object> map= (Map<String, Object>) yaml.load(yamlString);
Map<String,Object> map1= (Map<String, Object>) map.get("spring");
Map<String,Object> map2= (Map<String, Object>) map1.get("datasource");
return map2;
}
public List<DataSource> getDataSource(String profile) throws IOException {
List<DataSource> list = new ArrayList<DataSource>();
YamlPropertySourceLoader yamlLoader = new YamlPropertySourceLoader();
String fileName = "config/application-"+profile+".yml";
Map<String,Object> map = loadPropertiesToMap(fileName);
for (String key : map.keySet()) {
Map<String, Object> map1 = (Map<String, Object>)map.get(key);
Map<String, Object> map2 = (Map<String, Object>)map1.get("hikari");
HikariDataSource hikariDataSource = new HikariDataSource();
hikariDataSource.setMinimumIdle(Integer.parseInt(map2.get("minimum-idle").toString()));
hikariDataSource.setMaximumPoolSize(Integer.parseInt(map2.get("maximum-pool-size").toString()));
hikariDataSource.setValidationTimeout(Integer.parseInt(map2.get("validation-timeout").toString()));
hikariDataSource.setIdleTimeout(Integer.parseInt(map2.get("idle-timeout").toString()));
hikariDataSource.setMaxLifetime(Integer.parseInt(map2.get("max-lifetime").toString()));
hikariDataSource.setConnectionTimeout(Integer.parseInt(map2.get("connection-timeout").toString()));
hikariDataSource.setConnectionTestQuery(map2.get("connection-test-query").toString());
hikariDataSource.setUsername(map1.get("username").toString());
hikariDataSource.setPassword(map1.get("password").toString());
hikariDataSource.setDriverClassName(map1.get("driver-class-name").toString());
hikariDataSource.setJdbcUrl(map1.get("url").toString());
list.add(hikariDataSource);
}
return list;
}
}
package cn.com.fun.nyxkey.api.config;
package cn.com.fun.nyxkey.api.config;
import java.io.Serializable;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.checkerframework.checker.units.qual.C;
import org.springframework.context.annotation.Configuration;
import sun.reflect.ConstructorAccessor;
import sun.reflect.FieldAccessor;
import sun.reflect.ReflectionFactory;
public enum DatabaseType {
}
\ No newline at end of file
package cn.com.fun.nyxkey.api.config;
package cn.com.fun.nyxkey.api.config;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import sun.reflect.ConstructorAccessor;
import sun.reflect.FieldAccessor;
import sun.reflect.ReflectionFactory;
public class DynamicEnumUtils {
private static ReflectionFactory reflectionFactory = ReflectionFactory.getReflectionFactory();
private static void setFailsafeFieldValue(Field field, Object target, Object value) throws NoSuchFieldException,
IllegalAccessException {
// 反射访问私有变量
field.setAccessible(true);
/**
* 接下来,我们将字段实例中的修饰符更改为不再是final,
* 从而使反射允许我们修改静态final字段。
*/
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
int modifiers = modifiersField.getInt(field);
// 去掉修饰符int中的最后一位
modifiers &= ~Modifier.FINAL;
modifiersField.setInt(field, modifiers);
FieldAccessor fa = reflectionFactory.newFieldAccessor(field, false);
fa.set(target, value);
}
private static void blankField(Class<?> enumClass, String fieldName) throws NoSuchFieldException,
IllegalAccessException {
for (Field field : Class.class.getDeclaredFields()) {
if (field.getName().contains(fieldName)) {
AccessibleObject.setAccessible(new Field[] { field }, true);
setFailsafeFieldValue(field, enumClass, null);
break;
}
}
}
private static void cleanEnumCache(Class<?> enumClass) throws NoSuchFieldException, IllegalAccessException {
blankField(enumClass, "enumConstantDirectory"); // Sun (Oracle?!?) JDK 1.5/6
blankField(enumClass, "enumConstants"); // IBM JDK
}
private static ConstructorAccessor getConstructorAccessor(Class<?> enumClass, Class<?>[] additionalParameterTypes)
throws NoSuchMethodException {
Class<?>[] parameterTypes = new Class[additionalParameterTypes.length + 2];
parameterTypes[0] = String.class;
parameterTypes[1] = int.class;
System.arraycopy(additionalParameterTypes, 0, parameterTypes, 2, additionalParameterTypes.length);
return reflectionFactory.newConstructorAccessor(enumClass.getDeclaredConstructor(parameterTypes));
}
private static Object makeEnum(Class<?> enumClass, String value, int ordinal, Class<?>[] additionalTypes,
Object[] additionalValues) throws Exception {
Object[] parms = new Object[additionalValues.length + 2];
parms[0] = value;
parms[1] = Integer.valueOf(ordinal);
System.arraycopy(additionalValues, 0, parms, 2, additionalValues.length);
return enumClass.cast(getConstructorAccessor(enumClass, additionalTypes).newInstance(parms));
}
/**
* 将枚举实例添加到作为参数提供的枚举类中
*
* @param enumType 要修改的枚举类型
* @param enumName 添加的枚举类型名字
* @param additionalTypes 枚举类型参数类型列表
* @param additionalValues 枚举类型参数值列表
* @param <T>
*/
@SuppressWarnings("unchecked")
public static <T extends Enum<?>> void addEnum(Class<T> enumType, String enumName, Class<?>[] additionalTypes, Object[] additionalValues) {
// 0. 检查类型
if (!Enum.class.isAssignableFrom(enumType)) {
throw new RuntimeException("class " + enumType + " is not an instance of Enum");
}
// 1. 在枚举类中查找“$values”持有者并获取以前的枚举实例
Field valuesField = null;
Field[] fields = enumType.getDeclaredFields();
for (Field field : fields) {
if (field.getName().contains("$VALUES")) {
valuesField = field;
break;
}
}
AccessibleObject.setAccessible(new Field[] { valuesField }, true);
try {
// 2. 将他拷贝到数组
T[] previousValues = (T[]) valuesField.get(enumType);
List<T> values = new ArrayList<T>(Arrays.asList(previousValues));
// 3. 创建新的枚举项
T newValue = (T) makeEnum(enumType, enumName, values.size(), additionalTypes, additionalValues);
// 4. 添加新的枚举项
values.add(newValue);
// 5. 设定拷贝的数组,到枚举类型
setFailsafeFieldValue(valuesField, null, values.toArray((T[]) Array.newInstance(enumType, 0)));
// 6. 清楚枚举的缓存
cleanEnumCache(enumType);
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
}
\ No newline at end of file
package cn.com.fun.nyxkey.api.config;
package cn.com.fun.nyxkey.api.config;
import cn.com.fun.nyxkey.api.common.DynamicDataSource;
import org.apache.ibatis.session.SqlSessionFactory;
import org.aspectj.weaver.ast.Test;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.env.YamlPropertySourceLoader;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.env.Environment;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import javax.sql.DataSource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* springboot集成mybatis的基本入口 1)创建数据源(如果采用的是默认的tomcat-jdbc数据源,则不需要)
* 2)创建SqlSessionFactory 3)配置事务管理器,除非需要使用事务,否则不用配置
*/
@Configuration // 该注解类似于spring配置文件
public class MyBatisConfig{
@Autowired
private TestType testType;
@Autowired
private Environment environment;
@Bean
public DynamicDataSource dataSource() throws Exception{
Map<Object, Object> targetDataSources = new HashMap<>();
testType.getMessage();
YamlPropertySourceLoader yamlPropertySourceLoader = new YamlPropertySourceLoader();
DataSourceConfig dataSourceInput = new DataSourceConfig();
String ss = environment.getActiveProfiles()[0];
List<DataSource> list = dataSourceInput.getDataSource(ss);
//FIXME, adding datasource here step04
for (int i=0; i<testType.getDatabaseType1().size(); i++) {
targetDataSources.put(testType.getDatabaseType1().get(i), list.get(i));
}
//FIXME, adding primary datasource here step05
DynamicDataSource dataSource = new DynamicDataSource();
dataSource.setTargetDataSources(targetDataSources);// 该方法是AbstractRoutingDataSource的方法
dataSource.setDefaultTargetDataSource(list.get(0));// 默认的datasource设置为myTestDbDataSource
return dataSource;
}
@Bean
@ConfigurationProperties(prefix = "mybatis.configuration")
public org.apache.ibatis.session.Configuration globalConfiguration(){
return new org.apache.ibatis.session.Configuration();
}
/**
* 根据数据源创建SqlSessionFactory
*/
@Bean
public SqlSessionFactory sqlSessionFactory(DynamicDataSource ds,
org.apache.ibatis.session.Configuration config) throws Exception {
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
SqlSessionFactoryBean fb = new SqlSessionFactoryBean();
fb.setDataSource(ds);// 指定数据源(这个必须有,否则报错)
fb.setConfiguration(config);
return fb.getObject();
}
/**
* 配置事务管理器
*/
@Bean
public DataSourceTransactionManager transactionManager(DynamicDataSource dataSource) throws Exception {
return new DataSourceTransactionManager(dataSource);
}
}
\ No newline at end of file
package cn.com.fun.nyxkey.api.config;
package cn.com.fun.nyxkey.api.config;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import cn.com.fun.nyxkey.api.config.DynamicEnumUtils;
import cn.com.fun.nyxkey.api.config.DatabaseType;
import javax.annotation.PostConstruct;
import java.io.Serializable;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
@Data
@Component
public class TestType {
//FIXME, adding datasource here step01
@Value(value = "${ss.tt}")
private String tt;
@Value("134")
private String aa;
@Value( value = "#{'${ss.tt}'.split(',')}")
public List<String> DatabaseType1;
public int bb;
public String getMessage() {
for (String str : DatabaseType1) {
DynamicEnumUtils.addEnum(DatabaseType.class, str, new Class[]{}, new Object[]{});
}
for (DatabaseType enumT:DatabaseType.values()){
System.out.println(enumT.toString());
}
bb = 111;
return "姓名:"+tt+"___"+aa;
}
}
package cn.com.fun.nyxkey.api.config;
package cn.com.fun.nyxkey.api.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
/**
* 开启WebSocket支持
* @author jscat 2019-11-15
*/
@Configuration
public class WebSocketConfig {
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
}
\ No newline at end of file
package cn.com.fun.nyxkey.api.config;
package cn.com.fun.nyxkey.api.config;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArraySet;
import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
// URI to Map
import org.mortbay.util.MultiMap;
import org.mortbay.util.UrlEncoded;
/*
sid: sessionid
uid: userid
"ws://localhost:8085/websocket/chat?sid=chat&uid=uid_001";
session.getPathParameters(){param=chat}
session.getQueryString()sid=chat&uid=uid_001
session.getRequestURI().toString()ws://localhost:8085/websocket/chat?sid=chat&uid=uid_001
session.getQueryString()sid=chat&uid=uid_001
*/
@ServerEndpoint("/websocket/{param}")
@Component
public class WebSocketServer {
private static final Logger log = LoggerFactory.getLogger(WebSocketServer.class);
//静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。
private static int onlineCount = 0;
private static Map<String, Integer> onlineCountMap = new HashMap<String, Integer>();
//concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
private static CopyOnWriteArraySet<WebSocketServer> webSocketSet = new CopyOnWriteArraySet<WebSocketServer>();
//与某个客户端的连接会话,需要通过它来给客户端发送数据
private Session session;
//接收sid
private String sid="";
//接收uid
private String uid="";
/**
* 连接建立成功调用的方法*/
@OnOpen
public void onOpen(Session session, @PathParam("param") String param) {
System.out.println("用户"+param+" 登录");
Map<String, String> map = session.getPathParameters();
System.out.println("session.getPathParameters()"+map.toString());
String str = session.getQueryString();
System.out.println("session.getQueryString()"+str);
String uri = session.getRequestURI().toString();
System.out.println("session.getRequestURI().toString()"+uri);
String url = session.getQueryString();
System.out.println("session.getQueryString()"+url);
MultiMap multiMap = new MultiMap();
UrlEncoded.decodeTo(url.substring(url.indexOf("?") + 1), multiMap, "UTF-8");
System.out.println(multiMap.toString());
this.session = session;
this.sid = multiMap.getString("sid");
this.uid = multiMap.getString("uid");
String msg = multiMap.getString("msg");
webSocketSet.add(this); //加入set中
addOnlineCount(this.sid); //在线数加1
log.info("有新窗口开始监听:"+sid+",当前在线人数为" + getOnlineCount(sid));
JSONObject msgMap = new JSONObject();
msgMap.put("cmd", "onOpen");
msgMap.put("uid", this.uid);
msgMap.put("msg", msg);
try {
//sendMessage(msgMap.toString());
sendInfo(msgMap.toString(), this.sid);
} catch (IOException e) {
log.error("websocket IO异常");
}
}
/**
* 连接关闭调用的方法
*/
@OnClose
public void onClose() {
webSocketSet.remove(this); //从set中删除
subOnlineCount(sid); //在线数减1
log.info("有一连接关闭! "+sid+" 当前在线人数为" + getOnlineCount(sid));
}
/**
* 收到客户端消息后调用的方法
*
* @param message 客户端发送过来的消息*/
@OnMessage
public void onMessage(String message, Session session) {
log.info("收到来自窗口"+sid+"的信息:"+message);
//群发消息
/*
for (WebSocketServer item : webSocketSet) {
try {
item.sendMessage(message);
} catch (IOException e) {
e.printStackTrace();
log.info("收到来自窗口"+sid+"的信息:"+message);
}
}
*/
try {
sendInfo(message, sid);
} catch (IOException e) {
log.info("收到来自窗口"+sid+"的信息:"+message);
}
}
/**
*
* @param session
* @param error
*/
@OnError
public void onError(Session session, Throwable error) {
log.error("发生错误");
error.printStackTrace();
}
/**
* 实现服务器主动推送
*/
public void sendMessage(String message) throws IOException {
this.session.getBasicRemote().sendText(message);
}
/**
* 群发自定义消息
* */
public static void sendInfo(String message, @PathParam("sid") String sid) throws IOException {
log.info("推送消息到"+String.valueOf(webSocketSet.size())+"个"+sid+"窗口"+",推送内容:"+message);
for (WebSocketServer item : webSocketSet) {
try {
//这里可以设定只推送给这个sid的,为null则全部推送
if(sid==null) {
item.sendMessage(message);
}else if(item.sid.equals(sid)){
item.sendMessage(message);
}
} catch (IOException e) {
continue;
}
}
}
public static synchronized int getOnlineCount() {
return onlineCount;
}
public static synchronized void addOnlineCount() {
WebSocketServer.onlineCount++;
}
public static synchronized void subOnlineCount() {
WebSocketServer.onlineCount--;
}
public static synchronized int getOnlineCount(String sid) {
return onlineCountMap.get(sid);
}
public static synchronized void addOnlineCount(String sid) {
if(onlineCountMap.containsKey(sid))
{
onlineCountMap.put(sid, onlineCountMap.get(sid)+1);
}
else
{
onlineCountMap.put(sid, 1);
}
}
public static synchronized void subOnlineCount(String sid) {
onlineCountMap.put(sid, onlineCountMap.get(sid)-1);
}
}
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 竞答结果 tbl_match
* Created by jscat on 2020/01/06.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_keyT_match{
private String matchId; // 竞答的id uuid format
private String matchSeason; // 竞答赛季, s01
private String matchType; // 竞答类别: daily|pk
private String matchTeam; // 竞答队伍 uid_001
private String teamType; //主队还是客队 blue|red
private String matchResult; // 竞答结果 win|lose;
private String matchScore; // 竞答分数, 比如:;uid_1:1;uid_2:0;
private String quizIndex; // '竞答|学习进行到第几题',
private String rankScore; // 段位分数, 胜利+2,失败-1
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime; // 创建时间
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date updateDatetime; // 更新时间
}
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 题目Quiz基础数据结构
* Created by jscat on 2019-11-11
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_keyT_quiz{
private String id; // 主id
private String quizType; // 题目类型, whisky:0, wset, 1, wine, 2, Sake
private String userId; // quiz提交人
private String questionName; // quiz名称
private String choiceString; // 以;;双分号作为分隔
private String answer; // quiz正确答案
private String questionLevel; // quiz难度,1简单;2较难;3很难;4变态
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date currentDatetime; // 统计周期
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date updateDatetime; // 统计周期
}
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 题目Quiz_defect基础数据结构
* Created by jscat on 2019-12-12
* 因为可能用户会发现错误的题
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_keyT_quiz_defect{
private String id; // 主id did_uuid format
private String status; // quiz_defect 解决状态 0: 未解决; 1-已解决
private String QuestionFkId; // 题目的编号
private String userFkId; // quiz defect提交人 uid_uuid format
private String userComment; // defect 用户描述
private String sysComment; // defect 系统描述
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime; // defect创建时间
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date sysCommentDatetime; // 系统回复时间
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date updateDatetime; // 统计周期
}
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 题目comment基础数据结构
* Created by jscat on 2020-01-02
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_keyV_match_rank{
private String rankId; //排名id
private String matchSeason; // 赛季: s01
private String matchType; // 类型: daily|pk
private String matchName; // 类型: daily|pk
private String matchTeam; //uid_001
private String defaultType; //默认; 0 | 1
private String title; // 头衔
private String score; // 当前分数: s01, pk
private String rank; // 当前排名: s01, pk
private String totalMatch; //总玩家数,按match_season, match_type汇总,
private String totalQuiz; //总的知识数,按quiz_type汇总
private String ratioRank; //排名ratio
private String ratioFinish; //完成ratio
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime; // defect创建时间
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date updateDatetime; // 统计周期
}
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* quiz各类题目的总数目
* Created by jscat on 2020-01-02
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_keyV_quiz_type_total{
private String quizType; // 类型: daily|pk
private String quizName; // 类型: daily|pk
private String total; //总数
}
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 题目comment基础数据结构
* Created by jscat on 2020-01-02
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_msgT_comment{
private String commentId; // 发文的id
private String commentType; // 评论类型: quiz|post
private String objectId; // 题目的id
private String objectName; // 题目名称
private String content; // 针对post_id做评论
private String useridFrom; // 针对发文做评论的id, uuid format
private String useridTo; // 针对发文做评论的id, uuid format
private String contentTo; // 针对post_id做评论
private int numLike; // 针对每条comment的点赞次数,每点一次,则累加
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime; // 创建时间
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date updateDatetime; // 更新时间
public void setContent(String content)
{
if(content.equals("0"))
{
this.content = null;
}
else
{
this.content = content;
}
}
public void setContentTo(String content)
{
if(content.equals("0"))
{
this.contentTo = null;
}
else
{
this.contentTo = content;
}
}
public void setUseridTo(String strUseridTo)
{
if(strUseridTo.equals("0"))
{
this.useridTo = null;
}
else
{
this.useridTo = strUseridTo;
}
}
}
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 用户-msg视图表
* Created by jscat on 2019/12/24.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_msgV_user_msg{
private String commentId; // 发文的id, uuid format
private String objectId; // 回复对象的id, oid, 比如qiz, aid, gid, 等等, uuid format
private String objectName; // 题目名称
private String content; // 针对post_id的评论
private String numLike; // 针对每条comment的点赞次数,每点一次,则累加
private String useridFrom; // 针对发文做评论的id, uuid format
private String nicknameFrom; // nickName
private String avatarUrlFrom; // avatarUrlFrom
private String useridTo; // 针对某一片发文的userid, uuid format
private String contentTo; // 针对post_id做评论
private String nicknameTo; // nickName
private String avatarUrlTo; // avatarUrlTo
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime; // 统计周期
}
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 用户登陆表
* Created by jscat on 2019/12/24.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_userT_login_log{
private String id; // 主id
private String userId; // openid
private String wxcode; // openid
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date loginDatetime; // 登陆日期
}
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 用户表
* Created by jscat on 2019/12/24.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_userT_user{
private String id; // 主id
private String openid; // openid
private String authStatus; // 授权状态: 0-未授权, 1-已授权
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime; // 创建时间
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date updateDatetime; // 更新时间
}
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 用户详情表 tbl_userinfo
* Created by jscat on 2020/3/5
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_userT_userinfo{
private String userid; // userid
private String nickName; // nickName
private String avatarUrl; // avatarUrl
private String gender; // gender
private String province; // province
private String city; // city
private String country; // country
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime; // 创建日期
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date updateDatetime; // 更新日期
}
package cn.com.fun.nyxkey.api.domain.query;
package cn.com.fun.nyxkey.api.domain.query;
import cn.com.fun.nyxkey.api.common.Pagination;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* Created by jscat 2020/03/13
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Rockwell_keyCronStatQuery {
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date currentDatetime;
@Override
public String toString() {
return "Rockwell_keyCronStatQuery{" +
"currentDatetime='" + currentDatetime + '\'' +
'}';
}
}
package cn.com.fun.nyxkey.api.domain.query;
package cn.com.fun.nyxkey.api.domain.query;
import cn.com.fun.nyxkey.api.common.Pagination;
import cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match;
import cn.com.fun.nyxkey.api.domain.Rockwell_keyV_match_rank;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
* Created by jscat on 2020/01/06
*/
@Data
@AllArgsConstructor
public class Rockwell_keyT_matchQuery {
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime;
private String matchId;
private String matchSeason;
private String matchType;
private String matchTeam; //userid
private String matchResult; //用于统计比赛胜负 win|lose
private Pagination pagination;
private List<Rockwell_keyT_match> listRockwell_keyT_match;
private List<Rockwell_keyV_match_rank> listRockwell_keyV_match_rank;
//默认返回1页4条记录
public Rockwell_keyT_matchQuery()
{
this.pagination = new Pagination(1, 4);
}
public void setMatchSeason(String strMatchSeason)
{
if(strMatchSeason.equals("0"))
{
this.matchSeason = null;
}
else
{
this.matchSeason = strMatchSeason;
}
}
public void setMatchType(String strMatchType)
{
if(strMatchType.equals("0"))
{
this.matchType = null;
}
else
{
this.matchType = strMatchType;
}
}
public void setMatchId(String strMatchId)
{
if(strMatchId.equals("0"))
{
this.matchId = null;
}
else
{
this.matchId = strMatchId;
}
}
public void setMatchTeam(String strMatchTeam)
{
if(strMatchTeam.equals("0"))
{
this.matchTeam = null;
}
else
{
this.matchTeam = strMatchTeam;
}
}
@Override
public String toString() {
return "Rockwell_keyT_matchQuery{" +
"createDatetime='" + createDatetime + '\'' +
"matchId='" + matchId + '\'' +
"matchSeason='" + matchSeason + '\'' +
"matchType='" + matchType + '\'' +
"matchTeam='" + matchTeam + '\'' +
"matchResult='" + matchResult + '\'' +
"pagination='" + pagination + '\'' +
"listRockwell_keyT_match='" + listRockwell_keyT_match + '\'' +
"listRockwell_keyV_match_rank='" + listRockwell_keyV_match_rank + '\'' +
'}';
}
}
package cn.com.fun.nyxkey.api.domain.query;
package cn.com.fun.nyxkey.api.domain.query;
import cn.com.fun.nyxkey.api.common.Pagination;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* Created by jscat on 2019-11-11
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Rockwell_keyT_quizQuery {
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date currentDatetime;
private String questionName;
private Pagination pagination;
private String id;
public void setQuestionName(String questionName)
{
if(questionName.equals("null"))
{
this.questionName = null;
}
else
{
this.questionName = questionName;
}
}
@Override
public String toString() {
return "Rockwell_keyT_quizQuery{" +
"currentDatetime='" + currentDatetime + '\'' +
"questionName='" + questionName + '\'' +
"pagination='" + pagination + '\'' +
"id='" + id + '\'' +
'}';
}
}
package cn.com.fun.nyxkey.api.domain.query;
package cn.com.fun.nyxkey.api.domain.query;
import cn.com.fun.nyxkey.api.common.Pagination;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* Created by jscat on 2020-01-02
order by
*/
@Data
@AllArgsConstructor
public class Rockwell_msgT_commentQuery {
private String objectId;
private String commentId;
private String userId;
// "排序类型(升序(asc)、降序(desc))",默认是 asc
private String orderType;
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime;
private Pagination pagination;
public Rockwell_msgT_commentQuery(){
// 分页设置,默认是1页4条记录
this.pagination = new Pagination(1, 4);
// "排序类型(升序(asc)、降序(desc))",默认是 asc
this.orderType = "asc";
}
public void setObjectId(String strObjectId)
{
if(strObjectId.equals("0"))
{
this.objectId = null;
}
else
{
this.objectId = strObjectId;
}
}
public void setUserId(String strUserId) {
if (strUserId.equals("0")) {
this.userId = null;
} else {
this.userId = strUserId;
}
}
@Override
public String toString() {
return "Rockwell_msgT_commentQuery{" +
"objectId='" + objectId + '\'' +
"commentId='" + commentId + '\'' +
"userId='" + userId + '\'' +
"orderType='" + orderType + '\'' +
"createDatetime='" + createDatetime + '\'' +
"pagination='" + pagination + '\'' +
'}';
}
}
package cn.com.fun.nyxkey.api.domain.query;
package cn.com.fun.nyxkey.api.domain.query;
import cn.com.fun.nyxkey.api.common.Pagination;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* Created by jscat on 2019/12/24
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Rockwell_userT_userQuery {
private String id;
private String openid;
private Pagination pagination;
private String authStatus;
public void setId(String strId)
{
if(strId.equals("0"))
{
this.id = null;
}
else
{
this.id = strId;
}
}
public void setOpenid(String strOpenid)
{
if(strOpenid.equals("0"))
{
this.openid = null;
}
else
{
this.openid = strOpenid;
}
}
@Override
public String toString() {
return "Rockwell_userT_userQuery{" +
"id='" + id + '\'' +
"openid='" + openid + '\'' +
"authStatus='" + authStatus + '\'' +
"pagination='" + pagination + '\'' +
'}';
}
}
package cn.com.fun.nyxkey.api.etl;
package cn.com.fun.nyxkey.api.etl;
import cn.com.fun.nyxkey.api.common.CronJobType;
import cn.com.fun.nyxkey.api.service.Rockwell_keyService;
import cn.com.fun.nyxkey.api.service.Rockwell_userService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import static java.lang.Integer.parseInt;
@Component
public class DataProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(DataProcessor.class);
@Autowired
private Rockwell_keyService rockwell_keyService;
//计算赛季
public String getSeason()
{
Calendar calender = Calendar.getInstance();
Date date = new Date();
calender.setTime(date);
Integer year = calender.get(Calendar.YEAR);
Integer month = calender.get(Calendar.MONTH);
Integer season = year % 2020 * 4 + month/3 + 1;
String matchSeason = season >= 10 ? String.valueOf(season) : '0' + String.valueOf(season);
return "s"+String.valueOf(matchSeason);
}
@Scheduled(cron = "${app.service.cron.genT_match_rank}")
public void runStat() {
String matchSeason = getSeason();
rockwell_keyService.Rockwell_keyServiceGenT_match_rank(matchSeason);
}
}
package cn.com.fun.nyxkey.api.repository;
package cn.com.fun.nyxkey.api.repository;
import cn.com.fun.nyxkey.api.common.Pagination;
import cn.com.fun.nyxkey.api.domain.*;
import cn.com.fun.nyxkey.api.domain.query.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by jscat on 2019-11-11.
*/
@Repository
public interface Rockwell_keyMapper {
List<Rockwell_keyT_quiz> getT_quiz(Rockwell_keyT_quizQuery rockwell_keyT_quizQuery);
List<Rockwell_keyT_quiz> getT_quizRand();
List<Rockwell_keyT_quiz> getT_quizItem(Rockwell_keyT_quizQuery rockwell_keyT_quizQuery);
List<Rockwell_keyT_quiz> getT_quiz_study_by_sql(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyT_quiz> getT_quiz_study_by_id(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyV_quiz_type_total> getT_quiz_type_total(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_quizDefectItem(Rockwell_keyT_quiz_defect rockwell_keyT_quiz_defect);
/* 通过pagination, matchId查询t_match */
List<Rockwell_keyT_match> getT_match_by_matchid(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyT_match> getT_match_by_page(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_matchList(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_matchItem(Rockwell_keyT_match rockwell_keyT_match);
/* match rank api */
List<Rockwell_keyV_match_rank> getV_match_rank(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void updateT_match_rank_defaultType(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void genT_match_rank(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
/* testing */
void test(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
}
package cn.com.fun.nyxkey.api.repository;
package cn.com.fun.nyxkey.api.repository;
import cn.com.fun.nyxkey.api.common.Pagination;
import cn.com.fun.nyxkey.api.domain.*;
import cn.com.fun.nyxkey.api.domain.query.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by jscat on 2020-01-02.
用于留言和评论功能
*/
@Repository
public interface Rockwell_msgMapper {
/* 通过pagination, quizId查询comment */
List<Rockwell_msgV_user_msg> getV_user_comment_by_page(Rockwell_msgT_commentQuery rockwell_msgT_commentQuery);
List<Rockwell_msgV_user_msg> getT_comment_by_commentid(Rockwell_msgT_commentQuery rockwell_msgT_commentQuery);
void addT_commentItem(Rockwell_msgT_comment rockwell_msgT_comment);
void addT_commentLike(Rockwell_msgT_comment rockwell_msgT_comment);
}
package cn.com.fun.nyxkey.api.repository;
package cn.com.fun.nyxkey.api.repository;
import cn.com.fun.nyxkey.api.common.Pagination;
import cn.com.fun.nyxkey.api.domain.*;
import cn.com.fun.nyxkey.api.domain.query.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by jscat on 2020-02-17.
*/
@Repository
public interface Rockwell_userMapper {
List<Rockwell_keyT_quiz> getT_quiz();
Rockwell_userT_user wechatOpenIdIsExists(Rockwell_userT_userQuery rockwell_userT_userQuery);
Rockwell_userT_user queryUserByid(Rockwell_userT_userQuery rockwell_userT_userQuery);
List<Rockwell_userT_userinfo> queryUserInfoByid(Rockwell_userT_userQuery rockwell_userT_userQuery);
void insertUser(Rockwell_userT_user rockwell_userT_user);
void updateUser(Rockwell_userT_user rockwell_userT_user);
void insertLog(Rockwell_userT_login_log rockwellT_login_log);
void insertUserinfo(Rockwell_userT_userinfo rockwell_userT_userinfo);
}
package cn.com.fun.nyxkey.api.service;
package cn.com.fun.nyxkey.api.service;
import cn.com.fun.nyxkey.api.common.JSONResult;
import cn.com.fun.nyxkey.api.domain.*;
import cn.com.fun.nyxkey.api.domain.*;
import cn.com.fun.nyxkey.api.domain.query.*;
import org.joda.time.DateTime;
import java.util.Date;
import java.util.List;
/**
* Created by jscat on 2019-11-11.
*/
public interface Rockwell_keyService {
JSONResult Rockwell_keyServiceGetT_quizWithPage(String strQuestionName, int pageNum, int pageCount);
JSONResult Rockwell_keyServiceGetT_quizRand();
JSONResult Rockwell_keyServiceGetT_matchLike();
JSONResult Rockwell_keyServiceGetT_quizitem(String questionId);
JSONResult Rockwell_keyServiceGetT_quiz_study(String matchSeason, String matchType, String matchTeam, String quizId, int pageNum, int pageCount);
int addT_quizDefectItem(String questionId, String userId, String userComment);
JSONResult Rockwell_keyServiceGetT_quiz_type_total(String matchType);
// t_match相关service
// getT_match三个场合
// 1. match详情,指定matchId
// 2. 查询比赛历史 with pagination, 指定matchTeam, order by create_datetime desc, match_status == 1
// 3. 今日比赛未完,依靠create_datetime & match_status
JSONResult Rockwell_keyServiceGetT_match_by_matchid(String matchId);
JSONResult Rockwell_keyServiceGetT_match_by_page(String matchSeason, String matchType, String matchTeam);
void Rockwell_keyServiceAddT_matchList(List<Rockwell_keyT_match> listRockwell_keyT_match);
void Rockwell_keyServiceAddT_matchItem(String matchSeason, String matchType, String matchTeam, String matchScore,
String teamType, String matchResult, String quizIndex, String rankScore);
// match ranking
JSONResult Rockwell_keyServiceGetV_match_rank(String matchSeason, String matchType, String matchTeam);
void Rockwell_keyServiceUpdateT_match_rank_defaultType(List<Rockwell_keyV_match_rank> listRockwell_keyV_match_rank);
void Rockwell_keyServiceGenT_match_rank(String matchSeason);
// testing
void Rockwell_keyServiceTest(List<Rockwell_keyT_match> listRockwell_keyT_match);
}
package cn.com.fun.nyxkey.api.service;
package cn.com.fun.nyxkey.api.service;
import cn.com.fun.nyxkey.api.common.JSONResult;
import cn.com.fun.nyxkey.api.domain.*;
import cn.com.fun.nyxkey.api.domain.*;
import cn.com.fun.nyxkey.api.domain.query.*;
import org.joda.time.DateTime;
import java.util.Date;
import java.util.List;
/**
* Created by jscat on 2020-01-03.
*/
public interface Rockwell_msgService {
JSONResult Rockwell_msgServiceGetT_comment(String objectId, String userId, int pageNum, int pageCount);
JSONResult Rockwell_msgServiceAddT_commentItem(String commentType, String objectId, String objectName, String content, String contentTo, String useridFrom, String useridTo);
void Rockwell_msgServiceAddT_commentLike(String commentId);
}
package cn.com.fun.nyxkey.api.service;
package cn.com.fun.nyxkey.api.service;
import cn.com.fun.nyxkey.api.common.JSONResult;
import cn.com.fun.nyxkey.api.domain.*;
import cn.com.fun.nyxkey.api.domain.*;
import cn.com.fun.nyxkey.api.domain.query.*;
import org.joda.time.DateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Created by jscat on 2020-02-17.
*/
public interface Rockwell_userService {
JSONResult wxLogin(String encryptedData, String iv, String code, String userId);
JSONResult Rockwell_userServiceReg();
JSONResult Rockwell_userServiceGetT_userinfo(String userId);
}
package cn.com.fun.nyxkey.api.service.impl;
package cn.com.fun.nyxkey.api.service.impl;
import cn.com.fun.nyxkey.api.common.JSONResult;
import cn.com.fun.nyxkey.api.common.Pagination;
import cn.com.fun.nyxkey.api.repository.*;
import cn.com.fun.nyxkey.api.service.*;
import cn.com.fun.nyxkey.api.domain.*;
import cn.com.fun.nyxkey.api.domain.query.*;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.K;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Created by jscat on 2019-11-11.
*/
@Service
public class Rockwell_keyServiceImpl implements Rockwell_keyService {
private static final Logger LOGGER = LoggerFactory.getLogger(Rockwell_keyServiceImpl.class);
@Autowired
private Rockwell_keyMapper rockwell_keyMapper;
/*
接口api: main use 题目热搜
*/
public JSONResult Rockwell_keyServiceGetT_quizWithPage(String strQuestionName, int pageNum, int pageCount){
LOGGER.debug("find RockwellKeyServiceGetT_quizWithPage");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
Date date2= new Date();
try {
date2=dateFormat.parse(dateFormat.format(new Date()));
} catch (ParseException e) {
e.printStackTrace();
}
Rockwell_keyT_quizQuery rockwell_keyT_quizQuery = new Rockwell_keyT_quizQuery();
rockwell_keyT_quizQuery.setPagination(new Pagination(pageNum, pageCount));
rockwell_keyT_quizQuery.setQuestionName(strQuestionName);
rockwell_keyT_quizQuery.setCurrentDatetime(date2);
System.out.println("sql string: "+rockwell_keyT_quizQuery.toString());
LOGGER.debug("============= sql string: "+rockwell_keyT_quizQuery.toString());
List<Rockwell_keyT_quiz> listRockwell_keyT_quiz = new ArrayList<Rockwell_keyT_quiz>();
listRockwell_keyT_quiz = rockwell_keyMapper.getT_quiz(rockwell_keyT_quizQuery);
int totalCount = listRockwell_keyT_quiz.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyT_quiz);
return jsonResult;
}
/*
接口api: 随机选取10道题
*/
public JSONResult Rockwell_keyServiceGetT_quizRand(){
LOGGER.debug("find Rockwell_keyServiceGetTRand");
List<Rockwell_keyT_quiz> listRockwell_keyT_quiz = new ArrayList<Rockwell_keyT_quiz>();
listRockwell_keyT_quiz = rockwell_keyMapper.getT_quizRand();
int totalCount = listRockwell_keyT_quiz.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyT_quiz);
return jsonResult;
}
/*
接口api: 获取某一个具体id的数据
*/
public JSONResult Rockwell_keyServiceGetT_quizitem(String questionId){
LOGGER.debug("find Rockwell_keyServiceGetT_quizitem");
List<Rockwell_keyT_quiz> listRockwell_keyT_quiz = new ArrayList<Rockwell_keyT_quiz>();
Rockwell_keyT_quizQuery rockwell_keyT_quizQuery = new Rockwell_keyT_quizQuery();
rockwell_keyT_quizQuery.setId(questionId);
listRockwell_keyT_quiz = rockwell_keyMapper.getT_quizItem(rockwell_keyT_quizQuery);
int totalCount = listRockwell_keyT_quiz.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyT_quiz);
return jsonResult;
}
public JSONResult Rockwell_keyServiceGetT_quiz_study(String matchSeason, String matchType, String matchTeam, String quizId, int pageNum, int pageCount)
{
LOGGER.debug("find Rockwell_keyServiceGetT_quiz_by_study");
List<Rockwell_keyT_quiz> listRockwell_keyT_quiz = new ArrayList<Rockwell_keyT_quiz>();
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchSeason(matchSeason);
rockwell_keyT_matchQuery.setMatchType(matchType);
rockwell_keyT_matchQuery.setMatchTeam(matchTeam);
rockwell_keyT_matchQuery.setMatchId(quizId);
rockwell_keyT_matchQuery.setPagination(new Pagination(pageNum,pageCount));
if(!quizId.equals("0") && quizId != null)
{
listRockwell_keyT_quiz = rockwell_keyMapper.getT_quiz_study_by_id(rockwell_keyT_matchQuery);
}
else
{
listRockwell_keyT_quiz = rockwell_keyMapper.getT_quiz_study_by_sql(rockwell_keyT_matchQuery);
}
int totalCount = listRockwell_keyT_quiz.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyT_quiz);
return jsonResult;
}
public JSONResult Rockwell_keyServiceGetT_quiz_type_total(String matchType)
{
LOGGER.debug("find Rockwell_keyServiceGetT_quiz_type_total");
List<Rockwell_keyV_quiz_type_total> listRockwell_keyV_quiz_type_total = new ArrayList<Rockwell_keyV_quiz_type_total>();
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchType(matchType);
listRockwell_keyV_quiz_type_total = rockwell_keyMapper.getT_quiz_type_total(rockwell_keyT_matchQuery);
int totalCount = listRockwell_keyV_quiz_type_total.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyV_quiz_type_total);
return jsonResult;
}
/*
接口api: 获取竞答的点赞数
*/
public JSONResult Rockwell_keyServiceGetT_matchLike(){
LOGGER.debug("find Rockwell_keyServiceGetT_matchLike");
List<Rockwell_keyT_quiz> listRockwell_keyT_quiz = new ArrayList<Rockwell_keyT_quiz>();
listRockwell_keyT_quiz = rockwell_keyMapper.getT_quizRand();
int totalCount = listRockwell_keyT_quiz.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyT_quiz);
return jsonResult;
}
/**
* 新增quiz的defect,用于纠错
*/
public int addT_quizDefectItem(String questionId, String userId, String userComment)
{
LOGGER.debug("find addT_quizDefectItem");
Rockwell_keyT_quiz_defect rockwell_keyT_quiz_defect = new Rockwell_keyT_quiz_defect();
rockwell_keyT_quiz_defect.setId("did_"+UUID.randomUUID().toString());
rockwell_keyT_quiz_defect.setStatus("0");
rockwell_keyT_quiz_defect.setQuestionFkId(questionId);
rockwell_keyT_quiz_defect.setUserFkId(userId);
rockwell_keyT_quiz_defect.setUserComment(userComment);
rockwell_keyT_quiz_defect.setCreateDatetime(new Date());
rockwell_keyMapper.addT_quizDefectItem(rockwell_keyT_quiz_defect);
return 0;
}
// t_match相关service
// getT_match三个场合
// 1. match详情,指定matchId
// 2. 查询比赛历史 with pagination, 指定matchTeam, order by create_datetime desc, match_status == 1
// 3. 今日比赛结果daily,依靠create_datetime & match_status
public JSONResult Rockwell_keyServiceGetT_match_by_matchid(String matchId){
LOGGER.debug("find Rockwell_keyServiceGetT_match_by_matchid");
List<Rockwell_keyT_match> listRockwell_keyT_match = new ArrayList<Rockwell_keyT_match>();
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchId(matchId);
listRockwell_keyT_match = rockwell_keyMapper.getT_match_by_matchid(rockwell_keyT_matchQuery);
int totalCount = listRockwell_keyT_match.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyT_match);
return jsonResult;
}
public JSONResult Rockwell_keyServiceGetT_match_by_page(String matchSeason, String matchType, String matchTeam){
LOGGER.debug("find Rockwell_keyServiceGetT_match_by_matchstatus");
List<Rockwell_keyT_match> listRockwell_keyT_match = new ArrayList<Rockwell_keyT_match>();
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchSeason(matchSeason);
rockwell_keyT_matchQuery.setMatchType(matchType);
rockwell_keyT_matchQuery.setMatchTeam(matchTeam);
listRockwell_keyT_match = rockwell_keyMapper.getT_match_by_page(rockwell_keyT_matchQuery);
int totalCount = listRockwell_keyT_match.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyT_match);
return jsonResult;
}
public void Rockwell_keyServiceAddT_matchList(List<Rockwell_keyT_match> listRockwell_keyT_match)
{
LOGGER.debug("find Rockwell_keyServiceAddT_matchList");
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setListRockwell_keyT_match(listRockwell_keyT_match);
rockwell_keyMapper.addT_matchList(rockwell_keyT_matchQuery);
}
public void Rockwell_keyServiceAddT_matchItem(String matchSeason, String matchType, String matchTeam, String matchScore,
String teamType, String matchResult, String quizIndex, String rankScore)
{
LOGGER.debug("find Rockwell_keyServiceAddT_matchItem");
Rockwell_keyT_match rockwell_keyT_match = new Rockwell_keyT_match();
rockwell_keyT_match.setMatchId("mid_"+UUID.randomUUID().toString());
rockwell_keyT_match.setMatchSeason(matchSeason);
rockwell_keyT_match.setMatchType(matchType);
rockwell_keyT_match.setMatchTeam(matchTeam);
rockwell_keyT_match.setMatchScore(matchScore);
rockwell_keyT_match.setTeamType(teamType);
rockwell_keyT_match.setMatchResult(matchResult);
rockwell_keyT_match.setQuizIndex(quizIndex);
rockwell_keyT_match.setRankScore(rankScore);
rockwell_keyT_match.setCreateDatetime(new Date());
rockwell_keyT_match.setUpdateDatetime(new Date());
rockwell_keyMapper.addT_matchItem(rockwell_keyT_match);
}
// 获取match_season, match_type, match_team, score, rank, total的值
// 用于我的排名 jscat 2020-02-21
public JSONResult Rockwell_keyServiceGetV_match_rank(String matchSeason, String matchType, String matchTeam)
{
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchSeason(matchSeason);
rockwell_keyT_matchQuery.setMatchTeam(matchTeam);
rockwell_keyT_matchQuery.setMatchType(matchType);
//20200306 jscat 实时更新排名,会不会很慢?
rockwell_keyMapper.genT_match_rank(rockwell_keyT_matchQuery);
List<Rockwell_keyV_match_rank> listRockwell_keyV_match_rank= new ArrayList<Rockwell_keyV_match_rank>();
listRockwell_keyV_match_rank = rockwell_keyMapper.getV_match_rank(rockwell_keyT_matchQuery);
int totalCount = listRockwell_keyV_match_rank.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyV_match_rank);
return jsonResult;
}
// 获取match_season, match_type, match_team, score, rank, total的值
// 用于我的排名 jscat 2020-02-21
public void Rockwell_keyServiceUpdateT_match_rank_defaultType(List<Rockwell_keyV_match_rank> listRockwell_keyV_match_rank)
{
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setListRockwell_keyV_match_rank(listRockwell_keyV_match_rank);
rockwell_keyMapper.updateT_match_rank_defaultType(rockwell_keyT_matchQuery);
}
// 生成t_match_rank
// 用于我的排名 jscat 2020-02-21
public void Rockwell_keyServiceGenT_match_rank(String matchSeason)
{
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchSeason(matchSeason);
rockwell_keyMapper.genT_match_rank(rockwell_keyT_matchQuery);
}
// testing
public void Rockwell_keyServiceTest(List<Rockwell_keyT_match> listRockwell_keyT_match)
{
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setListRockwell_keyT_match(listRockwell_keyT_match);
rockwell_keyMapper.test(rockwell_keyT_matchQuery);
}
}
package cn.com.fun.nyxkey.api.service.impl;
package cn.com.fun.nyxkey.api.service.impl;
import cn.com.fun.nyxkey.api.common.JSONResult;
import cn.com.fun.nyxkey.api.common.Pagination;
import cn.com.fun.nyxkey.api.repository.*;
import cn.com.fun.nyxkey.api.service.*;
import cn.com.fun.nyxkey.api.domain.*;
import cn.com.fun.nyxkey.api.domain.query.*;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.K;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Created by jscat on 2020-01-03.
*/
@Service
public class Rockwell_msgServiceImpl implements Rockwell_msgService {
private static final Logger LOGGER = LoggerFactory.getLogger(Rockwell_msgServiceImpl.class);
@Autowired
private Rockwell_msgMapper rockwell_msgMapper;
/*
// 获取object(quiz|mall)最近4条comment
*/
public JSONResult Rockwell_msgServiceGetT_comment(String objectId, String userId, int pageNum, int pageCount){
LOGGER.debug("find Rockwell_msgServiceGetT_comment");
Rockwell_msgT_commentQuery rockwell_msgT_commentQuery = new Rockwell_msgT_commentQuery();
rockwell_msgT_commentQuery.setPagination(new Pagination(pageNum, pageCount));
rockwell_msgT_commentQuery.setObjectId(objectId);
rockwell_msgT_commentQuery.setUserId(userId);
// 如果userId不为空,则为参看某用户的评论,orderType为desc,按时间最新排序
if(!userId.equals("0"))
{
rockwell_msgT_commentQuery.setOrderType("desc");
}
System.out.println("sql string: "+rockwell_msgT_commentQuery.toString());
LOGGER.debug("============= sql string: "+rockwell_msgT_commentQuery.toString());
List<Rockwell_msgV_user_msg> listRockwell_msgV_user_msg = new ArrayList<Rockwell_msgV_user_msg>();
listRockwell_msgV_user_msg = rockwell_msgMapper.getV_user_comment_by_page(rockwell_msgT_commentQuery);
int totalCount = listRockwell_msgV_user_msg.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_msgV_user_msg);
return jsonResult;
}
/*
// 1.2 添加quiz comment item
*/
public JSONResult Rockwell_msgServiceAddT_commentItem(String commentType, String objectId, String objectName,
String content, String contentTo,
String useridFrom, String useridTo)
{
LOGGER.debug("find RockwellAddQuizMsgItem");
Rockwell_msgT_comment rockwell_msgT_comment = new Rockwell_msgT_comment();
String commentId = "cid_"+UUID.randomUUID().toString();
rockwell_msgT_comment.setCommentId(commentId);
rockwell_msgT_comment.setCommentType(commentType);
rockwell_msgT_comment.setObjectId(objectId);
rockwell_msgT_comment.setObjectName(objectName);
rockwell_msgT_comment.setContent(content);
rockwell_msgT_comment.setContentTo(contentTo);
rockwell_msgT_comment.setUseridFrom(useridFrom);
rockwell_msgT_comment.setUseridTo(useridTo);
rockwell_msgT_comment.setCreateDatetime(new Date());
rockwell_msgT_comment.setUpdateDatetime(new Date());
rockwell_msgMapper.addT_commentItem(rockwell_msgT_comment);
Rockwell_msgT_commentQuery rockwell_msgT_commentQuery = new Rockwell_msgT_commentQuery();
rockwell_msgT_commentQuery.setCommentId(commentId);
List<Rockwell_msgV_user_msg> listRockwell_msgV_user_msg = new ArrayList<Rockwell_msgV_user_msg>();
listRockwell_msgV_user_msg = rockwell_msgMapper.getT_comment_by_commentid(rockwell_msgT_commentQuery);
int totalCount = 1;
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_msgV_user_msg);
return jsonResult;
}
/*
1.3 添加点赞
*/
public void Rockwell_msgServiceAddT_commentLike(String commentId){
LOGGER.debug("find Rockwell_msgServiceAddT_commentLike");
Rockwell_msgT_comment rockwell_msgT_comment = new Rockwell_msgT_comment();
rockwell_msgT_comment.setCommentId(commentId);
rockwell_msgMapper.addT_commentLike(rockwell_msgT_comment);
}
}
package cn.com.fun.nyxkey.api.service.impl;
package cn.com.fun.nyxkey.api.service.impl;
import cn.com.fun.nyxkey.api.common.JSONResult;
import cn.com.fun.nyxkey.api.common.Pagination;
import cn.com.fun.nyxkey.api.repository.*;
import cn.com.fun.nyxkey.api.service.*;
import cn.com.fun.nyxkey.api.domain.*;
import cn.com.fun.nyxkey.api.domain.query.*;
import cn.com.fun.nyxkey.api.utils.AesCbcUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import cn.com.fun.nyxkey.api.web.common.HttpRequest;
/**
* Created by jerry on 2019-02-24.
*/
@Service
public class Rockwell_userServiceImpl implements Rockwell_userService {
private static final Logger LOGGER = LoggerFactory.getLogger(Rockwell_userServiceImpl.class);
@Autowired
private Rockwell_userMapper rockwell_userMapper;
@Value("${weixin.appid}")
private String appid;
@Value("${weixin.secret}")
private String secret;
/*
main use
用于微信小程序登陆
*/
public JSONResult wxLogin(String encryptedData, String iv, String code, String userId) {
LOGGER.info("wx login ");
Map map = new HashMap();
JSONResult jsonResult = new JSONResult();
//登录凭证不能为空
if (code == null || code.length() == 0) {
jsonResult.setresultCode(0);
jsonResult.setresultMsg("code 不能为空");
return jsonResult;
}
//小程序唯一标识 (在微信小程序管理后台获取)
String wxAppid = appid;
//小程序的 app secret (在微信小程序管理后台获取)
String wxSecret = secret;
//授权(必填)
String grant_type = "authorization_code";
//////////////// 1、向微信服务器 使用登录凭证 code 获取 session_key 和 openid ////////////////
//请求参数
String params = "appid=" + wxAppid + "&secret=" + wxSecret + "&js_code=" + code + "&grant_type=" + grant_type;
try {
//发送请求
String str = HttpRequest.sendGet("https://api.weixin.qq.com/sns/jscode2session", params);
//解析相应内容(转换成json对象)
JSONObject json = JSONObject.parseObject(str);
if(json.get("session_key").toString() != null) {
// step1 获取会话密钥(session_key)
String session_key = json.get("session_key").toString();
//用户的唯一标识(openid)
String openId = (String) json.get("openid");
// step2 去数据库 检查 openId 是否存在 不存在就新建用户
Rockwell_userT_userQuery rockwellT_userQuery = new Rockwell_userT_userQuery();
//rockwellT_userQuery.setOpenid(openId);
rockwellT_userQuery.setId(userId);
Rockwell_userT_user user = rockwell_userMapper.queryUserByid(rockwellT_userQuery);
// 更新用户信息
user.setOpenid(openId);
user.setAuthStatus("1"); //已授权
user.setUpdateDatetime(new Date());
rockwell_userMapper.insertUser(user);
// 返回小程序的openid设置为""
user.setOpenid("");
jsonResult.setData(user);
jsonResult.setresultMsg("SUCCESS");
jsonResult.setresultCode(200);
// 保存登录日志 tbl_login_log
Rockwell_userT_login_log log = new Rockwell_userT_login_log();
log.setId("lid_"+UUID.randomUUID().toString());
log.setLoginDatetime(new Date());
log.setUserId(user.getId());
log.setWxcode(code);
rockwell_userMapper.insertLog(log);
// 更新用户信息 tbl_userinfo
try{
//拿到用户session_key和用户敏感数据进行解密,拿到用户信息。
String decrypts= AesCbcUtil.decrypt(encryptedData,session_key,iv,"utf-8");
JSONObject json_userInfo = JSONObject.parseObject(decrypts);
System.out.println(json_userInfo);
String nickName = json_userInfo.get("nickName").toString(); //用户昵称
String avatarUrl = json_userInfo.get("avatarUrl").toString(); //头像
String gender = json_userInfo.get("gender").toString();//性别
// String unionid = json_userInfo.get("unionid").toString(); //unionid
String city = json_userInfo.get("city").toString(); //城市
String province = json_userInfo.get("province").toString();//省份
String country = json_userInfo.get("country").toString(); //国家
Rockwell_userT_userinfo rockwell_userT_userinfo = new Rockwell_userT_userinfo();
rockwell_userT_userinfo.setUserid(user.getId());
rockwell_userT_userinfo.setNickName(nickName);
rockwell_userT_userinfo.setAvatarUrl(avatarUrl);
rockwell_userT_userinfo.setGender(gender);
rockwell_userT_userinfo.setCity(city);
rockwell_userT_userinfo.setProvince(province);
rockwell_userT_userinfo.setCountry(country);
rockwell_userT_userinfo.setCreateDatetime(user.getCreateDatetime());
rockwell_userT_userinfo.setUpdateDatetime(new Date());
rockwell_userMapper.insertUserinfo(rockwell_userT_userinfo);
}catch (Exception e) {
e.printStackTrace();
}
}
else {
System.out.println(json);
}
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
return jsonResult;
}
/*
注册新用户
*/
public JSONResult Rockwell_userServiceReg()
{
JSONResult jsonResult = new JSONResult();
Rockwell_userT_user user = new Rockwell_userT_user();
String userId ="uid_"+UUID.randomUUID().toString();
user.setId(userId);
user.setOpenid("");
user.setAuthStatus("0"); //未授权
user.setCreateDatetime(new Date());
user.setUpdateDatetime(new Date());
rockwell_userMapper.insertUser(user);
String avatarUrl = "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/u_image/icon_avatar1.png";
Rockwell_userT_userinfo rockwell_userT_userinfo = new Rockwell_userT_userinfo();
rockwell_userT_userinfo.setUserid(userId);
rockwell_userT_userinfo.setNickName("匿名用户");
rockwell_userT_userinfo.setAvatarUrl(avatarUrl);
rockwell_userT_userinfo.setGender("");
rockwell_userT_userinfo.setCity("");
rockwell_userT_userinfo.setProvince("");
rockwell_userT_userinfo.setCountry("");
rockwell_userT_userinfo.setCreateDatetime(new Date());
rockwell_userT_userinfo.setUpdateDatetime(new Date());
rockwell_userMapper.insertUserinfo(rockwell_userT_userinfo);
jsonResult.setData(user);
jsonResult.setresultMsg("SUCCESS");
jsonResult.setresultCode(200);
return jsonResult;
}
public JSONResult Rockwell_userServiceGetT_userinfo(String userid)
{
Rockwell_userT_userQuery rockwell_userT_userQuery = new Rockwell_userT_userQuery();
rockwell_userT_userQuery.setId(userid);
List<Rockwell_userT_userinfo> listRockwell_userT_userinfo= new ArrayList<Rockwell_userT_userinfo>();
listRockwell_userT_userinfo = rockwell_userMapper.queryUserInfoByid(rockwell_userT_userQuery);
int totalCount = listRockwell_userT_userinfo.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_userT_userinfo);
return jsonResult;
}
}
package cn.com.fun.nyxkey.api.utils;
package cn.com.fun.nyxkey.api.utils;
/**
* Created by jscat on 2020/3/5
*/
import java.io.UnsupportedEncodingException;
import java.security.AlgorithmParameters;
import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidParameterSpecException;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import javax.management.openmbean.InvalidKeyException;
import org.apache.commons.codec.binary.Base64;
/**
* <p>User: qrn
* <p>Date: 14-1-28
* <p>Version: 1.0
* 描述: 解密
*/
public class AesCbcUtil {
/**
* AES解密
*
* @param encryptedData 包括敏感数据在内的完整用户信息的加密数据,
* @param key 秘钥
* @param iv 加密算法的初始向量,
* @param encodingFormat 解密后的结果需要进行的编码
* @return String
* @see Exception
*/
public static String decrypt(String encryptedData,String key, String iv, String encodingFormat) throws Exception {
// initialize();
//被加密的数据
byte[] dataByte = Base64.decodeBase64(encryptedData);
//加密秘钥
byte[] keyByte = Base64.decodeBase64(key);
//偏移量
byte[] ivByte = Base64.decodeBase64(iv);
try {
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
SecretKeySpec spec = new SecretKeySpec(keyByte, "AES");
AlgorithmParameters parameters = AlgorithmParameters.getInstance("AES");
parameters.init(new IvParameterSpec(ivByte));
cipher.init(Cipher.DECRYPT_MODE, spec, parameters);// 初始化
byte[] resultByte = cipher.doFinal(dataByte);
if (null != resultByte && resultByte.length > 0) {
String result = new String(resultByte, encodingFormat);
return result;
}
return null;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (InvalidParameterSpecException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (InvalidAlgorithmParameterException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
e.printStackTrace();
} catch (BadPaddingException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
}
\ No newline at end of file
package cn.com.fun.nyxkey.api.utils;
package cn.com.fun.nyxkey.api.utils;
/**
* Created by jscat on 2017/8/1.
*/
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
/**
* 文件操作
*/
public class CSVUtils {
/**
* 生成为CVS文件
* @param exportData
* 源数据List
* @param map
* csv文件的列表头map
* @param outPutPath
* 文件路径
* @param fileName
* 文件名称
* @return
*/
@SuppressWarnings("rawtypes")
public static File createCSVFile(List exportData, LinkedHashMap map, String outPutPath,
String fileName) {
File csvFile = null;
BufferedWriter csvFileOutputStream = null;
try {
File file = new File(outPutPath);
if (!file.exists()) {
file.mkdir();
}
//定义文件名格式并创建
csvFile = File.createTempFile(fileName, ".csv", new File(outPutPath));
System.out.println("csvFile:" + csvFile);
// UTF-8使正确读取分隔符","
csvFileOutputStream = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(
csvFile), "UTF-8"), 1024);
System.out.println("csvFileOutputStream:" + csvFileOutputStream);
// 写入文件头部
csvFileOutputStream.write(new String(new byte[] { (byte) 0xEF, (byte) 0xBB,(byte) 0xBF }));
for (Iterator propertyIterator = map.entrySet().iterator(); propertyIterator.hasNext();) {
java.util.Map.Entry propertyEntry = (java.util.Map.Entry) propertyIterator.next();
csvFileOutputStream
.write("" + (String) propertyEntry.getValue() != null ? (String) propertyEntry
.getValue() : "" + "");
if (propertyIterator.hasNext()) {
csvFileOutputStream.write(",");
}
}
csvFileOutputStream.newLine();
// 写入文件内容
for (Iterator iterator = exportData.iterator(); iterator.hasNext();) {
Object row = (Object) iterator.next();
for (Iterator propertyIterator = map.entrySet().iterator(); propertyIterator
.hasNext();) {
java.util.Map.Entry propertyEntry = (java.util.Map.Entry) propertyIterator
.next();
csvFileOutputStream.write((String) BeanUtils.getProperty(row,
(String) propertyEntry.getKey()));
if (propertyIterator.hasNext()) {
csvFileOutputStream.write(",");
}
}
if (iterator.hasNext()) {
csvFileOutputStream.newLine();
}
}
csvFileOutputStream.flush();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
csvFileOutputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return csvFile;
}
/**
* 下载文件
* @param response
* @param csvFilePath
* 文件路径
* @param fileName
* 文件名称
* @throws IOException
*/
public static void exportFile(HttpServletResponse response, String csvFilePath, String fileName)
throws IOException {
response.setContentType("application/csv;charset=UTF-8");
response.setHeader("Content-Disposition",
"attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
InputStream in = null;
try {
in = new FileInputStream(csvFilePath);
int len = 0;
byte[] buffer = new byte[1024];
response.setCharacterEncoding("UTF-8");
OutputStream out = response.getOutputStream();
while ((len = in.read(buffer)) > 0) {
out.write(new byte[] { (byte) 0xEF, (byte) 0xBB, (byte) 0xBF });
out.write(buffer, 0, len);
}
} catch (FileNotFoundException e) {
System.out.println(e);
} finally {
if (in != null) {
try {
in.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
}
/**
* 删除该目录filePath下的所有文件
* @param filePath
* 文件目录路径
*/
public static void deleteFiles(String filePath) {
File file = new File(filePath);
if (file.exists()) {
File[] files = file.listFiles();
for (int i = 0; i < files.length; i++) {
if (files[i].isFile()) {
files[i].delete();
}
}
}
}
/**
* 删除单个文件
* @param filePath
* 文件目录路径
* @param fileName
* 文件名称
*/
public static void deleteFile(String filePath, String fileName) {
File file = new File(filePath);
if (file.exists()) {
File[] files = file.listFiles();
for (int i = 0; i < files.length; i++) {
if (files[i].isFile()) {
if (files[i].getName().equals(fileName)) {
files[i].delete();
return;
}
}
}
}
}
/**
* 生成content
* @param exportData
* 源数据List
* @param map
* csv文件的列表头map
* @return
*/
@SuppressWarnings("rawtypes")
public static String genContent(List exportData, LinkedHashMap map) {
String content = "";
try {
// 写入文件头部
for (Iterator propertyIterator = map.entrySet().iterator(); propertyIterator.hasNext();) {
java.util.Map.Entry propertyEntry = (java.util.Map.Entry) propertyIterator.next();
content += "" + (String) propertyEntry.getValue() != null ? (String) propertyEntry
.getValue() : "" + "";
if (propertyIterator.hasNext()) {
content += ",";
}
}
content += "\n";
// 写入文件内容
for (Iterator iterator = exportData.iterator(); iterator.hasNext();) {
Object row = (Object) iterator.next();
for (Iterator propertyIterator = map.entrySet().iterator(); propertyIterator
.hasNext();) {
java.util.Map.Entry propertyEntry = (java.util.Map.Entry) propertyIterator
.next();
content += (String) BeanUtils.getProperty(row, (String) propertyEntry.getKey());
if (propertyIterator.hasNext()) {
content += ",";
}
}
if (iterator.hasNext()) {
content += "\n";
}
}
} catch (Exception e) {
e.printStackTrace();
}
return content;
}
/**
* 测试数据
* @param args
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) {
List exportData = new ArrayList<Map>();
Map row1 = new LinkedHashMap<String, String>();
row1.put("1", "11");
row1.put("2", "12");
row1.put("3", "13");
row1.put("4", "14");
exportData.add(row1);
row1 = new LinkedHashMap<String, String>();
row1.put("1", "21");
row1.put("2", "22");
row1.put("3", "23");
row1.put("4", "24");
exportData.add(row1);
LinkedHashMap map = new LinkedHashMap();
map.put("1", "第一列");
map.put("2", "第二列");
map.put("3", "第三列");
map.put("4", "第四列");
String path = "c:/export/";
String fileName = "文件导出";
File file = CSVUtils.createCSVFile(exportData, map, path, fileName);
String fileName2 = file.getName();
System.out.println("文件名称:" + fileName2);
}
}
package cn.com.fun.nyxkey.api.utils;
package cn.com.fun.nyxkey.api.utils;
import java.util.Date;
/**
* Created by jscat on 2017-05-08.
*/
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
public static Date max(Date d1, Date d2) {
if (d1 == null && d2 == null) {
return null;
} else if (d1 == null) {
return d2;
} else if (d2 == null) {
return d1;
}
return d1.after(d2) ? d1 : d2;
}
}
package cn.com.fun.nyxkey.api.utils;
package cn.com.fun.nyxkey.api.utils;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Locale;
@Configuration
public class SpringContextUtil implements ApplicationContextAware
{
private static ApplicationContext context;
@Override
public void setApplicationContext(ApplicationContext contex)
throws BeansException
{
System.out.println("--------------------contex---------"+contex);
SpringContextUtil.context = contex;
}
public static ApplicationContext getApplicationContext() {
return context;
}
public static Object getBean(String beanName) {
return context.getBean(beanName);
}
public static boolean containsBean(String name) {
return context.containsBean(name);
}
public static String getMessage(String key) {
return context.getMessage(key, null, Locale.getDefault());
}
}
package cn.com.fun.nyxkey.api.utils;
package cn.com.fun.nyxkey.api.utils;
import java.text.NumberFormat;
/**
* Created by jscat on 2017-05-09.
*/
public class StringUtils extends org.apache.commons.lang3.StringUtils {
public static String formatPercent(Number value) {
return formatPercent(value, 1);
}
public static String formatPercent(Number value, int maximumFractionDigits) {
if (value == null) {
return "0%";
}
NumberFormat instance = NumberFormat.getPercentInstance();
instance.setMaximumFractionDigits(maximumFractionDigits);
return instance.format(value);
}
public static String formatCurrencyHumanReadable(Double value) {
return formatCurrencyHumanReadable(value, 0);
}
public static String formatCurrencyHumanReadable(Double value, int maximumFractionDigits) {
return formatCurrencyHumanReadable(value, maximumFractionDigits, true, CurrencyUnit.TT, true);
}
public static String formatCurrencyHumanReadable(Double value, int maximumFractionDigits, boolean grouping,
CurrencyUnit currencyUnit, boolean appendUnit) {
if (value == null) {
return "0";
}
NumberFormat format = NumberFormat.getInstance();
format.setMaximumFractionDigits(maximumFractionDigits);
format.setGroupingUsed(grouping);
CurrencyUnit current = currencyUnit;
do {
if (Math.abs(value) >= current.value()) {
return appendUnit ? format.format(value / current.value()) + current.unit() : format.format(value / current.value());
}
} while((current = currencyUnit.next(current)) != null);
return format.format(value);
}
public enum CurrencyUnit {
// 亿 hundred million
HM(0, 1E8, "亿"),
// 万 ten thousand
TT(1, 1E4, "万");
private static final CurrencyUnit[] CURRENCY_UNIT = new CurrencyUnit[]{HM, TT};
private int index;
private double value;
private String unit;
CurrencyUnit(int index, double value, String unit) {
this.index = index;
this.value = value;
this.unit = unit;
}
public int index() {
return index;
}
public double value() {
return value;
}
public String unit() {
return unit;
}
public CurrencyUnit next(CurrencyUnit current) {
int nextIndex = current.index() + 1;
if (nextIndex >= CURRENCY_UNIT.length) {
return null;
}
return CURRENCY_UNIT[nextIndex];
}
}
}
package cn.com.fun.nyxkey.api.web.common;
package cn.com.fun.nyxkey.api.web.common;
import cn.com.fun.nyxkey.api.common.Constants;
import cn.com.fun.nyxkey.api.utils.DateUtils;
import cn.com.fun.nyxkey.api.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.beans.PropertyEditorSupport;
import java.text.ParseException;
/**
* Created by jscat on 2017-05-09.
*/
public class DateEditor extends PropertyEditorSupport {
private static final Logger LOGGER = LoggerFactory.getLogger(DateEditor.class);
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (StringUtils.isBlank(text)) {
setValue(null);
} else {
try {
setValue(DateUtils.parseDate(text, Constants.DATE_PATTERN, Constants.DATETIME_PATTERN));
} catch (ParseException e) {
LOGGER.error("error parsing text to date. [{}]", text, e);
setValue(null);
}
}
}
}
package cn.com.fun.nyxkey.api.web.common;
package cn.com.fun.nyxkey.api.web.common;
/**
* Created by jscat on 2020-02-17.
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
import java.util.Map;
public class HttpRequest {
public static void main(String[] args) {
//发送 GET 请求
String s=HttpRequest.sendGet("http://v.qq.com/x/cover/kvehb7okfxqstmc.html?vid=e01957zem6o", "");
System.out.println(s);
// //发送 POST 请求
// String sr=HttpRequest.sendPost("http://www.toutiao.com/stream/widget/local_weather/data/?city=%E4%B8%8A%E6%B5%B7", "");
// JSONObject json = JSONObject.fromObject(sr);
// System.out.println(json.get("data"));
}
/**
* 向指定URL发送GET方法的请求
*
* @param url
* 发送请求的URL
* @param param
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return URL 所代表远程资源的响应结果
*/
public static String sendGet(String url, String param) {
String result = "";
BufferedReader in = null;
try {
String urlNameString = url + "?" + param;
URL realUrl = new URL(urlNameString);
// 打开和URL之间的连接
URLConnection connection = realUrl.openConnection();
// 设置通用的请求属性
connection.setRequestProperty("accept", "*/*");
connection.setRequestProperty("connection", "Keep-Alive");
connection.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
// 建立实际的连接
connection.connect();
// 获取所有响应头字段
Map<String, List<String>> map = connection.getHeaderFields();
// 遍历所有的响应头字段
for (String key : map.keySet()) {
System.out.println(key + "--->" + map.get(key));
}
// 定义 BufferedReader输入流来读取URL的响应
in = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result += line;
}
} catch (Exception e) {
System.out.println("发送GET请求出现异常!" + e);
e.printStackTrace();
}
// 使用finally块来关闭输入流
finally {
try {
if (in != null) {
in.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
return result;
}
/**
* 向指定 URL 发送POST方法的请求
*
* @param url
* 发送请求的 URL
* @param param
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
public static String sendPost(String url, String param) {
PrintWriter out = null;
BufferedReader in = null;
String result = "";
try {
URL realUrl = new URL(url);
// 打开和URL之间的连接
URLConnection conn = realUrl.openConnection();
// 设置通用的请求属性
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
// 发送POST请求必须设置如下两行
conn.setDoOutput(true);
conn.setDoInput(true);
// 获取URLConnection对象对应的输出流
out = new PrintWriter(conn.getOutputStream());
// 发送请求参数
out.print(param);
// flush输出流的缓冲
out.flush();
// 定义BufferedReader输入流来读取URL的响应
in = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result += line;
}
} catch (Exception e) {
System.out.println("发送 POST 请求出现异常!"+e);
e.printStackTrace();
}
//使用finally块来关闭输出流、输入流
finally{
try{
if(out!=null){
out.close();
}
if(in!=null){
in.close();
}
}
catch(IOException ex){
ex.printStackTrace();
}
}
return result;
}
}
package cn.com.fun.nyxkey.api.web.common;
package cn.com.fun.nyxkey.api.web.common;
/**
* Created by jscat on 2016-12-28.
*/
public enum ResponseCode {
OK(0, "success"),
FAILED(100, "failed")
;
private Integer code;
private String message;
ResponseCode(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer code() {
return code;
}
public String message() {
return message;
}
}
package cn.com.fun.nyxkey.api.web.common;
package cn.com.fun.nyxkey.api.web.common;
/**
* Created by jscat on 2017-05-05.
*/
public class ResponseHelper {
public static <T> ResponseWrapper<T> newResponseWrapper(T instance, Class<T> type) {
ResponseWrapper<T> response = new ResponseWrapper<>();
response.setData(instance);
return response;
}
}
package cn.com.fun.nyxkey.api.web.common;
package cn.com.fun.nyxkey.api.web.common;
/**
* Created by jscat on 2016-12-28.
*/
public class ResponseWrapper<T> {
private Integer code;
private String message;
private String reason;
private T data;
public ResponseWrapper() {
updateResponseState(ResponseCode.OK);
}
public ResponseWrapper(ResponseCode responseCode) {
updateResponseState(responseCode);
}
public ResponseWrapper(Integer code, String message) {
this.code = code;
this.message = message;
}
public ResponseWrapper(Integer code, String message, String reason) {
this.code = code;
this.message = message;
this.reason = reason;
}
public ResponseWrapper(Integer code, String message, T data) {
this.code = code;
this.message = message;
this.data = data;
}
public void updateResponseState(ResponseCode responseCode) {
setCode(responseCode.code());
setMessage(responseCode.message());
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
package cn.com.fun.nyxkey.api.web.controller;
package cn.com.fun.nyxkey.api.web.controller;
import cn.com.fun.nyxkey.api.web.common.*;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Throwables;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.Map;
/**
* Created by jscat on 2019-11-11
*/
@RestControllerAdvice(annotations = RestController.class)
public class ApiControllerAdvice {
private static final Logger LOGGER = LoggerFactory.getLogger(ApiControllerAdvice.class);
@Autowired
private ObjectMapper objectMapper;
@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public ResponseWrapper<Object> handleException(HttpServletRequest request, Exception ex) {
LOGGER.error("API exception. contextPath: {}, queryString: {}",
request.getContextPath(), request.getQueryString(), ex);
ResponseWrapper<Object> response = new ResponseWrapper<>(ResponseCode.FAILED);
Map<String, String[]> parameters = request.getParameterMap();
String parametersJson;
try {
parametersJson = objectMapper.writeValueAsString(parameters);
} catch (JsonProcessingException e) {
parametersJson = "error processing parameters to json.";
LOGGER.warn(parametersJson + "contextPath: {}, queryString: {}", request.getContextPath(),
request.getQueryString(), e);
}
response.setReason("Root cause: " + Throwables.getRootCause(ex).getMessage()
+ ", request parameters: " + parametersJson);
return response;
}
@InitBinder
public void initBinder(WebDataBinder binder) {
binder.registerCustomEditor(Date.class, new DateEditor());
}
}
package cn.com.fun.nyxkey.api.web.controller;
package cn.com.fun.nyxkey.api.web.controller;
import cn.com.fun.nyxkey.api.config.WebSocketServer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping("/api/socket")
public class CheckCenterController {
//页面请求
@GetMapping("/index/{userId}")
public Map socket(@PathVariable String userId) {
Map result = new HashMap();
result.put("userId", userId);
return result;
}
//推送数据接口
@ResponseBody
@RequestMapping("/push/{cid}")
public Map pushToWeb(@RequestBody String param) {
Map result = new HashMap();
try {
WebSocketServer.sendInfo(param, param);
result.put("code", 200);
result.put("msg", "success");
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
}
\ No newline at end of file
package cn.com.fun.nyxkey.api.web.controller;
package cn.com.fun.nyxkey.api.web.controller;
import cn.com.fun.nyxkey.api.common.JSONResult;
import cn.com.fun.nyxkey.api.domain.Rockwell_msgV_user_msg;
import cn.com.fun.nyxkey.api.service.*;
import cn.com.fun.nyxkey.api.web.common.ResponseHelper;
import cn.com.fun.nyxkey.api.web.common.ResponseWrapper;
import io.swagger.annotations.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Created by jscat on 2020-01-03.
*/
@RestController
@RequestMapping("/api")
public class MsgApiController {
private static final Logger LOGGER = LoggerFactory.getLogger(MsgApiController.class);
@Autowired
private Rockwell_msgService msgService;
// 1.1 获取quiz最近4条comment by objectId
// 1.2 获取quiz最近4条comment by userid
// http://localhost:8084/api/quiz/msg/query?quizId=qid_123&pageNum=1&pageCount=5
// http://localhost:8084/api/quiz/msg/query?postId=pid_123
@ApiOperation(value="顺序获取object(quiz|mall|)的comment", notes="获取object的comments")
@ApiImplicitParams({
@ApiImplicitParam(name = "objectId", value = "objectId", required = false, dataType = "String", defaultValue = "0"),
@ApiImplicitParam(name = "userId", value = "userId", required = false, dataType = "String", defaultValue = "0"),
@ApiImplicitParam(name = "pageNum", value = "页码,从1开始", required = false, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "pageCount", value = "每页的数据个数,默认是5个", required = false, dataType = "String", defaultValue = "4")
})
@RequestMapping(value = "/nyx/msg/query", method = RequestMethod.GET)
public JSONResult RockwellGetQuizMsgQuery(
@RequestParam(value = "objectId", required = true, defaultValue = "0") String objectId,
@RequestParam(value = "userId", required = true, defaultValue = "0") String userId,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "5") int pageCount
)
{
LOGGER.debug("======================/nyx/quiz/msg/query");
List<Rockwell_msgV_user_msg> listRockwell_msgV_user_msg = new ArrayList<Rockwell_msgV_user_msg>();
JSONResult jsonResult = new JSONResult(0, listRockwell_msgV_user_msg);
if(objectId.equals("0") && userId.equals("0"))
{
return jsonResult;
}
else
{
return msgService.Rockwell_msgServiceGetT_comment(objectId, userId, pageNum, pageCount);
}
}
// 1.2 添加quiz comment item
@ApiOperation(value="添加quiz comment item", notes="添加quiz comment item")
@ApiImplicitParams({
@ApiImplicitParam(name = "commentType", value = "类型", required = false, dataType = "String", defaultValue = "quiz"),
@ApiImplicitParam(name = "objectId", value = "quiz的id", required = false, dataType = "String", defaultValue = "qid_123"),
@ApiImplicitParam(name = "objectName", value = "quiz的名称", required = false, dataType = "String", defaultValue = "威士忌的特征"),
@ApiImplicitParam(name = "useridFrom", value = "评论的用户id", required = false, dataType = "String", defaultValue = "uid_001"),
@ApiImplicitParam(name = "useridTo", value = "被@的用户id", required = false, dataType = "String", defaultValue = "uid_002"),
@ApiImplicitParam(name = "content", value = "用户回复的内容", required = false, dataType = "String", defaultValue = "请输入你的评论"),
@ApiImplicitParam(name = "contentTo", value = "回复的内容", required = false, dataType = "String", defaultValue = "请输入你的评论"),
})
@RequestMapping(value = "/nyx/msg/add", method = RequestMethod.POST)
@ResponseBody
public JSONResult RockwellAddQuizMsgItem(
@RequestParam(value = "commentType", required = false, defaultValue = "0") String commentType,
@RequestParam(value = "objectId", required = false, defaultValue = "qid_123") String objectId,
@RequestParam(value = "objectName", required = false, defaultValue = "威士忌的特征") String objectName,
@RequestParam(value = "useridFrom", required = false, defaultValue = "uid_001") String useridFrom,
@RequestParam(value = "useridTo", required = false, defaultValue = "0") String useridTo,
@RequestParam(value = "content", required = false, defaultValue = "0") String content,
@RequestParam(value = "contentTo", required = false, defaultValue = "0") String contentTo
) {
return msgService.Rockwell_msgServiceAddT_commentItem(commentType, objectId, objectName, content, contentTo, useridFrom, useridTo );
}
// 1.3 添加点赞
@ApiOperation(value="添加点赞", notes="添加点赞")
@ApiImplicitParams({
@ApiImplicitParam(name = "commentId", value = "commentId", required = false, dataType = "String", defaultValue = "cid_123"),
})
@RequestMapping(value = "/nyx/msg/like", method = RequestMethod.GET)
public void RockwellAddQuizMsgLike(
@RequestParam(value = "commentId", required = false, defaultValue = "cid_123") String commentId
) {
msgService.Rockwell_msgServiceAddT_commentLike(commentId);
}
}
package cn.com.fun.nyxkey.api.web.controller;
package cn.com.fun.nyxkey.api.web.controller;
import cn.com.fun.nyxkey.api.common.JSONResult;
import cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match;
import cn.com.fun.nyxkey.api.domain.Rockwell_keyV_match_rank;
import cn.com.fun.nyxkey.api.service.*;
import cn.com.fun.nyxkey.api.web.common.ResponseHelper;
import cn.com.fun.nyxkey.api.web.common.ResponseWrapper;
import io.swagger.annotations.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Created by jscat on 2019-11-11.
*/
@RestController
@RequestMapping("/api")
public class NyxApiController {
private static final Logger LOGGER = LoggerFactory.getLogger(NyxApiController.class);
@Autowired
private Rockwell_keyService keyService;
// 1.1 获取最近10条quiz
// http://localhost:8084/api/financing/hotsearch/report?pageNum=1&pageCount=5
@ApiOperation(value="顺序获取quiz", notes="获取quiz")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页码,从1开始", required = false, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "pageCount", value = "每页的数据个数,默认是5个", required = false, dataType = "String", defaultValue = "5")
})
@RequestMapping(value = "/nyx/quiz/query", method = RequestMethod.GET)
//@GetMapping("/nyx/quiz/query")
public JSONResult RockwellGetQuizQuery(
@RequestParam(value = "questionName", required = false, defaultValue = "") String strQuestionName,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "5") int pageCount
) {
LOGGER.debug("======================/financing/hotsearch/report");
return keyService.Rockwell_keyServiceGetT_quizWithPage(strQuestionName, pageNum, pageCount);
}
// 1.2 随机获取10条quiz
@ApiOperation(value="随机获取quiz", notes="随机获取quiz")
@RequestMapping(value = "/nyx/quiz/query/rand", method = RequestMethod.GET)
public JSONResult RockwellGetQuizRandQuery(
) {
return keyService.Rockwell_keyServiceGetT_quizRand();
}
// 1.3 获取某条记录的值
// http://localhost:8084/api/financing/hotsearch/report?pageNum=1&pageCount=5
@ApiOperation(value="获取具体quiz结果", notes="获取某一quiz结果")
@ApiImplicitParams({
@ApiImplicitParam(name = "questionId", value = "问题id", required = true, dataType = "String", defaultValue = "0")
})
@RequestMapping(value = "/nyx/quiz/query/item", method = RequestMethod.GET)
public JSONResult RockwellGetQuizQueryItem(
@RequestParam(value = "questionId", required = false, defaultValue = "") String questionId
) {
LOGGER.debug("======================/nyx/quiz/query/item");
return keyService.Rockwell_keyServiceGetT_quizitem(questionId);
}
// 1.4 获取用户match的点赞数
@ApiOperation(value="获取竞答的点赞数", notes="获取竞答的点赞数")
@RequestMapping(value = "/nyx/match/query/like", method = RequestMethod.GET)
//@GetMapping("/nyx/match/query/like")
public JSONResult RockwellGetMatchLikeQuery(
) {
return keyService.Rockwell_keyServiceGetT_matchLike();
}
// 1.5 为quiz添加defect,用于quiz纠错, 对应tbl_quiz
@ApiOperation(value="添加defect,用于quiz纠错", notes="添加defect,用于quiz纠错")
@RequestMapping(value = "/nyx/quiz/defect/add", method = RequestMethod.POST)
public void RockwellUpdateQuizDefect(
@RequestParam(value = "questionId", required = true, defaultValue = "0") String questionId,
@RequestParam(value = "userId", required = true, defaultValue = "0") String userId,
@RequestParam(value = "userComment", required = false, defaultValue = "没有选项") String userComment
) {
keyService.addT_quizDefectItem(questionId, userId, userComment);
}
// 1.3 知识学习模式获取具体quiz结果
@ApiOperation(value="知识学习模式获取具体quiz结果", notes="知识学习模式获取具体quiz结果")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchSeason", value = "赛季; s01", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchType", value = "比赛类型: pk|daily|study", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchTeam", value = "竞答队伍: uid_001", required = false, dataType = "String"),
@ApiImplicitParam(name = "quizId", value = "题目序号", required = false, dataType = "String"),
@ApiImplicitParam(name = "pageNum", value = "页码,从1开始", required = false, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "pageCount", value = "每页的数据个数,默认是4个", required = false, dataType = "String", defaultValue = "10")
})
@RequestMapping(value = "/nyx/quiz/query/study", method = RequestMethod.GET)
public JSONResult RockwellGetQuizQueryStudy(
@RequestParam(value = "matchSeason", required = false, defaultValue = "0") String matchSeason,
@RequestParam(value = "matchType", required = false, defaultValue = "0") String matchType,
@RequestParam(value = "matchTeam", required = false, defaultValue = "0") String matchTeam,
@RequestParam(value = "quizId", required = false, defaultValue = "0") String quizId,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "10") int pageCount
) {
LOGGER.debug("======================/nyx/quiz/query/item");
return keyService.Rockwell_keyServiceGetT_quiz_study(matchSeason, matchType, matchTeam, quizId, pageNum, pageCount);
}
// 1.4 获取Quiz某一类matchType的总数目
@ApiOperation(value="获取Quiz某一类matchType的总数目", notes="获取Quiz某一类matchType的总数目")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchType", value = "比赛类型: pk|daily|study", required = false, dataType = "String")
})
@RequestMapping(value = "/nyx/quiz/total/query", method = RequestMethod.GET)
public JSONResult RockwellGetQuizQueryStudy(
@RequestParam(value = "matchType", required = false) String matchType
) {
LOGGER.debug("======================/nyx/quiz/total/query");
return keyService.Rockwell_keyServiceGetT_quiz_type_total(matchType);
}
// APi2 t_match接口
// 2.1 为t_match添加match,对应tbl_match
@ApiOperation(value="为t_match添加match,对应tbl_match", notes="为t_match添加match,对应tbl_match")
@ApiImplicitParams({
})
@RequestMapping(value = "/nyx/match/add/list", method = RequestMethod.POST)
@ResponseBody
public void RockwellAddMatch(
@RequestBody List<Rockwell_keyT_match> listRockwell_keyT_match
) {
keyService.Rockwell_keyServiceAddT_matchList(listRockwell_keyT_match);
}
// APi2 t_match接口
// 2.2 为t_match添加match,对应tbl_match
@ApiOperation(value="为t_match添加match,对应tbl_match", notes="为t_match添加match,对应tbl_match")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchSeason", value = "赛季; s01", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchType", value = "比赛类型: pk|daily|study", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchTeam", value = "竞答队伍: uid_001", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchScore", value = "竞答中答对的个数", required = false, dataType = "String"),
@ApiImplicitParam(name = "teamType", value = "主队还是客队 blue|red", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchResult", value = "竞答结果", required = false, dataType = "String"),
@ApiImplicitParam(name = "quizIndex", value = "竞答已完成题数|学习进行到第几题", required = false, dataType = "String"),
@ApiImplicitParam(name = "rankScore", value = "竞答得分", required = false, dataType = "String"),
})
@RequestMapping(value = "/nyx/match/add/item", method = RequestMethod.POST)
@ResponseBody
public void RockwellAddMatchItem(
@RequestParam(value = "matchSeason", required = false, defaultValue = "0") String matchSeason,
@RequestParam(value = "matchType", required = false, defaultValue = "0") String matchType,
@RequestParam(value = "matchTeam", required = false, defaultValue = "0") String matchTeam,
@RequestParam(value = "matchScore", required = false, defaultValue = "0") String matchScore,
@RequestParam(value = "teamType", required = false, defaultValue = "0") String teamType,
@RequestParam(value = "matchResult", required = false, defaultValue = "0") String matchResult,
@RequestParam(value = "quizIndex", required = false, defaultValue = "0") String quizIndex,
@RequestParam(value = "rankScore", required = false, defaultValue = "0") String rankScore
) {
keyService.Rockwell_keyServiceAddT_matchItem(matchSeason, matchType, matchTeam, matchScore,
teamType, matchResult, quizIndex, rankScore);
}
// 1.8 get t_match by matchId
@ApiOperation(value="get t_match by matchId", notes="get t_match by matchId")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchId", value = "竞答id", required = true, dataType = "String")
})
@RequestMapping(value = "/nyx/match/query/matchid", method = RequestMethod.GET)
public JSONResult RockwellGetMatchById(
@RequestParam(value = "matchId", required = true) String matchId
) {
return keyService.Rockwell_keyServiceGetT_match_by_matchid(matchId);
}
// 1.9 get t_match daily by matchteam 获取每日推荐竞答结果
@ApiOperation(value="get t_match by page", notes="get t_match by page")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchSeason", value = "赛季; s01", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchType", value = "比赛类型: pk|daily|study", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchTeam", value = "竞答队伍: uid_001", required = false, dataType = "String"),
@ApiImplicitParam(name = "pageNum", value = "页码,从1开始", required = false, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "pageCount", value = "每页的数据个数,默认是4个", required = false, dataType = "String", defaultValue = "4")
})
@RequestMapping(value = "/nyx/match/query", method = RequestMethod.GET)
public JSONResult RockwellQueryMatchDaily(
@RequestParam(value = "matchSeason", required = false) String matchSeason,
@RequestParam(value = "matchType", required = false) String matchType,
@RequestParam(value = "matchTeam", required = false) String matchTeam,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "5") int pageCount
) {
return keyService.Rockwell_keyServiceGetT_match_by_page(matchSeason, matchType, matchTeam);
}
// 2.0 match ranking
@ApiOperation(value="获取用户的排名rank,分数score,和比例ratio", notes="获取用户的排名rank,分数score,和比例ratio")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchSeason", value = "赛季; s01", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchType", value = "竞答|学习类型: wset1|daily|pk", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchTeam", value = "竞答队伍: uid_001", required = false, dataType = "String"),
@ApiImplicitParam(name = "pageNum", value = "页码,从1开始", required = false, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "pageCount", value = "每页的数据个数,默认是4个", required = false, dataType = "String", defaultValue = "4")
})
@RequestMapping(value = "/nyx/match/rank/query", method = RequestMethod.GET)
public JSONResult RockwellQueryMatchRank(
@RequestParam(value = "matchSeason", required = false, defaultValue = "0") String matchSeason,
@RequestParam(value = "matchType", required = false, defaultValue = "0") String matchType,
@RequestParam(value = "matchTeam", required = false, defaultValue = "0") String matchTeam,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "5") int pageCount
) {
return keyService.Rockwell_keyServiceGetV_match_rank(matchSeason, matchType, matchTeam);
}
// match rank api 更新tbl_match_rank的defaultType值
@ApiOperation(value="更新tbl_match_rank的defaultType值", notes="更新tbl_match_rank的defaultType值")
@ApiImplicitParams({
})
@RequestMapping(value = "/nyx/match/rank/update", method = RequestMethod.POST)
@ResponseBody
public void RockwellUpdateMatchRankDefaultType(
@RequestBody List<Rockwell_keyV_match_rank> Rockwell_keyV_match_rank
) {
keyService.Rockwell_keyServiceUpdateT_match_rank_defaultType(Rockwell_keyV_match_rank);
}
// 2.0 test
@ApiOperation(value="test", notes="test")
@ApiImplicitParams({
})
@RequestMapping(value = "/nyx/match/test", method = RequestMethod.POST)
@ResponseBody
public void RockwellQueryTest(
@RequestBody List<Rockwell_keyT_match> listRockwell_keyT_match
) {
keyService.Rockwell_keyServiceTest(listRockwell_keyT_match);
}
}
package cn.com.fun.nyxkey.api.web.controller;
package cn.com.fun.nyxkey.api.web.controller;
import cn.com.fun.nyxkey.api.common.JSONResult;
import cn.com.fun.nyxkey.api.service.*;
import cn.com.fun.nyxkey.api.web.common.ResponseHelper;
import cn.com.fun.nyxkey.api.web.common.ResponseWrapper;
import io.swagger.annotations.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Created by jscat on 2020-02-17.
*/
@RestController
@RequestMapping("/api")
public class UserApiController {
private static final Logger LOGGER = LoggerFactory.getLogger(UserApiController.class);
@Autowired
private Rockwell_userService userService;
/*
* 微信登陆
* @param code 凭证
* @param encryptedData 用户数据
* @param iv 用户数据
* @param request request作用域:
* @return map
*/
@RequestMapping("/nyx/user/wxLogin")
@ResponseBody
public JSONResult wxLogin( HttpServletResponse response,
String encryptedData,
String iv, String code,
String userId) {
return userService.wxLogin(encryptedData, iv, code, userId);
}
// 注册新用户,并返回userId, authStatus, userInfo
@ApiOperation(value="reg new user", notes="reg new user")
@ApiImplicitParams({
})
@RequestMapping(value = "/nyx/user/reg", method = RequestMethod.GET)
public JSONResult RockwellUserReg(
) {
return userService.Rockwell_userServiceReg();
}
@ApiOperation(value="获取userInfo", notes="获取userInfo")
@ApiImplicitParams({
@ApiImplicitParam(name = "userid", value = "userid", required = true, dataType = "String", defaultValue = "0")
})
@RequestMapping(value = "/nyx/userinfo/query", method = RequestMethod.GET)
public JSONResult RockwellUserInfoQuery(
@RequestParam(value = "userid", required = true, defaultValue = "0") String userid
) {
LOGGER.debug("======================/nyx/userinfo/query");
return userService.Rockwell_userServiceGetT_userinfo(userid);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015-2016 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.fun.nyxkey.api.repository.Rockwell_keyMapper">
<sql id="pagination">
<![CDATA[
limit ${pagination.offset}, ${pagination.size}
]]>
</sql>
<!-- starting API interface -->
<!-- Quiz 热搜-->
<select id="getT_quiz" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_quizQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_quiz">
<![CDATA[
SELECT * from tbl_quiz where 1=1
]]>
<if test="questionName != null and questionName != '' ">
AND question_name LIKE CONCAT('%',#{questionName},'%')
</if>
<if test="pagination != null ">
<include refid="pagination"/>
</if>
</select>
<!-- Quiz 随机选取10道题 -->
<!-- order by rand()-->
<select id="getT_quizRand" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_quiz">
SELECT id FROM tbl_quiz
where 1=1
order by rand()
LIMIT 10
</select>
<!-- Quiz 获取某一具体问题的数据 -->
<select id="getT_quizItem" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_quiz">
SELECT * FROM tbl_quiz
where id=#{id}
</select>
<!-- Quiz 获取study的数据 -->
<select id="getT_quiz_study_by_sql" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_quiz">
SELECT * FROM tbl_quiz
WHERE 1=1
AND quiz_type=#{matchType}
AND id >
(
SELECT IF(COUNT(*)=0,0, ANY_VALUE(bb.quiz_index)) AS quiz_index FROM
(
SELECT quiz_index FROM tbl_match aa
WHERE 1=1
AND match_team=#{matchTeam}
AND match_season=#{matchSeason}
AND match_type=#{matchType}
ORDER BY create_datetime DESC
LIMIT 1
) bb
)
ORDER BY id ASC
<if test="pagination != null ">
<include refid="pagination"/>
</if>
</select>
<!-- Quiz 获取study的数据 by id 主要用于通过id来获取后10题的内容,而不是通过同数据库读取,对比getT_quiz_study_by_sql -->
<select id="getT_quiz_study_by_id" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_quiz">
SELECT * FROM tbl_quiz
WHERE 1=1
AND quiz_type=#{matchType}
AND id > #{matchId}
ORDER BY id ASC
<if test="pagination != null ">
<include refid="pagination"/>
</if>
</select>
<!-- Quiz 获取quiz_type_total的数据 -->
<select id="getT_quiz_type_total" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_quiz_type_total">
SELECT * FROM view_quiz_type_total
WHERE 1=1
AND quiz_type=#{matchType}
</select>
<!-- Quiz defect 新增一条quiz defect记录 -->
<insert id="addT_quizDefectItem" parameterType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_quiz_defect">
insert into tbl_quiz_defect(id, question_fk_id, user_fk_id, user_comment, create_datetime)
values (#{id}, #{questionFkId}, #{userFkId} , #{userComment}, #{createDatetime})
</insert>
<!-- match api1-1 新增一条 match 记录 -->
<insert id="addT_matchList" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery">
insert into tbl_match(match_id, match_season, match_type, match_team, match_result,match_score,team_type, quiz_index, rank_score, create_datetime,update_datetime)
values
<foreach collection="listRockwell_keyT_match" index="index" item="item" open="" separator="," close="">
(
#{item.matchId},
#{item.matchSeason},
#{item.matchType},
#{item.matchTeam},
#{item.matchResult},
#{item.matchScore},
#{item.teamType},
#{item.quizIndex},
#{item.rankScore},
#{item.createDatetime},
#{item.updateDatetime}
)
</foreach>
</insert>
<!-- match api1-2 新增一条 match 记录 -->
<insert id="addT_matchItem" parameterType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match">
insert into tbl_match(match_id, match_season, match_type, match_team, match_result,match_score,team_type, quiz_index, rank_score, create_datetime,update_datetime)
values
(
#{matchId},
#{matchSeason},
#{matchType},
#{matchTeam},
#{matchResult},
#{matchScore},
#{teamType},
#{quizIndex},
#{rankScore},
#{createDatetime},
#{updateDatetime}
)
</insert>
<!-- match api1-3 获取t_match的值
match_id is a MUST
-->
<select id="getT_match_by_matchid" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery"
resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match">
select * from tbl_match
where 1=1
AND match_id=#{matchId}
</select>
<!-- match api 1-5 获取t_match的值
-->
<select id="getT_match_by_page" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery"
resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match">
select * from tbl_match
WHERE 1=1
<if test="matchSeason != null and matchSeason != '' ">
AND match_season=#{matchSeason}
</if>
<if test="matchTeam != null and matchTeam != '' ">
AND match_team=#{matchTeam}
</if>
<if test="matchType != null and matchType != '' ">
AND match_type=#{matchType}
</if>
<if test="pagination != null ">
<include refid="pagination"/>
</if>
</select>
<!-- match rank
3 API:
- genT_match_rank
- getView_match_rank
- updateT_match_rank_defaultType
api 3.1 生成t_match_rank的值 to tbl_match_rank
-->
<select id="genT_match_rank" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery">
REPLACE INTO tbl_match_rank(rank_id, match_season, match_type, match_team, score, rank, total_match, total_quiz, ratio_rank, ratio_finish, create_datetime, update_datetime)
SELECT CONCAT("rid_",match_season,"_",match_type,"_",match_team) AS rank_id , match_season, match_type, match_team, score, rank, total_match, total_quiz, ratio_rank, ratio_finish, NOW() AS create_datetime, NOW() AS update_datetime FROM
(
SELECT objA.match_season, objA.match_type, objA.match_team, objA.score, objA.rank, objB.total AS total_match, objC.total AS total_quiz, FORMAT((objB.total-objA.rank+1)/objB.total,2) AS ratio_rank, FORMAT(objA.score/objC.total,2) AS ratio_finish
FROM
(
SELECT match_season, match_type, match_team, score,
CASE WHEN @p=season_type THEN @row:=@row+1 ELSE @row:=1 END rownum,
IF( @p=season_type,
CASE
WHEN @s=score_minus THEN @r
WHEN @s:=score_minus THEN @r:=@row
END,
@r:=1 ) AS rank,
@s:=score_minus,
@p:=season_type
FROM view_match_score
WHERE 1=1
<if test="matchSeason != null and matchSeason != '' ">
AND match_season=#{matchSeason}
</if>
ORDER BY match_season ASC, match_type ASC, score DESC
) objA
LEFT JOIN view_match_type_total objB ON objA.match_type=objB.match_type AND objA.match_season=objB.match_season
LEFT JOIN view_quiz_type_total objC ON objA.match_type=objC.quiz_type
) aa
</select>
<!-- match rank api 3.2 从 view_match_rank 获取 view_match_rank
-->
<select id="getV_match_rank" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_match_rank">
SELECT * FROM view_match_rank
WHERE 1=1
<if test="matchSeason != null and matchSeason != '' ">
AND match_season=#{matchSeason}
</if>
<if test="matchTeam != null and matchTeam != '' ">
AND match_team=#{matchTeam}
</if>
<if test="matchType != null and matchType != '' ">
AND match_type=#{matchType}
</if>
</select>
<!-- match rank api 3.3 从 更新t_match_rank的defaultType值
-->
<select id="updateT_match_rank_defaultType" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery">
REPLACE into tbl_match_rank_default_type
values
<foreach collection="listRockwell_keyV_match_rank" index="index" item="item" open="" separator="," close="">
(
#{item.rankId},
#{item.defaultType},
#{item.createDatetime},
#{item.updateDatetime}
)
</foreach>
</select>
<!-- ending API interface -->
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015-2016 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.fun.nyxkey.api.repository.Rockwell_msgMapper">
<sql id="pagination">
<![CDATA[
limit ${pagination.offset}, ${pagination.size}
]]>
</sql>
<!-- starting API interface -->
<!-- api-1 Quiz comment 新增一条quiz comment记录 -->
<!--
INSERT INTO tbl_comment(post_id, post_type, quiz_id, from_userid, from_nickname, content, to_postid, to_userid, to_nickname, to_content, create_datetime)
VALUES (
"pid_123",
"0",
"qid_21342",
"uid_123123",
"泥煤小王子",
"这款是最好的whisky",
"pid_34563465",
"uid_983ldls",
"张三",
"这款是最好的whisky吗?",
"2020-01-02 16:00:00"
)
-->
<insert id="addT_commentItem" parameterType="cn.com.fun.nyxkey.api.domain.Rockwell_msgT_comment">
INSERT INTO tbl_comment(comment_id, comment_type, object_id, object_name, content, content_to, userid_from, userid_to, create_datetime, update_datetime)
values (#{commentId}, #{commentType}, #{objectId}, #{objectName}, #{content}, #{contentTo}, #{useridFrom}, #{useridTo}, #{createDatetime}, #{updateDatetime})
</insert>
<!-- api-2 Quiz comment 更新comment的num_like记录-->
<!--
UPDATE tbl_comment
SET num_like=num_like+1
WHERE post_id='pid_123'
-->
<select id="addT_commentLike" parameterType="cn.com.fun.nyxkey.api.domain.Rockwell_msgT_comment">
UPDATE tbl_comment
SET num_like=num_like+1
WHERE comment_id=#{commentId}
</select>
<!-- api-3 Quiz comment 获取comment的详细内容
Pagination is a MUST
-->
<!--
SELECT * FROM tbl_comment WHERE 1=1
AND post_id='pid_123'
-->
<select id="getV_user_comment_by_page" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_msgT_commentQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_msgV_user_msg">
<![CDATA[
SELECT * FROM view_user_comment WHERE 1=1
]]>
<if test="objectId != null and objectId != '' ">
AND object_id=#{objectId}
</if>
<if test="userId != null and userId != '' ">
AND userid_from=#{userId}
</if>
order by create_datetime ${orderType}
<include refid="pagination"/>
</select>
<select id="getT_comment_by_commentid" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_msgT_commentQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_msgV_user_msg">
<![CDATA[
SELECT * FROM view_user_comment WHERE 1=1
]]>
<if test="commentId != null and commentId != '' ">
AND comment_id=#{commentId}
</if>
</select>
<!-- ending API interface -->
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015-2016 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.fun.nyxkey.api.repository.Rockwell_userMapper">
<sql id="pagination">
<![CDATA[
limit ${pagination.offset}, ${pagination.size}
]]>
</sql>
<!-- starting API interface -->
<!--检查是否存在openid-->
<select id="wechatOpenIdIsExists" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_userT_userQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_userT_user">
<![CDATA[
SELECT * FROM tbl_user
WHERE openid=#{openid}
]]>
</select>
<!--查找userId-->
<select id="queryUserByid" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_userT_userQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_userT_user">
<![CDATA[
SELECT * FROM tbl_user
WHERE id=#{id}
]]>
</select>
<!--查找userInfoById-->
<select id="queryUserInfoByid" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_userT_userQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_userT_userinfo">
<![CDATA[
SELECT * FROM tbl_userinfo
WHERE userid=#{id}
]]>
</select>
<!--user 新增和更新接口-->
<insert id="insertUser" parameterType="cn.com.fun.nyxkey.api.domain.Rockwell_userT_user">
REPLACE into tbl_user(id, openid, auth_status, create_datetime, update_datetime)
values (#{id}, #{openid}, #{authStatus}, #{createDatetime}, #{updateDatetime} )
</insert>
<!-- login log 新增一条login log记录 -->
<insert id="insertLog" parameterType="cn.com.fun.nyxkey.api.domain.Rockwell_userT_login_log">
insert into tbl_login_log(id, user_id, wxcode, login_datetime)
values (#{id}, #{userId}, #{wxcode} , #{loginDatetime})
</insert>
<!-- tbl_userinfo 新增活更新一条userinfo记录 -->
<insert id="insertUserinfo" parameterType="cn.com.fun.nyxkey.api.domain.Rockwell_userT_userinfo">
REPLACE into tbl_userinfo(userid, nickName, avatarUrl, gender, province, city, country, create_datetime, update_datetime)
values (#{userid}, #{nickName}, #{avatarUrl}, #{gender}, #{province}, #{city}, #{country} , #{createDatetime}, #{updateDatetime})
</insert>
</mapper>
\ No newline at end of file
#################################################################################################################
#################################################################################################################
# Data source
# Production database connections can also be auto-configured using a pooling DataSource.
# Here’s the algorithm for choosing a specific implementation:
# * We prefer the Tomcat pooling DataSource for its performance and concurrency,
# so if that is available we always choose it.
# * Otherwise, if HikariCP is available we will use it.
# * If neither the Tomcat pooling datasource nor HikariCP are available and if Commons DBCP is available
# we will use it, but we don’t recommend it in production and its support is deprecated.
# * Lastly, if Commons DBCP2 is available we will use it.
# If you use the spring-boot-starter-jdbc or spring-boot-starter-data-jpa ‘starters’ you will automatically
# get a dependency to tomcat-jdbc.
# * You can bypass that algorithm completely and specify the connection pool to use via
# the spring.datasource.type property. This is especially important if you are running your
# application in a Tomcat container as tomcat-jdbc is provided by default.
#################################################################################################################
ss:
tt: rockwell_key,rockwell_msg,rockwell_user
spring:
datasource:
rockwell_key:
url: jdbc:mysql://47.99.110.89:3308/rockwell_key?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: rockwell_dev
password: 123456
driver-class-name: com.mysql.jdbc.Driver
hikari:
minimum-idle: 10
maximum-pool-size: 60
validation-timeout: 3000
auto-commit: true
idle-timeout: 60000
max-lifetime: 100000
connection-timeout: 30000
connection-test-query: SELECT 1
rockwell_msg:
url: jdbc:mysql://47.99.110.89:3308/rockwell_msg?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: rockwell_dev
password: 123456
driver-class-name: com.mysql.jdbc.Driver
hikari:
minimum-idle: 10
maximum-pool-size: 60
validation-timeout: 3000
auto-commit: true
idle-timeout: 60000
max-lifetime: 100000
connection-timeout: 30000
connection-test-query: SELECT 1
rockwell_user:
url: jdbc:mysql://47.99.110.89:3308/rockwell_user?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: rockwell_dev
password: 123456
driver-class-name: com.mysql.jdbc.Driver
hikari:
minimum-idle: 10
maximum-pool-size: 60
validation-timeout: 3000
auto-commit: true
idle-timeout: 60000
max-lifetime: 100000
connection-timeout: 30000
connection-test-query: SELECT 1
\ No newline at end of file
#################################################################################################################
#################################################################################################################
# Data source
# Production database connections can also be auto-configured using a pooling DataSource.
# Here’s the algorithm for choosing a specific implementation:
# * We prefer the Tomcat pooling DataSource for its performance and concurrency,
# so if that is available we always choose it.
# * Otherwise, if HikariCP is available we will use it.
# * If neither the Tomcat pooling datasource nor HikariCP are available and if Commons DBCP is available
# we will use it, but we don’t recommend it in production and its support is deprecated.
# * Lastly, if Commons DBCP2 is available we will use it.
# If you use the spring-boot-starter-jdbc or spring-boot-starter-data-jpa ‘starters’ you will automatically
# get a dependency to tomcat-jdbc.
# * You can bypass that algorithm completely and specify the connection pool to use via
# the spring.datasource.type property. This is especially important if you are running your
# application in a Tomcat container as tomcat-jdbc is provided by default.
#################################################################################################################
ss:
tt: rockwell_key,rockwell_msg,rockwell_user
spring:
datasource:
rockwell_key:
url: jdbc:mysql://47.99.110.89:3306/rockwell_key
username: rockwell_dev
password: 123456
driver-class-name: com.mysql.jdbc.Driver
minimum-idle: 5
maximum-pool-size: 15
auto-commit: true
idle-timeout: 30000
pool-name: DatebookHikariCP
max-lifetime: 120000
connection-timeout: 30000
connection-test-query: SELECT 1
rockwell_msg:
url: jdbc:mysql://47.99.110.89:3306/rockwell_msg
username: rockwell_dev
password: 123456
driver-class-name: com.mysql.jdbc.Driver
minimum-idle: 5
maximum-pool-size: 15
auto-commit: true
idle-timeout: 30000
pool-name: DatebookHikariCP
max-lifetime: 120000
connection-timeout: 30000
connection-test-query: SELECT 1
rockwell_user:
url: jdbc:mysql://47.99.110.89:3306/rockwell_user
username: rockwell_dev
password: 123456
driver-class-name: com.mysql.jdbc.Driver
minimum-idle: 5
maximum-pool-size: 15
auto-commit: true
idle-timeout: 30000
pool-name: DatebookHikariCP
max-lifetime: 120000
connection-timeout: 30000
connection-test-query: SELECT 1
\ No newline at end of file
#################################################################################################################
#################################################################################################################
# Data source
# Production database connections can also be auto-configured using a pooling DataSource.
# Here’s the algorithm for choosing a specific implementation:
# * We prefer the Tomcat pooling DataSource for its performance and concurrency,
# so if that is available we always choose it.
# * Otherwise, if HikariCP is available we will use it.
# * If neither the Tomcat pooling datasource nor HikariCP are available and if Commons DBCP is available
# we will use it, but we don’t recommend it in production and its support is deprecated.
# * Lastly, if Commons DBCP2 is available we will use it.
# If you use the spring-boot-starter-jdbc or spring-boot-starter-data-jpa ‘starters’ you will automatically
# get a dependency to tomcat-jdbc.
# * You can bypass that algorithm completely and specify the connection pool to use via
# the spring.datasource.type property. This is especially important if you are running your
# application in a Tomcat container as tomcat-jdbc is provided by default.
#################################################################################################################
spring:
datasource:
# Fully qualified name of the connection pool implementation to use. By default, it is auto-detected from the classpath.
# JDBC url of the database.
url: jdbc:mysql://115.29.168.139:3306/checki
# Login user of the database.
username: checki
# Login password of the database.
password: 123456
# Fully qualified name of the JDBC driver. Auto-detected based on the URL by default.
driver-class-name: com.mysql.jdbc.Driver
tomcat:
initial-size: 2
min-idle: 2
max-active: 20
validation-query: select 1
validation-interval: 10000
validation-query-timeout: 10000
test-on-borrow: true
test-on-return: false
test-while-idle: true
time-between-eviction-runs-millis: 10000
min-evictable-idle-time-millis: 30000
remove-abandoned: true
jmx-enabled: true
server:
server:
port: 8085
compression:
enabled: true
spring:
profiles:
active: @application.active.profile@
resources:
static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/
application:
name: nyx-api
jackson:
time-zone: Asia/Shanghai
kafka:
bootstrap-servers: 10.29.180.87:9092,10.29.180.88:9092,10.29.180.89:9092
consumer:
group-id: udsp
logging:
file: log/server.log
level:
org.springframework.web: INFO
org.hibernate: DEBUG
cn.com.fun.nyxkey.api.service : INFO
cn.com.fun.nyxkey.api.repository : INFO
##也可以统一指定所有endpoints的路径`management.context-path=/manage`
##指定管理端口和IP
#
#security:
# user:
# #验证用户名
# name: admin
# #验证密码
# password: 123456
#
#management:
# port: 8083
# address: localhost
# security:
# #角色
# role: SUPERUSER
#################################################################################################################
# Mybatis
#################################################################################################################
mybatis:
# Locations of MyBatis mapper files.
mapper-locations: classpath:cn/com/fun/nyx/api/repository/*Mapper.xml
# Packages to search type aliases. (Package delimiters are ",; \t\n")
type-aliases-package: cn.com.fun.nyxkey.api.domain
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
app:
service:
cron:
genT_match_rank: 0 0/20 * * * ?
weixin:
appid: 'wx72555e77d9e5cee2'
secret: '072986d584176aa5aa9b1531841779f2'
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds">
<property name="LOG_HOME" value="tplus_log" />
<appender name="LOG_HOME" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/test.log</file>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<Pattern> %d [%thread] %-5level [%logger{0}] - %msg%n </Pattern>
</encoder>
</appender>
<!-- appender for server.log, time and size based rolling -->
<appender name="FILE-SERVER-LOG"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/server.log</file>
<encoder>
<Pattern> %d [%thread] %-5level [%logger{0}] - %msg%n </Pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern> ${LOG_HOME}/archived/server.%d{yyyy-MM-dd}.%i.log.zip </fileNamePattern>
<!-- each file should be at most 100MB, keep 30 days worth of history, but at most 20GB -->
<maxFileSize>100MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>3GB</totalSizeCap>
</rollingPolicy>
</appender>
<!-- add loggers here -->
<logger name="cn.com.fun.nyxkey.api" level="debug" additivity="false">
<appender-ref ref="FILE-SERVER-LOG" />
</logger>
<logger name= "cn.com.fun.nyxkey.api.repository.KeyMapper" level="TRACE" />
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE-SERVER-LOG" />
<appender-ref ref="LOG_HOME" />
</root>
</configuration>
package cn.com.fun.nyxkey.api;
package cn.com.fun.nyxkey.api;
import cn.com.fun.nyxkey.api.config.DataSourceConfig;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.core.env.EnumerablePropertySource;
import org.junit.Test;
import org.springframework.boot.env.PropertySourceLoader;
import org.springframework.boot.env.YamlPropertySourceLoader;
import org.springframework.core.env.EnumerablePropertySource;
import org.springframework.core.env.PropertySource;
import org.springframework.core.io.ClassPathResource;
import javax.sql.DataSource;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import cn.com.fun.nyxkey.api.config.*;
public class YamlLoaderTest {
@Test
public void propertyParseIsEqualToYaml() throws Exception {
DataSourceConfig dataSource = new DataSourceConfig();
String tt ="";
dataSource.getDataSource(tt);
}
private void verifyPropertyKeysAreSame(EnumerablePropertySource hoconParse, EnumerablePropertySource yamlParse) {
String[] hoconProperties = hoconParse.getPropertyNames();
Arrays.sort(hoconProperties);
String[] yamlProperties = yamlParse.getPropertyNames();
Arrays.sort(yamlProperties);
assertThat(hoconProperties, is(yamlProperties));
}
private EnumerablePropertySource loadProperties(PropertySourceLoader propertySourceLoader, String path) throws IOException {
List<PropertySource<?>> source = propertySourceLoader.load("hocon", new ClassPathResource(path));
assertThat("One property source expected", source.size(), is(1));
return (EnumerablePropertySource) source.get(0);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="main" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.com.fun</groupId>
<artifactId>nyxkey</artifactId>
<version>1.0-SNAPSHOT</version>
<name>nyxkey</name>
<packaging>pom</packaging>
<modules>
<module>api</module>
</modules>
<properties>
<java.version>1.8</java.version>
<spring.boot.version>2.1.3.RELEASE</spring.boot.version>
<mapper.version>4.1.5</mapper.version>
</properties>
<!-- Inherit defaults from Spring Boot -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
</parent>
<dependencyManagement>
<dependencies>
<!-- Add typical dependencies for a web application -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
<!-- Remove default web container -->
<!-- Tomcat, Jetty or Undertow ? -->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring.boot.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.0.1-jre</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-core -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.16</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat/tomcat-jdbc -->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>9.0.16</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<!-- 版本号可以不用指定,Spring Boot会选用合适的版本 -->
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper</artifactId>
<version>${mapper.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>
<!--pageHelper-->
<!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper-spring-boot-starter -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<!-- Package as an executable jar -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>dev</id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
</jvmArguments>
</configuration>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.2.RELEASE</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<properties>
<application.active.profile>dev</application.active.profile>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>test</id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
</jvmArguments>
</configuration>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.2.RELEASE</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<properties>
<application.active.profile>test</application.active.profile>
</properties>
</profile>
<profile>
<id>production</id>
<properties>
<application.active.profile>production</application.active.profile>
</properties>
</profile>
<profile>
<id>tomcat</id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
<id>undertow</id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
<id>jetty</id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
</project>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论