├── .gitignore
├── README.md
├── cloudfunctionTemplate
└── cloud.json
├── cloudfunctions
├── cloud
│ ├── comm
│ │ ├── biz_util.js
│ │ ├── config.js
│ │ └── router.js
│ ├── config.json
│ ├── controller
│ │ ├── album_controller.js
│ │ ├── base_controller.js
│ │ ├── check_controller.js
│ │ ├── info_controller.js
│ │ ├── my_controller.js
│ │ ├── passport_controller.js
│ │ └── user_controller.js
│ ├── framework
│ │ ├── client
│ │ │ └── controller.js
│ │ ├── cloud
│ │ │ ├── cloud_base.js
│ │ │ └── cloud_util.js
│ │ ├── database
│ │ │ ├── db_util.js
│ │ │ └── model.js
│ │ ├── handler
│ │ │ ├── app_code.js
│ │ │ ├── app_error.js
│ │ │ └── application.js
│ │ ├── lib
│ │ │ ├── mini_lib.js
│ │ │ └── official_account_lib.js
│ │ ├── utils
│ │ │ ├── constant.js
│ │ │ ├── str_util.js
│ │ │ ├── time_util.js
│ │ │ └── util.js
│ │ └── validate
│ │ │ ├── content_check.js
│ │ │ └── data_check.js
│ ├── index.js
│ ├── model
│ │ ├── album_model.js
│ │ ├── base_model.js
│ │ ├── info_model.js
│ │ ├── setup_model.js
│ │ └── user_model.js
│ ├── package-lock.json
│ ├── package.json
│ └── service
│ │ ├── album_service.js
│ │ ├── base_service.js
│ │ ├── info_service.js
│ │ ├── passport_service.js
│ │ └── user_service.js
└── package-lock.json
├── miniprogram
├── app.js
├── app.json
├── app.wxss
├── biz
│ ├── album_biz.js
│ ├── base_biz.js
│ ├── foot_biz.js
│ ├── info_biz.js
│ ├── passport_biz.js
│ ├── reg_biz.js
│ ├── search_biz.js
│ └── user_biz.js
├── cmpts
│ ├── lib
│ │ └── wxa-plugin-canvas
│ │ │ ├── index
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ ├── index.wxml
│ │ │ └── index.wxss
│ │ │ └── poster
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ ├── index.wxml
│ │ │ ├── index.wxss
│ │ │ └── poster.js
│ └── public
│ │ ├── img
│ │ ├── img_upload_cmpt.js
│ │ ├── img_upload_cmpt.json
│ │ ├── img_upload_cmpt.wxml
│ │ └── img_upload_cmpt.wxss
│ │ └── list
│ │ ├── comm_list_cmpt.js
│ │ ├── comm_list_cmpt.json
│ │ ├── comm_list_cmpt.wxml
│ │ ├── comm_list_cmpt.wxss
│ │ ├── simple_list_cmpt.js
│ │ ├── simple_list_cmpt.json
│ │ ├── simple_list_cmpt.wxml
│ │ └── simple_list_cmpt.wxss
├── helper
│ ├── biz_helper.js
│ ├── cache_helper.js
│ ├── cloud_helper.js
│ ├── comm.js
│ ├── content_check_helper.js
│ ├── helper.js
│ ├── page_helper.js
│ ├── setting.js
│ └── validate.js
├── images
│ ├── group
│ │ ├── logo0.png
│ │ ├── logo1.png
│ │ ├── logo2.png
│ │ └── logo3.png
│ ├── main.jpg
│ └── tabbar
│ │ ├── home.png
│ │ ├── home_cur.png
│ │ ├── info.png
│ │ ├── info_cur.png
│ │ ├── meet.png
│ │ ├── meet_cur.png
│ │ ├── my.png
│ │ ├── my_cur.png
│ │ ├── user.png
│ │ └── user_cur.png
├── lib
│ └── we-cropper
│ │ ├── we-cropper.js
│ │ └── we-cropper.wxml
├── pages
│ ├── about
│ │ ├── about.js
│ │ ├── about.json
│ │ ├── about.wxml
│ │ ├── about.wxss
│ │ ├── hint.js
│ │ ├── hint.json
│ │ ├── hint.wxml
│ │ └── hint.wxss
│ ├── album
│ │ ├── album_add.js
│ │ ├── album_add.json
│ │ ├── album_add.wxml
│ │ ├── album_add.wxss
│ │ ├── album_detail.js
│ │ ├── album_detail.json
│ │ ├── album_detail.wxml
│ │ ├── album_detail.wxss
│ │ ├── album_edit.js
│ │ ├── album_edit.json
│ │ ├── album_edit.wxml
│ │ ├── album_edit.wxss
│ │ ├── album_form_tpl.wxml
│ │ ├── album_index.js
│ │ ├── album_index.json
│ │ ├── album_index.wxml
│ │ └── album_index.wxss
│ ├── info
│ │ ├── info_add.js
│ │ ├── info_add.json
│ │ ├── info_add.wxml
│ │ ├── info_add.wxss
│ │ ├── info_detail.js
│ │ ├── info_detail.json
│ │ ├── info_detail.wxml
│ │ ├── info_detail.wxss
│ │ ├── info_edit.js
│ │ ├── info_edit.json
│ │ ├── info_edit.wxml
│ │ ├── info_edit.wxss
│ │ ├── info_form_tpl.wxml
│ │ ├── info_index.js
│ │ ├── info_index.json
│ │ ├── info_index.wxml
│ │ └── info_index.wxss
│ ├── my
│ │ ├── ad
│ │ │ ├── my_ad.js
│ │ │ ├── my_ad.json
│ │ │ ├── my_ad.wxml
│ │ │ └── my_ad.wxss
│ │ ├── album
│ │ │ ├── my_album.js
│ │ │ ├── my_album.json
│ │ │ ├── my_album.wxml
│ │ │ └── my_album.wxss
│ │ ├── base
│ │ │ ├── my_avatar.js
│ │ │ ├── my_avatar.json
│ │ │ ├── my_avatar.wxml
│ │ │ ├── my_avatar.wxss
│ │ │ ├── my_base.js
│ │ │ ├── my_base.json
│ │ │ ├── my_base.wxml
│ │ │ └── my_base.wxss
│ │ ├── foot
│ │ │ ├── my_foot.js
│ │ │ ├── my_foot.json
│ │ │ ├── my_foot.wxml
│ │ │ └── my_foot.wxss
│ │ ├── index
│ │ │ ├── my_index.js
│ │ │ ├── my_index.json
│ │ │ ├── my_index.wxml
│ │ │ └── my_index.wxss
│ │ ├── info
│ │ │ ├── my_info.js
│ │ │ ├── my_info.json
│ │ │ ├── my_info.wxml
│ │ │ └── my_info.wxss
│ │ └── reload
│ │ │ ├── my_reload.js
│ │ │ ├── my_reload.json
│ │ │ ├── my_reload.wxml
│ │ │ └── my_reload.wxss
│ ├── reg
│ │ ├── reg.wxss
│ │ ├── reg_step1.js
│ │ ├── reg_step1.json
│ │ ├── reg_step1.wxml
│ │ ├── reg_step1.wxss
│ │ ├── reg_step2.js
│ │ ├── reg_step2.json
│ │ ├── reg_step2.wxml
│ │ ├── reg_step2.wxss
│ │ ├── reg_step3.js
│ │ ├── reg_step3.json
│ │ ├── reg_step3.wxml
│ │ └── reg_step3.wxss
│ ├── search
│ │ ├── search.js
│ │ ├── search.json
│ │ ├── search.wxml
│ │ └── search.wxss
│ └── user
│ │ ├── user_detail.js
│ │ ├── user_detail.json
│ │ ├── user_detail.wxml
│ │ ├── user_detail.wxss
│ │ ├── user_index.js
│ │ ├── user_index.json
│ │ ├── user_index.wxml
│ │ └── user_index.wxss
├── sitemap.json
├── style
│ ├── comm
│ │ ├── animation.wxss
│ │ ├── avatar.wxss
│ │ ├── background.wxss
│ │ ├── bar.wxss
│ │ ├── base.wxss
│ │ ├── border.wxss
│ │ ├── button.wxss
│ │ ├── comm.wxss
│ │ ├── form.wxss
│ │ ├── icon.wxss
│ │ ├── image.wxss
│ │ ├── layout.wxss
│ │ ├── list.wxss
│ │ ├── load.wxss
│ │ ├── modal.wxss
│ │ ├── nav.wxss
│ │ ├── shadow.wxss
│ │ ├── tag.wxss
│ │ └── text.wxss
│ ├── project
│ │ ├── admin.wxss
│ │ ├── article_list.wxss
│ │ ├── detail.wxss
│ │ ├── project.wxss
│ │ └── user_list.wxss
│ └── skin.wxss
└── tpls
│ ├── biz
│ └── user_card_tpl.wxml
│ └── public
│ ├── list_load_tpl.wxml
│ └── top_tpl.wxml
├── project.config.json
└── 同学录小程序说明.docx
/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows
2 | [Dd]esktop.ini
3 | Thumbs.db
4 | $RECYCLE.BIN/
5 |
6 | # macOS
7 | .DS_Store
8 | .fseventsd
9 | .Spotlight-V100
10 | .TemporaryItems
11 | .Trashes
12 |
13 | # Node.js
14 | node_modules/
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | - 在这里,你会看到最完整的校友名录,一键找到你想找的TA!
2 |
3 | - 在这里,你可以了解最新的校友活动,点击报名就可参加心仪的活动!
4 |
5 | - 在这里,你能掌握最全的学院资讯,足不出户掌握一手消息!
6 |
7 | - 在这里,你可以收到校友专享的招聘信息,为你职业发展添砖加瓦!
8 |
9 | - 在这里,你会发现校友互助平台,帮助你对接需求和资源!
10 |
11 | # 技术使用
12 | 项目使用微信小程序平台进行开发。 使用腾讯云开发技术,免费资源配额, 无需域名和服务器即可搭建。 小程序本身的即用即走,适合小工具的使用场景,也适合程序的开发。
13 | 
14 |
--------------------------------------------------------------------------------
/cloudfunctionTemplate/cloud.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "测试",
4 | "value": {
5 | "router": "test/test"
6 | }
7 | }
8 | ]
--------------------------------------------------------------------------------
/cloudfunctions/cloud/comm/biz_util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 业务相关公用
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-10-24 19:20:00
5 | */
6 | const TYPE = {
7 | //类型 0=用户,1=互助,2=活动 3=相册 4=资讯 5=接龙 99=系统
8 | USER: 0,
9 | INFO: 1,
10 | MEET: 2,
11 | ALBUM: 3,
12 | NEWS: 4,
13 | GROUP: 5,
14 | SYS: 99
15 | }
16 |
17 | function getTypeDesc(type) {
18 | switch (type) {
19 | //类型 0=用户,1=互助,2=活动 3=相册 4=资讯 5=接龙 99=系统
20 | case TYPE.USER:
21 | return '用户';
22 | case TYPE.INFO:
23 | return '互助';
24 | case TYPE.MEET:
25 | return '活动';
26 | case TYPE.ALBUM:
27 | return '相册';
28 | case TYPE.NEWS:
29 | return '资讯';
30 | case TYPE.GROUP:
31 | return '接龙';
32 | case TYPE.SYS:
33 | return '系统';
34 | }
35 | }
36 | module.exports = {
37 | TYPE,
38 | getTypeDesc
39 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/comm/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | CLOUD_ID: 'xxxx', //云环境ID
3 |
4 | TEST_MODE: true, // 测试模式 涉及小程序码生成路径, 用以下 TEST_TOKEN_ID openid..
5 |
6 | TEST_TOKEN_ID: 'oTthr5P34HTx5iYLtATaGjNlIxZw',
7 |
8 | USER_MINI_QRCODE_DIR: 'client/mini_qrcode/', // 用户小程序码目录
9 |
10 | CHECK_CONTENT: true, //图片文字是否校验
11 |
12 | MINI_STATE: 'formal' //跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版
13 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/comm/router.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 路由配置文件
3 | * User: CC
4 | * Date: 2020-10-14 07:00:00
5 | */
6 |
7 | module.exports = {
8 |
9 |
10 |
11 | 'info/list': 'InfoController@getInfoList',
12 | 'info/my_list': 'InfoController@getMyInfoList',
13 | 'info/insert': 'InfoController@insertInfo',
14 | 'info/my_detail': 'InfoController@getMyInfoDetail',
15 | 'info/edit': 'InfoController@editInfo',
16 | 'info/del': 'InfoController@delInfo',
17 | 'info/like': 'InfoController@likeInfo',
18 | 'info/view': 'InfoController@viewInfo',
19 | 'info/update_pic': 'InfoController@updateInfoPic',
20 |
21 |
22 | 'album/list': 'AlbumController@getAlbumList',
23 | 'album/my_list': 'AlbumController@getMyAlbumList',
24 | 'album/insert': 'AlbumController@insertAlbum',
25 | 'album/my_detail': 'AlbumController@getMyAlbumDetail',
26 | 'album/edit': 'AlbumController@editAlbum',
27 | 'album/del': 'AlbumController@delAlbum',
28 | 'album/like': 'AlbumController@likeAlbum',
29 | 'album/view': 'AlbumController@viewAlbum',
30 | 'album/update_pic': 'AlbumController@updateAlbumPic',
31 |
32 |
33 |
34 | 'user/list': 'UserController@getUserList',
35 | 'user/detail': 'UserController@getUser',
36 | 'user/view': 'UserController@viewUser', //用户单页面查看
37 | 'user/my_detail': 'UserController@getMyDetail',
38 |
39 | 'my/invite': 'MyController@getMyInviteList', //我邀请的人
40 | 'my/info': 'MyController@getMyInfoList', //我发布的互助
41 | 'my/album': 'MyController@getMyAlbumList', //我发布的相册
42 |
43 |
44 | 'passport/phone': 'PassportController@getPhone',
45 | 'passport/unionid': 'PassportController@getUnionId',
46 | 'passport/reg': 'PassportController@register',
47 | 'passport/modify': 'PassportController@modifyBase',
48 | 'passport/login': 'PassportController@login',
49 | 'passport/check_family': 'PassportController@checkFamily',
50 | 'passport/update_pic': 'PassportController@updatePic',
51 |
52 | 'check/img': 'CheckController@checkImg',
53 |
54 | 'test/test': 'TestController@test',
55 |
56 |
57 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "permissions": {
3 | "openapi": ["wxacode.getUnlimited", "security.imgSecCheck", "security.msgSecCheck","serviceMarket.invokeService"]
4 | }
5 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/controller/base_controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 基本业务控制器
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-05 04:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 | const timeUtil = require('../framework/utils/time_util.js');
9 | const Controller = require('../framework/client/controller.js');
10 | const dataCheck = require('../framework/validate/data_check.js');
11 |
12 | class BaseController extends Controller {
13 |
14 | constructor(miniOpenId, request, router, token) {
15 | super(miniOpenId, request, router, token);
16 |
17 | // 云函数入口文件
18 |
19 | //this._cloud = cloudUtil.getCloud();
20 | //this._log = this._cloud.logger();
21 | /*
22 | this._db = this._cloud.database();
23 | this._dbCmd = this._db.command;
24 | this._dbAggr = this._dbCmd.aggregate;*/
25 |
26 | // 微信上下文 OPENID, APPID,UNIONID,CLIENTIP, CLIENTIPV6
27 | //this._wxContext = this._cloud.getWXContext();
28 | this._userId = miniOpenId;
29 |
30 | // 当前时间戳
31 | this._timestamp = timeUtil.time();
32 |
33 |
34 | }
35 |
36 | /**
37 | * 数据校验
38 | * @param {*} rules
39 | */
40 | validateData(rules = {}) {
41 | let input = this._request;
42 | return dataCheck.check(input, rules);
43 | }
44 | }
45 |
46 | module.exports = BaseController;
--------------------------------------------------------------------------------
/cloudfunctions/cloud/controller/check_controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 内容检测控制器
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-10-14 07:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 | const BaseController = require('./base_controller.js');
9 | const contentCheck = require('../framework/validate/content_check.js');
10 |
11 | class CheckController extends BaseController {
12 |
13 | /**
14 | * 图片校验
15 | */
16 | async checkImg() {
17 |
18 | // 数据校验
19 | let rules = {
20 | img: 'name=img',
21 | mine: 'required|default=jpg',
22 | };
23 |
24 | // 取得数据
25 | let input = this.validateData(rules);
26 |
27 | return await contentCheck.checkImg(input.img, 'jpg');
28 |
29 | }
30 |
31 | }
32 |
33 | module.exports = CheckController;
--------------------------------------------------------------------------------
/cloudfunctions/cloud/controller/passport_controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: passport模块控制器
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-10 19:52:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 | const BaseController = require('./base_controller.js');
9 | const PassportService = require('../service/passport_service.js');
10 | const contentCheck = require('../framework/validate/content_check.js');
11 |
12 | class PassportController extends BaseController {
13 |
14 | /**
15 | * 获取UnionID
16 | */
17 | async getUnionId() {
18 |
19 | // 数据校验
20 | let rules = {
21 | cloudID: 'required|string|min:1|max:200|name=cloudID',
22 | };
23 |
24 | // 取得数据
25 | let input = this.validateData(rules);
26 |
27 | let service = new PassportService();
28 | return await service.getUnionId(input.cloudID);
29 | }
30 |
31 | /**
32 | * 获取手机号码
33 | */
34 | async getPhone() {
35 |
36 | // 数据校验
37 | let rules = {
38 | cloudID: 'required|string|min:1|max:200|name=cloudID',
39 | };
40 |
41 | // 取得数据
42 | let input = this.validateData(rules);
43 |
44 | let service = new PassportService();
45 | return await service.getPhone(input.cloudID);
46 | }
47 |
48 | /**
49 | * 注册
50 | * @param {*} formData=表单填写数据,wechatData微信授权数据,phone授权的手机数据
51 | */
52 | async register() {
53 | // 数据校验
54 | let rules = {
55 | phone: 'required|string',
56 | formData: 'required|object',
57 | inviteData: 'required|object',
58 | wechatData: 'required|object',
59 | };
60 |
61 | // 取得数据
62 | let input = this.validateData(rules);
63 |
64 | // 内容审核
65 | await contentCheck.checkTextMulti(input.formData);
66 |
67 | let service = new PassportService();
68 | return await service.register(this._userId, input);
69 | }
70 |
71 | /**
72 | * 修改用户资料
73 | * @param {*} formData=表单填写数据
74 | */
75 | async modifyBase() {
76 | // 数据校验
77 | let rules = {
78 | formData: 'required|object',
79 | };
80 |
81 | // 取得数据
82 | let input = this.validateData(rules);
83 |
84 | // 内容审核
85 | await contentCheck.checkTextMulti(input.formData);
86 |
87 | let service = new PassportService();
88 | return await service.modifyBase(this._userId, input);
89 | }
90 |
91 | /**
92 | * 登录
93 | */
94 | async login() {
95 | // 数据校验
96 | let rules = {};
97 |
98 | // 取得数据
99 | let input = this.validateData(rules);
100 |
101 | let service = new PassportService();
102 | return await service.login(this._userId);
103 | }
104 |
105 | /**
106 | * 修改用户头像
107 | */
108 | async updatePic() {
109 | // 数据校验
110 | let rules = {
111 | fileID: 'required|string',
112 | };
113 |
114 | // 取得数据
115 | let input = this.validateData(rules);
116 |
117 | let service = new PassportService();
118 | return await service.updatePic(this._userId, input.fileID);
119 | }
120 |
121 | }
122 |
123 | module.exports = PassportController;
--------------------------------------------------------------------------------
/cloudfunctions/cloud/framework/client/controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 基础控制器
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-05 04:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 | class Controller {
8 |
9 | constructor(miniOpenId, request, router, token) {
10 | this._miniOpenId = miniOpenId;
11 | this._request = request;
12 | this._router = router;
13 | this._token = token;
14 | }
15 | }
16 |
17 | module.exports = Controller;
--------------------------------------------------------------------------------
/cloudfunctions/cloud/framework/cloud/cloud_base.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 云初始化实例
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-05 04:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 | const config = require('../../comm/config.js');
9 |
10 | /**
11 | * 获得云实例
12 | */
13 | function getCloud() {
14 | const cloud = require('wx-server-sdk');
15 | cloud.init({
16 | env: config.CLOUD_ID
17 | });
18 | return cloud;
19 | }
20 |
21 | module.exports = {
22 | getCloud
23 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/framework/cloud/cloud_util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 云基本操作模块
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-05 04:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 | const cloudBase = require('./cloud_base.js');
8 |
9 | /**
10 | * 高级日志记录错误
11 | * @param {*} method
12 | * @param {*} err
13 | */
14 | function log(method, err, level = 'error') {
15 | const cloud = cloudBase.getCloud();
16 | const log = cloud.logger();
17 | log.error({
18 | method: method,
19 | errCode: err.code,
20 | errMsg: err.message,
21 | errStack: err.stack
22 | });
23 | }
24 | /**
25 | * 根据临时文件地址取得网络地址
26 | * @param {*} fileID
27 | * @returns {String}
28 | */
29 | async function getTempFileURLOne(fileID) {
30 | if (!fileID) return '';
31 |
32 | const cloud = cloudBase.getCloud();
33 | let result = await cloud.getTempFileURL({
34 | fileList: [fileID],
35 | })
36 | if (result && result.fileList && result.fileList[0] && result.fileList[0].tempFileURL)
37 | return result.fileList[0].tempFileURL;
38 | return '';
39 | }
40 |
41 | /**
42 | * 根据临时文件地址取得网络地址
43 | * 用云文件 ID 换取真实链接,公有读的文件获取的链接不会过期,私有的文件获取的链接十分钟有效期。一次最多取 50
44 | * @param {*} fileList
45 | * @param {*} isValid 是否只取本次获取的合法的
46 | * @returns {Array} 对象数组 [{cloudId:, url:}]
47 | */
48 | async function getTempFileURL(tempFileList, isValid = false) {
49 | if (!tempFileList || tempFileList.length == 0) return [];
50 |
51 | const cloud = cloudBase.getCloud();
52 | let result = await cloud.getTempFileURL({
53 | fileList: tempFileList,
54 | })
55 | console.log(result);
56 |
57 | let list = result.fileList;
58 | let outList = [];
59 | for (let i = 0; i < list.length; i++) {
60 | let pic = {};
61 | if (list[i].status == 0) {
62 | //获取到地址的
63 | pic.url = list[i].tempFileURL;
64 | pic.cloudId = list[i].fileID;
65 | outList.push(pic)
66 | } else {
67 | //未获取到地址的(已经转换过的)
68 | if (!isValid) {
69 | pic.url = list[i].fileID; // fileID为URL, tempFileURL为空
70 | pic.cloudId = list[i].fileID;
71 | outList.push(pic)
72 | }
73 | }
74 | }
75 | console.log(outList);
76 | return outList;
77 | }
78 |
79 | /**
80 | * 用后面的文件数组替换前面的,并删除已经不存在的FileID
81 | * @param {*} oldFiles
82 | * 格式 下同
83 | * [{
84 | cloudId: xxxxx
85 | url: yyyyyy
86 | * },....]
87 | * @param {*} newFiles
88 | * @returns {Array} 对象数组 [{cloudId:, url:}]
89 | */
90 | async function handlerCloudFiles(oldFiles, newFiles) {
91 | const cloud = cloudBase.getCloud();
92 | for (let i = 0; i < oldFiles.length; i++) {
93 | let isDel = true;
94 | for (let j = 0; j < newFiles.length; j++) {
95 | if (oldFiles[i].url == newFiles[j].url) {
96 | // 从旧文件数组里 找到 新组 还存在的文件, 保存cloudID
97 | newFiles[j].cloudId = oldFiles[i].cloudId;
98 | isDel = false;
99 | break;
100 | }
101 | }
102 | // 新组里不存在,直接删除
103 | if (isDel && oldFiles[i].cloudId) {
104 |
105 | let result = await cloud.deleteFile({
106 | fileList: [oldFiles[i].cloudId],
107 | });
108 | console.log(result);
109 | }
110 |
111 | }
112 |
113 | return newFiles;
114 | }
115 |
116 | /**
117 | * 删除文件
118 | * @param {*} list 文件数组cloudid
119 | */
120 | async function deleteFiles(list = []) {
121 | const cloud = cloudBase.getCloud();
122 | if (!Array.isArray(list) || list.length == 0) return;
123 | await cloud.deleteFile({
124 | fileList: list,
125 | });
126 | }
127 |
128 | module.exports = {
129 | log,
130 | getTempFileURL,
131 | getTempFileURLOne,
132 | deleteFiles,
133 | handlerCloudFiles
134 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/framework/handler/app_code.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 错误代码定义
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-05 04:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 | module.exports = {
8 | SUCC: 200,
9 | SVR: 500, //服务器错误
10 | LOGIC: 1600, //逻辑错误
11 | DATA: 1301, // 数据校验错误
12 | HEADER: 1302, // header 校验错误
13 | NOT_USER: 1303, // 用户不存在
14 | USER_EXCEPTION: 1304, // 用户异常
15 | MUST_LOGIN: 1305, //需要登录
16 | USER_CHECK: 1306, //用户审核中
17 |
18 | ADMIN_ERROR: 2001 //管理员错误
19 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/framework/handler/app_error.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 应用异常处理类
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-05 04:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 |
9 | const appCode = require('./app_code.js');
10 |
11 | class AppError extends Error {
12 | constructor(message, code = appCode.LOGIC) {
13 | super(message);
14 | this.name = 'AppError';
15 | this.code = code;
16 | }
17 | }
18 |
19 | module.exports = AppError;
--------------------------------------------------------------------------------
/cloudfunctions/cloud/framework/lib/mini_lib.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 小程序封装类库
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-06 14:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 | const cloudBase = require('../cloud/cloud_base.js');
8 | const cloudUtil = require('../cloud/cloud_util.js');
9 |
10 | async function sendOnceTempMsg(body) {
11 | console.log('sendOnceTempMsg', body);
12 | let cloud = cloudBase.getCloud();
13 | try {
14 | await cloud.openapi.subscribeMessage.send(body);
15 | } catch (err) {
16 | cloudUtil.log('sendOnceTempMsg', err);
17 | }
18 | }
19 | module.exports = {
20 | sendOnceTempMsg
21 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/framework/lib/official_account_lib.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 公众号封装类库
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-06 04:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 | const request = require('request');
9 |
10 | /**
11 | * 获取公众号access_token
12 | */
13 | async function getOfficialAccountAccessToken() {
14 | let appid = 'wx63eb61409e1a25f5';
15 | let secret = '1c3ae7d1af911085b84355bd5e27ab13';
16 | let token_url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' + appid + '&' + 'secret=' + secret;
17 | const rp = options =>
18 | new Promise((resolve, reject) => {
19 | request(options, (error, response, body) => {
20 | if (error) {
21 | reject(error);
22 | }
23 | resolve(response);
24 | });
25 | });
26 | const result = await rp({
27 | url: token_url,
28 | method: 'GET'
29 | });
30 | return (typeof result.body === 'object') ? result.body : JSON.parse(result.body);;
31 | }
32 |
33 |
34 | /**
35 | * 发送公众号模板消息
36 | */
37 | async function sendTemp() {
38 | try {
39 | const cloud = cloudUtil.getCloud();
40 | const result = await cloud.openapi.uniformMessage.send({
41 | touser: 'oYyk-5Q4WyAc0DWnqt2x89kfR_y0',
42 | mpTemplateMsg: {
43 | appid: 'wx63eb61409e1a25f5',
44 | url: 'http://weixin.qq.com/download',
45 | miniprogram: {
46 | appid: 'wxac22c5d07761ba60',
47 | path: 'info/info_index'
48 | },
49 | data: {
50 | first: {
51 | value: '恭喜你购买成功!',
52 | color: '#173177'
53 | },
54 | keyword1: {
55 | value: '巧克力',
56 | color: '#173177'
57 | },
58 | keyword2: {
59 | value: '39.8元',
60 | color: '#173177'
61 | },
62 |
63 | remark: {
64 | value: '欢迎再次购买!',
65 | color: '#173177'
66 | }
67 | },
68 | templateId: '4-OLRJmUxTyCSZJH1IJHn6DPFvz6f2nDjS0XSL4UwJM'
69 | },
70 | });
71 | console.log(result)
72 | } catch (err) {
73 | console.log(err)
74 | }
75 | }
76 |
77 | module.exports = {
78 | getOfficialAccountAccessToken,
79 | sendTemp //发送模板消息
80 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/framework/utils/constant.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 通用常量定义
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-05 04:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 | module.exports = {
8 |
9 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/framework/utils/str_util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 字符相关操作函数
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-05 04:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 |
9 | /**
10 | * 生成一个特定范围内的随机数
11 | */
12 | const genRandomNum = (min, max) => (Math.random() * (max - min + 1) | 0) + min;
13 |
14 | /**
15 | * 生成一个随机的数字字母字符串
16 | */
17 | const genRandomString = len => {
18 | const text = 'abcdefghijklmnopqrstuvwxyz0123456789';
19 | const rdmIndex = text => Math.random() * text.length | 0;
20 | let rdmString = '';
21 | for (; rdmString.length < len; rdmString += text.charAt(rdmIndex(text)));
22 | return rdmString;
23 | }
24 |
25 |
26 | /**
27 | * 把字符串格式化为数组
28 | * @param {*} str
29 | * @param {*} sp
30 | */
31 | function str2Arr(str, sp) {
32 | if (str && Array.isArray(str)) return str;
33 |
34 | if (sp == undefined) sp = ',';
35 |
36 | str = str.replace(/,/g, ",");
37 | let arr = str.split(',');
38 | for (let i = 0; i < arr.length; i++) {
39 | arr[i] = arr[i].trim();
40 |
41 | if (isNumber(arr[i])) {
42 | arr[i] = Number(arr[i]);
43 | }
44 |
45 | }
46 | return arr;
47 | }
48 |
49 | /**
50 | * 校验只要是数字(包含正负整数,0以及正负浮点数)就返回true
51 | * @param {*} val
52 | */
53 | function isNumber(val) {
54 | var reg = /^[0-9]+.?[0-9]*$/;
55 | if (reg.test(val)) {
56 | return true;
57 | } else {
58 | return false;
59 | }
60 | }
61 |
62 | /**
63 | * 提取对象数组的某个属性数组
64 | * @param {*} arr
65 | * @param {*} key
66 | */
67 | function getArrByKey(arr, key) {
68 | if (!Array.isArray(arr)) return;
69 | return arr.map((item) => {
70 | return item[key]
71 | });
72 | }
73 |
74 | /**
75 | * 文本内容格式化处理
76 | * @param {*} content
77 | * @param {*} len 截取长度 -1不截取
78 | */
79 | function fmtText(content, len = -1) {
80 | let str = content.replace(/[\r\n]/g, ""); //去掉回车换行
81 | if (len > 0) {
82 | str = str.substr(0, len);
83 | }
84 | return str.trim();
85 | }
86 |
87 | module.exports = {
88 | str2Arr,
89 | isNumber,
90 | getArrByKey,
91 | genRandomString, // 随机字符串
92 | genRandomNum, // 随机数字
93 | fmtText, // 文本内容格式化处理
94 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/framework/utils/util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 通用工具函数
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-05 04:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 | /**
9 | * 判断变量,参数,对象属性是否定义
10 | * @param {*} val
11 | */
12 | function isDefined(val) {
13 | // == 不能判断是否为null
14 | if (val === undefined)
15 | return false;
16 | else
17 | return true;
18 | }
19 |
20 | /**
21 | * 休眠时间,配合await使用
22 | * @param {*} time 毫秒
23 | */
24 | function sleep(time) {
25 | return new Promise((resolve) => setTimeout(resolve, time));
26 | };
27 |
28 | module.exports = {
29 | isDefined, //判断变量,参数,对象属性是否定义
30 | sleep
31 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/framework/validate/content_check.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 内容审核
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-05 04:00:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 | const AppError = require('../handler/app_error.js');
9 | const cloudBase = require('../cloud/cloud_base.js');
10 | const config = require('../../comm/config.js');
11 |
12 | /**
13 | * 校验图片信息
14 | * @param {*} 图片流buffer
15 | */
16 | async function checkImg(imgData, mine) {
17 | if (!config.CHECK_CONTENT) return;
18 |
19 | let cloud = cloudBase.getCloud();
20 | try {
21 | const result = await cloud.openapi.security.imgSecCheck({
22 | media: {
23 | contentType: 'image/' + mine,
24 | value: Buffer.from(imgData, 'base64') // 这里必须要将小程序端传过来的进行Buffer转化,否则就会报错,接口异常
25 | }
26 |
27 | })
28 | console.log('imgcheck', result);
29 | if (!result || result.errCode !== 0) {
30 | throw new AppError('图片内容不合适,请修改');
31 | }
32 |
33 | } catch (err) {
34 | console.log('imgcheck ex', err);
35 | throw new AppError('图片内容不合适,请修改');
36 | }
37 |
38 | }
39 |
40 | /**
41 | * 把输入数据里的文本数据提交内容审核
42 | * @param {*} input
43 | */
44 | async function checkTextMulti(input) {
45 | if (!config.CHECK_CONTENT) return;
46 |
47 | let txt = '';
48 | for (let k in input) {
49 | if (typeof (input[k]) === 'string')
50 | txt += input[k];
51 | }
52 | await checkText(txt);
53 | }
54 |
55 | /**
56 | * 校验文字信息
57 | * @param {*}
58 | */
59 | async function checkText(txt) {
60 | if (!config.CHECK_CONTENT) return;
61 |
62 | if (!txt) return;
63 |
64 | let cloud = cloudBase.getCloud();
65 | try {
66 | const result = await cloud.openapi.security.msgSecCheck({
67 | content: txt
68 |
69 | })
70 | // console.log('checkText', result);
71 | if (!result || result.errCode !== 0) {
72 | throw new AppError('文字内容不合适,请修改');
73 | }
74 |
75 | } catch (err) {
76 | console.log('checkText ex', err);
77 | throw new AppError('文字内容不合适,请修改');
78 | }
79 |
80 | }
81 |
82 | module.exports = {
83 | checkImg,
84 | checkTextMulti,
85 | checkText
86 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/index.js:
--------------------------------------------------------------------------------
1 | const application = require('./framework/handler/application.js');
2 |
3 | // 云函数入口函数
4 | exports.main = async (event, context) => {
5 | return await application.app(event, context);
6 | }
--------------------------------------------------------------------------------
/cloudfunctions/cloud/model/album_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 相册实体
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-10-24 19:20:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 |
9 | const BaseModel = require('./base_model.js');
10 |
11 | class AlbumModel extends BaseModel {
12 |
13 | }
14 |
15 | // 集合名
16 | AlbumModel.CL = "t_album";
17 |
18 | AlbumModel.DB_STRUCTURE = {
19 | ALBUM_ID: 'string|true',
20 | ALBUM_USER_ID: 'string|true',
21 |
22 | ALBUM_TITLE: 'string|true|comment=标题',
23 | ALBUM_CONTENT: 'string|true|comment=内容',
24 | ALBUM_DESC: 'string|false|comment=描述',
25 | ALBUM_STATUS: 'int|true|default=1|comment=状态 0=待审核 1=正常 7=结束 8=停用 9=删除',
26 | ALBUM_TYPE: 'string|true|default=其他|comment=类型 同学时光,校园追忆,校友今夕,活动聚会,个人风采,其他',
27 | ALBUM_ORDER: 'int|true|default=9999',
28 |
29 | ALBUM_VIEW_CNT: 'int|true|default=0|comment=访问次数',
30 | ALBUM_FAV_CNT: 'int|true|default=0|comment=收藏人数',
31 | ALBUM_COMMENT_CNT: 'int|true|default=0|comment=评论数',
32 | ALBUM_LIKE_CNT: 'int|true|default=0|comment=点赞数',
33 |
34 |
35 | ALBUM_PIC: 'array|false|default=[]|comment=附加图片 对象数组[{cloudId,url}]',
36 |
37 | ALBUM_ADD_TIME: 'int|true',
38 | ALBUM_EDIT_TIME: 'int|true',
39 | ALBUM_ADD_IP: 'string|false',
40 | ALBUM_EDIT_IP: 'string|false',
41 | };
42 |
43 | // 字段前缀
44 | AlbumModel.FIELD_PREFIX = "ALBUM_";
45 |
46 | AlbumModel.STATUS = {
47 | //0=待审核 1=正常 7=结束 8=停用 9=删除
48 | UNUSE: 0,
49 | COMM: 1,
50 | OVER: 7,
51 | PEDDING: 8,
52 | DEL: 9
53 | };
54 |
55 | AlbumModel.STATUS_DESC = {
56 | //0=待审核 1=正常 7=结束 8=停用 9=删除
57 | UNUSE: '待审核',
58 | COMM: '正常',
59 | OVER: '结束',
60 | PEDDING: '停用',
61 | DEL: '删除'
62 | };
63 |
64 |
65 | module.exports = AlbumModel;
--------------------------------------------------------------------------------
/cloudfunctions/cloud/model/base_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 实体基类
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-11-14 19:20:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 |
9 | const Model = require('../framework/database/model.js');
10 |
11 | class BaseModel extends Model{
12 | }
13 |
14 | module.exports = BaseModel;
--------------------------------------------------------------------------------
/cloudfunctions/cloud/model/info_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 互助实体
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-10-14 19:20:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 |
9 | const BaseModel = require('./base_model.js');
10 |
11 | class InfoModel extends BaseModel {
12 |
13 | }
14 |
15 | // 集合名
16 | InfoModel.CL = "t_info";
17 |
18 | InfoModel.DB_STRUCTURE = {
19 | INFO_ID: 'string|true',
20 | INFO_USER_ID: 'string|true',
21 |
22 | INFO_TITLE: 'string|true|comment=标题',
23 | INFO_DESC: 'string|false|comment=描述',
24 | INFO_CONTENT: 'string|true|comment=内容',
25 | INFO_STATUS: 'int|true|default=1|comment=状态 0=待审核 1=正常 7=过期 8=停用 9=删除',
26 | INFO_TYPE: 'string|true|default=其他|comment=类型 资源合作,活动聚会,创业合作,招聘猎头,求职,企业推介,供应采购,商务合作,服务咨询,其他',
27 | INFO_ORDER: 'int|true|default=9999',
28 |
29 | INFO_VIEW_CNT: 'int|true|default=0|comment=访问次数',
30 | INFO_FAV_CNT: 'int|true|default=0|comment=收藏人数',
31 | INFO_COMMENT_CNT: 'int|true|default=0|comment=评论数',
32 | INFO_LIKE_CNT: 'int|true|default=0|comment=点赞数',
33 |
34 | INFO_EXPIRE_TIME: 'int|true|default=0|comment=过期时间 0=永不过期',
35 |
36 | INFO_REGION_PROVINCE: 'string|false|comment=区域(省)',
37 | INFO_REGION_CITY: 'string|false|comment=区域(市)',
38 | INFO_REGION_COUNTY: 'string|false|comment=区域(区)',
39 |
40 | INFO_PIC: 'array|false|default=[]|comment=附加图片 对象数组[{cloudId,url}]',
41 |
42 | INFO_ADD_TIME: 'int|true',
43 | INFO_EDIT_TIME: 'int|true',
44 | INFO_ADD_IP: 'string|false',
45 | INFO_EDIT_IP: 'string|false',
46 | };
47 |
48 | // 字段前缀
49 | InfoModel.FIELD_PREFIX = "INFO_";
50 |
51 | InfoModel.STATUS = {
52 | //0=待审核 1=正常 8=停用 9=删除
53 | UNUSE: 0,
54 | COMM: 1,
55 | PEDDING: 8,
56 | DEL: 9
57 | };
58 |
59 | InfoModel.STATUS_DESC = {
60 | //0=待审核 1=正常 8=停用 9=删除
61 | UNUSE: '待审核',
62 | COMM: '正常',
63 | PEDDING: '停用',
64 | DEL: '删除'
65 | };
66 |
67 |
68 | module.exports = InfoModel;
--------------------------------------------------------------------------------
/cloudfunctions/cloud/model/setup_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 系统设置实体
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-11-05 19:20:00
5 | * Version : CCMiniCloud Framework Ver 2.0.1 ALL RIGHTS RESERVED BY 明章科技
6 | */
7 |
8 |
9 | const BaseModel = require('./base_model.js');
10 |
11 | class SetupModel extends BaseModel {
12 |
13 | }
14 |
15 | // 集合名
16 | SetupModel.CL = "t_setup";
17 |
18 | SetupModel.DB_STRUCTURE = {
19 | SETUP_ID: 'string|true',
20 |
21 | SETUP_TITLE: 'string|false|comment=网站名称',
22 | SETUP_ABOUT: 'string|false|comment=关于我们',
23 |
24 | SETUP_LOGO: 'object|false|default={}|comment=网站底图 对象{cloudId,url}',
25 |
26 | SETUP_AD_PIC: 'array|false|default=[]|comment=海报底图 对象数组[{cloudId,url}]',
27 |
28 | SETUP_REG_CHECK : 'int|true|default=0|comment=注册是否审核 0/1',
29 |
30 | SETUP_ADD_TIME: 'int|true',
31 | SETUP_EDIT_TIME: 'int|true',
32 | SETUP_ADD_IP: 'string|false',
33 | SETUP_EDIT_IP: 'string|false',
34 | };
35 |
36 | // 字段前缀
37 | SetupModel.FIELD_PREFIX = "SETUP_";
38 |
39 |
40 |
41 |
42 |
43 |
44 | module.exports = SetupModel;
--------------------------------------------------------------------------------
/cloudfunctions/cloud/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cloud",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "date-utils": "^1.2.21",
13 | "wx-server-sdk": "~2.1.2"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/cloudfunctions/cloud/service/base_service.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 业务基类
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-09-05 04:00:00
5 | */
6 |
7 | const AppError = require('../framework/handler/app_error.js');
8 | const appCode = require('../framework/handler/app_code.js');
9 | const timeUtil = require('../framework/utils/time_util.js');
10 | const UserModel = require('../model/user_model.js');
11 |
12 | class BaseService {
13 | constructor() {
14 | // 当前时间戳
15 | this._timestamp = timeUtil.time();
16 | }
17 |
18 | /**
19 | * 抛出异常
20 | * @param {*} msg
21 | * @param {*} code
22 | */
23 | AppError(msg, code = appCode.LOGIC) {
24 | throw new AppError(msg, code);
25 | }
26 |
27 | /**
28 | * 与用户表联表查询 默认用户表参数
29 | * @param {*} localField
30 | */
31 | getJoinUserParams(localField = '_openid') {
32 | return {
33 | from: 't_user',
34 | localField: localField,
35 | foreignField: 'USER_MINI_OPENID',
36 | as: 'USER_DETAIL',
37 | };
38 | }
39 |
40 | /**
41 | * 与用户表联表查询 默认用户表输出字段
42 | */
43 | getJoinUserFields() {
44 | return 'USER_DETAIL.USER_ITEM,USER_DETAIL.USER_NAME,USER_DETAIL.USER_PIC,USER_DETAIL.USER_MINI_OPENID,USER_DETAIL.USER_SEX';
45 | }
46 |
47 | /**
48 | * 与用户表联表查询 默认用户表输出字段 for ADMIN
49 | */
50 | getJoinUserFieldsAdmin() {
51 | return 'USER_DETAIL.USER_ITEM,USER_DETAIL.USER_NAME,USER_DETAIL.USER_MINI_OPENID,USER_DETAIL.USER_SEX';
52 | }
53 |
54 |
55 | /**
56 | * 单独用户表 默认输出字段
57 | */
58 | getUserFields() {
59 | return 'USER_NAME,USER_PIC,USER_SEX,USER_MINI_OPENID,USER_ITEM';
60 | }
61 |
62 | /**
63 | * 获取当前授权用户信息
64 | * @param {*} openid
65 | */
66 | async getUserMyBase(userId, fields = this.getUserFields()) {
67 | let where = {
68 | USER_MINI_OPENID: userId
69 | }
70 | return await UserModel.getOne(where, fields);
71 | }
72 |
73 | /**
74 | * 获取某个用户信息
75 | * @param {*} openid
76 | */
77 | async getUserOne(userId, fields = this.getUserFields()) {
78 | let where = {
79 | USER_MINI_OPENID: userId
80 | }
81 | return await UserModel.getOne(where, fields);
82 | }
83 | }
84 |
85 | module.exports = BaseService;
--------------------------------------------------------------------------------
/cloudfunctions/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "lockfileVersion": 1
3 | }
4 |
--------------------------------------------------------------------------------
/miniprogram/app.js:
--------------------------------------------------------------------------------
1 | const PassportBiz = require('./biz/passport_biz.js');
2 |
3 | App({
4 | onLaunch: function (options) {
5 |
6 | if (!wx.cloud) {
7 | console.error('请使用 2.2.3 或以上的基础库以使用云能力')
8 | } else {
9 | wx.cloud.init({
10 | // env 参数说明:
11 | // env 参数决定接下来小程序发起的云开发调用(wx.cloud.xxx)会默认请求到哪个云环境的资源
12 | // 此处请填入环境 ID, 环境 ID 可打开云控制台查看
13 | // 如不填则使用默认环境(第一个创建的环境)
14 | // env: 'my-env-id',
15 | traceUser: true,
16 | })
17 | }
18 |
19 | this.globalData = {}
20 | },
21 | /*
22 | onShow: function (options) {
23 | // 启动,或者从后台进入前台
24 | //GroupBiz.initGroupShareTicket(options);
25 | },
26 | onHide: function () {
27 | // 小程序从前台进入后台
28 | //GroupBiz.clearGroupShareTicket();
29 | }*/
30 | })
--------------------------------------------------------------------------------
/miniprogram/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 |
4 | "pages/my/index/my_index",
5 | "pages/reg/reg_step1",
6 | "pages/reg/reg_step2",
7 | "pages/reg/reg_step3",
8 | "pages/my/base/my_base",
9 | "pages/my/reload/my_reload",
10 | "pages/my/base/my_avatar",
11 | "pages/info/info_index",
12 | "pages/info/info_add",
13 | "pages/info/info_detail",
14 |
15 | "pages/info/info_edit",
16 | "pages/search/search",
17 | "pages/user/user_index",
18 | "pages/user/user_detail",
19 |
20 | "pages/album/album_index",
21 | "pages/album/album_add",
22 | "pages/album/album_edit",
23 | "pages/album/album_detail",
24 |
25 |
26 | "pages/my/info/my_info",
27 | "pages/my/album/my_album",
28 | "pages/my/foot/my_foot",
29 | "pages/my/ad/my_ad",
30 |
31 | "pages/about/about",
32 | "pages/about/hint"
33 | ],
34 | "window": {
35 | "backgroundColor": "#f1f1f1",
36 | "backgroundTextStyle": "light",
37 | "navigationBarBackgroundColor": "#1cbbb4",
38 | "navigationBarTitleText": "CC校友录",
39 | "navigationBarTextStyle": "white"
40 | },
41 | "tabBar": {
42 | "backgroundColor": "#fefefe",
43 | "color": "#ccc",
44 | "selectedColor": "#1cbbb4",
45 | "list": [
46 |
47 | {
48 | "pagePath": "pages/user/user_index",
49 | "text": "找校友",
50 | "iconPath": "/images/tabbar/user.png",
51 | "selectedIconPath": "/images/tabbar/user_cur.png"
52 | },
53 | {
54 | "pagePath": "pages/info/info_index",
55 | "text": "校友互助",
56 | "iconPath": "/images/tabbar/info.png",
57 | "selectedIconPath": "/images/tabbar/info_cur.png"
58 | },
59 | {
60 | "pagePath": "pages/album/album_index",
61 | "text": "校友相册",
62 | "iconPath": "/images/tabbar/meet.png",
63 | "selectedIconPath": "/images/tabbar/meet_cur.png"
64 | },
65 | {
66 | "pagePath": "pages/my/index/my_index",
67 | "text": "个人中心",
68 | "iconPath": "/images/tabbar/my.png",
69 | "selectedIconPath": "/images/tabbar/my_cur.png"
70 | }
71 | ]
72 | },
73 | "sitemapLocation": "sitemap.json"
74 | }
--------------------------------------------------------------------------------
/miniprogram/app.wxss:
--------------------------------------------------------------------------------
1 | @import "style/comm/comm.wxss";
2 | @import "style/project/project.wxss";
3 |
4 | @import "style/skin.wxss";
5 |
6 |
--------------------------------------------------------------------------------
/miniprogram/biz/album_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 相册模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | const BaseBiz = require('./base_biz.js');
8 | const cloudHelper = require('../helper/cloud_helper.js');
9 | const helper = require('../helper/helper.js');
10 | const setting = require('../helper/setting.js');
11 |
12 | class AlbumBiz extends BaseBiz {
13 |
14 |
15 | /**
16 | * 表单初始化相关数据
17 | */
18 | static initFormData(id = '') {
19 |
20 | return {
21 | id,
22 |
23 | // 分类
24 | typeOptions: AlbumBiz.TYPE_OPTIONS,
25 |
26 |
27 |
28 | // 图片数据
29 | imgMax: setting.ALBUM_MAX_PIC,
30 | imgList: [],
31 |
32 | // 表单数据
33 | formTypeIndex: 0,
34 | formTitle: '',
35 | formContent: '',
36 | }
37 |
38 | }
39 |
40 | /**
41 | * 图片上传
42 | * @param {string} albumId
43 | * @param {Array} imgList 图片数组
44 | */
45 | static async updateAlbumPic(albumId, imgList) {
46 |
47 | // 图片上传到云空间
48 | imgList = await cloudHelper.transTempPics(imgList, setting.ALBUM_PIC_DIR, albumId);
49 |
50 | // 更新本记录的图片信息
51 | let params = {
52 | albumId: albumId,
53 | imgList: imgList
54 | }
55 |
56 | try {
57 | // 更新数据 从promise 里直接同步返回
58 | let res = await cloudHelper.callCloudSumbit('album/update_pic', params);
59 | return res.data.urls;
60 | } catch (e) {}
61 | }
62 |
63 | /**
64 | * 搜索菜单设置
65 | */
66 | static getSearchMenu() {
67 |
68 | let sortItem1 = [{
69 | label: '综合排序',
70 | type: '',
71 | value: 0
72 | }];
73 |
74 | // 分类
75 | let sortItem2 = [{
76 | label: '所有分类',
77 | type: '',
78 | value: 0
79 | }];
80 | for (let k in AlbumBiz.TYPE_OPTIONS){
81 | sortItem2.push(
82 | {
83 | label: AlbumBiz.TYPE_OPTIONS[k],
84 | type: 'type',
85 | value: AlbumBiz.TYPE_OPTIONS[k],
86 | }
87 | )
88 | }
89 |
90 | let sortItems = [sortItem2];
91 | let sortMenus = [{
92 | label: '最新',
93 | type: 'sort',
94 | value: 'new'
95 | },
96 | {
97 | label: '最热',
98 | type: 'sort',
99 | value: 'view'
100 | },
101 | {
102 | label: '全部',
103 | type: '',
104 | value: ''
105 | }
106 | ]
107 |
108 | return {
109 | sortItems,
110 | sortMenus
111 | }
112 |
113 | }
114 | }
115 | /**
116 | * 分类
117 | */
118 | AlbumBiz.TYPE_OPTIONS = "同学时光,校园追忆,校友今夕,活动聚会,个人风采,其他".split(',');
119 |
120 | //表单校验
121 | AlbumBiz.CHECK_FORM = {
122 | title: 'formTitle|required|string|min:5|max:50|name=相册标题',
123 | type: 'formType|required|string|min:2|max:10|name=相册分类',
124 | content: 'formContent|required|string|min:10|max:500|name=简要描述'
125 | };
126 |
127 | module.exports = AlbumBiz;
--------------------------------------------------------------------------------
/miniprogram/biz/base_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 基础模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | class BaseBiz {
8 |
9 | }
10 |
11 | module.exports = BaseBiz;
--------------------------------------------------------------------------------
/miniprogram/biz/foot_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 足迹模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | const BaseBiz = require('./base_biz.js');
8 | const cacheHelper = require('../helper/cache_helper.js');
9 | const helper = require('../helper/helper.js');
10 | const bizHelper = require('../helper/biz_helper.js');
11 | const CACHE_FOOT = 'CACHE_FOOT';
12 |
13 | class FootBiz extends BaseBiz {
14 |
15 | static getFootList() {
16 | let foot = cacheHelper.get(CACHE_FOOT);
17 | if (foot) {
18 | for (let i = 0; i < foot.length; i++) {
19 | foot[i].time = helper.timestamp2Time(foot[i].time);
20 |
21 | switch (foot[i].type) {
22 | case bizHelper.TYPE.USER:
23 | foot[i].typeDesc = '同学';
24 | foot[i].color = 'red';
25 | break;
26 | case bizHelper.TYPE.INFO:
27 | foot[i].typeDesc = '互助';
28 | foot[i].color = 'blue';
29 | break;
30 | case bizHelper.TYPE.MEET:
31 | foot[i].typeDesc = '活动';
32 | foot[i].color = 'green';
33 | break;
34 | case bizHelper.TYPE.ALBUM:
35 | foot[i].typeDesc = '相册';
36 | foot[i].color = 'yellow';
37 | break;
38 | case bizHelper.TYPE.NEWS:
39 | foot[i].typeDesc = '资讯';
40 | foot[i].color = 'pink';
41 | break;
42 | }
43 | }
44 | }
45 |
46 | return foot;
47 | }
48 |
49 | /**添加足迹缓存
50 | *
51 | * @param {*} key 键
52 | * @param {*} val 值
53 | * 格式 key:{
54 | * oid:
55 | * type:类型
56 | * title:标题
57 | * time:加入时间
58 | * }
59 | * @param {*} size 最大个数
60 | * @param {*} expire 过期时间
61 | */
62 | static addFoot(oid, type, title, size = 60, expire = 86400 * 365 * 3) {
63 | if (!oid || !title) return [];
64 |
65 | let foot = cacheHelper.get(CACHE_FOOT, []);
66 |
67 | //查询是否存在 并删除
68 | for (let k in foot) {
69 | if (oid == foot[k].oid && type == foot[k].type)
70 | foot.splice(k, 1);
71 | }
72 |
73 | // 加到头部
74 | let val = {
75 | oid,
76 | type,
77 | title,
78 | time: helper.time()
79 | }
80 | foot.unshift(val);
81 |
82 | // 判断个数, 多的删除
83 | if (foot.length > size)
84 | foot.splice(foot.length - 1, 1);
85 |
86 | // 存缓存
87 | cacheHelper.set(CACHE_FOOT, foot, expire);
88 |
89 | return foot;
90 | }
91 | }
92 |
93 | module.exports = FootBiz;
--------------------------------------------------------------------------------
/miniprogram/biz/info_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 资讯模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | const BaseBiz = require('./base_biz.js');
8 | const cloudHelper = require('../helper/cloud_helper.js');
9 | const helper = require('../helper/helper.js');
10 | const setting = require('../helper/setting.js');
11 |
12 | class InfoBiz extends BaseBiz {
13 |
14 |
15 | /**
16 | * 表单初始化相关数据
17 | */
18 | static initFormData(id = '') {
19 |
20 | return {
21 | id,
22 |
23 | // 分类
24 | typeOptions: InfoBiz.TYPE_OPTIONS,
25 |
26 | // 有效期
27 | expireStart: helper.time('Y-M-D'),
28 | expireEnd: helper.time('Y-M-D', setting.INFO_MAX_EXPIRE),
29 |
30 | // 图片数据
31 | imgMax: setting.INFO_MAX_PIC,
32 | imgList: [],
33 |
34 |
35 | // 表单数据
36 | formTypeIndex: 0,
37 | formTitle: '',
38 | formContent: '',
39 | formExpireTime: helper.time('Y-M-D'),
40 | formRegion: setting.INFO_DEFAULT_REGION
41 | }
42 |
43 | }
44 |
45 | /**
46 | * 图片上传
47 | * @param {string} infoId
48 | * @param {Array} imgList 图片数组
49 | */
50 | static async updateInfoPic(infoId, imgList) {
51 |
52 | // 图片上传到云空间
53 | imgList = await cloudHelper.transTempPics(imgList, setting.INFO_PIC_DIR, infoId);
54 |
55 | // 更新本记录的图片信息
56 | let params = {
57 | infoId: infoId,
58 | imgList: imgList
59 | }
60 |
61 | try {
62 | // 更新数据 从promise 里直接同步返回
63 | let res = await cloudHelper.callCloudSumbit('info/update_pic', params);
64 | return res.data.urls;
65 | } catch (e) {}
66 | }
67 |
68 | /**
69 | * 搜索菜单设置
70 | */
71 | static getSearchMenu() {
72 |
73 | let sortItem1 = [{
74 | label: '综合排序',
75 | type: '',
76 | value: 0
77 | }];
78 |
79 | // 分类
80 | let sortItem2 = [{
81 | label: '所有分类',
82 | type: '',
83 | value: 0
84 | }];
85 | for (let k in InfoBiz.TYPE_OPTIONS){
86 | sortItem2.push(
87 | {
88 | label: InfoBiz.TYPE_OPTIONS[k],
89 | type: 'type',
90 | value: InfoBiz.TYPE_OPTIONS[k],
91 | }
92 | )
93 | }
94 |
95 | let sortItems = [sortItem2];
96 | let sortMenus = [{
97 | label: '最新',
98 | type: 'sort',
99 | value: 'new'
100 | },
101 | {
102 | label: '最热',
103 | type: 'sort',
104 | value: 'view'
105 | },
106 | {
107 | label: '全部',
108 | type: '',
109 | value: ''
110 | }
111 | ]
112 |
113 | return {
114 | sortItems,
115 | sortMenus
116 | }
117 |
118 | }
119 | }
120 | /**
121 | * 分类
122 | */
123 | InfoBiz.TYPE_OPTIONS = "资源合作,活动聚会,创业合作,招聘猎头,求职,企业推介,供应采购,商务合作,服务咨询,其他".split(',');
124 |
125 | //表单校验
126 | InfoBiz.CHECK_FORM = {
127 | title: 'formTitle|required|string|min:5|max:50|name=互助标题',
128 | type: 'formType|required|string|min:2|max:10|name=互助分类',
129 | expireTime: 'formExpireTime|required|date|name=有效期',
130 | region: 'formRegion|required|array|len:3|name=有效区域',
131 | content: 'formContent|required|string|min:10|max:50000|name=详细描述'
132 | };
133 |
134 | module.exports = InfoBiz;
--------------------------------------------------------------------------------
/miniprogram/biz/reg_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 注册模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | const BaseBiz = require('./base_biz.js');
8 | const cacheHelper = require('../helper/cache_helper.js');
9 | const cloudHelper = require('../helper/cloud_helper.js');
10 | const helper = require('../helper/helper.js');
11 | const validate = require('../helper/validate.js');
12 | const pageHelper = require('../helper/page_helper.js');
13 |
14 | /**
15 | *
16 | */
17 | class RegBiz extends BaseBiz {
18 | /**
19 | * 判断第一步是否完成
20 | */
21 | static isStep1() {
22 | let cache = cacheHelper.get(RegBiz.CACHE_REG);
23 | if (!cache || !cache['phone'])
24 | return false;
25 | else
26 | return true;
27 | }
28 |
29 | /**
30 | * 判断第2步是否完成
31 | */
32 | static isStep2() {
33 | let cache = cacheHelper.get(RegBiz.CACHE_REG);
34 | if (!cache || !cache['user'])
35 | return false;
36 | else
37 | return true;
38 | }
39 |
40 | static clearRegCache() {
41 | cacheHelper.remove(RegBiz.CACHE_REG);
42 | }
43 |
44 | /**
45 | * 保存已授权或者填写的信息 phone=电话 user=微信资料 form=填写的表单 invite=邀请信息
46 | * @param {*} key
47 | * @param {*} val
48 | */
49 | static setRegCache(key, val) {
50 | let cache = cacheHelper.get(RegBiz.CACHE_REG);
51 | if (!cache) cache = {};
52 | cache[key] = val;
53 | cacheHelper.set(RegBiz.CACHE_REG, cache, 3600 * 30);
54 | }
55 |
56 | /**
57 | * 获取授权或者填写的信息
58 | * @param {*} key
59 | */
60 | static getRegCache(key) {
61 | let cache = cacheHelper.get(RegBiz.CACHE_REG);
62 | if (cache && cache[key]) return cache[key];
63 | return null;
64 | }
65 |
66 | /**
67 | * 邀请判断
68 | * @param {*} options
69 | */
70 | static async checkInvite(options) {
71 |
72 | // 判断参数
73 | let code = options.code;
74 |
75 | if (options && options.scene) {
76 | code = options.scene;
77 | }
78 | if (!validate.isCheckId(code, 15, 20)) return;
79 |
80 | RegBiz.setRegCache('invite', {
81 | code
82 | });
83 | }
84 |
85 | /**
86 | * 注册第二步
87 | * @param {*} e
88 | */
89 | static async registerStep2(e) {
90 | if (e.detail.errMsg == "getUserInfo:ok") {
91 | let userInfo = e.detail.userInfo;
92 | if (!helper.isDefined(userInfo) || !userInfo)
93 | wx.showToast({
94 | title: '授权失败,请重新授权',
95 | icon: 'none',
96 | duration: 4000
97 | });
98 | else {
99 |
100 | // 存储 用户信息
101 | RegBiz.setRegCache('user', userInfo);
102 | wx.navigateTo({
103 | url: 'reg_step3',
104 | })
105 | }
106 | } else
107 | wx.showToast({
108 | title: '授权失败,请重新授权',
109 | icon: 'none'
110 | });
111 | }
112 |
113 | /**
114 | * 注册第一步
115 | * @param {*} e
116 | */
117 | static async registerStep1(e) {
118 | if (e.detail.errMsg == "getPhoneNumber:ok") {
119 | let cloudID = e.detail.cloudID;
120 | let params = {
121 | cloudID
122 | };
123 | let opt = {
124 | title: '验证中'
125 | };
126 | let phone = await cloudHelper.callCloudData('passport/phone', params, opt);
127 | if (!phone || phone.length < 11)
128 | wx.showToast({
129 | title: '手机号码获取失败,请重新绑定手机号码',
130 | icon: 'none',
131 | duration: 4000
132 | });
133 | else {
134 | // 存储 手机号码
135 | RegBiz.setRegCache('phone', phone);
136 | // 判断是否手机授权
137 |
138 | wx.navigateTo({
139 | url: 'reg_step2',
140 | })
141 | }
142 | } else
143 | wx.showToast({
144 | title: '手机号码获取失败,请重启绑定手机号码',
145 | icon: 'none'
146 | });
147 |
148 | }
149 | }
150 | RegBiz.CACHE_REG = 'CACHE_REG_INFO';
151 |
152 | module.exports = RegBiz;
--------------------------------------------------------------------------------
/miniprogram/biz/search_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 搜索模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | const BaseBiz = require('./base_biz.js');
8 | const cacheHelper = require('../helper/cache_helper.js');
9 |
10 | /**
11 | *
12 | */
13 | class SearchBiz extends BaseBiz {
14 |
15 | static clearHistory(key){
16 | cacheHelper.remove(key);
17 | }
18 |
19 | static getHistory(key)
20 | {
21 | return cacheHelper.get(key, []);
22 |
23 | }
24 |
25 | /**添加关键字缓存
26 | *
27 | * @param {*} key
28 | * @param {*} val
29 | * @param {*} size 个数
30 | * @param {*} expire 过期时间
31 | */
32 | static addHistory(key, val, size = 20, expire = 86400 * 30) {
33 | if (!val || val.length == 0) return [];
34 |
35 | let his = cacheHelper.get(key, []);
36 |
37 | //查询是否存在 并删除
38 | let pos = his.indexOf(val);
39 | if (pos > -1) his.splice(pos, 1);
40 |
41 | // 加到头部
42 | his.unshift(val);
43 |
44 | // 判断个数, 多的删除
45 | if (his.length > size)
46 | his.splice(his.length - 1, 1);
47 |
48 | // 存缓存
49 | cacheHelper.set(key, his, expire);
50 |
51 | return his;
52 | }
53 |
54 | }
55 |
56 | module.exports = SearchBiz;
--------------------------------------------------------------------------------
/miniprogram/cmpts/lib/wxa-plugin-canvas/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/lib/wxa-plugin-canvas/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/lib/wxa-plugin-canvas/index/index.wxss:
--------------------------------------------------------------------------------
1 | .canvas {
2 | width: 750rpx;
3 | height: 750rpx;
4 | }
5 | .canvas.pro {
6 | position: absolute;
7 | bottom: 0;
8 | left: 0;
9 | transform: translate3d(-9999rpx, 0, 0);
10 | }
11 | .canvas.debug {
12 | position: absolute;
13 | bottom: 0;
14 | left: 0;
15 | border: 1rpx solid #ccc;
16 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/lib/wxa-plugin-canvas/poster/index.js:
--------------------------------------------------------------------------------
1 | Component({
2 | properties: {
3 | config: {
4 | type: Object,
5 | value: {},
6 | },
7 | preload: { // 是否预下载图片资源
8 | type: Boolean,
9 | value: false,
10 | },
11 | hideLoading: { // 是否隐藏loading
12 | type: Boolean,
13 | value: false,
14 | }
15 | },
16 | ready() {
17 | if (this.data.preload) {
18 | const poster = this.selectComponent('#poster');
19 | this.downloadStatus = 'doing';
20 | poster.downloadResource(this.data.config).then(() => {
21 | this.downloadStatus = 'success';
22 | this.trigger('downloadSuccess');
23 | }).catch((e) => {
24 | this.downloadStatus = 'fail';
25 | this.trigger('downloadFail', e);
26 | });
27 | }
28 | },
29 | methods: {
30 | trigger(event, data) {
31 | if (this.listener && typeof this.listener[event] === 'function') {
32 | this.listener[event](data);
33 | }
34 | },
35 | once(event, fun) {
36 | if (typeof this.listener === 'undefined') {
37 | this.listener = {};
38 | }
39 | this.listener[event] = fun;
40 | },
41 | downloadResource(reset) {
42 | return new Promise((resolve, reject) => {
43 | if (reset) {
44 | this.downloadStatus = null;
45 | }
46 | const poster = this.selectComponent('#poster');
47 | if (this.downloadStatus && this.downloadStatus !== 'fail') {
48 | if (this.downloadStatus === 'success') {
49 | resolve();
50 | } else {
51 | this.once('downloadSuccess', () => resolve());
52 | this.once('downloadFail', (e) => reject(e));
53 | }
54 | } else {
55 | poster.downloadResource(this.data.config)
56 | .then(() => {
57 | this.downloadStatus = 'success';
58 | resolve();
59 | })
60 | .catch((e) => reject(e));
61 | }
62 | })
63 | },
64 | onCreate(reset = false) {
65 | !this.data.hideLoading && wx.showLoading({ mask: true, title: '生成中' });
66 | return this.downloadResource(typeof reset === 'boolean' && reset).then(() => {
67 | !this.data.hideLoading && wx.hideLoading();
68 | const poster = this.selectComponent('#poster');
69 | poster.create(this.data.config);
70 | })
71 | .catch((err) => {
72 | !this.data.hideLoading && wx.hideLoading();
73 | wx.showToast({ icon: 'none', title: err.errMsg || '生成失败' });
74 | console.error(err);
75 | this.triggerEvent('fail', err);
76 | })
77 | },
78 | onCreateSuccess(e) {
79 | const { detail } = e;
80 | this.triggerEvent('success', detail);
81 | },
82 | onCreateFail(err) {
83 | console.error(err);
84 | this.triggerEvent('fail', err);
85 | }
86 | }
87 | })
--------------------------------------------------------------------------------
/miniprogram/cmpts/lib/wxa-plugin-canvas/poster/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "we-canvas": "../index/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/lib/wxa-plugin-canvas/poster/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/lib/wxa-plugin-canvas/poster/index.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/cmpts/lib/wxa-plugin-canvas/poster/index.wxss
--------------------------------------------------------------------------------
/miniprogram/cmpts/lib/wxa-plugin-canvas/poster/poster.js:
--------------------------------------------------------------------------------
1 | const defaultOptions = {
2 | selector: '#poster'
3 | };
4 |
5 | function Poster(options = {}, that) {
6 | options = {
7 | ...defaultOptions,
8 | ...options,
9 | };
10 |
11 | const pages = getCurrentPages();
12 | let ctx = pages[pages.length - 1];
13 | if (that) ctx = that
14 | const poster = ctx.selectComponent(options.selector);
15 | delete options.selector;
16 |
17 | return poster;
18 | };
19 |
20 | Poster.create = (reset = false, that) => {
21 | const poster = Poster({}, that);
22 | if (!poster) {
23 | console.error('请设置组件的id="poster"!!!');
24 | } else {
25 | return Poster({}, that).onCreate(reset);
26 | }
27 | }
28 |
29 | export default Poster;
30 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/img/img_upload_cmpt.js:
--------------------------------------------------------------------------------
1 | const pageHelper = require('../../../helper/page_helper.js');
2 | const cloudHelper = require('../../../helper/cloud_helper.js');
3 | const contentCheckHelper = require('../../../helper/content_check_helper.js');
4 | const setting = require('../../../helper/setting.js');
5 |
6 | Component({
7 | /**
8 | * 组件的属性列表
9 | */
10 | properties: {
11 | imgList: {
12 | type: Array,
13 | value: []
14 |
15 | },
16 | imgMax: {
17 | type: Number,
18 | value: 4,
19 | },
20 | title: {
21 | type: String,
22 | value: '图片上传',
23 | },
24 | isCheck:{ //是否做图片内容校验
25 | type: Boolean,
26 | value: true,
27 | },
28 | imgUploadSize:{ //图片最大大小
29 | type: Number,
30 | value: setting.IMG_UPLOAD_SIZE,
31 | }
32 | },
33 |
34 | /**
35 | * 组件的初始数据
36 | */
37 | data: {
38 | //imgList:[]
39 | },
40 |
41 |
42 | /**
43 | * 生命周期方法
44 | */
45 | lifetimes: {
46 | attached: function () {
47 |
48 | },
49 |
50 | ready: function () {
51 |
52 | },
53 | detached: function () {
54 | // 在组件实例被从页面节点树移除时执行
55 | },
56 | },
57 |
58 | /**
59 | * 组件的方法列表
60 | */
61 | methods: {
62 | /**
63 | * 选择上传图片
64 | */
65 | bindChooseImgTap: function (e) {
66 | wx.chooseImage({
67 | count: this.data.imgMax - this.data.imgList.length, //默认9
68 | sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
69 | sourceType: ['album', 'camera'], //从相册选择
70 | success: async (res) => {
71 | wx.showLoading({
72 | title: '图片校验中',
73 | mask: true
74 | });
75 |
76 | for (let k = 0; k < res.tempFiles.length; k++) {
77 | let size = res.tempFiles[k].size;
78 | let path = res.tempFiles[k].path;
79 | console.log('size=' + size + ',path=' + path)
80 | if (!contentCheckHelper.imgTypeCheck(path)) {
81 | wx.hideLoading();
82 | return pageHelper.showNoneToast('只能上传png、jpg、jpep格式', 3000);
83 | }
84 |
85 | let imageMaxSize = 1024 * 1000 * this.data.imgUploadSize;
86 | if (!contentCheckHelper.imgSizeCheck(size, imageMaxSize)) {
87 | wx.hideLoading();
88 | return pageHelper.showNoneToast('单张图片大小不能超过 ' + this.data.imgUploadSize + 'M', 3000);
89 | }
90 |
91 |
92 | // 读取文件流,云校验
93 | //let imgData = wx.getFileSystemManager().readFileSync(path, 'base64');
94 |
95 | //console.log('imgData size=' + imgData.length);
96 |
97 | if (this.data.isCheck){
98 | let check = await contentCheckHelper.imgCheck(path);
99 | if (!check) {
100 | wx.hideLoading();
101 | return pageHelper.showNoneToast('存在不合适的图片, 已屏蔽', 3000);
102 | }
103 | }
104 |
105 |
106 | this.setData({
107 | imgList: this.data.imgList.concat(path)
108 | });
109 | this.triggerEvent('myImgUploadEvent', this.data.imgList);
110 |
111 | }
112 |
113 | wx.hideLoading();
114 | }
115 | });
116 | },
117 |
118 | bindPreviewImgTap: function (e) {
119 | wx.previewImage({
120 | urls: this.data.imgList,
121 | current: e.currentTarget.dataset.url
122 | });
123 | },
124 |
125 | /**
126 | * 删除图片
127 | */
128 | catchDelImgTap: function (e) {
129 | let that = this;
130 | let callback = function () {
131 | that.data.imgList.splice(e.currentTarget.dataset.index, 1);
132 | that.setData({
133 | imgList: that.data.imgList
134 | });
135 | that.triggerEvent('myImgUploadEvent', that.data.imgList);
136 | }
137 | pageHelper.showConfirm('确定要删除该图片吗?', callback);
138 | },
139 |
140 | }
141 | })
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/img/img_upload_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/img/img_upload_cmpt.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{title}} (每张大小不超过{{imgUploadSize}}M)
4 |
5 |
6 | {{imgList.length}}/{{imgMax}}
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/img/img_upload_cmpt.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../style/comm/comm.wxss";
2 | @import "../../../style/project/project.wxss";
3 |
4 | @import "../../../style/skin.wxss";
5 |
6 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/list/comm_list_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/list/comm_list_cmpt.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | {{ index==sortIndex && item.items[sortItemIndex] ? item.items[sortItemIndex].label: item.items[0].label}}
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | {{its.label}}
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/list/comm_list_cmpt.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../style/comm/comm.wxss";
2 | @import "../../../style/project/project.wxss";
3 |
4 | @import "../../../style/skin.wxss";
5 |
6 |
7 |
8 |
9 | /*sort*/
10 | .tabs {
11 | display: flex;
12 | font-size: 28rpx;
13 | color: #aaa;
14 | height: 80rpx;
15 | line-height: 80rpx;
16 | }
17 |
18 | .tabs .tab {
19 | flex-grow: 1;
20 | text-align: center;
21 | position: relative;
22 | }
23 |
24 | .tabs .cur{
25 | font-weight:bold;
26 | }
27 |
28 | .tabs .tab-menu.cur:after{
29 | content: " ";
30 | position: absolute;
31 | left: 0;
32 | bottom: 0rpx;
33 | width: 100%;
34 | height: 4rpx;
35 | background-color: #0E9489;
36 | }
37 |
38 | .tabs .icon {
39 | color: #000;
40 | }
41 |
42 |
43 | .sort {
44 | position: absolute;
45 | top: 178rpx;
46 | bottom: 0;
47 | width: 100%;
48 | background-color: rgba(188, 188, 188, 0.3);
49 | z-index: 999;
50 | }
51 |
52 | .sort .sort-item {
53 | border-top: 1px solid #eee;
54 | height: 80rpx;
55 | line-height: 80rpx;
56 | padding-left: 50rpx;
57 | background-color: #fff;
58 | }
59 |
60 |
61 | /**头部*/
62 | .top_bar {
63 | width: 100%;
64 | }
65 |
66 | .top_bar_scroll {
67 | position: fixed;
68 | top: 0rpx;
69 | left: 0;
70 | z-index: 99;
71 | background: #fff;
72 |
73 | z-index: 999;
74 | }
75 |
76 |
77 | .box-list {
78 | display: flex;
79 | flex-direction: column;
80 | height: 100vh;
81 | overflow: hidden;
82 | }
83 |
84 | .box-list-scroll {
85 | flex: 1;
86 | height: 1px;
87 | }
88 |
89 |
90 | .top-button{
91 | position: fixed;
92 | bottom: 50rpx;
93 | right: 30rpx;
94 | opacity: .8 ;
95 | }
96 |
97 | .list-scroll-view{
98 | display: inline-block;
99 | padding: 0 10rpx;
100 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/list/simple_list_cmpt.js:
--------------------------------------------------------------------------------
1 | const cloudHelper = require('../../../helper/cloud_helper.js');
2 | const bizHelper = require('../../../helper/biz_helper.js');
3 | const pageHelper = require('../../../helper/page_helper.js');
4 | const helper = require('../../../helper/helper.js');
5 | const PassportBiz = require('../../../biz/passport_biz.js');
6 |
7 | Component({
8 | options: {
9 | //pureDataPattern: /^_dataList/, // 指定所有 _ 开头的数据字段为纯数据字段
10 | multipleSlots: true // 在组件定义时的选项中启用多slot支持
11 | },
12 |
13 | /**
14 | * 组件的属性列表
15 | */
16 | properties: {
17 | router: { // 业务路由
18 | type: String,
19 | value: ''
20 | },
21 | _params: { //路由的附加参数
22 | type: Object,
23 | value: {}
24 | },
25 | _dataList: {
26 | type: Object,
27 | value: null
28 | },
29 | type: {
30 | type: String, //业务类型 info,user,well
31 | value: ''
32 | },
33 |
34 | whereEx: {
35 | type: Object, // 附加查询条件
36 | value: null,
37 | },
38 |
39 | topBottom: {
40 | type: String, // 回顶部按钮的位置
41 | value: '50'
42 | },
43 |
44 | isCache: {
45 | type: Boolean, //是否cache
46 | value: true
47 | },
48 | skin: {
49 | type: String, // 皮肤
50 | value: ''
51 | },
52 | isLoad: {
53 | type: Boolean, //数据加载中
54 | value: false
55 | },
56 | dataNoHint: {
57 | type: String, //无数据提示
58 | value: '暂无数据'
59 | },
60 | },
61 |
62 | /**
63 | * 组件的初始数据
64 | */
65 | data: {
66 | refresherTriggered: false, //下拉刷新是否完成
67 |
68 | topNum: 0, //回顶部
69 | topShow: false,
70 | },
71 |
72 | lifetimes: {
73 | created: function () {
74 | // 组件实例化,但节点树还未导入,因此这时不能用setData
75 | },
76 | attached: function () {
77 | // 在组件实例进入页面节点树时执行
78 | // 节点树完成,可以用setData渲染节点,但无法操作节点
79 | },
80 | ready: async function () {
81 | PassportBiz.initPage(this);
82 |
83 | // 组件布局完成,这时可以获取节点信息,也可以操作节点
84 | await this._getList(1);
85 | },
86 | move: function () {
87 | // 组件实例被移动到树的另一个位置
88 | },
89 | detached: function () {
90 | // 在组件实例被从页面节点树移除时执行
91 | },
92 | },
93 |
94 | pageLifetimes: {
95 | async show() {
96 | // 页面被展示
97 | if (!this.data.isCache || !bizHelper.isCacheList(this.data.type))
98 | await this._getList(1);
99 | },
100 | hide() {
101 | // 页面被隐藏
102 | },
103 | resize(size) {
104 | // 页面尺寸变化
105 | }
106 | },
107 |
108 | /**
109 | * 组件的方法列表
110 | */
111 | methods: {
112 | reload: async function () {
113 | await this._getList(1);
114 | },
115 | // 数据列表
116 | _getList: async function (page) {
117 |
118 | let params = {
119 | page: page,
120 | ...this.data._params
121 | };
122 | if (this.data.whereEx) params.whereEx = this.data.whereEx;
123 |
124 | if (page == 1 && !this.data._dataList) {
125 | this.triggerEvent('myCommListEvent', {
126 | dataList: null //第一页面且没有数据提示加载中
127 | });
128 | }
129 |
130 |
131 | let opt = {};
132 | //if (this.data._dataList && this.data._dataList.list && this.data._dataList.list.length > 0)
133 | opt.title = 'bar';
134 | await cloudHelper.dataList(this, '_dataList', this.data.router, params, opt);
135 |
136 | this.triggerEvent('myCommListEvent', { //TODO 考虑改为双向数据绑定model
137 | dataList: this.data._dataList
138 | });
139 |
140 | if (this.data.isCache)
141 | bizHelper.setCacheList(this.data.type);
142 | },
143 |
144 | bindReachBottom: async function () {
145 | // 上拉触底
146 | this.setData({
147 | isLoad: true
148 | });
149 | await this._getList(this.data._dataList.page + 1);
150 | this.setData({
151 | isLoad: false
152 | });
153 | },
154 |
155 | }
156 | })
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/list/simple_list_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/list/simple_list_cmpt.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 点击查看更多...
6 |
7 |
10 |
11 |
13 |
14 | {{dataNoHint}}
15 |
16 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/list/simple_list_cmpt.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../style/comm/comm.wxss";
2 | @import "../../../style/project/project.wxss";
3 |
4 | @import "../../../style/skin.wxss";
5 |
6 |
7 |
8 | /**头部*/
9 | .top_bar {
10 | width: 100%;
11 | }
12 |
13 | .top_bar_scroll {
14 | position: fixed;
15 | top: 0rpx;
16 | left: 0;
17 | z-index: 99;
18 | background: #fff;
19 |
20 | z-index: 999;
21 | }
22 |
23 |
24 | .box-list {
25 | display: flex;
26 | flex-direction: column;
27 | flex: 1;
28 | overflow: hidden;
29 | }
30 |
31 | .box-list-scroll {
32 | flex: 1;
33 | height: 1px;
34 | }
35 |
36 |
37 | .top-button{
38 | position: fixed;
39 | bottom: 50rpx;
40 | right: 30rpx;
41 | opacity: .8 ;
42 | }
43 |
44 | .list-scroll-view{
45 | display: inline-block;
46 | padding: 0 10rpx;
47 | }
--------------------------------------------------------------------------------
/miniprogram/helper/biz_helper.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 业务通用
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | const cacheHelper = require('./cache_helper.js');
8 | const setting = require('./setting.js');
9 |
10 | const TYPE = {
11 | //类型 0=用户,1=互助,2=活动 3=相册 4=资讯 5=接龙
12 | USER: 0,
13 | INFO: 1,
14 | MEET: 2,
15 | ALBUM: 3,
16 | NEWS: 4,
17 | GROUP: 5
18 | }
19 |
20 |
21 |
22 | function getSkin(skin) {
23 | for (let k in SKIN) {
24 | if (SKIN[k].def == skin)
25 | return SKIN[k];
26 | }
27 | }
28 |
29 | function getType(type) {
30 | let ret = 0;
31 | switch (type) {
32 | case 'user':
33 | ret = 0;
34 | break;
35 | case 'info':
36 | ret = 1;
37 | break;
38 | case 'meet':
39 | ret = 2;
40 | break;
41 | case 'album':
42 | ret = 3;
43 | break;
44 | case 'news':
45 | ret = 4;
46 | break;
47 | }
48 | return ret;
49 | }
50 |
51 | function isCacheList(key) {
52 | key = key.toUpperCase();
53 | if (setting.CACHE_IS_LIST)
54 | return cacheHelper.get(key + '_LIST');
55 | else
56 | return false;
57 | }
58 |
59 | function removeCacheList(key) {
60 | key = key.toUpperCase();
61 | if (setting.CACHE_IS_LIST)
62 | cacheHelper.remove(key + '_LIST');
63 | }
64 |
65 | function setCacheList(key, time = setting.CACHE_LIST_TIME) {
66 | key = key.toUpperCase();
67 | if (setting.CACHE_IS_LIST)
68 | cacheHelper.set(key + '_LIST', 'TRUE', time);
69 | }
70 |
71 |
72 | module.exports = {
73 | isCacheList,
74 | removeCacheList,
75 | setCacheList,
76 | TYPE,
77 | getType,
78 | getSkin
79 | }
--------------------------------------------------------------------------------
/miniprogram/helper/cache_helper.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 微信缓存二次封装,有设置时效性的封装
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | const TIME_SUFFIX = "_deadtime"
8 |
9 | /**
10 | * 设置
11 | * k 键key
12 | * v 值value
13 | * t 秒
14 | */
15 | function set(k, v, t = 86400 * 30) {
16 | if (!k) return null;
17 |
18 | wx.setStorageSync(k, v);
19 | let seconds = parseInt(t);
20 | if (seconds > 0) {
21 | let newtime = Date.parse(new Date());
22 | newtime = newtime / 1000 + seconds;
23 | wx.setStorageSync(k + TIME_SUFFIX, newtime + "");
24 | } else {
25 | wx.removeStorageSync(k + TIME_SUFFIX);
26 | }
27 | }
28 |
29 |
30 | /**
31 | * 获取
32 | * k 键key
33 | * def 默认值
34 | */
35 | function get(k, def = null) {
36 | if (!k) return null;
37 |
38 | let deadtime = parseInt(wx.getStorageSync(k + TIME_SUFFIX));
39 |
40 | if (deadtime) {
41 | if (parseInt(deadtime) < Date.parse(new Date()) / 1000) {
42 | wx.removeStorageSync(k);
43 | wx.removeStorageSync(k + TIME_SUFFIX);
44 | return def;
45 | }
46 | }
47 |
48 | let res = wx.getStorageSync(k);
49 | if (res) {
50 | return res;
51 | } else {
52 | return def;
53 | }
54 | }
55 |
56 | /**
57 | * 删除
58 | */
59 | function remove(k) {
60 | if (!k) return null;
61 |
62 | wx.removeStorageSync(k);
63 | wx.removeStorageSync(k + TIME_SUFFIX);
64 | }
65 |
66 | /**
67 | * 清除所有key
68 | */
69 | function clear() {
70 | wx.clearStorageSync();
71 | }
72 |
73 | module.exports = {
74 | set,
75 | get,
76 | remove,
77 | clear
78 | }
--------------------------------------------------------------------------------
/miniprogram/helper/comm.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 通用常量
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | module.exports = {
8 | CACHE_TOKEN: 'CACHE_TOKEN', // 登录
9 | CACHE_ADMIN: 'ADMIN_TOKEN', // 管理员登录
10 | }
--------------------------------------------------------------------------------
/miniprogram/helper/content_check_helper.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: UGC内容校验
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY www.code942.com
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | const cloudHelper = require('../helper/cloud_helper.js');
8 | const setting = require('../helper/setting.js');
9 |
10 | /**
11 | * 图片类型校验
12 | * @param {*} fileName
13 | * @param {*} type
14 | */
15 | function imgTypeCheck(path, type = ['jpg', 'jpeg', 'png']) {
16 | let fmt = path.split(".")[(path.split(".")).length - 1];
17 | if (type.indexOf(fmt) > -1)
18 | return true;
19 | else
20 | return false;
21 | }
22 |
23 | /**
24 | * 图片大小校验
25 | * @param {*} size
26 | * @param {*} maxSize
27 | */
28 | function imgSizeCheck(size, maxSize) {
29 | return size < maxSize;
30 | }
31 |
32 | async function imgCheckCloud(path, opt) {
33 |
34 |
35 | /*
36 | let result = await cloudHelper.callCloudSumbit('check/img', params, opt).then(res => {
37 | return true;
38 | }).catch(err => {
39 | return false;
40 | });
41 | */
42 |
43 | let result = await wx.cloud.callFunction({
44 | name: 'cloud',
45 | data: {
46 | router: 'check/img',
47 | token : '',
48 | params:{img: wx.cloud.CDN( {
49 | type: 'filePath',
50 | filePath: path,
51 | })
52 | }
53 | },
54 | success: function (res) {
55 | console.log(res)
56 | console.log('scc')
57 | return true;
58 | },
59 | fail: function (res) {
60 | console.log(res)
61 | return false;
62 | },
63 | complete: function (res) {
64 |
65 | }
66 | });
67 | return result;
68 | }
69 |
70 | /**
71 | * 图像校验
72 | * @param {*} imgData
73 | */
74 | async function imgCheck(imgData) {
75 | if (!setting.CHECK_CONTENT) return true;
76 |
77 | let result = await wx.serviceMarket.invokeService({
78 | service: 'wxee446d7507c68b11',
79 | api: 'imgSecCheck',
80 | data: {
81 | "Action": "ImageModeration",
82 | "Scenes": ["PORN", "POLITICS", "TERRORISM"],
83 | "ImageUrl": new wx.serviceMarket.CDN({
84 | type: 'filePath',
85 | filePath: imgData,
86 | }),
87 | "ImageBase64": '',
88 | "Config": "",
89 | "Extra": ""
90 | },
91 | }).then(res => {
92 | if (res && res.data && res.data.Response &&
93 | res.data.Response.PornResult && res.data.Response.PornResult.Suggestion === 'PASS' &&
94 | res.data.Response.PoliticsResult && res.data.Response.PoliticsResult.Suggestion === 'PASS' &&
95 | res.data.Response.TerrorismResult && res.data.Response.TerrorismResult.Suggestion === 'PASS')
96 | return true;
97 | else
98 | return false;
99 | }).catch(err => {
100 | console.log(err);
101 | return false;
102 | });
103 |
104 | return result;
105 | }
106 |
107 |
108 | module.exports = {
109 | imgCheck,
110 | imgCheckCloud,
111 | imgTypeCheck,
112 | imgSizeCheck
113 | }
--------------------------------------------------------------------------------
/miniprogram/helper/setting.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | CLOUD_ID: 'xxx', // 云环境ID
3 |
4 | CHECK_CONTENT: true, //图片文字是否校验
5 |
6 |
7 | TEST_MODE: false,
8 |
9 | SKIN: 'skin1', //皮肤
10 |
11 | TEST_USER_ID: 'oYyk-5Q4WyAc0DWnqt2x89kfR_y0',
12 | TEST_TOKEN: {
13 | id: 'aa133ce55f4048a400124d2b38b64f60',
14 | name: '刘敏',
15 | pic: '',
16 | status: 1,
17 | type: 1
18 | },
19 |
20 | VER: 'CC校友录Free',
21 |
22 | IMG_UPLOAD_SIZE: 2, //图片上传大小M兆
23 |
24 | IS_OPEN_COMMENT: true, //是否开启评论
25 |
26 | PASSPORT_TOKEN_EXPIRE: 86400, //登录有效时间 秒
27 |
28 | ADMIN_TOKEN_EXPIRE: 3600 * 2, //管理员过期时间2小时有效 秒
29 |
30 | CACHE_IS_LIST: true, //列表是否缓存
31 | CACHE_LIST_TIME: 60 * 30, //列表缓存时间秒
32 |
33 | CHAT_IS_WATCH: true, // 开启聊天观察者监控
34 |
35 | TABBAR_IS_GUEST: true, //是否开启tabbar可游客访问
36 |
37 |
38 | USER_PIC_DIR: 'client/user/pic/', //用户头像图片目录
39 |
40 | AD_PIC_DIR: 'client/ad/pic/', //海报底图图片目录
41 | AD_MAX_PIC: 8, //海报底图上限
42 |
43 | SCHOOL_PIC_DIR: 'client/school/pic/', //校园底图
44 |
45 | INFO_PIC_DIR: 'client/info/pic/', //互助图片目录
46 | INFO_MAX_EXPIRE: 86400 * 60, //互助有效期 秒
47 | INFO_DEFAULT_REGION: ['广东省', '广州市', '越秀区'], //默认区域
48 | INFO_MAX_PIC: 8, //互助图片上限
49 |
50 | MEET_PIC_DIR: 'client/info/pic/', //活动图片目录
51 | MEET_DEFAULT_REGION: ['广东省', '广州市', '越秀区'], //默认区域
52 | MEET_MAX_PIC: 8, //活动图片上限
53 |
54 | ALBUM_PIC_DIR: 'client/album/pic/', //活动图片目录
55 | ALBUM_MAX_PIC: 8, //活动图片上限
56 |
57 | NEWS_PIC_DIR: 'client/news/pic/', //资讯图片目录
58 | NEWS_MAX_PIC: 8, //资讯图片上限
59 |
60 | HOME_CACHE_TIME: 60 * 5, //秒
61 |
62 | CACHE_SETUP: 3600 * 10, //系统全局配置缓存时间 秒
63 |
64 | }
--------------------------------------------------------------------------------
/miniprogram/images/group/logo0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/group/logo0.png
--------------------------------------------------------------------------------
/miniprogram/images/group/logo1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/group/logo1.png
--------------------------------------------------------------------------------
/miniprogram/images/group/logo2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/group/logo2.png
--------------------------------------------------------------------------------
/miniprogram/images/group/logo3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/group/logo3.png
--------------------------------------------------------------------------------
/miniprogram/images/main.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/main.jpg
--------------------------------------------------------------------------------
/miniprogram/images/tabbar/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/tabbar/home.png
--------------------------------------------------------------------------------
/miniprogram/images/tabbar/home_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/tabbar/home_cur.png
--------------------------------------------------------------------------------
/miniprogram/images/tabbar/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/tabbar/info.png
--------------------------------------------------------------------------------
/miniprogram/images/tabbar/info_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/tabbar/info_cur.png
--------------------------------------------------------------------------------
/miniprogram/images/tabbar/meet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/tabbar/meet.png
--------------------------------------------------------------------------------
/miniprogram/images/tabbar/meet_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/tabbar/meet_cur.png
--------------------------------------------------------------------------------
/miniprogram/images/tabbar/my.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/tabbar/my.png
--------------------------------------------------------------------------------
/miniprogram/images/tabbar/my_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/tabbar/my_cur.png
--------------------------------------------------------------------------------
/miniprogram/images/tabbar/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/tabbar/user.png
--------------------------------------------------------------------------------
/miniprogram/images/tabbar/user_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/miniprogram/images/tabbar/user_cur.png
--------------------------------------------------------------------------------
/miniprogram/lib/we-cropper/we-cropper.wxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
10 |
--------------------------------------------------------------------------------
/miniprogram/pages/about/about.js:
--------------------------------------------------------------------------------
1 | const cloudHelper = require('../../helper/cloud_helper.js');
2 | const helper = require('../../helper/helper.js');
3 | const bizHelper = require('../../helper/biz_helper.js');
4 | const pageHelper = require('../../helper/page_helper.js');
5 | const PassportBiz = require('../../biz/passport_biz.js');
6 |
7 | Page({
8 |
9 | /**
10 | * 页面的初始数据
11 | */
12 | data: {
13 | isLoad: false
14 | },
15 |
16 | /**
17 | * 生命周期函数--监听页面加载
18 | */
19 | onLoad: function (options) {
20 | PassportBiz.initPage(this);
21 |
22 | },
23 |
24 | /**
25 | * 生命周期函数--监听页面初次渲染完成
26 | */
27 | onReady: function () {
28 |
29 | },
30 |
31 | /**
32 | * 生命周期函数--监听页面显示
33 | */
34 | onShow: function () {
35 |
36 | },
37 |
38 | /**
39 | * 生命周期函数--监听页面隐藏
40 | */
41 | onHide: function () {
42 |
43 | },
44 |
45 | /**
46 | * 生命周期函数--监听页面卸载
47 | */
48 | onUnload: function () {
49 |
50 | },
51 |
52 | /**
53 | * 页面相关事件处理函数--监听用户下拉动作
54 | */
55 | onPullDownRefresh: function () {
56 | this._loadDetail();
57 | wx.stopPullDownRefresh();
58 | },
59 |
60 |
61 | /**
62 | * 用户点击右上角分享
63 | */
64 | onShareAppMessage: function () {
65 |
66 | },
67 |
68 | url: function (e) {
69 | pageHelper.url(e, this);
70 | }
71 | })
--------------------------------------------------------------------------------
/miniprogram/pages/about/about.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 |
4 | },
5 | "enablePullDownRefresh": true,
6 | "navigationBarTitleText": "关于我们"
7 | }
--------------------------------------------------------------------------------
/miniprogram/pages/about/about.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 关于CC校友录Free版
5 |
6 | CC校友录小程序 是一个采用微信小程序和腾讯云开发技术构建的高效校友录解决方案。
7 |
8 | 使用腾讯云开发技术,免费资源配额,无需域名和服务器即可搭建.
9 |
10 | 小程序在微信里打开,无须下载app,也无须再访问传统的PC站点,随时随地可以和互动.
11 |
12 |
13 |
14 |
15 | 作者主页: http://www.code942.com
16 | 作者微信: cclinux0730
17 |
18 |
19 |
20 |
21 |
22 |
23 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/miniprogram/pages/about/about.wxss:
--------------------------------------------------------------------------------
1 | .main-about{
2 | padding:40rpx;
3 | height:100vh;
4 | display: flex;
5 | flex-direction: column;
6 | justify-content: flex-start;
7 | }
8 |
9 | .main-about .main-content{
10 | width:100%;
11 | flex: 1;
12 | }
13 |
14 | .main-about .content{
15 | width:100%;
16 | background-color: #fff;
17 | padding:50rpx;
18 | border-radius: 20rpx;
19 | margin-top:15rpx;
20 | }
21 |
22 | .main-about .content .title{
23 | width:100%;
24 | text-align: center;
25 | font-size:36rpx;
26 | line-height: 1.8;
27 | margin-bottom: 30rpx;
28 | }
29 |
30 | .main-about .content .txt{
31 | color:#666;
32 | margin-bottom: 30rpx;
33 | font-size:28rpx;
34 | line-height: 1.6;
35 | }
36 |
37 | .main-about .content.content-err{
38 | padding-top:120rpx;
39 | padding-bottom:120rpx;
40 | }
41 |
42 | .main-about .content .err-icon{
43 | text-align: center;
44 | font-size: 150rpx;
45 | }
46 |
47 | .main-about .content .err-info{
48 | text-align: center;
49 | font-size: 30rpx;
50 | color:#666;
51 | }
52 |
53 | .main-about .content .err-apply{
54 | display: flex;
55 | justify-content: center;
56 | align-items: center;
57 | margin-top:60rpx;
58 | }
59 |
60 | .main-about .comm-list{
61 | width:100%;
62 | }
63 |
--------------------------------------------------------------------------------
/miniprogram/pages/about/hint.js:
--------------------------------------------------------------------------------
1 | const pageHelper = require('../../helper/page_helper.js');
2 | const PassportBiz = require('../../biz/passport_biz.js');
3 |
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | type: 0, //0-需要注册提示 1=用户异常提示 2=认证中提示 9=自定义错误
11 | msg: ''
12 | },
13 |
14 | /**
15 | * 生命周期函数--监听页面加载
16 | */
17 | onLoad: function (options) {
18 | PassportBiz.initPage(this);
19 | PassportBiz.setSetup(this);
20 |
21 | let type = 9;
22 | let msg = (options && options.msg) ? decodeURIComponent(options.msg) : '';
23 |
24 | if (options && options.type) type = options.type;
25 |
26 | this.setData({
27 | type,
28 | msg
29 | });
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面初次渲染完成
34 | */
35 | onReady: function () {
36 |
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面显示
41 | */
42 | onShow: function () {
43 |
44 | },
45 |
46 | /**
47 | * 生命周期函数--监听页面隐藏
48 | */
49 | onHide: function () {
50 |
51 | },
52 |
53 | /**
54 | * 生命周期函数--监听页面卸载
55 | */
56 | onUnload: function () {
57 |
58 | },
59 |
60 | url: function (e) {
61 | pageHelper.url(e, this);
62 | }
63 |
64 | })
--------------------------------------------------------------------------------
/miniprogram/pages/about/hint.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 |
4 | },
5 | "navigationBarTitleText": "温馨提示"
6 | }
--------------------------------------------------------------------------------
/miniprogram/pages/about/hint.wxml:
--------------------------------------------------------------------------------
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 |
26 |
27 |
28 | {{msg}}
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/miniprogram/pages/about/hint.wxss:
--------------------------------------------------------------------------------
1 | @import 'about.wxss'
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_add.js:
--------------------------------------------------------------------------------
1 | const cloudHelper = require('../../helper/cloud_helper.js');
2 | const helper = require('../../helper/helper.js');
3 | const validate = require('../../helper/validate.js');
4 | var AlbumBiz = require('../../biz/album_biz.js');
5 | const setting = require('../../helper/setting.js');
6 | const pageHelper = require('../../helper/page_helper.js');
7 | const bizHelper = require('../../helper/biz_helper.js');
8 | const PassportBiz = require('../../biz/passport_biz.js');
9 |
10 | Page({
11 |
12 | /**
13 | * 页面的初始数据
14 | */
15 | data: {
16 |
17 |
18 | },
19 |
20 | /**
21 | * 生命周期函数--监听页面加载
22 | */
23 | onLoad: async function (options) {
24 | PassportBiz.initPage(this);
25 |
26 | if (!await PassportBiz.loginMustRegWin(this)) return;
27 |
28 | this.setData(AlbumBiz.initFormData()); // 初始化表单数据
29 | },
30 |
31 | /**
32 | * 生命周期函数--监听页面初次渲染完成
33 | */
34 | onReady: function () {
35 |
36 | },
37 |
38 | /**
39 | * 生命周期函数--监听页面显示
40 | */
41 | onShow: function () {
42 |
43 | },
44 |
45 | /**
46 | * 生命周期函数--监听页面隐藏
47 | */
48 | onHide: function () {
49 |
50 | },
51 |
52 | /**
53 | * 生命周期函数--监听页面卸载
54 | */
55 | onUnload: function () {
56 |
57 | },
58 |
59 |
60 | model: function (e) {
61 | pageHelper.model(this, e);
62 | },
63 |
64 | /**
65 | * 数据提交
66 | */
67 | bindFormSubmit: async function () {
68 |
69 | let data = this.data;
70 | data.formType = AlbumBiz.TYPE_OPTIONS[data.formTypeIndex];
71 |
72 | // 数据校验
73 | data = validate.check(data, AlbumBiz.CHECK_FORM, this);
74 | if (!data) return;
75 |
76 | try {
77 | // 图片 提交处理
78 | let imgList = this.data.imgList;
79 | if (imgList.length == 0)
80 | {
81 | pageHelper.showModal('至少需要上传一张图片');
82 | return;
83 | }
84 |
85 | // 先创建,再上传
86 | let result = await cloudHelper.callCloudSumbit('album/insert', data);
87 |
88 | wx.showLoading({
89 | title: '提交中...',
90 | mask: true
91 | });
92 |
93 | let albumId = result.data.id;
94 | await AlbumBiz.updateAlbumPic(albumId, imgList);
95 |
96 |
97 | let callback = async function () {
98 | bizHelper.removeCacheList('album');
99 | wx.switchTab({
100 | url: "album_index"
101 | });
102 | }
103 | pageHelper.showSuccToast('发布成功', 2000, callback);
104 |
105 | } catch (err) {
106 | console.log(err);
107 | }
108 |
109 | },
110 |
111 |
112 | bindMyImgUploadListener: function (e) {
113 | this.setData({
114 | imgList: e.detail
115 | });
116 | }
117 |
118 | })
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_add.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-img-upload": "../../cmpts/public/img/img_upload_cmpt"
4 | },
5 | "enablePullDownRefresh":false,
6 | "navigationBarTitleText": "创建相册"
7 | }
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_add.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_add.wxss:
--------------------------------------------------------------------------------
1 | /* miniprogram/pages/album/album_add.wxss */
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | },
4 | "enablePullDownRefresh": true,
5 | "backgroundTextStyle": "dark",
6 | "navigationBarTitleText": "相册浏览"
7 | }
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{album.ALBUM_TITLE}}
10 | {{album.ALBUM_ADD_TIME}} {{album.ALBUM_TYPE}}
11 |
12 |
13 |
14 |
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | 手动翻页
31 | 自动播放
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | {{album.ALBUM_CONTENT}}
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_detail.wxss:
--------------------------------------------------------------------------------
1 | @import "../../style/project/detail.wxss";
2 |
3 |
4 | .album-box {
5 | width: 100%;
6 | height: 700rpx;
7 | display: flex;
8 | flex-direction: column;
9 | justify-content: center;
10 | margin-top: 20rpx;
11 | }
12 |
13 | .article-box .article-album {
14 | position: relative;
15 | }
16 |
17 | .album-box swiper {
18 | width: 100%;
19 | height: 100%;
20 | }
21 |
22 | .album-box image {
23 | width: 100%;
24 | height: 100%;
25 | }
26 |
27 | .article-album .prev {
28 | width: 60rpx;
29 | height: 120rpx;
30 | position: absolute;
31 | top: 50%;
32 | right: 0;
33 | background-color: rgba(0, 0, 0, 0.2);
34 | border-top-left-radius: 80rpx;
35 | border-bottom-left-radius: 80rpx;
36 | padding-left: 15rpx;
37 | }
38 |
39 | .article-album .next {
40 | width: 60rpx;
41 | height: 120rpx;
42 | position: absolute;
43 | top: 50%;
44 | left: 0;
45 | background-color: rgba(0, 0, 0, 0.2);
46 | border-top-right-radius: 80rpx;
47 | border-bottom-right-radius: 80rpx;
48 | padding-right: 15rpx;
49 | }
50 |
51 | .article-album .prev,
52 | .article-album .next {
53 | display: flex;
54 | justify-content: center;
55 | align-items: center;
56 | font-size: 50rpx;
57 | }
58 |
59 | .article-album .hand {
60 | position: absolute;
61 | bottom: 0;
62 | right: 0;
63 | width: 160rpx;
64 | line-height: 1.8;
65 | font-size: 28rpx;
66 | text-align: center;
67 | background-color: #f2f2f2;
68 | border-radius: 20rpx 0 20rpx 0;
69 | }
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_edit.js:
--------------------------------------------------------------------------------
1 | const cloudHelper = require('../../helper/cloud_helper.js');
2 | const helper = require('../../helper/helper.js');
3 | const validate = require('../../helper/validate.js');
4 | const AlbumBiz = require('../../biz/album_biz.js');
5 | const pageHelper = require('../../helper/page_helper.js');
6 | const bizHelper = require('../../helper/biz_helper.js');
7 | const PassportBiz = require('../../biz/passport_biz.js');
8 |
9 | Page({
10 |
11 | /**
12 | * 页面的初始数据
13 | */
14 | data: {
15 | isLoad: false
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面加载
20 | */
21 | onLoad: async function (options) {
22 | PassportBiz.initPage(this);
23 |
24 | if (!await PassportBiz.loginMustRegWin(this)) return;
25 | if (!pageHelper.getId(this, options)) return;
26 |
27 | this._loadDetail(this.data.id);
28 |
29 | },
30 |
31 | _loadDetail: async function (id) {
32 | if (!this.data.isLoad) this.setData(AlbumBiz.initFormData(id)); // 初始化表单数据
33 |
34 | let params = {
35 | id
36 | };
37 | let opt = {
38 | hint: false
39 | };
40 | let album = await cloudHelper.callCloudData('album/my_detail', params, opt);
41 | if (!album) {
42 | return;
43 | };
44 |
45 | let formTypeIndex = AlbumBiz.TYPE_OPTIONS.indexOf(album.ALBUM_TYPE);
46 | formTypeIndex = (formTypeIndex < 0) ? 0 : formTypeIndex;
47 |
48 | this.setData({
49 | isLoad: true,
50 |
51 | imgList: album.ALBUM_PIC,
52 |
53 | // 表单数据
54 | formType: album.ALBUM_TYPE,
55 | formTypeIndex,
56 |
57 | formTitle: album.ALBUM_TITLE,
58 | formContent: album.ALBUM_CONTENT,
59 | });
60 | },
61 |
62 | /**
63 | * 生命周期函数--监听页面初次渲染完成
64 | */
65 | onReady: function () {
66 |
67 | },
68 |
69 | /**
70 | * 生命周期函数--监听页面显示
71 | */
72 | onShow: function () {
73 |
74 | },
75 |
76 | /**
77 | * 生命周期函数--监听页面隐藏
78 | */
79 | onHide: function () {
80 |
81 | },
82 |
83 | /**
84 | * 生命周期函数--监听页面卸载
85 | */
86 | onUnload: function () {
87 |
88 | },
89 |
90 | /**
91 | * 页面相关事件处理函数--监听用户下拉动作
92 | */
93 | onPullDownRefresh: async function () {
94 | await this._loadDetail(this.data.id);
95 | wx.stopPullDownRefresh();
96 | },
97 |
98 | model: function (e) {
99 | pageHelper.model(this, e);
100 | },
101 |
102 | /**
103 | * 数据提交
104 | */
105 | bindFormSubmit: async function () {
106 |
107 | let data = this.data;
108 | data.formType = AlbumBiz.TYPE_OPTIONS[data.formTypeIndex];
109 |
110 | // 数据校验
111 | data = validate.check(data, AlbumBiz.CHECK_FORM, this);
112 | if (!data) return;
113 | data.desc = helper.fmtText(data.content, 100);
114 |
115 | try {
116 | let albumId = this.data.id;
117 | data.id = albumId;
118 |
119 | // 图片 提交处理
120 | let imgList = this.data.imgList;
121 | if (imgList.length == 0)
122 | {
123 | pageHelper.showModal('至少需要上传一张图片');
124 | return;
125 | }
126 |
127 |
128 | // 先修改,再上传
129 | await cloudHelper.callCloudSumbit('album/edit', data);
130 |
131 | // 图片 提交处理
132 | wx.showLoading({
133 | title: '提交中...',
134 | mask: true
135 | });
136 |
137 | await AlbumBiz.updateAlbumPic(albumId, imgList);
138 |
139 | let callback = function () {
140 |
141 | // 更新列表页面数据
142 | pageHelper.modifyPrevPageListNode(albumId, 'ALBUM_TITLE', data.title);
143 | pageHelper.modifyPrevPageListNode(albumId, 'ALBUM_DESC', data.desc);
144 | pageHelper.modifyPrevPageListNode(albumId, 'ALBUM_PIC', imgList);
145 |
146 | wx.redirectTo({
147 | url: "album_detail?id=" + albumId
148 | });
149 | }
150 | pageHelper.showSuccToast('编辑成功', 2000, callback);
151 |
152 | } catch (err) {
153 | console.log(err);
154 | }
155 |
156 | },
157 |
158 | bindMyImgUploadListener: function (e) {
159 | this.setData({
160 | imgList: e.detail
161 | });
162 | }
163 |
164 | })
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_edit.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-img-upload": "../../cmpts/public/img/img_upload_cmpt"
4 | },
5 | "enablePullDownRefresh": true,
6 | "backgroundTextStyle": "dark",
7 | "navigationBarTitleText": "编辑相册信息"
8 | }
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_edit.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_edit.wxss:
--------------------------------------------------------------------------------
1 | /* miniprogram/pages/album/album_edit.wxss */
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_form_tpl.wxml:
--------------------------------------------------------------------------------
1 |
2 |
47 |
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_index.js:
--------------------------------------------------------------------------------
1 | const AlbumBiz = require('../../biz/album_biz.js');
2 | const pageHelper = require('../../helper/page_helper.js');
3 | const PassportBiz = require('../../biz/passport_biz.js');
4 | const setting = require('../../helper/setting.js');
5 |
6 | Page({
7 |
8 | /**
9 | * 页面的初始数据
10 | */
11 | data: {
12 |
13 | },
14 |
15 | /**
16 | * 生命周期函数--监听页面加载
17 | */
18 | onLoad: async function (options) {
19 | PassportBiz.initPage(this);
20 |
21 | this.setData({
22 | isOpenComment: setting.IS_OPEN_COMMENT
23 | });
24 |
25 | //设置搜索菜单
26 | this.setData(AlbumBiz.getSearchMenu());
27 | },
28 |
29 | /**
30 | * 生命周期函数--监听页面初次渲染完成
31 | */
32 | onReady: function () {},
33 |
34 | /**
35 | * 生命周期函数--监听页面显示
36 | */
37 | onShow: async function () {
38 | if (!setting.TABBAR_IS_GUEST) {
39 | if (!await PassportBiz.loginMustRegWin(this)) return;
40 | }
41 | else {
42 | PassportBiz.loginSilence(this);
43 | this.setData({isLogin:true});
44 | }
45 |
46 | },
47 |
48 | /**
49 | * 生命周期函数--监听页面隐藏
50 | */
51 | onHide: function () {
52 |
53 | },
54 |
55 | /**
56 | * 生命周期函数--监听页面卸载
57 | */
58 | onUnload: function () {
59 |
60 | },
61 |
62 | url: async function (e) {
63 | pageHelper.url(e);
64 | },
65 |
66 | myCommListListener: function (e) {
67 | pageHelper.commListListener(this, e);
68 | },
69 |
70 | })
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-comm-list": "../../../cmpts/public/list/comm_list_cmpt"
4 | },
5 | "enablePullDownRefresh": false,
6 | "disableScroll": true,
7 | "backgroundTextStyle": "dark",
8 | "navigationBarTitleText": "相册"
9 | }
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | {{index+1}}.
16 | {{item.ALBUM_TITLE}}
17 | new
18 | hot
19 | 置顶
20 |
21 |
22 |
23 |
26 |
27 | {{item.USER_DETAIL.USER_NAME}} ({{item.USER_DETAIL.USER_ITEM}})
28 |
29 |
30 | {{item.ALBUM_DESC}}
31 |
33 |
34 |
35 |
36 |
38 |
39 |
40 |
41 |
42 | {{item.ALBUM_TYPE}}
43 |
44 | {{item.ALBUM_VIEW_CNT}}阅读
45 |
46 |
47 |
48 | {{item.ALBUM_COMMENT_CNT}}
49 |
50 |
51 |
52 | {{item.ALBUM_FAV_CNT}}
53 |
54 |
55 | {{item.ALBUM_LIKE_CNT}}
56 |
57 | {{item.ALBUM_ADD_TIME}}
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/miniprogram/pages/album/album_index.wxss:
--------------------------------------------------------------------------------
1 | @import "../../style/project/article_list.wxss";
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_add.js:
--------------------------------------------------------------------------------
1 | const cloudHelper = require('../../helper/cloud_helper.js');
2 | const helper = require('../../helper/helper.js');
3 | const validate = require('../../helper/validate.js');
4 | var InfoBiz = require('../../biz/info_biz.js');
5 | const setting = require('../../helper/setting.js');
6 | const pageHelper = require('../../helper/page_helper.js');
7 | const bizHelper = require('../../helper/biz_helper.js');
8 | const PassportBiz = require('../../biz/passport_biz.js');
9 |
10 | Page({
11 |
12 | /**
13 | * 页面的初始数据
14 | */
15 | data: {
16 |
17 |
18 | },
19 |
20 | /**
21 | * 生命周期函数--监听页面加载
22 | */
23 | onLoad: async function (options) {
24 | PassportBiz.initPage(this);
25 |
26 | if (!await PassportBiz.loginMustRegWin(this)) return;
27 |
28 | this.setData(InfoBiz.initFormData()); // 初始化表单数据
29 | let formExpireTime = helper.timestamp2Time(helper.time() + 86400 * 1000 * 30, 'Y-M-D');
30 | this.setData({formExpireTime});
31 | },
32 |
33 | /**
34 | * 生命周期函数--监听页面初次渲染完成
35 | */
36 | onReady: function () {
37 |
38 | },
39 |
40 | /**
41 | * 生命周期函数--监听页面显示
42 | */
43 | onShow: function () {
44 |
45 | },
46 |
47 | /**
48 | * 生命周期函数--监听页面隐藏
49 | */
50 | onHide: function () {
51 |
52 | },
53 |
54 | /**
55 | * 生命周期函数--监听页面卸载
56 | */
57 | onUnload: function () {
58 |
59 | },
60 |
61 |
62 | model: function (e) {
63 | pageHelper.model(this, e);
64 | },
65 |
66 | /**
67 | * 数据提交
68 | */
69 | bindFormSubmit: async function () {
70 |
71 | let data = this.data;
72 | data.formType = InfoBiz.TYPE_OPTIONS[data.formTypeIndex];
73 |
74 | // 数据校验
75 | data = validate.check(data, InfoBiz.CHECK_FORM, this);
76 | if (!data) return;
77 |
78 | try {
79 | // 先创建,再上传
80 | let result = await cloudHelper.callCloudSumbit('info/insert', data);
81 |
82 | // 图片 提交处理
83 | let imgList = this.data.imgList;
84 | if (imgList.length > 0) {
85 | wx.showLoading({
86 | title: '提交中...',
87 | mask: true
88 | });
89 |
90 | let infoId = result.data.id;
91 | await InfoBiz.updateInfoPic(infoId, imgList);
92 | }
93 |
94 | let callback = async function () {
95 | bizHelper.removeCacheList('info');
96 | wx.switchTab({
97 | url: "info_index"
98 | });
99 | }
100 | pageHelper.showSuccToast('发布成功', 2000, callback);
101 |
102 | } catch (err) {
103 | console.log(err);
104 | }
105 |
106 | },
107 |
108 |
109 | bindMyImgUploadListener: function (e) {
110 | this.setData({
111 | imgList: e.detail
112 | });
113 | }
114 |
115 | })
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_add.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-img-upload": "../../cmpts/public/img/img_upload_cmpt"
4 | },
5 | "enablePullDownRefresh":false,
6 | "navigationBarTitleText": "发布互助"
7 | }
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_add.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_add.wxss:
--------------------------------------------------------------------------------
1 | /* miniprogram/pages/info/info_add.wxss */
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_detail.js:
--------------------------------------------------------------------------------
1 | const cloudHelper = require('../../helper/cloud_helper.js');
2 | const helper = require('../../helper/helper.js');
3 | const bizHelper = require('../../helper/biz_helper.js');
4 | const pageHelper = require('../../helper/page_helper.js');
5 | const PassportBiz = require('../../biz/passport_biz.js');
6 | const FootBiz = require('../../biz/foot_biz.js');
7 |
8 |
9 | Page({
10 |
11 | /**
12 | * 页面的初始数据
13 | */
14 | data: {
15 | isLoad: false,
16 | isEdit: false
17 | },
18 |
19 | /**
20 | * 生命周期函数--监听页面加载
21 | */
22 | onLoad: async function (options) {
23 | PassportBiz.initPage(this);
24 |
25 | if (!await PassportBiz.loginMustRegWin(this)) return;
26 | if (!pageHelper.getId(this, options)) return;
27 |
28 | this._loadDetail();
29 |
30 | },
31 |
32 | _loadDetail: async function () {
33 | let id = this.data.id;
34 | if (!id) return;
35 |
36 | let params = {
37 | id,
38 | };
39 | let opt = {
40 | hint: false
41 | };
42 | let info = await cloudHelper.callCloudData('info/view', params, opt);
43 | if (!info) {
44 | this.setData({
45 | isLoad: null
46 | })
47 | return;
48 | }
49 |
50 | this.setData({
51 | isLoad: true,
52 | info,
53 | isEdit: (info.INFO_USER_ID === PassportBiz.getUserId()),
54 |
55 | });
56 |
57 | // 足迹
58 | FootBiz.addFoot(id, bizHelper.TYPE.INFO, info.INFO_TITLE);
59 | },
60 |
61 | /**
62 | * 生命周期函数--监听页面初次渲染完成
63 | */
64 | onReady: function () {},
65 |
66 | /**
67 | * 生命周期函数--监听页面显示
68 | */
69 | onShow: function () {
70 |
71 | },
72 |
73 | /**
74 | * 生命周期函数--监听页面隐藏
75 | */
76 | onHide: function () {
77 |
78 | },
79 |
80 | /**
81 | * 生命周期函数--监听页面卸载
82 | */
83 | onUnload: function () {
84 |
85 | },
86 |
87 | /**
88 | * 页面相关事件处理函数--监听用户下拉动作
89 | */
90 | onPullDownRefresh: async function () {
91 | await this._loadDetail();
92 | wx.stopPullDownRefresh();
93 | },
94 |
95 |
96 | url: function (e) {
97 | pageHelper.url(e);
98 | },
99 |
100 | onPageScroll: function (e) {
101 | // 回页首按钮
102 | pageHelper.showTopBtn(e, this);
103 |
104 | },
105 |
106 | top: function (e) {
107 | // 回页首事件
108 | pageHelper.top();
109 | },
110 |
111 | /**
112 | * 编辑
113 | */
114 | bindEditTap: function (e) {
115 | wx.redirectTo({
116 | url: 'info_edit?id=' + this.data.id,
117 | });
118 | },
119 |
120 | /**
121 | * 删除
122 | */
123 | bindDelTap: async function (e) {
124 | if (!await PassportBiz.loginMustRegWin(this)) return;
125 |
126 | let id = this.data.id;
127 | let callback = async function () {
128 | await cloudHelper.callCloudSumbit('info/del', {
129 | id
130 | }).then(res => {
131 | pageHelper.delPrevPageListNode(id);
132 | pageHelper.showSuccToast('删除成功', 1500, function () {
133 | wx.switchTab({
134 | url: 'info_index',
135 | });
136 | })
137 | }).catch(err => {});
138 | }
139 |
140 | pageHelper.showConfirm('您确认删除?删除后不可恢复', callback);
141 | },
142 |
143 | /**
144 | * 用户点击右上角分享
145 | */
146 | onShareAppMessage: function (res) {
147 | return {
148 | title: this.data.info.INFO_TITLE,
149 | path: '/pages/info/info_detail?id=' + this.data.id,
150 | }
151 | },
152 |
153 |
154 | })
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | },
4 | "enablePullDownRefresh": true,
5 | "backgroundTextStyle": "dark",
6 | "navigationBarTitleText": "互助详情"
7 | }
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{info.INFO_TITLE}}
10 | {{info.INFO_ADD_TIME}} {{info.INFO_TYPE}}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | 地区:{{info.INFO_REGION}}
19 | 有效期至:{{info.INFO_EXPIRE_TIME}}
20 |
21 |
22 |
23 | {{info.INFO_CONTENT}}
24 |
25 |
26 |
27 |
28 |
29 |
31 |
32 |
33 |
34 |
35 | {{info.INFO_ADD_TIME}} {{info.INFO_TYPE}}
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_detail.wxss:
--------------------------------------------------------------------------------
1 | @import "../../style/project/detail.wxss";
2 |
3 |
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_edit.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-img-upload": "../../cmpts/public/img/img_upload_cmpt"
4 | },
5 | "enablePullDownRefresh": true,
6 | "backgroundTextStyle": "dark",
7 | "navigationBarTitleText": "编辑互助信息"
8 | }
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_edit.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_edit.wxss:
--------------------------------------------------------------------------------
1 | /* miniprogram/pages/info/info_edit.wxss */
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_form_tpl.wxml:
--------------------------------------------------------------------------------
1 |
2 |
65 |
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_index.js:
--------------------------------------------------------------------------------
1 | const InfoBiz = require('../../biz/info_biz.js');
2 | const pageHelper = require('../../helper/page_helper.js');
3 | const PassportBiz = require('../../biz/passport_biz.js');
4 | const setting = require('../../helper/setting.js');
5 |
6 | Page({
7 |
8 | /**
9 | * 页面的初始数据
10 | */
11 | data: {
12 |
13 | },
14 |
15 | /**
16 | * 生命周期函数--监听页面加载
17 | */
18 | onLoad: async function (options) {
19 | PassportBiz.initPage(this);
20 |
21 | this.setData({
22 | isOpenComment: setting.IS_OPEN_COMMENT
23 | });
24 |
25 | //设置搜索菜单
26 | this.setData(InfoBiz.getSearchMenu());
27 | },
28 |
29 | /**
30 | * 生命周期函数--监听页面初次渲染完成
31 | */
32 | onReady: function () {},
33 |
34 | /**
35 | * 生命周期函数--监听页面显示
36 | */
37 | onShow: async function () {
38 | if (!setting.TABBAR_IS_GUEST) {
39 | if (!await PassportBiz.loginMustRegWin(this)) return;
40 | }
41 | else {
42 | PassportBiz.loginSilence(this);
43 | this.setData({isLogin:true});
44 | }
45 |
46 | },
47 |
48 | /**
49 | * 生命周期函数--监听页面隐藏
50 | */
51 | onHide: function () {
52 |
53 | },
54 |
55 | /**
56 | * 生命周期函数--监听页面卸载
57 | */
58 | onUnload: function () {
59 |
60 | },
61 |
62 | url: async function (e) {
63 | pageHelper.url(e);
64 | },
65 |
66 | myCommListListener: function (e) {
67 | pageHelper.commListListener(this, e);
68 | },
69 |
70 | })
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-comm-list": "../../../cmpts/public/list/comm_list_cmpt"
4 | },
5 | "enablePullDownRefresh": false,
6 | "disableScroll": true,
7 | "backgroundTextStyle": "dark",
8 | "navigationBarTitleText": "互助信息"
9 | }
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | 已过期
15 |
16 | {{index+1}}.
17 | {{item.INFO_TITLE}}
18 | new
19 | hot
20 | 置顶
21 |
22 |
23 |
24 |
27 |
28 | {{item.USER_DETAIL.USER_NAME}} ({{item.USER_DETAIL.USER_ITEM}})
29 |
30 |
31 | {{item.INFO_DESC}}
32 |
34 |
35 |
36 |
37 | {{item.INFO_TYPE}}
38 |
39 | {{item.INFO_VIEW_CNT}}阅读
40 |
41 |
42 |
43 | {{item.INFO_COMMENT_CNT}}
44 |
45 |
46 |
47 | {{item.INFO_FAV_CNT}}
48 |
49 |
50 | {{item.INFO_LIKE_CNT}}
51 |
52 | {{item.INFO_ADD_TIME}}
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/miniprogram/pages/info/info_index.wxss:
--------------------------------------------------------------------------------
1 | @import "../../style/project/article_list.wxss";
--------------------------------------------------------------------------------
/miniprogram/pages/my/ad/my_ad.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {"poster": "../../../cmpts/lib/wxa-plugin-canvas/poster"},
3 | "navigationBarTitleText": "为母校代言"
4 | }
--------------------------------------------------------------------------------
/miniprogram/pages/my/ad/my_ad.wxml:
--------------------------------------------------------------------------------
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 | - 分享至 -
26 |
27 |
31 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/miniprogram/pages/my/ad/my_ad.wxss:
--------------------------------------------------------------------------------
1 | .ceshi_swiper {
2 | width: 599rpx;
3 | margin: 10rpx auto;
4 | position: relative;
5 | }
6 |
7 | .ceshi_prew text {
8 | color: #fff;
9 | font-size: 60rpx;
10 | float: left;
11 | margin-top: 25rpx;
12 | margin-left: -5rpx;
13 | }
14 |
15 | .ceshi_next text {
16 | color: #fff;
17 | font-size: 60rpx;
18 | display: block;
19 | float: right;
20 | margin-top: 25rpx;
21 | margin-right: -5rpx;
22 | }
23 |
24 | .ceshi_next {
25 | width: 60rpx;
26 | height: 120rpx;
27 | position: absolute;
28 | top: 300rpx;
29 | right: 0rpx;
30 | background-color: rgba(0, 0, 0, 0.2);
31 | border-top-left-radius: 80rpx;
32 | border-bottom-left-radius: 80rpx;
33 | }
34 |
35 | .ceshi_prew {
36 | width: 60rpx;
37 | height: 120rpx;
38 | position: absolute;
39 | top: 300rpx;
40 | left: 0rpx;
41 | background-color: rgba(0, 0, 0, 0.2);
42 | border-top-right-radius: 80rpx;
43 | border-bottom-right-radius: 80rpx;
44 | }
45 |
46 | .zuopin_qh {
47 | float: left;
48 | }
49 |
50 | .read_kecheng {
51 | background: #fff;
52 | }
53 |
54 | .zuopin {
55 | overflow: hidden;
56 | margin: 10rpx auto;
57 | background: #fff;
58 | width: 610rpx;
59 | padding-top: 10rpx;
60 | padding-bottom: 10rpx;
61 | }
62 |
63 | .zuopin_qh {
64 | margin-left: 15rpx;
65 | margin-right: 15rpx;
66 | }
67 |
68 | .zuopin_qh image {
69 | box-shadow: 0 0 10px #dadada;
70 | }
71 |
72 | .zuopinr {
73 | background: #f2b91c;
74 | width: 48rpx;
75 | height: 48rpx;
76 | border-radius: 48rpx;
77 | color: #fff;
78 | font-size: 35rpx;
79 | text-align: center;
80 | right: 20rpx;
81 | position: absolute;
82 | top: 160rpx;
83 | }
84 |
85 | .zuopinl {
86 | background: #f2b91c;
87 | width: 48rpx;
88 | height: 48rpx;
89 | border-radius: 48rpx;
90 | color: #fff;
91 | font-size: 35rpx;
92 | text-align: center;
93 | left: 20rpx;
94 | position: absolute;
95 | top: 160rpx;
96 | }
97 |
98 | .zuopin_read {
99 | position: relative;
100 | }
101 |
102 | swiper.zuopin_read_swiper {
103 | height: 500rpx;
104 | }
105 |
106 | swiper.zuopin_read_swiper {
107 | height: 500rpx;
108 | }
109 |
110 | .ceshi_swiper image {
111 | width: 599rpx;
112 | height: 323rpx;
113 | }
114 |
115 | .ceshi_swiper2 image {
116 | width: 626rpx;
117 | height: 337rpx;
118 | }
119 |
120 | swiper.ceshi_swiper_s {
121 | height: 337rpx;
122 | }
123 |
124 | swiper.read_swiper {
125 | height: 323rpx;
126 |
127 | }
128 |
129 | .swiper-item {
130 | display: flex;
131 | justify-content: center;
132 | align-items: center;
133 | width: 100%;
134 | }
--------------------------------------------------------------------------------
/miniprogram/pages/my/album/my_album.js:
--------------------------------------------------------------------------------
1 | const pageHelper = require('../../../helper/page_helper.js');
2 | const PassportBiz = require('../../../biz/passport_biz.js');
3 | const cloudHelper = require('../../../helper/cloud_helper.js');
4 |
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 |
12 | },
13 |
14 | /**
15 | * 生命周期函数--监听页面加载
16 | */
17 | onLoad: async function (options) {
18 | PassportBiz.initPage(this);
19 | if (!await PassportBiz.loginMustReturnWin(this)) return;
20 | },
21 |
22 | /**
23 | * 生命周期函数--监听页面初次渲染完成
24 | */
25 | onReady: function () {
26 |
27 | },
28 |
29 | /**
30 | * 生命周期函数--监听页面显示
31 | */
32 | onShow: function () {
33 |
34 | },
35 |
36 | /**
37 | * 生命周期函数--监听页面隐藏
38 | */
39 | onHide: function () {
40 |
41 | },
42 |
43 | /**
44 | * 生命周期函数--监听页面卸载
45 | */
46 | onUnload: function () {
47 |
48 | },
49 |
50 | url: async function (e) {
51 | pageHelper.url(e);
52 | },
53 |
54 | myCommListListener: function (e) {
55 | pageHelper.commListListener(this, e);
56 | },
57 |
58 | bindDelTap: function (e) {
59 | let that = this;
60 | let callback = async function () {
61 | let id = e.currentTarget.dataset.id;
62 | if (!id) return;
63 | await cloudHelper.callCloudSumbit('album/del', {
64 | id
65 | }).then(res => {
66 | pageHelper.delListNode(id, that.data.dataList.list);
67 | that.setData({
68 | dataList: that.data.dataList
69 | });
70 | }).catch(err => {});
71 | }
72 |
73 | pageHelper.showConfirm('您确认删除?删除后不可恢复', callback);
74 | }
75 | })
--------------------------------------------------------------------------------
/miniprogram/pages/my/album/my_album.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-comm-list": "../../../cmpts/public/list/comm_list_cmpt"
4 | },
5 | "enablePullDownRefresh": false,
6 | "disableScroll": true,
7 | "backgroundTextStyle": "dark",
8 | "navigationBarTitleText": "我创建的相册"
9 | }
--------------------------------------------------------------------------------
/miniprogram/pages/my/album/my_album.wxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
9 |
10 |
11 |
12 |
13 |
14 |
16 | 已过期
17 |
18 | {{item.ALBUM_TITLE}}
19 | new
20 | hot
21 | 置顶
23 |
24 |
25 |
26 | {{item.ALBUM_TYPE}}
27 |
28 | {{item.ALBUM_VIEW_CNT}}阅读
29 |
30 |
31 | {{item.ALBUM_COMMENT_CNT}}
32 |
33 |
34 | {{item.ALBUM_FAV_CNT}}
35 |
36 |
37 | {{item.ALBUM_LIKE_CNT}}
38 |
39 |
40 |
41 |
42 | 发布时间:{{item.ALBUM_ADD_TIME}}
43 |
44 |
45 |
46 |
47 |
49 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/miniprogram/pages/my/album/my_album.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../style/project/article_list.wxss";
--------------------------------------------------------------------------------
/miniprogram/pages/my/base/my_avatar.js:
--------------------------------------------------------------------------------
1 | import WeCropper from '../../../lib/we-cropper/we-cropper.js'
2 | const PassportBiz = require('../../../biz/passport_biz.js');
3 | const UserBiz = require('../../../biz/user_biz.js');
4 | const pageHelper = require('../../../helper/page_helper.js');
5 |
6 | const device = wx.getSystemInfoSync()
7 | const width = device.windowWidth
8 | const height = device.windowHeight - 50
9 |
10 | Page({
11 | data: {
12 | formId: '',
13 | source: 'my_base',
14 | cropperOpt: {
15 | id: 'cropper',
16 | targetId: 'targetCropper',
17 | pixelRatio: device.pixelRatio,
18 | width,
19 | height,
20 | scale: 2.5,
21 | zoom: 8,
22 | cut: {
23 | x: (width - 300) / 2,
24 | y: (height - 300) / 2,
25 | width: 300,
26 | height: 300
27 | },
28 | boundStyle: {
29 | color: '#04b00f',
30 | mask: 'rgba(0,0,0,0.8)',
31 | lineWidth: 1
32 | }
33 | }
34 | },
35 |
36 | onLoad: async function (options) {
37 | PassportBiz.initPage(this);
38 |
39 | if (!await PassportBiz.loginMustReturnWin(this)) return;
40 |
41 | if (!options || !options.id || !options.src) return;
42 |
43 | if (options.source) {
44 | this.setData({
45 | source: options.source
46 | });
47 | }
48 |
49 | this.setData({
50 | formId: options.id
51 | });
52 |
53 | const {
54 | cropperOpt
55 | } = this.data;
56 | cropperOpt.src = options.src;
57 | this.cropper = new WeCropper(cropperOpt)
58 | .on('ready', (ctx) => {
59 | //console.log(`wecropper is ready for work!`)
60 | })
61 | .on('beforeImageLoad', (ctx) => {
62 | //console.log(`before picture loaded, i can do something`)
63 | //console.log(`current canvas context:`, ctx)
64 | wx.showToast({
65 | title: '上传中',
66 | icon: 'loading',
67 | duration: 20000
68 | });
69 | })
70 | .on('imageLoad', (ctx) => {
71 | //console.log(`picture loaded`)
72 | //console.log(`current canvas context:`, ctx)
73 | wx.hideToast();
74 | })
75 | .on('beforeDraw', (ctx, instance) => {
76 | //console.log(`before canvas draw,i can do something`)
77 | //console.log(`current canvas context:`, ctx)
78 | })
79 |
80 | },
81 |
82 | touchStart: function (e) {
83 | this.cropper.touchStart(e);
84 | },
85 | touchMove: function (e) {
86 | this.cropper.touchMove(e);
87 | },
88 | touchEnd: function (e) {
89 | this.cropper.touchEnd(e);
90 | },
91 |
92 | getCropperImage: async function () {
93 | let that = this;
94 | wx.showLoading({
95 | title: '头像上传中',
96 | });
97 | this.cropper.getCropperImage(async function (path, err) {
98 | if (err) {
99 | wx.showModal({
100 | title: '温馨提示',
101 | content: err.message
102 | });
103 | } else {
104 | //上传逻辑
105 | await UserBiz.uploadAvatar(path, that.data.source, that.data.formId);
106 | }
107 | })
108 |
109 | },
110 |
111 | uploadTap: function () {
112 | let that = this;
113 | wx.chooseImage({
114 | count: 1, // 默认9
115 | sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
116 | sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
117 | success(res) {
118 | const src = res.tempFilePaths[0];
119 | // 获取裁剪图片资源后,给data添加src属性及其值
120 | that.cropper.pushOrign(src);
121 | }
122 | })
123 | },
124 |
125 | })
--------------------------------------------------------------------------------
/miniprogram/pages/my/base/my_avatar.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "上传头像",
3 | "disableScroll": true
4 | }
--------------------------------------------------------------------------------
/miniprogram/pages/my/base/my_avatar.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 上传图片
9 |
10 |
11 | 确定提交
12 |
13 |
14 |
--------------------------------------------------------------------------------
/miniprogram/pages/my/base/my_avatar.wxss:
--------------------------------------------------------------------------------
1 | .cropper-wrapper{
2 | padding:0;
3 | display: flex;
4 | flex-direction: column;
5 | height:100vh;
6 | background-color: rgba(0, 0, 0, 1);
7 | }
8 |
9 | .cropper-wrapper .cropper{
10 | position: absolute;
11 | top: 0;
12 | left: 0;
13 | }
14 |
15 | .cropper-wrapper .pic-box{
16 | flex:1;
17 | padding:0;
18 | }
19 |
20 | .cropper-wrapper .cropper-buttons{
21 | height: 100rpx;
22 | display: flex;
23 | padding:0 30rpx;
24 | justify-content: space-between;
25 | align-items: center;
26 | box-sizing: border-box;
27 | width:100%;
28 | }
29 |
30 | .btn{
31 | height: 30px;
32 | line-height: 30px;
33 | padding: 0 24rpx;
34 | border-radius: 2px;
35 | color: #ffffff;
36 | }
--------------------------------------------------------------------------------
/miniprogram/pages/my/base/my_base.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "navigationBarTitleText": "修改个人资料"
4 | }
--------------------------------------------------------------------------------
/miniprogram/pages/my/base/my_base.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/miniprogram/pages/my/foot/my_foot.js:
--------------------------------------------------------------------------------
1 | const pageHelper = require('../../../helper/page_helper.js');
2 | const helper = require('../../../helper/helper.js');
3 | const PassportBiz = require('../../../biz/passport_biz.js');
4 | const FootBiz = require('../../../biz/foot_biz.js');
5 | const bizHelper = require('../../../helper/biz_helper.js');
6 |
7 | Page({
8 |
9 | /**
10 | * 页面的初始数据
11 | */
12 | data: {
13 | footList: []
14 | },
15 |
16 | /**
17 | * 生命周期函数--监听页面加载
18 | */
19 | onLoad: async function (options) {
20 | PassportBiz.initPage(this);
21 | if (!await PassportBiz.loginMustReturnWin(this)) return;
22 |
23 | let footList = FootBiz.getFootList();
24 | this.setData({
25 | footList
26 | });
27 |
28 | },
29 |
30 | /**
31 | * 生命周期函数--监听页面初次渲染完成
32 | */
33 | onReady: function () {
34 |
35 | },
36 |
37 | /**
38 | * 生命周期函数--监听页面显示
39 | */
40 | onShow: function () {
41 |
42 | },
43 |
44 | /**
45 | * 生命周期函数--监听页面隐藏
46 | */
47 | onHide: function () {
48 |
49 | },
50 |
51 | /**
52 | * 生命周期函数--监听页面卸载
53 | */
54 | onUnload: function () {
55 |
56 | },
57 |
58 |
59 | /**
60 | * 查看详情
61 | */
62 | bindDetailTap: async function (e) {
63 | let oid = e.currentTarget.dataset.oid;
64 | let type = e.currentTarget.dataset.type;
65 |
66 | if (!oid || !helper.isDefined(type)) return;
67 | let url = '';
68 | switch (type) {
69 | case bizHelper.TYPE.USER:
70 | url = '/pages/user/user_detail?id=' + oid;
71 | break;
72 | case bizHelper.TYPE.INFO:
73 | url = '/pages/info/info_detail?id=' + oid;
74 | break;
75 | case bizHelper.TYPE.MEET:
76 | url = '/pages/meet/meet_detail?id=' + oid;
77 | break;
78 | case bizHelper.TYPE.ALBUM:
79 | url = '/pages/album/album_detail?id=' + oid;
80 | break;
81 | case bizHelper.TYPE.NEWS:
82 | url = '/pages/news/news_detail?id=' + oid;
83 | break;
84 | }
85 |
86 | wx.navigateTo({
87 | url: url
88 | });
89 | },
90 | })
--------------------------------------------------------------------------------
/miniprogram/pages/my/foot/my_foot.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "navigationBarTitleText": "我的浏览记录"
4 | }
--------------------------------------------------------------------------------
/miniprogram/pages/my/foot/my_foot.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item.typeDesc}}
9 |
10 | {{item.title}}
11 | {{item.time}}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/miniprogram/pages/my/foot/my_foot.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../style/project/article_list.wxss";
--------------------------------------------------------------------------------
/miniprogram/pages/my/index/my_index.js:
--------------------------------------------------------------------------------
1 | const PassportBiz = require('../../../biz/passport_biz.js');
2 | const UserBiz = require('../../../biz/user_biz.js');
3 | const cacheHelper = require('../../../helper/cache_helper.js');
4 | const cloudHelper = require('../../../helper/cloud_helper.js');
5 | const comm = require('../../../helper/comm.js');
6 | const pageHelper = require('../../../helper/page_helper.js');
7 |
8 | Page({
9 |
10 | /**
11 | * 页面的初始数据
12 | */
13 | data: {
14 | user: null
15 | },
16 |
17 | /**
18 | * 生命周期函数--监听页面加载
19 | */
20 | onLoad: async function (options) {
21 | PassportBiz.initApp();
22 | PassportBiz.initPage(this);
23 |
24 | await this._login();
25 | },
26 |
27 | /**
28 | * 生命周期函数--监听页面初次渲染完成
29 | */
30 | onReady: function () {},
31 |
32 | /**
33 | * 生命周期函数--监听页面显示
34 | */
35 | onShow: async function () {
36 | PassportBiz.setSetup(this);
37 |
38 | // 小圆点
39 | //PassportBiz.isChatReadRedDot();
40 | },
41 |
42 | /**
43 | * 生命周期函数--监听页面隐藏
44 | */
45 | onHide: function () {
46 |
47 | },
48 |
49 | /**
50 | * 生命周期函数--监听页面卸载
51 | */
52 | onUnload: function () {
53 |
54 | },
55 |
56 | /**
57 | * 页面相关事件处理函数--监听用户下拉动作
58 | */
59 | onPullDownRefresh: async function () {
60 | await this._login();
61 | wx.stopPullDownRefresh();
62 | },
63 |
64 | //登录
65 | _login:async function(){
66 | await PassportBiz.loginSilence(this);
67 |
68 | // 取得token里的信息
69 | let token = PassportBiz.getToken();
70 | if (!token) {
71 | return;
72 | }
73 |
74 | // 先用token里信息渲染
75 | let user = {};
76 | user.USER_PIC = token.pic;
77 | user.USER_NAME = token.name;
78 | user.USER_ITEM = token.item;
79 | user.USER_SEX = token.sex;
80 | user.USER_STATUS = token.status;
81 |
82 | this.setData({
83 | user
84 | });
85 |
86 | // 再调用服务器信息渲染
87 | this._getUserInfo();
88 | },
89 |
90 | /**
91 | * 页面上拉触底事件的处理函数
92 | */
93 | onReachBottom: function () {
94 |
95 | },
96 |
97 | _getUserInfo: async function () {
98 | if (!PassportBiz.isLogin()) return;
99 |
100 | // 取得用户信息
101 | let opt = {
102 | title: 'bar'
103 | };
104 | let user = await cloudHelper.callCloudData('user/my_detail', {}, opt);
105 | if (!user || user.USER_STATUS == 0 || user.USER_STATUS == 9) {
106 | pageHelper.reload();
107 | }
108 | this.setData({
109 | user
110 | });
111 | },
112 |
113 | url: function (e) {
114 | pageHelper.url(e);
115 | },
116 |
117 | bindAvatarTap: async function () {
118 | UserBiz.chooseAvatar(PassportBiz.getUserKey(), 'my_index');
119 | },
120 |
121 | bindSetTap: async function (e) {
122 | wx.showActionSheet({
123 | itemList: ['清除缓存', '重新登录', '退出登录'],
124 | success: async res => {
125 | let idx = res.tapIndex;
126 | if (idx == 0) {
127 | let token = PassportBiz.getToken();
128 | cacheHelper.clear();
129 | cacheHelper.set(comm.CACHE_TOKEN, token);
130 | }
131 | if (idx == 1) {
132 | await this._login();
133 | }
134 | if (idx == 2) {
135 | cacheHelper.clear();
136 | this.setData({
137 | user: null
138 | });
139 | }
140 |
141 | },
142 | fail: function (res) {}
143 | })
144 | }
145 | })
--------------------------------------------------------------------------------
/miniprogram/pages/my/index/my_index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "enablePullDownRefresh": true,
4 | "backgroundTextStyle": "dark",
5 | "navigationBarTitleText": "个人中心"
6 | }
--------------------------------------------------------------------------------
/miniprogram/pages/my/index/my_index.wxss:
--------------------------------------------------------------------------------
1 | .main-my-index {
2 | padding: 0;
3 | }
4 |
5 | .main-my-index .avatar-open {
6 | width: 130rpx;
7 | height: 130rpx;
8 | clip-path: circle(66rpx at center);
9 | }
10 |
11 | .main-my-index .user {
12 | background-color: #0E9489;
13 | height: 280rpx;
14 | width: 100%;
15 | display: flex;
16 | box-sizing: border-box;
17 | padding: 100rpx 40rpx 0rpx 40rpx;
18 | flex-direction: column;
19 | align-items: center;
20 | justify-content: center;
21 | position: relative;
22 | }
23 |
24 |
25 | .main-my-index .user .user-bar {
26 | flex: 1;
27 | display: flex;
28 | box-sizing: border-box;
29 | width: 100%;
30 | z-index: 999;
31 | }
32 |
33 | .main-my-index .user .user-bar .avatar {
34 | height: 130rpx;
35 | width: 130rpx;
36 | border:0rpx;
37 | }
38 |
39 | .main-my-index .user .user-bar .detail {
40 | width: 400rpx;
41 | margin-left: 40rpx;
42 | display: flex;
43 | flex-direction: column;
44 | justify-content: flex-start;
45 | color: #fff;
46 | box-sizing: border-box;
47 | }
48 |
49 | .main-my-index .user .user-bar .detail .name {
50 | font-size: 36rpx;
51 | font-weight: bold;
52 | }
53 |
54 | .main-my-index .user .user-bar .detail .desc {
55 | margin-top: 15rpx;
56 | }
57 |
58 | .main-my-index .user .user-bar .detail .desc .bg-gray {
59 | opacity: .5;
60 | }
61 |
62 | .main-my-index .user .right-top {
63 | position: absolute;
64 | top: 20rpx;
65 | right: 20rpx;
66 | }
67 |
68 | .main-my-index .user .left-top {
69 | position: absolute;
70 | top: 20rpx;
71 | left: 20rpx;
72 | }
73 |
74 | .main-my-index .user .info {
75 | background-color: #CCBE97;
76 | height: 80rpx;
77 | width: 100%;
78 | opacity: 0.6;
79 | border-top-left-radius: 20rpx;
80 | border-top-right-radius: 20rpx;
81 | }
82 |
83 | .main-my-index .down {
84 | box-sizing: border-box;
85 | width: 100%;
86 | display: flex;
87 | flex-direction: column;
88 | justify-content: center;
89 | }
90 |
91 | .main-my-index .down .data {
92 | display: flex;
93 | justify-content: space-between;
94 | align-items: center;
95 | height: 150rpx;
96 | padding: 0rpx 40rpx 0rpx 40rpx;
97 | width: 100%;
98 | background-color: #fff;
99 | }
100 |
101 | .main-my-index .down .data view {
102 | width: 150rpx;
103 | display: flex;
104 | flex-direction: column;
105 | align-items: center;
106 | justify-content: center;
107 | }
108 |
109 | .main-my-index .down .data view .num {
110 | font-size: 32rpx;
111 | font-weight: bold;
112 | }
113 |
114 | .main-my-index .down .data view .txt {
115 | font-size: 24rpx;
116 | color: #aaa;
117 | }
118 |
119 | .main-my-index .comm-list .item.arrow::before,
120 | .main-my-index .comm-list .item .content .item-icon {
121 | color: #0E9489;
122 | }
--------------------------------------------------------------------------------
/miniprogram/pages/my/info/my_info.js:
--------------------------------------------------------------------------------
1 | const pageHelper = require('../../../helper/page_helper.js');
2 | const PassportBiz = require('../../../biz/passport_biz.js');
3 | const cloudHelper = require('../../../helper/cloud_helper.js');
4 |
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 |
12 | },
13 |
14 | /**
15 | * 生命周期函数--监听页面加载
16 | */
17 | onLoad: async function (options) {
18 | PassportBiz.initPage(this);
19 |
20 | if (!await PassportBiz.loginMustReturnWin(this)) return;
21 | },
22 |
23 | /**
24 | * 生命周期函数--监听页面初次渲染完成
25 | */
26 | onReady: function () {
27 |
28 | },
29 |
30 | /**
31 | * 生命周期函数--监听页面显示
32 | */
33 | onShow: function () {
34 |
35 | },
36 |
37 | /**
38 | * 生命周期函数--监听页面隐藏
39 | */
40 | onHide: function () {
41 |
42 | },
43 |
44 | /**
45 | * 生命周期函数--监听页面卸载
46 | */
47 | onUnload: function () {
48 |
49 | },
50 |
51 | url: async function (e) {
52 | pageHelper.url(e);
53 | },
54 |
55 | myCommListListener: function (e) {
56 | pageHelper.commListListener(this, e);
57 | },
58 |
59 | bindDelTap: function (e) {
60 | let that = this;
61 | let callback = async function () {
62 | let id = e.currentTarget.dataset.id;
63 | if (!id) return;
64 | await cloudHelper.callCloudSumbit('info/del', {
65 | id
66 | }).then(res => {
67 | pageHelper.delListNode(id, that.data.dataList.list);
68 | that.setData({
69 | dataList: that.data.dataList
70 | });
71 | }).catch(err => {});
72 | }
73 |
74 | pageHelper.showConfirm('您确认删除?删除后不可恢复', callback);
75 | }
76 | })
--------------------------------------------------------------------------------
/miniprogram/pages/my/info/my_info.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-comm-list": "../../../cmpts/public/list/comm_list_cmpt"
4 | },
5 | "enablePullDownRefresh": false,
6 | "disableScroll": true,
7 | "backgroundTextStyle": "dark",
8 | "navigationBarTitleText": "我发布的互助"
9 | }
--------------------------------------------------------------------------------
/miniprogram/pages/my/info/my_info.wxml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | 已过期
15 |
16 | {{item.INFO_TITLE}}
17 | new
18 | hot
19 | 置顶
20 |
21 |
22 |
23 | {{item.INFO_TYPE}}
24 |
25 | {{item.INFO_VIEW_CNT}}阅读
26 |
27 |
28 | {{item.INFO_COMMENT_CNT}}
29 |
30 |
31 | {{item.INFO_FAV_CNT}}
32 |
33 |
34 | {{item.INFO_LIKE_CNT}}
35 |
36 |
37 |
38 |
39 | 发布时间:{{item.INFO_ADD_TIME}}
40 |
41 |
42 | 有效期至:{{item.INFO_EXPIRE_TIME}}
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/miniprogram/pages/my/info/my_info.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../style/project/article_list.wxss";
--------------------------------------------------------------------------------
/miniprogram/pages/my/reload/my_reload.js:
--------------------------------------------------------------------------------
1 | const PassportBiz = require('../../../biz/passport_biz.js');
2 |
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 |
10 | },
11 |
12 | /**
13 | * 生命周期函数--监听页面加载
14 | */
15 | onLoad: function (options) {
16 | PassportBiz.initPage(this);
17 | },
18 |
19 | /**
20 | * 生命周期函数--监听页面初次渲染完成
21 | */
22 | onReady: function () {
23 |
24 | },
25 |
26 | /**
27 | * 生命周期函数--监听页面显示
28 | */
29 | onShow: async function () {
30 |
31 | PassportBiz.clearToken();
32 | await PassportBiz.loginSilence();
33 |
34 | wx.reLaunch({
35 | url: '/pages/my/index/my_index',
36 | })
37 |
38 | },
39 |
40 | /**
41 | * 生命周期函数--监听页面隐藏
42 | */
43 | onHide: function () {
44 |
45 | },
46 |
47 | /**
48 | * 生命周期函数--监听页面卸载
49 | */
50 | onUnload: function () {
51 |
52 | },
53 |
54 | })
--------------------------------------------------------------------------------
/miniprogram/pages/my/reload/my_reload.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/miniprogram/pages/my/reload/my_reload.wxml:
--------------------------------------------------------------------------------
1 | 信息更新中...
--------------------------------------------------------------------------------
/miniprogram/pages/my/reload/my_reload.wxss:
--------------------------------------------------------------------------------
1 | /* miniprogram/pages/my/reload/my_reload.wxss */
--------------------------------------------------------------------------------
/miniprogram/pages/reg/reg.wxss:
--------------------------------------------------------------------------------
1 | page{
2 | background-color: #fff;
3 | }
4 |
5 | .main-reg{
6 | width:100%;
7 | box-sizing: border-box;
8 | padding:20rpx 20rpx;
9 | display: flex;
10 | flex-direction: column;
11 | justify-content: center;
12 | align-items: center;
13 | }
14 | .main-reg .step{
15 | display: flex;
16 | justify-content: center;
17 | align-items: center;
18 | width:100%;
19 | }
20 |
21 | .main-reg .step .item{
22 | width:33.3%;
23 | display: flex;
24 | flex-direction: column;
25 | box-sizing: border-box;
26 | padding:30rpx;
27 | justify-content: center;
28 | align-items: center;
29 | }
30 |
31 | .main-reg .step .item .circle-item{
32 | width:100rpx;
33 | height:100rpx;
34 | background-color:#fff;
35 | color:#0E9489;
36 | border-radius: 50%;
37 | display: flex;
38 | justify-content: center;
39 | align-items: center;
40 | position: relative;
41 | border:4rpx solid #0E9489;
42 | }
43 |
44 | .main-reg .step .item.cur .circle-item{
45 | background-color:#0E9489;
46 | color:#fff;
47 | }
48 |
49 | .main-reg .step .item.cur .icon-check{
50 | font-size:50rpx;
51 | }
52 |
53 | .main-reg .step .item .circle-item-mid::after {
54 | content: '';
55 | position: absolute;
56 | top: 50%;
57 | background: #ccc;
58 | width: 110%;
59 | height: 2rpx;
60 | left:120%;
61 | }
62 |
63 | .main-reg .step .item .circle-item-mid::before {
64 | content: '';
65 | position: absolute;
66 | top: 50%;
67 | background: #ccc;
68 | width: 110%;
69 | height: 2rpx;
70 | right:120%;
71 | }
72 |
73 | .main-reg .step .item .circle-item .num{
74 | font-size:38rpx;
75 | font-weight:bold;
76 | }
77 |
78 | .main-reg .step .item .circle-item .icon-check{
79 | font-weight:bold;
80 | }
81 |
82 | .main-reg .step .item .step-text{
83 | margin-top:20rpx;
84 | font-size:30rpx;
85 | }
86 |
87 | .main-reg .step .item.cur .step-text{
88 | color:#0E9489;
89 | }
90 |
91 | .main-reg .step-desc{
92 | margin-top:30rpx;
93 | font-size:30rpx;
94 | color:#86C8C3;
95 | }
96 |
97 | .main-reg .btn-reg{
98 | margin-top:200rpx;
99 | background-color: #0E9489;
100 | }
101 |
--------------------------------------------------------------------------------
/miniprogram/pages/reg/reg_step1.js:
--------------------------------------------------------------------------------
1 | const pageHelper = require('../../helper/page_helper.js');
2 | const RegBiz = require('../../biz/reg_biz.js');
3 | const PassportBiz = require('../../biz/passport_biz.js');
4 | const helper = require('../../helper/helper.js');
5 |
6 |
7 | Page({
8 |
9 | /**
10 | * 页面的初始数据
11 | */
12 | data: {
13 |
14 | },
15 |
16 | /**
17 | * 生命周期函数--监听页面加载
18 | */
19 | onLoad: async function (options) {
20 | PassportBiz.setSetup(this);
21 | PassportBiz.initPage(this);
22 |
23 | PassportBiz.clearToken();
24 | if (await PassportBiz.isRegister(this)) return;
25 |
26 | await RegBiz.checkInvite(options);
27 | },
28 |
29 | /**
30 | * 生命周期函数--监听页面初次渲染完成
31 | */
32 | onReady: function () {
33 |
34 | },
35 |
36 | /**
37 | * 生命周期函数--监听页面显示
38 | */
39 | onShow: function () {
40 |
41 | },
42 |
43 | /**
44 | * 生命周期函数--监听页面隐藏
45 | */
46 | onHide: function () {
47 |
48 | },
49 |
50 | /**
51 | * 生命周期函数--监听页面卸载
52 | */
53 | onUnload: function () {},
54 |
55 | bindGetPhoneNumber: async function (e) {
56 | await RegBiz.registerStep1(e);
57 | },
58 |
59 | url: function (e) {
60 | pageHelper.url(e, this);
61 | }
62 |
63 | })
--------------------------------------------------------------------------------
/miniprogram/pages/reg/reg_step1.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "navigationBarTitleText": "注册第一步"
4 | }
--------------------------------------------------------------------------------
/miniprogram/pages/reg/reg_step1.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 1
6 | 手机验证
7 |
8 |
9 | 2
10 | 微信授权
11 |
12 |
13 | 3
14 | 提交资料
15 |
16 |
17 |
18 | 注册需要验证手机号码 (号码仅做验证,不公开)
19 |
20 |
21 |
22 |
23 |
34 |
35 |
--------------------------------------------------------------------------------
/miniprogram/pages/reg/reg_step1.wxss:
--------------------------------------------------------------------------------
1 | @import "reg.wxss";
--------------------------------------------------------------------------------
/miniprogram/pages/reg/reg_step2.js:
--------------------------------------------------------------------------------
1 | const RegBiz = require('../../biz/reg_biz.js');
2 | const PassportBiz = require('../../biz/passport_biz.js');
3 | const pageHelper = require('../../helper/page_helper.js');
4 |
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 |
12 | },
13 |
14 | /**
15 | * 生命周期函数--监听页面加载
16 | */
17 | onLoad: async function (options) {
18 | PassportBiz.initPage(this);
19 |
20 | if (await PassportBiz.isRegister(this)) return;
21 |
22 | // 判断是否有phone认证
23 | if (!RegBiz.isStep1())
24 | return wx.redirectTo({
25 | url: 'reg_step1',
26 | });
27 | },
28 |
29 | /**
30 | * 生命周期函数--监听页面初次渲染完成
31 | */
32 | onReady: function () {
33 |
34 | },
35 |
36 | /**
37 | * 生命周期函数--监听页面显示
38 | */
39 | onShow: function () {
40 |
41 | },
42 |
43 | /**
44 | * 生命周期函数--监听页面隐藏
45 | */
46 | onHide: function () {
47 |
48 | },
49 |
50 | /**
51 | * 生命周期函数--监听页面卸载
52 | */
53 | onUnload: function () {
54 |
55 | },
56 |
57 | bindGetUserInfo: async function (e) {
58 | await RegBiz.registerStep2(e);
59 | },
60 |
61 | url: function (e) {
62 | pageHelper.url(e, this);
63 | }
64 |
65 | })
--------------------------------------------------------------------------------
/miniprogram/pages/reg/reg_step2.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "navigationBarTitleText": "注册第二步"
4 | }
--------------------------------------------------------------------------------
/miniprogram/pages/reg/reg_step2.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 手机验证
6 |
7 |
8 | 2
9 | 微信授权
10 |
11 |
12 | 3
13 | 提交资料
14 |
15 |
16 |
17 | 注册需要获取您的昵称,头像信息
18 |
20 |
21 |
32 |
33 |
--------------------------------------------------------------------------------
/miniprogram/pages/reg/reg_step2.wxss:
--------------------------------------------------------------------------------
1 | @import "reg.wxss";
--------------------------------------------------------------------------------
/miniprogram/pages/reg/reg_step3.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "navigationBarTitleText": "注册第三步"
4 | }
--------------------------------------------------------------------------------
/miniprogram/pages/reg/reg_step3.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 手机验证
6 |
7 |
8 |
9 |
10 | 微信授权
11 |
12 |
13 | 3
14 | 提交资料
15 |
16 |
17 |
18 |
19 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/miniprogram/pages/reg/reg_step3.wxss:
--------------------------------------------------------------------------------
1 | @import "reg.wxss";
2 |
3 | .main-reg .form{
4 | width:100%;
5 | box-sizing: border-box;
6 | }
7 |
8 | .main-reg .btn-main{
9 | margin-top:100rpx;
10 | }
--------------------------------------------------------------------------------
/miniprogram/pages/search/search.js:
--------------------------------------------------------------------------------
1 | const SearchBiz = require('../../biz/search_biz.js');
2 | const pageHelper = require('../../helper/page_helper.js');
3 | const PassportBiz = require('../../biz/passport_biz.js');
4 |
5 |
6 | Page({
7 |
8 | /**
9 | * 页面的初始数据
10 | */
11 | data: {
12 | type: '', // 来自哪个业务标识
13 | returnUrl: '', //搜索完返回哪个地址
14 | cacheName: '', //本业务搜索历史缓存
15 | search: '', //搜索关键字
16 |
17 | hisKeys: []
18 | },
19 |
20 | /**
21 | * 生命周期函数--监听页面加载
22 | */
23 | onLoad: function (options) {
24 | PassportBiz.initPage(this);
25 |
26 | let type = options.type;
27 | let returnUrl = options.returnUrl;
28 |
29 | let cacheName = 'SERACH_HIS_' + type;
30 | this.setData({
31 | type,
32 | cacheName,
33 | returnUrl
34 | });
35 | },
36 |
37 | /**
38 | * 生命周期函数--监听页面初次渲染完成
39 | */
40 | onReady: function () {
41 |
42 | },
43 |
44 | /**
45 | * 生命周期函数--监听页面显示
46 | */
47 | onShow: function () {
48 | let hisKeys = SearchBiz.getHistory(this.data.cacheName);
49 | this.setData({
50 | hisKeys
51 | });
52 | },
53 |
54 | /**
55 | * 生命周期函数--监听页面隐藏
56 | */
57 | onHide: function () {
58 |
59 | },
60 |
61 | /**
62 | * 生命周期函数--监听页面卸载
63 | */
64 | onUnload: function () {
65 |
66 | },
67 |
68 | url:function(e){
69 | pageHelper.url(e);
70 | },
71 |
72 |
73 | /**
74 | * 点击确认搜索
75 | */
76 | bindSearchConfirm: function (e) {
77 |
78 | if (!this.data.type) return;
79 |
80 | let search = this.data.search.trim();
81 | if (!search) return;
82 |
83 | // 历史记录
84 | let hisKeys = SearchBiz.addHistory(this.data.cacheName, search);
85 | this.setData({
86 | search,
87 | hisKeys
88 | });
89 |
90 | let prevPage = pageHelper.getPrevPage();
91 | // 直接调用上一个页面的setData()方法,把数据存到上一个页面中去
92 | prevPage.setData({
93 | search,
94 | })
95 |
96 | let returnUrl = this.data.returnUrl;
97 | if (returnUrl == '/pages/info/info_index' ||
98 | returnUrl == '/pages/user/user_index' ||
99 | returnUrl == '/pages/meet/meet_list' ||
100 | returnUrl == '/pages/home/home_index')
101 | wx.switchTab({
102 | url: returnUrl,
103 | });
104 | else
105 | wx.navigateBack({
106 | delta: 0,
107 | });
108 |
109 | },
110 |
111 | // 清空搜索记录
112 | bindDelHisTap: function (e) {
113 | SearchBiz.clearHistory(this.data.cacheName);
114 | this.setData({
115 | hisKeys: []
116 | });
117 | },
118 |
119 | //清除关键字
120 | bindClearKeyTap: function (e) {
121 | this.setData({
122 | search: ''
123 | });
124 | },
125 |
126 | // 点击历史
127 | bindKeyTap: function (e) {
128 | let search = e.currentTarget.dataset.key.trim();
129 | if (search) {
130 | this.setData({
131 | search
132 | });
133 | this.bindSearchConfirm(e);
134 | }
135 | },
136 |
137 | })
--------------------------------------------------------------------------------
/miniprogram/pages/search/search.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/miniprogram/pages/search/search.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | 历史记录
15 |
16 |
17 | {{item}}
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/miniprogram/pages/search/search.wxss:
--------------------------------------------------------------------------------
1 | .main-search{
2 | box-sizing: border-box;
3 | width:100%;
4 | height: 100vh;
5 | display: flex;
6 | padding:0;
7 | flex-direction: column;
8 | justify-content: center;
9 | align-items: center;
10 | }
11 |
12 | .main-search .search{
13 | width:100%;
14 | }
15 |
16 | .main-search .his{
17 | flex:1;
18 | margin-top:2rpx;
19 | width:100%;
20 | background-color: #fff;
21 | display: flex;
22 | flex-direction: column;
23 | padding:30rpx;
24 | }
25 |
26 | .main-search .his .title{
27 | width:100%;
28 | display: flex;
29 | align-items: center;
30 | justify-content: flex-start;
31 | }
32 |
33 | .main-search .his .title .tit{
34 | font-size:34rpx;
35 | font-weight:bold;
36 | flex:1;
37 | }
38 |
39 | .main-search .his .title .del{
40 | font-size:32rpx;
41 | color:#aaa;
42 | margin-left: auto;
43 | }
44 |
45 | .main-search .his .search-content{
46 | width:100%;
47 | display: flex;
48 | align-items: center;
49 | flex-wrap: wrap;
50 | margin-top:40rpx;
51 | }
52 |
53 | .main-search .his .search-content .btn{
54 | margin-right:30rpx;
55 | margin-top:30rpx;
56 | font-size:28rpx;
57 | padding: 35rpx 45rpx;
58 | background-color: #f2f2f2;
59 | }
--------------------------------------------------------------------------------
/miniprogram/pages/user/user_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "enablePullDownRefresh": true,
4 | "backgroundTextStyle": "dark",
5 | "navigationBarTitleText": "校友详情"
6 | }
--------------------------------------------------------------------------------
/miniprogram/pages/user/user_index.js:
--------------------------------------------------------------------------------
1 | const UserBiz = require('../../biz/user_biz.js');
2 | const pageHelper = require('../../helper/page_helper.js');
3 | const PassportBiz = require('../../biz/passport_biz.js');
4 | const cacheHelper = require('../../helper/cache_helper.js');
5 | const setting = require('../../helper/setting.js');
6 |
7 | const CACHE_SHOW_USER_TYPE = 'USER_SHOW_TYPE';
8 |
9 | Page({
10 |
11 | /**
12 | * 页面的初始数据
13 | */
14 | data: {
15 | showUserType: 0, //默认展示风格
16 | showUserTypeBtn: ['详细模式', '简明模式']
17 | },
18 |
19 | /**
20 | * 生命周期函数--监听页面加载
21 | */
22 | onLoad: function (options) {
23 | PassportBiz.initPage(this);
24 |
25 | //设置搜索菜单
26 | this.setData(UserBiz.getSearchMenu());
27 |
28 | let showUserType = cacheHelper.get(CACHE_SHOW_USER_TYPE);
29 | if (showUserType) {
30 | this.setData({
31 | showUserType
32 | });
33 | }
34 | },
35 |
36 | /**
37 | * 生命周期函数--监听页面初次渲染完成
38 | */
39 | onReady: function () {
40 |
41 | },
42 |
43 | /**
44 | * 生命周期函数--监听页面显示
45 | */
46 | onShow: async function () {
47 | if (!setting.TABBAR_IS_GUEST) {
48 | if (!await PassportBiz.loginMustRegWin(this)) return;
49 | }
50 | else {
51 | PassportBiz.loginSilence(this);
52 | this.setData({isLogin:true});
53 | }
54 |
55 | },
56 |
57 | /**
58 | * 生命周期函数--监听页面隐藏
59 | */
60 | onHide: function () {
61 |
62 | },
63 |
64 | /**
65 | * 生命周期函数--监听页面卸载
66 | */
67 | onUnload: function () {
68 |
69 | },
70 |
71 | url: async function (e) {
72 | pageHelper.url(e);
73 | },
74 |
75 | myCommListListener: function (e) {
76 | pageHelper.commListListener(this, e);
77 | },
78 |
79 | bindChangeTap: function () {
80 | let showUserType = (this.data.showUserType == 0) ? 1 : 0;
81 | cacheHelper.set(CACHE_SHOW_USER_TYPE, showUserType);
82 | this.setData({
83 | showUserType
84 | });
85 | }
86 |
87 | })
--------------------------------------------------------------------------------
/miniprogram/pages/user/user_index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-comm-list": "../../../cmpts/public/list/comm_list_cmpt"
4 | },
5 | "enablePullDownRefresh": false,
6 | "disableScroll": true,
7 | "backgroundTextStyle": "dark",
8 | "navigationBarTitleText": "找校友"
9 | }
--------------------------------------------------------------------------------
/miniprogram/pages/user/user_index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
9 |
10 |
11 |
12 |
13 |
15 |
16 |
17 |
19 |
20 |
21 |
22 |
23 |
24 | {{item.USER_NAME}}
25 | {{item.USER_ITEM}}|{{item.USER_CITY}}|{{item.USER_BIRTH}}
27 |
28 |
29 |
30 |
31 |
32 | {{item.USER_ENROLL}}-{{item.USER_GRAD}}|{{item.USER_EDU}}
33 |
34 |
35 | {{item.USER_COMPANY}}|{{item.USER_COMPANY_DUTY}}
36 |
37 |
38 | {{item.USER_TRADE}}
39 |
40 |
41 |
42 |
43 |
44 | {{item.USER_LOGIN_TIME}} 活跃
45 |
46 |
47 |
48 | {{item.USER_INFO_CNT}}
49 |
50 |
51 |
52 |
53 | {{item.USER_ALBUM_CNT}}
54 |
55 |
56 |
57 |
58 | {{item.USER_MEET_CNT}}
59 |
60 |
61 |
62 | {{item.USER_MEET_JOIN_CNT}}
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/miniprogram/pages/user/user_index.wxss:
--------------------------------------------------------------------------------
1 | @import '../../style/project/user_list.wxss';
2 |
--------------------------------------------------------------------------------
/miniprogram/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "disallow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/miniprogram/style/comm/animation.wxss:
--------------------------------------------------------------------------------
1 | /*
2 | Animation 微动画
3 | 基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28
4 | */
5 |
6 | /* css 滤镜 控制黑白底色gif的 */
7 | .gif-black{
8 | mix-blend-mode: screen;
9 | }
10 | .gif-white{
11 | mix-blend-mode: multiply;
12 | }
13 |
14 |
15 | /* Animation css */
16 | [class*=animation-] {
17 | animation-duration: .5s;
18 | animation-timing-function: ease-out;
19 | animation-fill-mode: both
20 | }
21 |
22 | .animation-fade {
23 | animation-name: fade;
24 | animation-duration: .8s;
25 | animation-timing-function: linear
26 | }
27 |
28 | .animation-scale-up {
29 | animation-name: scale-up
30 | }
31 |
32 | .animation-scale-down {
33 | animation-name: scale-down
34 | }
35 |
36 | .animation-slide-top {
37 | animation-name: slide-top
38 | }
39 |
40 | .animation-slide-bottom {
41 | animation-name: slide-bottom
42 | }
43 |
44 | .animation-slide-left {
45 | animation-name: slide-left
46 | }
47 |
48 | .animation-slide-right {
49 | animation-name: slide-right
50 | }
51 |
52 | .animation-shake {
53 | animation-name: shake
54 | }
55 |
56 | .animation-reverse {
57 | animation-direction: reverse
58 | }
59 |
60 | @keyframes fade {
61 | 0% {
62 | opacity: 0
63 | }
64 |
65 | 100% {
66 | opacity: 1
67 | }
68 | }
69 |
70 | @keyframes scale-up {
71 | 0% {
72 | opacity: 0;
73 | transform: scale(.2)
74 | }
75 |
76 | 100% {
77 | opacity: 1;
78 | transform: scale(1)
79 | }
80 | }
81 |
82 | @keyframes scale-down {
83 | 0% {
84 | opacity: 0;
85 | transform: scale(1.8)
86 | }
87 |
88 | 100% {
89 | opacity: 1;
90 | transform: scale(1)
91 | }
92 | }
93 |
94 | @keyframes slide-top {
95 | 0% {
96 | opacity: 0;
97 | transform: translateY(-100%)
98 | }
99 |
100 | 100% {
101 | opacity: 1;
102 | transform: translateY(0)
103 | }
104 | }
105 |
106 | @keyframes slide-bottom {
107 | 0% {
108 | opacity: 0;
109 | transform: translateY(100%)
110 | }
111 |
112 | 100% {
113 | opacity: 1;
114 | transform: translateY(0)
115 | }
116 | }
117 |
118 | @keyframes shake {
119 |
120 | 0%,
121 | 100% {
122 | transform: translateX(0)
123 | }
124 |
125 | 10% {
126 | transform: translateX(-9px)
127 | }
128 |
129 | 20% {
130 | transform: translateX(8px)
131 | }
132 |
133 | 30% {
134 | transform: translateX(-7px)
135 | }
136 |
137 | 40% {
138 | transform: translateX(6px)
139 | }
140 |
141 | 50% {
142 | transform: translateX(-5px)
143 | }
144 |
145 | 60% {
146 | transform: translateX(4px)
147 | }
148 |
149 | 70% {
150 | transform: translateX(-3px)
151 | }
152 |
153 | 80% {
154 | transform: translateX(2px)
155 | }
156 |
157 | 90% {
158 | transform: translateX(-1px)
159 | }
160 | }
161 |
162 | @keyframes slide-left {
163 | 0% {
164 | opacity: 0;
165 | transform: translateX(-100%)
166 | }
167 |
168 | 100% {
169 | opacity: 1;
170 | transform: translateX(0)
171 | }
172 | }
173 |
174 | @keyframes slide-right {
175 | 0% {
176 | opacity: 0;
177 | transform: translateX(100%)
178 | }
179 |
180 | 100% {
181 | opacity: 1;
182 | transform: translateX(0)
183 | }
184 | }
--------------------------------------------------------------------------------
/miniprogram/style/comm/avatar.wxss:
--------------------------------------------------------------------------------
1 |
2 | /* ==================
3 | 头像
4 | ==================== */
5 | .avatar {
6 | font-variant: small-caps;
7 | margin: 0;
8 | padding: 0;
9 | display: inline-flex;
10 | text-align: center;
11 | justify-content: center;
12 | align-items: center;
13 | color: var(--white);
14 | white-space: nowrap;
15 | position: relative;
16 | width: 64rpx;
17 | height: 64rpx;
18 | background-size: cover;
19 | background-position: center;
20 | vertical-align: middle;
21 | font-size: 1.5em;
22 | }
23 |
24 | .avatar:not([class*="bg-"]) {
25 | background-color: #ccc;
26 | }
27 |
28 | .avatar.xs {
29 | width: 32rpx;
30 | height: 32rpx;
31 | font-size: 1em;
32 | }
33 |
34 | .avatar.small {
35 | width: 48rpx;
36 | height: 48rpx;
37 | font-size: 1em;
38 | }
39 |
40 | .avatar.large {
41 | width: 96rpx;
42 | height: 96rpx;
43 | font-size: 2em;
44 | }
45 |
46 | .avatar.xl {
47 | width: 128rpx;
48 | height: 128rpx;
49 | font-size: 2.5em;
50 | }
51 |
52 | .avatar .avatar-text {
53 | font-size: 0.4em;
54 | }
55 |
56 | .avatar-group {
57 | direction: rtl;
58 | unicode-bidi: bidi-override;
59 | padding: 0 10rpx 0 40rpx;
60 | display: inline-block;
61 | }
62 |
63 | .avatar-group .avatar {
64 | margin-left: -30rpx;
65 | border: 4rpx solid var(--ghostWhite);
66 | vertical-align: middle;
67 | }
68 |
69 | .avatar-group .avatar.small {
70 | margin-left: -20rpx;
71 | border: 1rpx solid var(--ghostWhite);
72 | }
73 |
--------------------------------------------------------------------------------
/miniprogram/style/comm/base.wxss:
--------------------------------------------------------------------------------
1 | /* ==================
2 | 初始化
3 | ==================== */
4 | page {
5 | /* Color 可以自定义相关配色 */
6 | /* var属性兼容性 --> https://www.caniuse.com/#feat=css-variables */
7 | /* 标准色 */
8 | --red: #e54d42;
9 | --orange: #f37b1d;
10 | --yellow: #fbbd08;
11 | --olive: #8dc63f;
12 | --green: #39b54a;
13 | --darkgreen: #0E9489;
14 | --cyan: #1cbbb4;
15 | --blue: #0081ff;
16 | --purple: #6739b6;
17 | --mauve: #9c26b0;
18 | --pink: #e03997;
19 | --brown: #a5673f;
20 | --grey: #8799a3;
21 | --black: #333333;
22 | --darkGray: #666666;
23 | --gray: #aaaaaa;
24 | --ghostWhite: #f1f1f1;
25 | --white: #ffffff;
26 | /* 浅色 */
27 | --redLight: #fadbd9;
28 | --orangeLight: #fde6d2;
29 | --yellowLight: #fef2ce;
30 | --oliveLight: #e8f4d9;
31 | --greenLight: #d7f0db;
32 | --cyanLight: #d2f1f0;
33 | --blueLight: #cce6ff;
34 | --purpleLight: #e1d7f0;
35 | --mauveLight: #ebd4ef;
36 | --pinkLight: #f9d7ea;
37 | --brownLight: #ede1d9;
38 | --greyLight: #e7ebed;
39 |
40 | /* 阴影透明色 */
41 | --ShadowSize: 6rpx 6rpx 8rpx;
42 | --redShadow: rgba(204, 69, 59, 0.2);
43 | --orangeShadow: rgba(217, 109, 26, 0.2);
44 | --yellowShadow: rgba(224, 170, 7, 0.2);
45 | --oliveShadow: rgba(124, 173, 55, 0.2);
46 | --greenShadow: rgba(48, 156, 63, 0.2);
47 | --darkgreenShadow: rgba(48, 156, 63, 0.2);
48 | --cyanShadow: rgba(28, 187, 180, 0.2);
49 | --blueShadow: rgba(0, 102, 204, 0.2);
50 | --purpleShadow: rgba(88, 48, 156, 0.2);
51 | --mauveShadow: rgba(133, 33, 150, 0.2);
52 | --pinkShadow: rgba(199, 50, 134, 0.2);
53 | --brownShadow: rgba(140, 88, 53, 0.2);
54 | --greyShadow: rgba(114, 130, 138, 0.2);
55 | --grayShadow: rgba(114, 130, 138, 0.2);
56 | --blackShadow: rgba(26, 26, 26, 0.2);
57 |
58 | background-color: var(--ghostWhite);
59 | font-size: 28rpx;
60 | color: var(--black);
61 | font-family: Helvetica Neue, Helvetica, sans-serif;
62 | }
63 |
64 | view,
65 | scroll-view,
66 | swiper,
67 | button,
68 | input,
69 | textarea,
70 | label,
71 | navigator,
72 | image {
73 | box-sizing: border-box;
74 | }
75 |
76 | .hide {
77 | display: none;
78 | }
79 |
80 | .round {
81 | border-radius: 5000rpx;
82 | }
83 |
84 | .radius {
85 | border-radius: 6rpx;
86 | }
87 |
88 | .block {
89 | display: block;
90 | }
91 |
92 | /* 多行文本 */
93 | .text-content{
94 | line-height: 1.6;
95 | }
--------------------------------------------------------------------------------
/miniprogram/style/comm/border.wxss:
--------------------------------------------------------------------------------
1 |
2 | /* ==================
3 | 边框 line为伪元素
4 | ==================== */
5 |
6 | .border-red::after {
7 | border-color: var(--red);
8 | }
9 |
10 | .border-orange::after {
11 | border-color: var(--orange);
12 | }
13 |
14 | .border-yellow::after {
15 | border-color: var(--yellow);
16 | }
17 |
18 | .border-olive::after {
19 | border-color: var(--olive);
20 | }
21 |
22 | .border-green::after {
23 | border-color: var(--green);
24 | }
25 |
26 | .border-darkgreen::after {
27 | border-color: var(--darkgreen);
28 | }
29 |
30 | .border-cyan::after {
31 | border-color: var(--cyan);
32 | }
33 |
34 | .border-blue::after {
35 | border-color: var(--blue);
36 | }
37 |
38 | .border-purple::after {
39 | border-color: var(--purple);
40 | }
41 |
42 | .border-mauve::after {
43 | border-color: var(--mauve);
44 | }
45 |
46 | .border-pink::after {
47 | border-color: var(--pink);
48 | }
49 |
50 | .border-brown::after {
51 | border-color: var(--brown);
52 | }
53 |
54 | .border-grey::after {
55 | border-color: var(--grey);
56 | }
57 |
58 | .border-gray::after {
59 | border-color: var(--gray);
60 | }
61 |
62 | .border-black::after {
63 | border-color: var(--black);
64 | }
65 |
66 | .border-white::after {
67 | border-color: var(--white);
68 | }
69 |
70 |
71 |
72 | /* ==================
73 | 边框
74 | ==================== */
75 |
76 | /* -- 实线 -- */
77 |
78 | .solid,
79 | .solid-top,
80 | .solid-right,
81 | .solid-bottom,
82 | .solid-left,
83 | .solid-bold,
84 | .solid-bold-top,
85 | .solid-bold-right,
86 | .solid-bold-bottom,
87 | .solid-bold-left {
88 | position: relative;
89 | }
90 |
91 | .solid::after,
92 | .solid-top::after,
93 | .solid-right::after,
94 | .solid-bottom::after,
95 | .solid-left::after,
96 | .solid-bold::after,
97 | .solid-bold-top::after,
98 | .solid-bold-right::after,
99 | .solid-bold-bottom::after,
100 | .solid-bold-left::after {
101 | content: " ";
102 | width: 200%;
103 | height: 200%;
104 | position: absolute;
105 | top: 0;
106 | left: 0;
107 | border-radius: inherit;
108 | transform: scale(0.5);
109 | transform-origin: 0 0;
110 | pointer-events: none;
111 | box-sizing: border-box;
112 | }
113 |
114 | .solid::after {
115 | border: 4rpx solid rgba(0, 0, 0, 0.1);
116 | }
117 |
118 | .solid-top::after {
119 | border-top: 4rpx solid rgba(0, 0, 0, 0.1);
120 | }
121 |
122 | .solid-right::after {
123 | border-right: 4rpx solid rgba(0, 0, 0, 0.1);
124 | }
125 |
126 | .solid-bottom::after {
127 | border-bottom: 4rpx solid rgba(0, 0, 0, 0.1);
128 | }
129 |
130 | .solid-left::after {
131 | border-left: 4rpx solid rgba(0, 0, 0, 0.1);
132 | }
133 |
134 | .solid-bold::after {
135 | border: 8rpx solid #eee;
136 | }
137 |
138 | .solid-bold-top::after {
139 | border-top: 8rpx solid #eee;
140 | }
141 |
142 | .solid-bold-right::after {
143 | border-right: 8rpx solid #eee;
144 | }
145 |
146 | .solid-bold-bottom::after {
147 | border-bottom: 8rpx solid #eee;
148 | }
149 |
150 | .solid-bold-left::after {
151 | border-left: 8rpx solid #eee;
152 | }
--------------------------------------------------------------------------------
/miniprogram/style/comm/button.wxss:
--------------------------------------------------------------------------------
1 |
2 | /* ==================
3 | 按钮
4 | ==================== */
5 |
6 | .btn {
7 | border: 0rpx;
8 | display: inline-flex;
9 | align-items: center;
10 | justify-content: center;
11 | box-sizing: border-box;
12 | padding: 0 30rpx;
13 | font-size: 28rpx;
14 | height: 64rpx;
15 | line-height: 1;
16 | text-align: center;
17 | text-decoration: none;
18 | overflow: visible;
19 | margin-left: initial;
20 | transform: translate(0rpx, 0rpx);
21 | margin-right: initial;
22 | border-radius: 12rpx;
23 | }
24 |
25 | .btn::after {
26 | display: none;
27 | }
28 |
29 | .btn:not([class*="bg-"]) {
30 | background-color: #f0f0f0;
31 | }
32 |
33 | .btn[class*="border"] {
34 | background-color: transparent;
35 | }
36 |
37 | /* 伪元素边框 */
38 | .btn[class*="border"]::after {
39 | content: " ";
40 | display: block;
41 | width: 200%;
42 | height: 200%;
43 | position: absolute;
44 | top: 0;
45 | left: 0;
46 | border: 1rpx solid currentColor;
47 | transform: scale(0.5);
48 | transform-origin: 0 0;
49 | box-sizing: border-box;
50 | z-index: 1;
51 | pointer-events: none;
52 | border-radius: 12rpx;
53 | }
54 |
55 | .btn[class*="bg-"]::after {
56 | display: none;
57 | }
58 |
59 | .btn.small {
60 | padding: 0 20rpx;
61 | font-size: 20rpx;
62 | height: 48rpx;
63 | border-radius: 10rpx;
64 | }
65 |
66 | .btn.mid {
67 | padding: 0 20rpx;
68 | font-size: 24rpx;
69 | height: 50rpx;
70 | border-radius: 10rpx;
71 | }
72 |
73 | .btn.large {
74 | padding: 0 40rpx;
75 | font-size: 32rpx;
76 | height: 80rpx;
77 | border-radius: 14rpx;
78 | }
79 |
80 | .btn.btn-icon.small {
81 | width: 48rpx;
82 | height: 48rpx;
83 | }
84 |
85 | .btn.btn-icon {
86 | width: 64rpx;
87 | height: 64rpx;
88 | border-radius: 500rpx;
89 | padding: 0;
90 | }
91 |
92 | button.btn-icon.large {
93 | width: 80rpx;
94 | height: 80rpx;
95 | }
96 |
97 | .btn.shadow-blur::before {
98 | top: 4rpx;
99 | left: 4rpx;
100 | filter: blur(6rpx);
101 | opacity: 0.6;
102 | }
103 |
104 | .btn.button-hover {
105 | transform: translate(1rpx, 1rpx);
106 | }
107 |
108 | .btn[disabled] {
109 | opacity: 0.6;
110 | color: var(--white);
111 | }
112 |
113 |
114 | .btn.round {
115 | border-radius: 5000rpx;
116 | }
117 |
118 | .btn.round[class*="border"]::after {
119 | border-radius: 1000rpx;
120 | }
121 |
122 | .btn.border-bold::after {
123 | border: 6rpx solid currentColor;
124 | }
125 |
126 |
--------------------------------------------------------------------------------
/miniprogram/style/comm/comm.wxss:
--------------------------------------------------------------------------------
1 | @import "base.wxss";
2 |
3 | @import "avatar.wxss";
4 | @import "background.wxss";
5 | @import "bar.wxss";
6 | @import "border.wxss";
7 | @import "button.wxss";
8 | @import "image.wxss";
9 | @import "modal.wxss";
10 | @import "nav.wxss";
11 | @import "shadow.wxss";
12 | @import "tag.wxss";
13 | @import "icon.wxss";
14 | @import "form.wxss";
15 | @import "text.wxss";
16 | @import "list.wxss";
17 | @import "load.wxss";
18 | @import "layout.wxss";
--------------------------------------------------------------------------------
/miniprogram/style/comm/image.wxss:
--------------------------------------------------------------------------------
1 |
2 | /* ==================
3 | 图片
4 | ==================== */
5 |
6 | image {
7 | max-width: 100%;
8 | display: inline-block;
9 | position: relative;
10 | z-index: 0;
11 | }
12 |
13 | image.loading::before {
14 | content: "";
15 | background-color: #f5f5f5;
16 | display: block;
17 | position: absolute;
18 | width: 100%;
19 | height: 100%;
20 | z-index: -2;
21 | }
22 |
23 | image.loading::after {
24 | content: "\e7f1";
25 | font-family: "icon";
26 | position: absolute;
27 | top: 0;
28 | left: 0;
29 | width: 32rpx;
30 | height: 32rpx;
31 | line-height: 32rpx;
32 | right: 0;
33 | bottom: 0;
34 | z-index: -1;
35 | font-size: 32rpx;
36 | margin: auto;
37 | color: #ccc;
38 | -webkit-animation: icon-spin 2s infinite linear;
39 | animation: icon-spin 2s infinite linear;
40 | display: block;
41 | }
--------------------------------------------------------------------------------
/miniprogram/style/comm/load.wxss:
--------------------------------------------------------------------------------
1 | /* ==================
2 | 加载
3 | ==================== */
4 |
5 | .load {
6 | display: block;
7 | line-height: 3em;
8 | text-align: center;
9 | }
10 |
11 | .load::before {
12 | font-family: "icon";
13 | display: inline-block;
14 | margin-right: 6rpx;
15 | }
16 |
17 | .load.loading::before, .load.loading-none::before {
18 | content: "\e67a";
19 | animation: icon-spin 2s infinite linear;
20 | }
21 |
22 | .load.loading::after {
23 | content: "加载中...";
24 | }
25 |
26 | .load.over::before {
27 | content: "\e64a";
28 | }
29 |
30 | .load.over::after {
31 | content: "没有更多了";
32 | }
33 |
34 | .load.error::before {
35 | content: "\e658";
36 | }
37 | /*
38 | .load.error::after {
39 | content: "加载失败";
40 | }*/
41 |
42 | .load.notexist::before {
43 | content: "\e658";
44 | }
45 |
46 | .load.notexist::after {
47 | content: "数据不存在或者已删除";
48 | }
49 |
50 | .load.load-icon::before {
51 | font-size: 32rpx;
52 | }
53 |
54 | .load.load-icon::after {
55 | display: none;
56 | }
57 |
58 | .load.load-icon.over {
59 | display: none;
60 | }
61 |
62 | .load.load-modal {
63 | position: fixed;
64 | top: 0;
65 | right: 0;
66 | bottom: 140rpx;
67 | left: 0;
68 | margin: auto;
69 | width: 260rpx;
70 | height: 260rpx;
71 | background-color: var(--white);
72 | border-radius: 10rpx;
73 | box-shadow: 0 0 0rpx 2000rpx rgba(0, 0, 0, 0.5);
74 | display: flex;
75 | align-items: center;
76 | flex-direction: column;
77 | justify-content: center;
78 | font-size: 28rpx;
79 | z-index: 9999;
80 | line-height: 2.4em;
81 | }
82 |
83 | .load.load-modal [class*="icon-"] {
84 | font-size: 60rpx;
85 | }
86 |
87 | .load.load-modal image {
88 | width: 70rpx;
89 | height: 70rpx;
90 | }
91 |
92 | .load.load-modal::after {
93 | content: "";
94 | position: absolute;
95 | background-color: var(--white);
96 | border-radius: 50%;
97 | width: 200rpx;
98 | height: 200rpx;
99 | font-size: 10px;
100 | border-top: 6rpx solid rgba(0, 0, 0, 0.05);
101 | border-right: 6rpx solid rgba(0, 0, 0, 0.05);
102 | border-bottom: 6rpx solid rgba(0, 0, 0, 0.05);
103 | border-left: 6rpx solid var(--orange);
104 | animation: icon-spin 1s infinite linear;
105 | z-index: -1;
106 | }
107 |
108 | .load-progress {
109 | pointer-events: none;
110 | top: 0;
111 | position: fixed;
112 | width: 100%;
113 | left: 0;
114 | z-index: 2000;
115 | }
116 |
117 | .load-progress.hide {
118 | display: none;
119 | }
120 |
121 | .load-progress .load-progress-bar {
122 | position: relative;
123 | width: 100%;
124 | height: 4rpx;
125 | overflow: hidden;
126 | transition: all 200ms ease 0s;
127 | }
128 |
129 | .load-progress .load-progress-spinner {
130 | position: absolute;
131 | top: 10rpx;
132 | right: 10rpx;
133 | z-index: 2000;
134 | display: block;
135 | }
136 |
137 | .load-progress .load-progress-spinner::after {
138 | content: "";
139 | display: block;
140 | width: 24rpx;
141 | height: 24rpx;
142 | -webkit-box-sizing: border-box;
143 | box-sizing: border-box;
144 | border: solid 4rpx transparent;
145 | border-top-color: inherit;
146 | border-left-color: inherit;
147 | border-radius: 50%;
148 | -webkit-animation: load-progress-spinner 0.4s linear infinite;
149 | animation: load-progress-spinner 0.4s linear infinite;
150 | }
151 |
152 | @-webkit-keyframes load-progress-spinner {
153 | 0% {
154 | -webkit-transform: rotate(0);
155 | transform: rotate(0);
156 | }
157 |
158 | 100% {
159 | -webkit-transform: rotate(360deg);
160 | transform: rotate(360deg);
161 | }
162 | }
163 |
164 | @keyframes load-progress-spinner {
165 | 0% {
166 | -webkit-transform: rotate(0);
167 | transform: rotate(0);
168 | }
169 |
170 | 100% {
171 | -webkit-transform: rotate(360deg);
172 | transform: rotate(360deg);
173 | }
174 | }
175 |
--------------------------------------------------------------------------------
/miniprogram/style/comm/nav.wxss:
--------------------------------------------------------------------------------
1 |
2 | /* ==================
3 | 导航栏
4 | ==================== */
5 |
6 | .tab {
7 | white-space: nowrap;
8 | }
9 |
10 | ::-webkit-scrollbar {
11 | display: none;
12 | }
13 |
14 | .tab .item {
15 | height: 90rpx;
16 | display: inline-block;
17 | line-height: 90rpx;
18 | margin: 0 10rpx;
19 | padding: 0 20rpx;
20 | }
21 |
22 | .tab .item.cur {
23 | border-bottom: 4rpx solid;
24 | }
25 |
--------------------------------------------------------------------------------
/miniprogram/style/comm/shadow.wxss:
--------------------------------------------------------------------------------
1 |
2 | /* ==================
3 | 阴影
4 | ==================== */
5 | /* -- 形状阴影 -- */
6 | .shadow[class*='white'] {
7 | --ShadowSize: 0 1rpx 6rpx;
8 | }
9 |
10 | .shadow-large {
11 | --ShadowSize: 0rpx 40rpx 100rpx 0rpx;
12 | }
13 |
14 | .shadow-warp {
15 | position: relative;
16 | box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1);
17 | }
18 |
19 | .shadow-warp:before,
20 | .shadow-warp:after {
21 | position: absolute;
22 | content: "";
23 | top: 20rpx;
24 | bottom: 30rpx;
25 | left: 20rpx;
26 | width: 50%;
27 | box-shadow: 0 30rpx 20rpx rgba(0, 0, 0, 0.2);
28 | transform: rotate(-3deg);
29 | z-index: -1;
30 | }
31 |
32 | .shadow-warp:after {
33 | right: 20rpx;
34 | left: auto;
35 | transform: rotate(3deg);
36 | }
37 |
38 | .shadow-blur {
39 | position: relative;
40 | }
41 |
42 | .shadow-blur::before {
43 | content: "";
44 | display: block;
45 | background: inherit;
46 | filter: blur(10rpx);
47 | position: absolute;
48 | width: 100%;
49 | height: 100%;
50 | top: 10rpx;
51 | left: 10rpx;
52 | z-index: -1;
53 | opacity: 0.4;
54 | transform-origin: 0 0;
55 | border-radius: inherit;
56 | transform: scale(1, 1);
57 | }
58 |
59 |
60 | .shadow {
61 | box-shadow: var(--ShadowSize) var(--greyShadow);
62 | }
63 |
64 | .shadow[class*="-red"] {
65 | box-shadow: var(--ShadowSize) var(--redShadow);
66 | }
67 |
68 | .shadow[class*="-orange"] {
69 | box-shadow: var(--ShadowSize) var(--orangeShadow);
70 | }
71 |
72 | .shadow[class*="-yellow"] {
73 | box-shadow: var(--ShadowSize) var(--yellowShadow);
74 | }
75 |
76 | .shadow[class*="-olive"] {
77 | box-shadow: var(--ShadowSize) var(--oliveShadow);
78 | }
79 |
80 | .shadow[class*="-green"] {
81 | box-shadow: var(--ShadowSize) var(--greenShadow);
82 | }
83 |
84 | .shadow[class*="-darkgreen"] {
85 | box-shadow: var(--ShadowSize) var(--darkgreenShadow);
86 | }
87 |
88 | .shadow[class*="-cyan"] {
89 | box-shadow: var(--ShadowSize) var(--cyanShadow);
90 | }
91 |
92 | .shadow[class*="-blue"] {
93 | box-shadow: var(--ShadowSize) var(--blueShadow);
94 | }
95 |
96 | .shadow[class*="-purple"] {
97 | box-shadow: var(--ShadowSize) var(--purpleShadow);
98 | }
99 |
100 | .shadow[class*="-mauve"] {
101 | box-shadow: var(--ShadowSize) var(--mauveShadow);
102 | }
103 |
104 | .shadow[class*="-pink"] {
105 | box-shadow: var(--ShadowSize) var(--pinkShadow);
106 | }
107 |
108 | .shadow[class*="-brown"] {
109 | box-shadow: var(--ShadowSize) var(--brownShadow);
110 | }
111 |
112 | .shadow[class*="-grey"] {
113 | box-shadow: var(--ShadowSize) var(--greyShadow);
114 | }
115 |
116 | .shadow[class*="-gray"] {
117 | box-shadow: var(--ShadowSize) var(--grayShadow);
118 | }
119 |
120 | .shadow[class*="-black"] {
121 | box-shadow: var(--ShadowSize) var(--blackShadow);
122 | }
123 |
124 | .shadow[class*="-white"] {
125 | box-shadow: var(--ShadowSize) var(--blackShadow);
126 | }
127 |
128 |
--------------------------------------------------------------------------------
/miniprogram/style/comm/tag.wxss:
--------------------------------------------------------------------------------
1 |
2 | /* ==================
3 | 标签
4 | ==================== */
5 |
6 | .tag {
7 | font-size: 24rpx;
8 | vertical-align: middle;
9 | position: relative;
10 | display: inline-flex;
11 | align-items: center;
12 | justify-content: center;
13 | box-sizing: border-box;
14 | padding: 0rpx 16rpx;
15 | height: 48rpx;
16 | font-family: Helvetica Neue, Helvetica, sans-serif;
17 | white-space: nowrap;
18 | }
19 |
20 | .tag:not([class*="bg"]):not([class*="border"]) {
21 | background-color: var(--ghostWhite);
22 | }
23 |
24 | .tag[class*="border-"]::after {
25 | content: " ";
26 | width: 200%;
27 | height: 200%;
28 | position: absolute;
29 | top: 0;
30 | left: 0;
31 | border: 1rpx solid currentColor;
32 | transform: scale(0.5);
33 | transform-origin: 0 0;
34 | box-sizing: border-box;
35 | border-radius: inherit;
36 | z-index: 1;
37 | pointer-events: none;
38 | }
39 |
40 | .tag.radius[class*="border"]::after {
41 | border-radius: 12rpx;
42 | }
43 |
44 | .tag.round[class*="border"]::after {
45 | border-radius: 1000rpx;
46 | }
47 |
48 | .tag[class*="border-"]::after {
49 | border-radius: 0;
50 | }
51 |
52 | .tag.border-bold::after {
53 | border: 6rpx solid currentColor;
54 | }
55 |
56 | .tag+.tag {
57 | margin-left: 10rpx;
58 | }
59 |
60 | .tag.small {
61 | font-size: 20rpx;
62 | padding: 0rpx 12rpx;
63 | height: 32rpx;
64 | }
65 |
66 | .capsule {
67 | display: inline-flex;
68 | vertical-align: middle;
69 | }
70 |
71 | .capsule+.capsule {
72 | margin-left: 10rpx;
73 | }
74 |
75 | .capsule .tag {
76 | margin: 0;
77 | }
78 |
79 | .capsule .tag[class*="border-"]:last-child::after {
80 | border-left: 0rpx solid transparent;
81 | }
82 |
83 | .capsule .tag[class*="border-"]:first-child::after {
84 | border-right: 0rpx solid transparent;
85 | }
86 |
87 | .capsule.radius .tag:first-child {
88 | border-top-left-radius: 6rpx;
89 | border-bottom-left-radius: 6rpx;
90 | }
91 |
92 | .capsule.radius .tag:last-child::after,
93 | .capsule.radius .tag[class*="border-"] {
94 | border-top-right-radius: 12rpx;
95 | border-bottom-right-radius: 12rpx;
96 | }
97 |
98 | .capsule.round .tag:first-child {
99 | border-top-left-radius: 200rpx;
100 | border-bottom-left-radius: 200rpx;
101 | text-indent: 4rpx;
102 | }
103 |
104 | .capsule.round .tag:last-child::after,
105 | .capsule.round .tag:last-child {
106 | border-top-right-radius: 200rpx;
107 | border-bottom-right-radius: 200rpx;
108 | text-indent: -4rpx;
109 | }
110 |
111 | .tag.badge {
112 | border-radius: 200rpx;
113 | position: absolute;
114 | top: -10rpx;
115 | right: -10rpx;
116 | font-size: 20rpx;
117 | padding: 0rpx 10rpx;
118 | height: 28rpx;
119 | color: var(--white);
120 | }
121 |
122 | .tag.badge:not([class*="bg-"]) {
123 | background-color: #dd514c;
124 | }
125 |
126 | .tag:empty:not([class*="icon-"]) {
127 | padding: 0rpx;
128 | width: 16rpx;
129 | height: 16rpx;
130 | top: -4rpx;
131 | right: -4rpx;
132 | }
133 |
134 | .tag[class*="icon-"] {
135 | width: 32rpx;
136 | height: 32rpx;
137 | top: -4rpx;
138 | right: -4rpx;
139 | }
140 |
--------------------------------------------------------------------------------
/miniprogram/style/comm/text.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 | /* ==================
4 | 文本
5 | ==================== */
6 |
7 | .text-xs,
8 | [class*="icon-"].text-xs {
9 | font-size: 20rpx!important;
10 | }
11 |
12 | .text-s,
13 | [class*="icon-"].text-s {
14 | font-size: 24rpx!important;
15 | }
16 |
17 | .text-normal,
18 | [class*="icon-"].text-normal {
19 | font-size: 28rpx!important;
20 | }
21 |
22 | .text-l,
23 | [class*="icon-"].text-l {
24 | font-size: 32rpx!important;
25 | }
26 |
27 | .text-xl,
28 | [class*="icon-"].text-xl {
29 | font-size: 36rpx!important;
30 | }
31 |
32 | .text-xxl,
33 | [class*="icon-"].text-xxl {
34 | font-size: 44rpx!important;
35 | }
36 |
37 | .text-xxxl,
38 | [class*="icon-"].text-xxxl {
39 | font-size: 80rpx!important;
40 | }
41 |
42 | .text-xxxxl,
43 | [class*="icon-"].text-xxxxl {
44 | font-size: 120rpx!important;
45 | }
46 |
47 |
48 | .text-cut {
49 | text-overflow: ellipsis;
50 | white-space: nowrap;
51 | overflow: hidden;
52 | }
53 |
54 | .content-cut {
55 | text-overflow: ellipsis;
56 | overflow: hidden;
57 | }
58 |
59 | .content-cut-two {
60 | text-overflow: ellipsis;
61 | overflow: hidden;
62 | display: -webkit-box;
63 | word-break: break-all;
64 | -webkit-box-orient: vertical;
65 | -webkit-line-clamp: 2;
66 | }
67 |
68 | .content-cut-three {
69 | text-overflow: ellipsis;
70 | overflow: hidden;
71 | display: -webkit-box;
72 | word-break: break-all;
73 | -webkit-box-orient: vertical;
74 | -webkit-line-clamp: 3;
75 | }
76 |
77 | .text-bold {
78 | font-weight: bold!important;
79 | }
80 |
81 | .text-center {
82 | text-align: center!important;
83 | }
84 |
85 | .text-content {
86 | line-height: 1.6!important;
87 | }
88 |
89 | .text-left {
90 | text-align: left!important;
91 | }
92 |
93 | .text-right {
94 | text-align: right!important;
95 | }
96 |
97 | .text-red,
98 | .border-red {
99 | color: var(--red)!important;
100 | }
101 |
102 | .text-orange,
103 | .border-orange {
104 | color: var(--orange)!important;
105 | }
106 |
107 | .text-yellow,
108 | .border-yellow {
109 | color: var(--yellow)!important;
110 | }
111 |
112 | .text-olive,
113 | .border-olive {
114 | color: var(--olive)!important;
115 | }
116 |
117 | .text-green,
118 | .border-green {
119 | color: var(--green)!important;
120 | }
121 |
122 | .text-darkgreen,
123 | .border-darkgreen {
124 | color: var(--darkgreen)!important;
125 | }
126 |
127 | .text-cyan,
128 | .border-cyan {
129 | color: var(--cyan)!important;
130 | }
131 |
132 | .text-blue,
133 | .border-blue {
134 | color: var(--blue)!important;
135 | }
136 |
137 | .text-purple,
138 | .border-purple {
139 | color: var(--purple)!important;
140 | }
141 |
142 | .text-mauve,
143 | .border-mauve {
144 | color: var(--mauve)!important;
145 | }
146 |
147 | .text-pink,
148 | .border-pink {
149 | color: var(--pink)!important;
150 | }
151 |
152 | .text-brown,
153 | .border-brown {
154 | color: var(--brown)!important;
155 | }
156 |
157 | .text-grey,
158 | .border-grey {
159 | color: var(--grey)!important;
160 | }
161 |
162 | .text-gray,
163 | .border-gray {
164 | color: var(--gray)!important;
165 | }
166 |
167 | .text-black,
168 | .border-black {
169 | color: var(--black)!important;
170 | }
171 |
172 | .text-white,
173 | .border-white {
174 | color: var(--white)!important;
175 | }
176 |
177 |
--------------------------------------------------------------------------------
/miniprogram/style/project/project.wxss:
--------------------------------------------------------------------------------
1 | /* 主框架 */
2 | .main {
3 | width: 100%;
4 | box-sizing: border-box;
5 | padding: 20rpx 20rpx;
6 | display: flex;
7 | flex-direction: column;
8 | justify-content: center;
9 | align-items: center;
10 | }
11 |
12 | /*表单*/
13 | .main form {
14 | width: 100%;
15 | display: flex;
16 | flex-direction: column;
17 | }
18 |
19 | .form-group .title {
20 | font-weight: bold;
21 | }
22 |
23 | .form-box {
24 | background-color: #fff;
25 | border-radius: 20rpx;
26 | margin-bottom: 24rpx;
27 | box-sizing: border-box;
28 | width: 100%;
29 | }
30 |
31 | /* 固定按钮 */
32 | .btn-fixed {
33 | position: fixed;
34 | bottom: 130rpx;
35 | right: 12rpx;
36 | color: #fff;
37 | font-size: 40rpx;
38 | font-weight: bold;
39 | border-radius: 50%;
40 | background-color: #ccc;
41 | width: 60rpx;
42 | height: 60rpx;
43 | display: flex;
44 | align-items: center;
45 | justify-content: center;
46 | }
47 |
48 | /*单行大按钮*/
49 | .btn-main {
50 | width: 600rpx;
51 | font-size: 32rpx;
52 | height: 80rpx;
53 | line-height: 80rpx;
54 | border-radius: 40rpx;
55 | background-color: #0E9489;
56 | color: #fff;
57 | font-weight: bold;
58 | }
59 |
60 | /**校友底图**/
61 | .school-cover{
62 | position:absolute;
63 | top:0;
64 | left:0;
65 | width:100%;
66 | height:100%;
67 | opacity: .9;
68 | background-size:750rpx 280rpx;
69 | }
70 |
71 | .site-footer{
72 | width:100%;
73 | display: flex;
74 | flex-direction: column;
75 | justify-content: center;
76 | align-items: center;
77 | font-size: 28rpx;
78 | color:#666;
79 | margin-top:20rpx;
80 | }
81 |
82 | .site-footer .link{
83 | display: flex;
84 | justify-content: center;
85 | align-items: center;
86 | }
87 |
88 | .site-footer .link view, .site-footer .link button{
89 | margin-left:5rpx;
90 | margin-right:5rpx;
91 | }
92 |
93 | .site-footer .link .line{
94 | color:#ccc;
95 | }
96 |
97 | .site-footer .info{
98 | margin-top:10rpx;
99 | color:#aaa;
100 | font-size:24rpx;
101 | }
102 |
103 | .clearbtn {
104 | margin:0;
105 | padding:0;
106 | background-color: transparent;
107 | text-align: center;
108 | font-size:inherit;
109 | color: inherit;
110 | }
111 |
112 | .clearbtn::after {
113 | border: none !important;
114 | }
--------------------------------------------------------------------------------
/miniprogram/style/project/user_list.wxss:
--------------------------------------------------------------------------------
1 | .user-list {
2 | width: 100%;
3 | box-sizing: border-box;
4 | padding: 30rpx 30rpx 30rpx 30rpx;
5 | display: flex;
6 | flex-direction: column;
7 | justify-content: center;
8 | }
9 |
10 | .user-list .item {
11 | border-radius: 20rpx;
12 | background-color: #fff;
13 | display: flex;
14 | justify-content: center;
15 | padding: 20rpx;
16 | margin-bottom: 24rpx;
17 | position: relative;
18 | }
19 |
20 | .user-list .item .pic {
21 | width: 140rpx;
22 | }
23 |
24 | .user-list .item .detail {
25 | flex: 1;
26 | box-sizing: border-box;
27 | width: 400rpx;
28 | display: flex;
29 | flex-direction: column;
30 | }
31 |
32 | .user-list .item .detail .name {
33 | font-size: 24rpx;
34 | margin-bottom: 10rpx;
35 | z-index: 999;
36 | }
37 |
38 | .user-list .item .detail .name .yname{
39 | font-size: 32rpx;
40 | font-weight: bold;
41 | margin-right:10rpx;
42 | }
43 |
44 | .user-list .item .detail .name text {
45 | font-size: 24rpx;
46 | font-weight: normal;
47 | }
48 |
49 | .user-list .item .line {
50 | margin:0 6rpx;
51 | color: #ddd;
52 | }
53 |
54 | .user-list .item .detail .desc {
55 | line-height: 1.7;
56 | font-size: 24rpx;
57 | color: #666;
58 | }
59 |
60 | .user-list .item .detail .desc.last {
61 | line-height: 1.7;
62 | font-size: 24rpx;
63 | color: #aaa;
64 | }
65 |
66 | .user-list .item .mark {
67 | position: absolute;
68 | top: 0;
69 | right: 0;
70 | height: 52rpx;
71 | width: 112rpx;
72 | color: white;
73 | background-color: #CECECE;
74 | line-height: 52rpx;
75 | font-size: 24rpx;
76 | text-align: center;
77 | border-radius: 0 20rpx 0 20rpx;
78 | }
--------------------------------------------------------------------------------
/miniprogram/style/skin.wxss:
--------------------------------------------------------------------------------
1 | /*********** skin1 begin ************/
2 |
3 | .color-skin1 {
4 | color: #1cbbb4 !important;
5 | }
6 |
7 | .bg-skin1,
8 | .after-skin1:after {
9 | background-color: #1cbbb4 !important;
10 | color: #fff !important;
11 | }
12 |
13 | .border-skin1 {
14 | border-color: #1cbbb4 !important;
15 | }
--------------------------------------------------------------------------------
/miniprogram/tpls/biz/user_card_tpl.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{user.USER_NAME}}
8 | {{user.USER_ITEM}}
9 |
10 |
11 | 详情
12 |
13 |
14 |
--------------------------------------------------------------------------------
/miniprogram/tpls/public/list_load_tpl.wxml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 | 暂无数据
7 |
--------------------------------------------------------------------------------
/miniprogram/tpls/public/top_tpl.wxml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/同学录小程序说明.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixuandouyin/tjuclassmate/c9472addef33404bbd78af571e54faf1ab4333aa/同学录小程序说明.docx
--------------------------------------------------------------------------------