├── .gitignore
├── CC投票小程序安装使用手册.docx
├── README.md
├── cloudfunctions
└── mcloud
│ ├── config.json
│ ├── config
│ └── config.js
│ ├── framework
│ ├── cloud
│ │ ├── cloud_base.js
│ │ └── cloud_util.js
│ ├── core
│ │ ├── app_code.js
│ │ ├── app_error.js
│ │ ├── app_other.js
│ │ ├── app_util.js
│ │ └── application.js
│ ├── database
│ │ ├── db_util.js
│ │ ├── model.js
│ │ └── multi_model.js
│ ├── lib
│ │ ├── faker_lib.js
│ │ ├── md5_lib.js
│ │ └── mini_lib.js
│ ├── platform
│ │ ├── controller
│ │ │ ├── base_admin_controller.js
│ │ │ └── base_controller.js
│ │ ├── model
│ │ │ ├── admin_model.js
│ │ │ ├── base_model.js
│ │ │ └── log_model.js
│ │ └── service
│ │ │ ├── base_admin_service.js
│ │ │ └── base_service.js
│ ├── utils
│ │ ├── constant.js
│ │ ├── data_util.js
│ │ ├── export_util.js
│ │ ├── log_util.js
│ │ ├── math_util.js
│ │ ├── setup
│ │ │ ├── setup_model.js
│ │ │ └── setup_util.js
│ │ ├── time_util.js
│ │ └── util.js
│ └── validate
│ │ ├── content_check.js
│ │ └── data_check.js
│ ├── index.js
│ ├── package-lock.json
│ ├── package.json
│ └── project
│ └── VOTE1
│ ├── controller
│ ├── admin
│ │ ├── admin_home_controller.js
│ │ ├── admin_mgr_controller.js
│ │ ├── admin_news_controller.js
│ │ ├── admin_setup_controller.js
│ │ ├── admin_user_controller.js
│ │ ├── admin_vote_controller.js
│ │ └── base_project_admin_controller.js
│ ├── base_project_controller.js
│ ├── check_controller.js
│ ├── fav_controller.js
│ ├── home_controller.js
│ ├── my_controller.js
│ ├── news_controller.js
│ ├── passport_controller.js
│ └── vote_controller.js
│ ├── model
│ ├── base_project_model.js
│ ├── fav_model.js
│ ├── news_model.js
│ ├── user_model.js
│ ├── vote_join_model.js
│ └── vote_model.js
│ ├── public
│ ├── constants.js
│ ├── project_config.js
│ └── route.js
│ └── service
│ ├── admin
│ ├── admin_home_service.js
│ ├── admin_mgr_service.js
│ ├── admin_news_service.js
│ ├── admin_setup_service.js
│ ├── admin_user_service.js
│ ├── admin_vote_service.js
│ └── base_project_admin_service.js
│ ├── base_project_service.js
│ ├── fav_service.js
│ ├── home_service.js
│ ├── news_service.js
│ ├── passport_service.js
│ └── vote_service.js
├── miniprogram
├── app.js
├── app.json
├── app.wxss
├── cmpts
│ ├── biz
│ │ ├── detail
│ │ │ ├── detail_cmpt.js
│ │ │ ├── detail_cmpt.json
│ │ │ ├── detail_cmpt.wxml
│ │ │ └── detail_cmpt.wxss
│ │ └── foot
│ │ │ ├── foot_cmpt.js
│ │ │ ├── foot_cmpt.json
│ │ │ ├── foot_cmpt.wxml
│ │ │ └── foot_cmpt.wxss
│ └── public
│ │ ├── calendar
│ │ ├── calendar_comm
│ │ │ ├── calendar_comm_cmpt.js
│ │ │ ├── calendar_comm_cmpt.json
│ │ │ ├── calendar_comm_cmpt.wxml
│ │ │ ├── calendar_comm_cmpt.wxss
│ │ │ └── din.wxss
│ │ ├── calendar_lib.js
│ │ └── calendar_meet
│ │ │ ├── calendar_meet_cmpt.js
│ │ │ ├── calendar_meet_cmpt.json
│ │ │ ├── calendar_meet_cmpt.wxml
│ │ │ └── calendar_meet_cmpt.wxss
│ │ ├── checkbox
│ │ ├── checkbox_cmpt.js
│ │ ├── checkbox_cmpt.json
│ │ ├── checkbox_cmpt.wxml
│ │ └── checkbox_cmpt.wxss
│ │ ├── editor
│ │ ├── editor_cmpt.js
│ │ ├── editor_cmpt.json
│ │ ├── editor_cmpt.wxml
│ │ └── editor_cmpt.wxss
│ │ ├── form
│ │ ├── form_set
│ │ │ ├── field
│ │ │ │ ├── form_set_field.js
│ │ │ │ ├── form_set_field.json
│ │ │ │ ├── form_set_field.wxml
│ │ │ │ └── form_set_field.wxss
│ │ │ ├── form_set_cmpt.js
│ │ │ ├── form_set_cmpt.json
│ │ │ ├── form_set_cmpt.wxml
│ │ │ └── form_set_cmpt.wxss
│ │ ├── form_set_helper.js
│ │ └── form_show
│ │ │ ├── content
│ │ │ ├── form_show_content.js
│ │ │ ├── form_show_content.json
│ │ │ ├── form_show_content.wxml
│ │ │ └── form_show_content.wxss
│ │ │ ├── form_show_cmpt.js
│ │ │ ├── form_show_cmpt.json
│ │ │ ├── form_show_cmpt.wxml
│ │ │ └── form_show_cmpt.wxss
│ │ ├── 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
│ │ ├── modal
│ │ ├── modal_cmpt.js
│ │ ├── modal_cmpt.json
│ │ ├── modal_cmpt.wxml
│ │ └── modal_cmpt.wxss
│ │ ├── picker
│ │ ├── picker_cmpt.js
│ │ ├── picker_cmpt.json
│ │ ├── picker_cmpt.wxml
│ │ └── picker_cmpt.wxss
│ │ ├── picker_multi
│ │ ├── picker_multi_cmpt.js
│ │ ├── picker_multi_cmpt.json
│ │ ├── picker_multi_cmpt.wxml
│ │ └── picker_multi_cmpt.wxss
│ │ ├── picker_time
│ │ ├── datetime_picker.js
│ │ ├── picker_time_cmpt.js
│ │ ├── picker_time_cmpt.json
│ │ ├── picker_time_cmpt.wxml
│ │ └── picker_time_cmpt.wxss
│ │ ├── poster
│ │ ├── images
│ │ │ ├── friend.png
│ │ │ └── wechat.png
│ │ ├── poster_cmpt.js
│ │ ├── poster_cmpt.json
│ │ ├── poster_cmpt.wxml
│ │ ├── poster_cmpt.wxss
│ │ ├── poster_cmpt_helper.js
│ │ └── wxa-plugin-canvas
│ │ │ ├── index
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ ├── index.wxml
│ │ │ └── index.wxss
│ │ │ └── poster
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ ├── index.wxml
│ │ │ ├── index.wxss
│ │ │ └── poster.js
│ │ ├── swiper
│ │ ├── swiper_cmpt.js
│ │ ├── swiper_cmpt.json
│ │ ├── swiper_cmpt.wxml
│ │ └── swiper_cmpt.wxss
│ │ └── table
│ │ ├── table_cmpt.js
│ │ ├── table_cmpt.json
│ │ ├── table_cmpt.wxml
│ │ └── table_cmpt.wxss
├── comm
│ ├── behavior
│ │ ├── my_fav_bh.js
│ │ ├── my_foot_bh.js
│ │ ├── news_index_bh.js
│ │ └── search_bh.js
│ ├── biz
│ │ ├── admin_biz.js
│ │ ├── base_biz.js
│ │ ├── fav_biz.js
│ │ ├── foot_biz.js
│ │ ├── passport_biz.js
│ │ ├── public_biz.js
│ │ └── search_biz.js
│ └── constants.js
├── helper
│ ├── cache_helper.js
│ ├── cloud_helper.js
│ ├── content_check_helper.js
│ ├── data_helper.js
│ ├── file_helper.js
│ ├── form_helper.js
│ ├── helper.js
│ ├── mini_helper.js
│ ├── page_helper.js
│ ├── pic_helper.js
│ ├── time_helper.js
│ └── validate.js
├── images
│ └── cover.gif
├── lib
│ └── tools
│ │ ├── base64_lib.js
│ │ ├── lunar_lib.js
│ │ └── qrcode_lib.js
├── pages
│ └── test1
│ │ ├── test1.js
│ │ └── test1.wxml
├── projects
│ └── VOTE1
│ │ ├── biz
│ │ ├── admin_news_biz.js
│ │ ├── admin_vote_biz.js
│ │ ├── news_biz.js
│ │ ├── project_biz.js
│ │ └── vote_biz.js
│ │ ├── images
│ │ ├── home.jpg
│ │ ├── menu
│ │ │ ├── news_1.png
│ │ │ ├── vote_1.png
│ │ │ ├── vote_2.png
│ │ │ ├── vote_3.png
│ │ │ ├── vote_4.png
│ │ │ └── vote_5.png
│ │ └── tabbar
│ │ │ ├── home.png
│ │ │ ├── home_cur.png
│ │ │ ├── my.png
│ │ │ ├── my_cur.png
│ │ │ ├── news.png
│ │ │ ├── news_cur.png
│ │ │ ├── vote.png
│ │ │ └── vote_cur.png
│ │ ├── pages
│ │ ├── about
│ │ │ └── index
│ │ │ │ ├── about_index.js
│ │ │ │ ├── about_index.json
│ │ │ │ ├── about_index.wxml
│ │ │ │ └── about_index.wxss
│ │ ├── admin
│ │ │ ├── content
│ │ │ │ ├── admin_content.js
│ │ │ │ ├── admin_content.json
│ │ │ │ ├── admin_content.wxml
│ │ │ │ └── admin_content.wxss
│ │ │ ├── index
│ │ │ │ ├── home
│ │ │ │ │ ├── admin_home.js
│ │ │ │ │ ├── admin_home.json
│ │ │ │ │ ├── admin_home.wxml
│ │ │ │ │ └── admin_home.wxss
│ │ │ │ └── login
│ │ │ │ │ ├── admin_login.js
│ │ │ │ │ ├── admin_login.json
│ │ │ │ │ ├── admin_login.wxml
│ │ │ │ │ └── admin_login.wxss
│ │ │ ├── mgr
│ │ │ │ ├── add
│ │ │ │ │ ├── admin_mgr_add.js
│ │ │ │ │ ├── admin_mgr_add.json
│ │ │ │ │ ├── admin_mgr_add.wxml
│ │ │ │ │ └── admin_mgr_add.wxss
│ │ │ │ ├── edit
│ │ │ │ │ ├── admin_mgr_edit.js
│ │ │ │ │ ├── admin_mgr_edit.json
│ │ │ │ │ ├── admin_mgr_edit.wxml
│ │ │ │ │ └── admin_mgr_edit.wxss
│ │ │ │ ├── list
│ │ │ │ │ ├── admin_mgr_list.js
│ │ │ │ │ ├── admin_mgr_list.json
│ │ │ │ │ ├── admin_mgr_list.wxml
│ │ │ │ │ └── admin_mgr_list.wxss
│ │ │ │ ├── log
│ │ │ │ │ ├── admin_log_list.js
│ │ │ │ │ ├── admin_log_list.json
│ │ │ │ │ ├── admin_log_list.wxml
│ │ │ │ │ └── admin_log_list.wxss
│ │ │ │ └── pwd
│ │ │ │ │ ├── admin_mgr_pwd.js
│ │ │ │ │ ├── admin_mgr_pwd.json
│ │ │ │ │ ├── admin_mgr_pwd.wxml
│ │ │ │ │ └── admin_mgr_pwd.wxss
│ │ │ ├── news
│ │ │ │ ├── add
│ │ │ │ │ ├── admin_news_add.js
│ │ │ │ │ ├── admin_news_add.json
│ │ │ │ │ ├── admin_news_add.wxml
│ │ │ │ │ └── admin_news_add.wxss
│ │ │ │ ├── admin_news_form_tpl.wxml
│ │ │ │ ├── edit
│ │ │ │ │ ├── admin_news_edit.js
│ │ │ │ │ ├── admin_news_edit.json
│ │ │ │ │ ├── admin_news_edit.wxml
│ │ │ │ │ └── admin_news_edit.wxss
│ │ │ │ └── list
│ │ │ │ │ ├── admin_news_list.js
│ │ │ │ │ ├── admin_news_list.json
│ │ │ │ │ ├── admin_news_list.wxml
│ │ │ │ │ └── admin_news_list.wxss
│ │ │ ├── setup
│ │ │ │ ├── about
│ │ │ │ │ ├── admin_setup_about.js
│ │ │ │ │ ├── admin_setup_about.json
│ │ │ │ │ ├── admin_setup_about.wxml
│ │ │ │ │ └── admin_setup_about.wxss
│ │ │ │ └── qr
│ │ │ │ │ ├── admin_setup_qr.js
│ │ │ │ │ ├── admin_setup_qr.json
│ │ │ │ │ ├── admin_setup_qr.wxml
│ │ │ │ │ └── admin_setup_qr.wxss
│ │ │ ├── user
│ │ │ │ ├── detail
│ │ │ │ │ ├── admin_user_detail.js
│ │ │ │ │ ├── admin_user_detail.json
│ │ │ │ │ ├── admin_user_detail.wxml
│ │ │ │ │ └── admin_user_detail.wxss
│ │ │ │ ├── export
│ │ │ │ │ ├── admin_user_export.js
│ │ │ │ │ ├── admin_user_export.json
│ │ │ │ │ ├── admin_user_export.wxml
│ │ │ │ │ └── admin_user_export.wxss
│ │ │ │ └── list
│ │ │ │ │ ├── admin_user_list.js
│ │ │ │ │ ├── admin_user_list.json
│ │ │ │ │ ├── admin_user_list.wxml
│ │ │ │ │ └── admin_user_list.wxss
│ │ │ └── vote
│ │ │ │ ├── add
│ │ │ │ ├── admin_vote_add.js
│ │ │ │ ├── admin_vote_add.json
│ │ │ │ ├── admin_vote_add.wxml
│ │ │ │ └── admin_vote_add.wxss
│ │ │ │ ├── admin_vote_bh.js
│ │ │ │ ├── content
│ │ │ │ ├── admin_vote_content.js
│ │ │ │ ├── admin_vote_content.json
│ │ │ │ ├── admin_vote_content.wxml
│ │ │ │ └── admin_vote_content.wxss
│ │ │ │ ├── edit
│ │ │ │ ├── admin_vote_edit.js
│ │ │ │ ├── admin_vote_edit.json
│ │ │ │ ├── admin_vote_edit.wxml
│ │ │ │ └── admin_vote_edit.wxss
│ │ │ │ ├── export
│ │ │ │ ├── admin_vote_export.js
│ │ │ │ ├── admin_vote_export.json
│ │ │ │ ├── admin_vote_export.wxml
│ │ │ │ └── admin_vote_export.wxss
│ │ │ │ ├── list
│ │ │ │ ├── admin_vote_list.js
│ │ │ │ ├── admin_vote_list.json
│ │ │ │ ├── admin_vote_list.wxml
│ │ │ │ └── admin_vote_list.wxss
│ │ │ │ ├── stat
│ │ │ │ ├── admin_vote_stat.js
│ │ │ │ ├── admin_vote_stat.json
│ │ │ │ ├── admin_vote_stat.wxml
│ │ │ │ └── admin_vote_stat.wxss
│ │ │ │ └── vote_form_tpl.wxml
│ │ ├── default
│ │ │ └── index
│ │ │ │ ├── default_index.js
│ │ │ │ ├── default_index.json
│ │ │ │ ├── default_index.wxml
│ │ │ │ └── default_index.wxss
│ │ ├── my
│ │ │ ├── edit
│ │ │ │ ├── my_edit.js
│ │ │ │ ├── my_edit.json
│ │ │ │ ├── my_edit.wxml
│ │ │ │ ├── my_edit.wxss
│ │ │ │ └── user_form.wxml
│ │ │ ├── fav
│ │ │ │ ├── my_fav.js
│ │ │ │ ├── my_fav.json
│ │ │ │ ├── my_fav.wxml
│ │ │ │ └── my_fav.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
│ │ │ └── reg
│ │ │ │ ├── my_reg.js
│ │ │ │ ├── my_reg.json
│ │ │ │ ├── my_reg.wxml
│ │ │ │ └── my_reg.wxss
│ │ ├── news
│ │ │ ├── detail
│ │ │ │ ├── news_detail.js
│ │ │ │ ├── news_detail.json
│ │ │ │ ├── news_detail.wxml
│ │ │ │ └── news_detail.wxss
│ │ │ └── index
│ │ │ │ ├── news_index.js
│ │ │ │ ├── news_index.json
│ │ │ │ ├── news_index.wxml
│ │ │ │ └── news_index.wxss
│ │ ├── search
│ │ │ ├── search.js
│ │ │ ├── search.json
│ │ │ ├── search.wxml
│ │ │ └── search.wxss
│ │ ├── tpls
│ │ │ └── menu_tpl.wxml
│ │ └── vote
│ │ │ ├── detail
│ │ │ ├── vote_detail.js
│ │ │ ├── vote_detail.json
│ │ │ ├── vote_detail.wxml
│ │ │ └── vote_detail.wxss
│ │ │ ├── index
│ │ │ ├── vote_index.js
│ │ │ ├── vote_index.json
│ │ │ ├── vote_index.wxml
│ │ │ └── vote_index.wxss
│ │ │ ├── item
│ │ │ ├── vote_item.js
│ │ │ ├── vote_item.json
│ │ │ ├── vote_item.wxml
│ │ │ └── vote_item.wxss
│ │ │ ├── my_join_list
│ │ │ ├── vote_my_join_list.js
│ │ │ ├── vote_my_join_list.json
│ │ │ ├── vote_my_join_list.wxml
│ │ │ └── vote_my_join_list.wxss
│ │ │ └── vote.wxss
│ │ ├── public
│ │ └── project_setting.js
│ │ └── style
│ │ └── skin.wxss
├── setting
│ └── setting.js
├── sitemap.json
├── style
│ ├── base
│ │ ├── 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
│ │ ├── table.wxss
│ │ ├── tag.wxss
│ │ └── text.wxss
│ ├── project
│ │ ├── my_fav_style.wxss
│ │ ├── my_foot_style.wxss
│ │ └── search_style.wxss
│ └── public
│ │ ├── admin.wxss
│ │ ├── article_list.wxss
│ │ ├── comm_box_list.wxss
│ │ ├── detail.wxss
│ │ └── project.wxss
└── tpls
│ ├── project
│ ├── my_fav_tpl.wxml
│ ├── my_foot_tpl.wxml
│ ├── news_index_tpl.wxml
│ └── search_tpl.wxml
│ ├── public
│ ├── base_list_tpl.wxml
│ ├── list_load_tpl.wxml
│ └── top_tpl.wxml
│ └── wxs
│ └── tools.wxs
├── project.config.json
└── project.private.config.json
/.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 |
--------------------------------------------------------------------------------
/CC投票小程序安装使用手册.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/CC投票小程序安装使用手册.docx
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "permissions": {
3 | "openapi": ["wxacode.getUnlimited", "security.imgSecCheck", "security.msgSecCheck","serviceMarket.invokeService"]
4 | }
5 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/config/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 |
3 | //### 环境相关
4 | CLOUD_ID: 'init-5go8b8pdc98ea814', //你的云环境id
5 |
6 | // ##################################################################
7 | COLLECTION_PRFIX: 'bx_',
8 |
9 | IS_DEMO: false, //是否演示版 (后台不可操作提交动作)
10 | // ##################################################################
11 | // #### 调试相关
12 | TEST_MODE: false, // 测试模式 涉及小程序码生成路径, 用以下 TEST_TOKEN_ID openid..
13 | TEST_TOKEN_ID: 'oD58U5Ej-gK0BjqSspqjQEPgXuQQ',
14 |
15 |
16 | // #### 内容安全
17 | CLIENT_CHECK_CONTENT: false, //前台图片文字是否校验
18 | ADMIN_CHECK_CONTENT: false, //后台图片文字是否校验
19 |
20 | // ### 后台业务相关
21 | ADMIN_LOGIN_EXPIRE: 86400, //管理员token过期时间 (秒)
22 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/cloud/cloud_base.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 云初始化实例
3 | * Ver : CCMiniCloud Framework 2.2.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2020-09-05 04:00:00
5 | */
6 |
7 | const config = require('../../config/config.js');
8 |
9 | /**
10 | * 获得云实例
11 | */
12 | function getCloud() {
13 | const cloud = require('wx-server-sdk');
14 | cloud.init({
15 | env: config.CLOUD_ID
16 | });
17 | return cloud;
18 | }
19 |
20 | module.exports = {
21 | getCloud
22 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/core/app_code.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 错误代码定义
3 | * Ver : CCMiniCloud Framework 2.4.1 ALL RIGHTS RESERVED BY Cclinux0730 (wechat)
4 | * Date: 2020-09-05 04:00:00
5 | */
6 | module.exports = {
7 | SUCC: 200,
8 | SVR: 500, // 服务器错误
9 | LOGIC: 1600, //逻辑错误
10 | DATA: 1301, // 数据校验错误
11 | HEADER: 1302, // header 校验错误
12 |
13 |
14 | //2000开始为业务错误代码,
15 |
16 | ADMIN_ERROR: 2401 //管理员错误
17 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/core/app_error.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 应用异常处理类
3 | * Ver : CCMiniCloud Framework 2.5.1 ALL RIGHTS RESERVED BY cClinux0730 (wechat)
4 | * Date: 2020-09-05 04:00:00
5 | */
6 |
7 |
8 | const appCode = require('./app_code.js');
9 |
10 | class AppError extends Error {
11 | constructor(message, code = appCode.LOGIC) {
12 | super(message);
13 | this.name = 'AppError';
14 | this.code = code;
15 | }
16 | }
17 |
18 | module.exports = AppError;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/core/app_other.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 云函数非标业务处理
3 | * Ver : CCMiniCloud Framework 2.6.1 ALL RIGHTS RESERVED BY ccLinux@qq.com
4 | * Date: 2021-10-21 04:00:00
5 | */
6 |
7 | function handlerOther(event) {
8 | let isOther = false;
9 |
10 | if (!event) return {
11 | isOther,
12 | eventX
13 | };
14 |
15 | // 公众号事件处理
16 | if (event['FromUserName'] && event['MsgType']) {
17 | console.log('公众号事件处理');
18 | let ret = {
19 | route: 'oa/serve',
20 | params: event
21 | }
22 | return {
23 | isOther: true,
24 | eventX: ret
25 | };
26 | }
27 |
28 | return {
29 | isOther,
30 | eventX: event
31 | };
32 | }
33 |
34 |
35 | module.exports = {
36 | handlerOther,
37 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/core/app_util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 云函数业务主逻辑函数
3 | * Ver : CCMiniCloud Framework 2.7.1 ALL RIGHTS RESERVED BY cclinuX0730 (wechat)
4 | * Date: 2021-02-09 04:00:00
5 | */
6 |
7 | const appCode = require('./app_code.js');
8 |
9 | function handlerBasic(code, msg = '', data = {}) {
10 |
11 | switch (code) {
12 | case appCode.SUCC:
13 | msg = (msg) ? msg + ':ok' : 'ok';
14 | break;
15 | case appCode.SVR:
16 | msg = '服务器繁忙,请稍后再试';
17 | break;
18 | case appCode.LOGIC:
19 | break;
20 | case appCode.DATA:
21 | break;
22 |
23 | /*
24 | default:
25 | msg = '服务器开小差了,请稍后再试';
26 | break;*/
27 | }
28 |
29 | return {
30 | code: code,
31 | msg: msg,
32 | data: data
33 | }
34 |
35 | }
36 |
37 | function handlerSvrErr(msg = '') {
38 | return handlerBasic(appCode.SVR, msg);
39 | }
40 |
41 | function handlerSucc(msg = '') {
42 | return handlerBasic(appCode.SUCC, msg);
43 | }
44 |
45 | function handlerAppErr(msg = '', code = appCode.LOGIC) {
46 | return handlerBasic(code, msg);
47 | }
48 |
49 |
50 | function handlerData(data, msg = '') {
51 | return handlerBasic(appCode.SUCC, msg, data);
52 | }
53 |
54 | module.exports = {
55 | handlerBasic,
56 | handlerData,
57 | handlerSucc,
58 | handlerSvrErr,
59 | handlerAppErr
60 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/lib/mini_lib.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 小程序封装类库
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cClinux0730 (wechat)
4 | * Date: 2020-09-06 14:00:00
5 | */
6 | const cloudBase = require('../cloud/cloud_base.js');
7 | const cloudUtil = require('../cloud/cloud_util.js');
8 | const config = require('../../config/config');
9 |
10 |
11 | // 消息长度截取
12 | function fmtThing(str) { //20个以内字符,可汉字、数字、字母或符号组合
13 | return str.substr(0, 20);
14 | }
15 |
16 | function fmtCharacterString(str) { //32位以内数字、字母或符号
17 | return str.substr(0, 32);
18 | }
19 |
20 | function fmtPhrase(str) { //5个以内汉字
21 | return str.substr(0, 5);
22 | }
23 |
24 | /**
25 | * 发送一次性消息
26 | * @param {*} body
27 | * @param {*} key
28 | */
29 | async function sendMiniOnceTempMsg(body, key = '') {
30 | // console.log('##sendOnceTempMsg[' + key + ']', body);
31 | let cloud = cloudBase.getCloud();
32 | try {
33 | // 默认参数
34 | body.lang = 'zh_CN';
35 | body.miniprogramState = 'formal';
36 |
37 | await cloud.openapi.subscribeMessage.send(body);
38 | } catch (err) {
39 | cloudUtil.log('##sendOnceTempMsg[' + key + ']', err);
40 | }
41 | }
42 | module.exports = {
43 | sendMiniOnceTempMsg,
44 |
45 | fmtThing,
46 | fmtCharacterString,
47 | fmtPhrase
48 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/platform/controller/base_admin_controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 后台管理控制器模块
3 | * Ver : CCMiniCloud Framework 2.0.3 ALL RIGHTS RESERVED BY cclinuX0730 (wechat)
4 | * Date: 2022-05-26 19:20:00
5 | */
6 |
7 | const BaseController = require('./base_controller.js');
8 | const BaseAdminService = require('../service/base_admin_service.js');
9 | const LogModel = require('../model/log_model.js');
10 |
11 | const timeUtil = require('../../../framework/utils/time_util.js');
12 |
13 | class BaseAdminController extends BaseController {
14 |
15 | constructor(route, openId, event) {
16 | super(route, openId, event);
17 |
18 | // 当前时间戳
19 | this._timestamp = timeUtil.time();
20 |
21 | this._admin = null;
22 | this._adminId = '0';
23 |
24 | }
25 |
26 | /** 是否管理员 */
27 | async isAdmin() {
28 | // 判断是否管理员
29 | let service = new BaseAdminService();
30 | let admin = await service.isAdmin(this._token);
31 | this._admin = admin;
32 | this._adminId = admin._id;
33 | }
34 |
35 | /** 是否超级管理员 */
36 | async isSuperAdmin() {
37 | // 判断是否管理员
38 | let service = new BaseAdminService();
39 | let admin = await service.isSuperAdmin(this._token);
40 | this._admin = admin;
41 | this._adminId = admin._id;
42 | }
43 |
44 | /** 记录日志 */
45 | async log(content, type) {
46 | let service = new BaseAdminService();
47 | await service.insertLog(content, this._admin, type);
48 | }
49 |
50 | async logSys(content) {
51 | await this.log(content, LogModel.TYPE.SYS);
52 | }
53 |
54 | async logUser(content) {
55 | await this.log(content, LogModel.TYPE.USER);
56 | }
57 |
58 | async logOther(content) {
59 | await this.log(content, LogModel.TYPE.OTHER);
60 | }
61 |
62 | async logNews(content) {
63 | await this.log(content, LogModel.TYPE.NEWS);
64 | }
65 |
66 | }
67 |
68 | module.exports = BaseAdminController;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/platform/controller/base_controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 基础控制器
3 | * Ver : CCMiniCloud Framework 2.0.4 ALL RIGHTS RESERVED BY cclinUx0730 (wechat)
4 | * Date: 2020-09-05 04:00:00
5 | */
6 |
7 | const config = require('../../../config/config.js');
8 | const timeUtil = require('../../utils/time_util.js');
9 | const util = require('../../utils/util.js');
10 | const dataCheck = require('../../validate/data_check.js');
11 |
12 | const AppError = require('../../core/app_error.js');
13 | const appCode = require('../../core/app_code.js');
14 |
15 | class BaseController {
16 |
17 | constructor(route, openId, event) {
18 | this._route = route; // 路由
19 | this._openId = openId; //用户身份
20 | this._event = event; // 所有参数
21 | this._request = event.params; //数据参数
22 |
23 | // 测试模式
24 | if (config.TEST_MODE)
25 | openId = config.TEST_TOKEN_ID;
26 |
27 | if (!openId) {
28 | console.error('OPENID is unfined');
29 | throw new AppError('OPENID is unfined', appCode.SVR);
30 | }
31 |
32 | let userId = openId;
33 |
34 | this._token = event.token || '';
35 | this._userId = userId;
36 |
37 | // 当前时间戳
38 | this._timestamp = timeUtil.time();
39 | let time = timeUtil.time('Y-M-D h:m:s');
40 |
41 | console.log('------------------------');
42 | console.log(`【${time}】【Request -- ↘↘↘】\n【↘Token = ${this._token}】\n【↘USER-ID = ${userId}】\n【↘↘IN DATA】=\n`, JSON.stringify(this._request, null, 4));
43 |
44 | }
45 |
46 | /**
47 | * 数据校验
48 | * @param {*} rules
49 | */
50 | validateData(rules = {}) {
51 | let input = this._request;
52 | return dataCheck.check(input, rules);
53 | }
54 |
55 | // 取得某个具体的参数值
56 | getParameter(name) {
57 | let input = this._request;
58 | if (util.isDefined(input[name]))
59 | return input[name];
60 | else
61 | return '';
62 | }
63 | }
64 |
65 | module.exports = BaseController;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/platform/model/admin_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 系统管理员实体
3 | * Date: 2021-03-15 19:20:00
4 | * Ver : CCMiniCloud Framework 2.0.5 ALL RIGHTS RESERVED BY CCLINUX0730 (wechat)
5 | */
6 |
7 |
8 | const BaseModel = require('./base_model.js');
9 |
10 | class AdminModel extends BaseModel {
11 |
12 | }
13 |
14 | // 集合名
15 | AdminModel.CL = BaseModel.C('admin');
16 |
17 | AdminModel.DB_STRUCTURE = {
18 | _pid: 'string|true',
19 | ADMIN_ID: 'string|true',
20 | ADMIN_NAME: 'string|true',
21 | ADMIN_DESC: 'string|true',
22 | ADMIN_PHONE: 'string|false|comment=手机',
23 | ADMIN_PASSWORD: 'string|true|comment=密码',
24 | ADMIN_STATUS: 'int|true|default=1|comment=状态:0=禁用 1=启用',
25 |
26 | ADMIN_LOGIN_CNT: 'int|true|default=0|comment=登录次数',
27 | ADMIN_LOGIN_TIME: 'int|true|default=0|comment=最后登录时间',
28 | ADMIN_TYPE: 'int|true|default=0|comment=类型 0=普通管理员 1=超级管理员',
29 |
30 | ADMIN_TOKEN: 'string|false|comment=当前登录token',
31 | ADMIN_TOKEN_TIME: 'int|true|default=0|comment=当前登录token time',
32 |
33 | ADMIN_ADD_TIME: 'int|true',
34 | ADMIN_EDIT_TIME: 'int|true',
35 | ADMIN_ADD_IP: 'string|false',
36 | ADMIN_EDIT_IP: 'string|false',
37 | };
38 |
39 | // 字段前缀
40 | AdminModel.FIELD_PREFIX = "ADMIN_";
41 |
42 |
43 |
44 |
45 |
46 |
47 | module.exports = AdminModel;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/platform/model/base_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 实体基类
3 | * Date: 2021-03-15 19:20:00
4 | * Ver : CCMiniCloud Framework 2.0.6 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
5 | */
6 |
7 |
8 | const MultiModel = require('../../../framework/database/multi_model.js');
9 |
10 | class BaseModel extends MultiModel {
11 |
12 | }
13 |
14 | module.exports = BaseModel;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/platform/model/log_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 后台操作日志实体
3 | * Ver : CCMiniCloud Framework 2.0.7 ALL RIGHTS RESERVED BY cclinuX0730 (wechat)
4 | * Date: 2020-10-16 19:20:00
5 | */
6 |
7 |
8 | const BaseModel = require('./base_model.js');
9 |
10 | class LogModel extends BaseModel {
11 |
12 | }
13 |
14 | // 集合名
15 | LogModel.CL = BaseModel.C('log');
16 |
17 | LogModel.DB_STRUCTURE = {
18 | _pid: 'string|true',
19 | LOG_ID: 'string|true',
20 |
21 | LOG_ADMIN_ID: 'string|true|comment=管理员',
22 | LOG_ADMIN_DESC: 'string|false',
23 | LOG_ADMIN_NAME: 'string|true',
24 |
25 | LOG_CONTENT: 'string|true',
26 |
27 | LOG_TYPE: 'int|true|comment=日志类型 ',
28 |
29 | LOG_ADD_TIME: 'int|true',
30 | LOG_EDIT_TIME: 'int|true',
31 | LOG_ADD_IP: 'string|false',
32 | LOG_EDIT_IP: 'string|false',
33 | };
34 |
35 | // 字段前缀
36 | LogModel.FIELD_PREFIX = "LOG_";
37 |
38 | LogModel.TYPE = {
39 | SYS: 0,
40 | USER: 1,
41 | NEWS: 2,
42 | OTHER: 99,
43 |
44 | }
45 | LogModel.TYPE_DESC = {
46 | SYS: '系统',
47 | USER: '用户',
48 | NEWS: '文章',
49 | OTHER: '其他',
50 | }
51 |
52 | module.exports = LogModel;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/platform/service/base_service.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 基础业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.9 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2022-04-24 04:00:00
5 | */
6 |
7 | const AppError = require('../../core/app_error.js');
8 | const appCode = require('../../core/app_code.js');
9 | const timeUtil = require('../../utils/time_util.js');
10 |
11 | class BaseService {
12 | constructor() {
13 | // 当前时间戳
14 | this._timestamp = timeUtil.time();
15 |
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 | module.exports = BaseService;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/utils/constant.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 通用常量定义
3 | * Ver : CCMiniCloud Framework 2.32.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2020-09-05 04:00:00
5 | */
6 | module.exports = {
7 |
8 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/utils/math_util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 数学计算相关操作函数
3 | * Ver : CCMiniCloud Framework 2.35.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2021-10-04 04:00:00
5 | */
6 |
7 |
8 | /** 获取百分比, 保留2位小数 */
9 | function percent(num1, num2) {
10 | return Math.round(num1 / num2 * 10000) / 100.00;
11 | }
12 |
13 | /** 数组对象排序 */
14 | function arrayObjecSortAsc(property) {
15 | return function (a, b) {
16 | var value1 = a[property];
17 | var value2 = b[property];
18 | return value1 - value2;
19 | }
20 | }
21 |
22 | /** 数组对象排序 */
23 | function arrayObjecSortDesc(property) {
24 | return function (a, b) {
25 | var value1 = a[property];
26 | var value2 = b[property];
27 | return value2 - value1;
28 | }
29 | }
30 |
31 | module.exports = {
32 | percent, // 百分比,保留2位小数
33 | arrayObjecSortAsc, // 数组对象排序
34 | arrayObjecSortDesc, // 数组对象排序
35 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/utils/setup/setup_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 系统设置实体
3 | * Ver : CCMiniCloud Framework 2.0.15 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2020-11-05 19:20:00
5 | */
6 |
7 |
8 | const MultiModel = require('../../database/multi_model.js');
9 |
10 | class SetupModel extends MultiModel {
11 |
12 | }
13 |
14 | // 集合名
15 | SetupModel.CL = MultiModel.C('setup');
16 |
17 | SetupModel.DB_STRUCTURE = {
18 | _pid: 'string|true',
19 | SETUP_ID: 'string|true',
20 |
21 | SETUP_KEY: 'string|true',
22 | SETUP_VALUE: 'object|true', // {val:}
23 |
24 | SETUP_ADD_TIME: 'int|true',
25 | SETUP_EDIT_TIME: 'int|true',
26 | SETUP_ADD_IP: 'string|false',
27 | SETUP_EDIT_IP: 'string|false',
28 | };
29 |
30 | // 字段前缀
31 | SetupModel.FIELD_PREFIX = "SETUP_";
32 |
33 |
34 | module.exports = SetupModel;
35 |
36 | /*
37 | ### 富文本
38 | [{"type":"text","val":"xxx"},{"type":"img","val":"cloudId://xxxx"}]
39 |
40 | ### 导出
41 | {"EXPORT_CLOUD_ID":"","EXPORT_EDIT_TIME":""}
42 | */
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/utils/setup/setup_util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 系统设置相关函数
3 | * Ver : CCMiniCloud Framework 2.31.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2022-05-25 04:00:00
5 | */
6 |
7 | const SetupModel = require('./setup_model.js');
8 |
9 | /**
10 | * 设置
11 | * key 键key
12 | * val 值value
13 | * t 秒
14 | */
15 | async function set(key, val) {
16 | if (!key) return null;
17 |
18 | let where = {
19 | SETUP_KEY: key
20 | }
21 |
22 | let data = {
23 | SETUP_VALUE: {
24 | val
25 | },
26 | }
27 |
28 | await SetupModel.insertOrUpdate(where, data);
29 |
30 | }
31 |
32 | /**
33 | * 获取
34 | * k 键key
35 | * def 默认值
36 | */
37 | async function get(key) {
38 |
39 | if (!key) return null;
40 |
41 | let where = {
42 | SETUP_KEY: key
43 | }
44 |
45 | let setup = await SetupModel.getOne(where, 'SETUP_VALUE');
46 | if (!setup) return null;
47 |
48 |
49 | let res = setup.SETUP_VALUE.val;
50 |
51 | if (res === undefined) {
52 | return null;
53 | } else {
54 | return res;
55 | }
56 | }
57 |
58 | async function get(key) {
59 |
60 | if (!key) return null;
61 |
62 | let where = {
63 | SETUP_KEY: key
64 | }
65 |
66 | let setup = await SetupModel.getOne(where, 'SETUP_VALUE');
67 | if (!setup) return null;
68 |
69 |
70 | let res = setup.SETUP_VALUE.val;
71 |
72 | if (res === undefined) {
73 | return null;
74 | } else {
75 | return res;
76 | }
77 | }
78 |
79 | async function remove(key, fuzzy = false) {
80 | if (!key) return;
81 |
82 | let where = {
83 | SETUP_KEY: key
84 | }
85 |
86 | if (fuzzy) {
87 | where.SETUP_KEY = {
88 | $regex: '.*' + key,
89 | $options: 'i'
90 | };
91 | }
92 |
93 | await SetupModel.del(where);
94 | }
95 |
96 | module.exports = {
97 | set,
98 | get,
99 | remove
100 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/framework/utils/util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 通用工具函数
3 | * Ver : CCMiniCloud Framework 2.38.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2020-09-05 04:00:00
5 | */
6 |
7 | function getProjectId() {
8 | if (global.PID)
9 | return global.PID;
10 | else
11 | return 'ONE';
12 | }
13 |
14 | /**
15 | * 判断变量,参数,对象属性是否定义
16 | * @param {*} val
17 | */
18 | function isDefined(val) {
19 | // == 不能判断是否为null
20 | if (val === undefined)
21 | return false;
22 | else
23 | return true;
24 | }
25 |
26 | /**
27 | * 判断对象是否为空
28 | * @param {*} obj
29 | */
30 | function isObjectNull(obj) {
31 | return (Object.keys(obj).length == 0);
32 | }
33 |
34 |
35 |
36 | /**
37 | * 休眠时间,配合await使用
38 | * @param {*} time 毫秒
39 | */
40 | function sleep(time) {
41 | return new Promise((resolve) => setTimeout(resolve, time));
42 | };
43 |
44 |
45 |
46 |
47 | module.exports = {
48 | getProjectId,
49 | isDefined, //判断变量,参数,对象属性是否定义
50 | sleep,
51 | isObjectNull,
52 |
53 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/index.js:
--------------------------------------------------------------------------------
1 | const application = require('./framework/core/application.js');
2 |
3 | // 云函数入口函数
4 | exports.main = async (event, context) => {
5 | return await application.app(event, context);
6 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/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 | "mysql": "^2.18.1",
14 | "node-xlsx": "^0.16.1",
15 | "wx-server-sdk": "~2.1.2"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/controller/admin/admin_home_controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 后台登录与首页模块
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2021-03-15 19:20:00
5 | */
6 |
7 | const BaseProjectAdminController = require('./base_project_admin_controller.js');
8 | const AdminHomeService = require('../../service/admin/admin_home_service.js');
9 |
10 | class AdminHomeController extends BaseProjectAdminController {
11 |
12 |
13 | // 管理首页
14 | async adminHome() {
15 | await this.isAdmin();
16 |
17 | // 数据校验
18 | let rules = {
19 |
20 | };
21 |
22 | // 取得数据
23 | let input = this.validateData(rules);
24 |
25 | let service = new AdminHomeService();
26 | return await service.adminHome();
27 | }
28 |
29 |
30 |
31 | }
32 |
33 | module.exports = AdminHomeController;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/controller/admin/admin_setup_controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 设置控制模块
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2021-07-11 10:20:00
5 | */
6 |
7 | const BaseProjectAdminController = require('./base_project_admin_controller.js');
8 | const AdminSetupService = require('../../service/admin/admin_setup_service.js');
9 | const contentCheck = require('../../../../framework/validate/content_check.js');
10 |
11 | class AdminSetupController extends BaseProjectAdminController {
12 |
13 | // 通用setup
14 | async setSetup() {
15 | await this.isAdmin();
16 |
17 | // 数据校验
18 | let rules = {
19 | key: 'must|string|name=KEY',
20 | content: 'name=内容',
21 | };
22 |
23 | // 取得数据
24 | let input = this.validateData(rules);
25 |
26 | // 内容审核
27 | await contentCheck.checkTextMultiAdmin(input);
28 |
29 | let service = new AdminSetupService();
30 | await service.setSetup(input.key, input.content);
31 | }
32 |
33 | // 富文本setup
34 | async setContentSetup() {
35 | await this.isAdmin();
36 |
37 | // 数据校验
38 | let rules = {
39 | id: 'must|string|name=KEY',
40 | content: 'must|array|name=内容',
41 | };
42 |
43 | // 取得数据
44 | let input = this.validateData(rules);
45 |
46 | // 内容审核
47 | await contentCheck.checkTextMultiAdmin(input);
48 |
49 | let service = new AdminSetupService();
50 | await service.setSetup(input.id, input.content);
51 | }
52 |
53 | async genMiniQr() {
54 | await this.isAdmin();
55 |
56 | // 数据校验
57 | let rules = {
58 | path: 'must|string',
59 | sc: 'string',
60 | };
61 |
62 | // 取得数据
63 | let input = this.validateData(rules);
64 |
65 |
66 | let service = new AdminSetupService();
67 | return await service.genMiniQr(input.path, input.sc);
68 | }
69 | }
70 |
71 | module.exports = AdminSetupController;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/controller/admin/base_project_admin_controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 后台管理控制模块
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2021-03-15 19:20:00
5 | */
6 |
7 | const BaseAdminController = require('../../../../framework/platform/controller/base_admin_controller.js');
8 | const BaseProjectService = require('../../service/base_project_service.js');
9 |
10 | class BaseProjectAdminController extends BaseAdminController {
11 | // TODO
12 | async initSetup() {
13 | let service = new BaseProjectService();
14 | await service.initSetup();
15 | }
16 |
17 | }
18 |
19 | module.exports = BaseProjectAdminController;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/controller/base_project_controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 本业务基本控制器
3 | * Date: 2021-03-15 19:20:00
4 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
5 | */
6 |
7 | const BaseController = require('../../../framework/platform/controller/base_controller.js');
8 | const BaseProjectService = require('../service/base_project_service.js');
9 |
10 | class BaseProjectController extends BaseController {
11 |
12 | // TODO
13 | async initSetup() {
14 | let service = new BaseProjectService();
15 | await service.initSetup();
16 | }
17 | }
18 |
19 | module.exports = BaseProjectController;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/controller/check_controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 内容检测控制器
3 | * Date: 2021-03-15 19:20:00
4 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
5 | */
6 |
7 | const BaseProjectController = require('./base_project_controller.js');
8 | const contentCheck = require('../../framework/validate/content_check.js');
9 |
10 | class CheckController extends BaseProjectController {
11 |
12 | /**
13 | * 图片校验
14 | */
15 | async checkImg() {
16 |
17 | // 数据校验
18 | let rules = {
19 | img: 'name=img',
20 | mine: 'must|default=jpg',
21 | };
22 |
23 | // 取得数据
24 | let input = this.validateData(rules);
25 |
26 | return await contentCheck.checkImg(input.img, 'jpg');
27 |
28 | }
29 |
30 | }
31 |
32 | module.exports = CheckController;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/controller/home_controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 全局或者主页模块控制器
3 | * Date: 2020-11-05 10:20:00
4 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
5 | */
6 |
7 | const BaseProjectController = require('./base_project_controller.js');
8 | const HomeService = require('../service/home_service.js');
9 |
10 | class HomeController extends BaseProjectController {
11 |
12 | async getSetup() {
13 | // 数据校验
14 | let rules = {
15 | key: 'must|string|name=KEY',
16 | };
17 |
18 | // 取得数据
19 | let input = this.validateData(rules);
20 |
21 | let service = new HomeService();
22 | return await service.getSetup(input.key);
23 |
24 | }
25 |
26 |
27 | /** 首页推荐列表 */
28 | async getHomeList() {
29 | let service = new HomeService();
30 | return await service.getHomeList();
31 | }
32 |
33 | }
34 |
35 | module.exports = HomeController;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/controller/my_controller.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 用户中心模块控制器
3 | * Date: 2021-03-15 19:20:00
4 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
5 | */
6 |
7 | const BaseProjectController = require('./base_project_controller.js');
8 |
9 | class MyController extends BaseProjectController {
10 |
11 | }
12 |
13 | module.exports = MyController;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/model/base_project_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 实体ORM基类
3 | * Date: 2022-03-15 19:20:00
4 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
5 | */
6 |
7 |
8 | const BaseModel = require('../../../framework/platform/model/base_model.js');
9 |
10 | class BaseProjectModel extends BaseModel {
11 |
12 |
13 | }
14 |
15 | module.exports = BaseProjectModel;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/model/fav_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 收藏实体
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2022-05-24 19:20:00
5 | */
6 |
7 |
8 | const BaseProjectModel = require('./base_project_model.js');
9 |
10 | class FavModel extends BaseProjectModel {
11 |
12 | }
13 |
14 | // 集合名
15 | FavModel.CL = BaseProjectModel.C('fav');
16 |
17 | FavModel.DB_STRUCTURE = {
18 | _pid: 'string|true',
19 | FAV_ID: 'string|true',
20 |
21 | FAV_USER_ID: 'string|true',
22 |
23 | FAV_TITLE: 'string|true|comment=标题',
24 | FAV_TYPE: 'string|true|comment=类型',
25 | FAV_OID: 'string|true|comment=相关表主键',
26 | FAV_PATH: 'string|true|comment=路径',
27 |
28 | FAV_ADD_TIME: 'int|true',
29 | FAV_EDIT_TIME: 'int|true',
30 | FAV_ADD_IP: 'string|false',
31 | FAV_EDIT_IP: 'string|false',
32 | };
33 |
34 | // 字段前缀
35 | FavModel.FIELD_PREFIX = "FAV_";
36 |
37 | module.exports = FavModel;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/model/news_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 资讯实体
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2020-10-28 19:20:00
5 | */
6 |
7 |
8 | const BaseProjectModel = require('./base_project_model.js');
9 |
10 | class NewsModel extends BaseProjectModel {
11 |
12 | }
13 |
14 | // 集合名
15 | NewsModel.CL = BaseProjectModel.C('news');
16 |
17 | NewsModel.DB_STRUCTURE = {
18 | _pid: 'string|true',
19 | NEWS_ID: 'string|true',
20 |
21 | NEWS_TITLE: 'string|false|comment=标题',
22 | NEWS_DESC: 'string|false|comment=描述',
23 | NEWS_STATUS: 'int|true|default=1|comment=状态 0/1',
24 |
25 | NEWS_CATE_ID: 'string|true|comment=分类编号',
26 | NEWS_CATE_NAME: 'string|true|comment=分类冗余',
27 |
28 | NEWS_ORDER: 'int|true|default=9999',
29 | NEWS_VOUCH: 'int|true|default=0',
30 |
31 | NEWS_CONTENT: 'array|true|default=[]|comment=内容',
32 |
33 | NEWS_QR: 'string|false',
34 | NEWS_VIEW_CNT: 'int|true|default=0|comment=访问次数',
35 |
36 | NEWS_PIC: 'array|false|default=[]|comment=附加图片 [cloudId1,cloudId2,cloudId3...]',
37 |
38 | NEWS_ADD_TIME: 'int|true',
39 | NEWS_EDIT_TIME: 'int|true',
40 | NEWS_ADD_IP: 'string|false',
41 | NEWS_EDIT_IP: 'string|false',
42 | };
43 |
44 | // 字段前缀
45 | NewsModel.FIELD_PREFIX = "NEWS_";
46 |
47 |
48 | module.exports = NewsModel;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/model/user_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 用户实体
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2020-10-14 19:20:00
5 | */
6 |
7 |
8 | const BaseProjectModel = require('./base_project_model.js');
9 | class UserModel extends BaseProjectModel { }
10 |
11 | // 集合名
12 | UserModel.CL = BaseProjectModel.C('user');
13 |
14 | UserModel.DB_STRUCTURE = {
15 | _pid: 'string|true',
16 | USER_ID: 'string|true',
17 |
18 | USER_MINI_OPENID: 'string|true|comment=小程序openid',
19 | USER_STATUS: 'int|true|default=1|comment=状态 0=待审核,1=正常',
20 |
21 | USER_NAME: 'string|false|comment=用户昵称',
22 | USER_MOBILE: 'string|false|comment=联系电话',
23 |
24 | USER_FORMS: 'array|true|default=[]',
25 | USER_OBJ: 'object|true|default={}',
26 |
27 | USER_LOGIN_CNT: 'int|true|default=0|comment=登陆次数',
28 | USER_LOGIN_TIME: 'int|false|comment=最近登录时间',
29 |
30 |
31 | USER_ADD_TIME: 'int|true',
32 | USER_ADD_IP: 'string|false',
33 |
34 | USER_EDIT_TIME: 'int|true',
35 | USER_EDIT_IP: 'string|false',
36 | }
37 |
38 | // 字段前缀
39 | UserModel.FIELD_PREFIX = "USER_";
40 |
41 | /**
42 | * 状态 0=待审核,1=正常
43 | */
44 | UserModel.STATUS = {
45 | UNUSE: 0,
46 | COMM: 1
47 | };
48 |
49 | UserModel.STATUS_DESC = {
50 | UNUSE: '待审核',
51 | COMM: '正常'
52 | };
53 |
54 |
55 | module.exports = UserModel;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/model/vote_join_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 投票明细
3 | * Ver : CCMiniCloud Framework 2.6.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2022-07-13 19:20:00
5 | */
6 |
7 |
8 | const BaseProjectModel = require('./base_project_model.js');
9 |
10 | class VoteJoinModel extends BaseProjectModel {
11 |
12 | }
13 |
14 | // 集合名
15 | VoteJoinModel.CL = BaseProjectModel.C('vote_join');
16 |
17 | VoteJoinModel.DB_STRUCTURE = {
18 | _pid: 'string|true',
19 | VOTE_JOIN_ID: 'string|true',
20 |
21 | VOTE_JOIN_USER_ID: 'string|true|comment=用户ID',
22 | VOTE_JOIN_VOTE_ID: 'string|true|comment=投票PK',
23 | VOTE_JOIN_IDX: 'int|true|comment=投票项目索引',
24 | VOTE_JOIN_DAY: 'string|true|comment=投票日期',
25 |
26 | VOTE_JOIN_VOTE_TITLE: 'string|true|comment=投票项目冗余',
27 | VOTE_JOIN_ITEM_LABEL: 'string|true|comment=投票选项冗余',
28 |
29 | VOTE_JOIN_ADD_TIME: 'int|true',
30 | VOTE_JOIN_EDIT_TIME: 'int|true',
31 | VOTE_JOIN_ADD_IP: 'string|false',
32 | VOTE_JOIN_EDIT_IP: 'string|false',
33 | };
34 |
35 | // 字段前缀
36 | VoteJoinModel.FIELD_PREFIX = "VOTE_JOIN_";
37 |
38 |
39 |
40 |
41 |
42 | module.exports = VoteJoinModel;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/model/vote_model.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 投票实体
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2022-07-05 19:20:00
5 | */
6 |
7 | const BaseProjectModel = require('./base_project_model.js');
8 |
9 | class VoteModel extends BaseProjectModel {
10 |
11 | }
12 |
13 | // 集合名
14 | VoteModel.CL = BaseProjectModel.C('vote');
15 |
16 | VoteModel.DB_STRUCTURE = {
17 | _pid: 'string|true',
18 | VOTE_ID: 'string|true',
19 |
20 | VOTE_TITLE: 'string|true|comment=标题',
21 | VOTE_STATUS: 'int|true|default=1|comment=状态 0=未启用,1=使用中',
22 |
23 | VOTE_CATE_ID: 'string|true|default=0|comment=分类',
24 | VOTE_CATE_NAME: 'string|false|comment=分类冗余',
25 |
26 | VOTE_IS_REG: 'int|true|default=0|comment=是否需要注册',
27 | VOTE_SHOW_START: 'int|true|default=0|comment=是否展示开始时间',
28 |
29 | VOTE_START: 'int|true|comment=开始时间',
30 | VOTE_END: 'int|true|comment=截止时间',
31 | VOTE_THEME: 'int|true|default=0|comment=主题',
32 |
33 | VOTE_ORDER: 'int|true|default=9999',
34 | VOTE_VOUCH: 'int|true|default=0',
35 |
36 | VOTE_ITEM: 'array|false|default=[]|comment=投票项目 [{label=名称,cnt=数量,pic=图片}]',
37 | VOTE_TYPE: 'int|true|default=1|comment=模式 0=全程 1=每日可投',
38 | VOTE_MAX_CNT: 'int|true|default=3|comment=可投总票数',
39 |
40 | VOTE_FORMS: 'array|true|default=[]',
41 | VOTE_OBJ: 'object|true|default={}',
42 |
43 | VOTE_QR: 'string|false',
44 | VOTE_VIEW_CNT: 'int|true|default=0',
45 | VOTE_USER_CNT: 'int|true|default=0',
46 | VOTE_CNT: 'int|true|default=0',
47 |
48 | VOTE_ADD_TIME: 'int|true',
49 | VOTE_EDIT_TIME: 'int|true',
50 | VOTE_ADD_IP: 'string|false',
51 | VOTE_EDIT_IP: 'string|false',
52 | };
53 |
54 | // 字段前缀
55 | VoteModel.FIELD_PREFIX = "VOTE_";
56 |
57 | /**
58 | * 状态 0=未启用,1=使用中
59 | */
60 | VoteModel.STATUS = {
61 | UNUSE: 0,
62 | COMM: 1
63 | };
64 |
65 |
66 |
67 | module.exports = VoteModel;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/public/constants.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | // 首页推荐
3 | SETUP_HOME_VOUCH_KEY : 'SETUP_HOME_VOUCH_KEY',
4 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/public/project_config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | // ## 缓存相关
3 | CACHE_CALENDAR_TIME: 60 * 30, //日历缓存
4 |
5 | }
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/service/admin/admin_home_service.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 后台HOME/登录模块
3 | * Date: 2021-06-15 07:48:00
4 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
5 | */
6 |
7 | const BaseProjectAdminService = require('./base_project_admin_service.js');
8 | const UserModel = require('../../model/user_model.js');
9 | const NewsModel = require('../../model/news_model.js');
10 | const VoteModel = require('../../model/vote_model.js');
11 | const constants = require('../../public/constants.js');
12 | const setupUtil = require('../../../../framework/utils/setup/setup_util.js');
13 |
14 | class AdminHomeService extends BaseProjectAdminService {
15 |
16 | /**
17 | * 首页数据归集
18 | */
19 | async adminHome() {
20 | let where = {};
21 |
22 | let userCnt = await UserModel.count(where);
23 | let newsCnt = await NewsModel.count(where);
24 | let voteCnt = await VoteModel.count(where);
25 | return [
26 | { title: '用户数', cnt: userCnt },
27 | { title: '内容数', cnt: newsCnt },
28 | { title: '投票项目', cnt: voteCnt }
29 | ]
30 | }
31 |
32 | // 用户数据清理
33 | async clearUserData(userId) {
34 |
35 | }
36 |
37 |
38 | //##################首页推荐
39 | /**添加首页推荐 */
40 | async updateHomeVouch({ type, ext, title, id, desc, pic }) {
41 | this.AppError('该功能暂不开放,如有需要请加作者微信:cclinux0730');
42 | }
43 |
44 | /**删除推荐数据 */
45 | async delHomeVouch(id) {
46 | this.AppError('该功能暂不开放,如有需要请加作者微信:cclinux0730');
47 |
48 | }
49 | }
50 |
51 | module.exports = AdminHomeService;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/service/admin/base_project_admin_service.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 后台管理模块 基类
3 | * Date: 2021-03-15 07:48:00
4 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
5 | */
6 |
7 | const BaseAdminService = require('../../../../framework/platform/service/base_admin_service.js');
8 | ;
9 | const util = require('../../../../framework/utils/util.js');
10 | const cloudBase = require('../../../../framework/cloud/cloud_base.js');
11 |
12 | class BaseProjectAdminService extends BaseAdminService {
13 |
14 | getProjectId() {
15 | return util.getProjectId();
16 | }
17 |
18 | async genDetailQr(type, id) {
19 | let cloud = cloudBase.getCloud();
20 |
21 | let page = `projects/${this.getProjectId()}/pages/${type}/detail/${type}_detail`;
22 | console.log('page=', page);
23 | let result = await cloud.openapi.wxacode.getUnlimited({
24 | scene: id,
25 | width: 280,
26 | check_path: false,
27 | //env_version: 'trial', //release,trial,develop
28 | page
29 | });
30 |
31 | let cloudPath = `${this.getProjectId()}/${type}/${id}/qr.png`;
32 | console.log('cloudPath=', cloudPath);
33 | let upload = await cloud.uploadFile({
34 | cloudPath,
35 | fileContent: result.buffer,
36 | });
37 |
38 | if (!upload || !upload.fileID) return;
39 |
40 | return upload.fileID;
41 | }
42 | }
43 |
44 | module.exports = BaseProjectAdminService;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/service/home_service.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 全局/首页模块业务逻辑
3 | * Date: 2021-03-15 04:00:00
4 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
5 | */
6 |
7 | const BaseProjectService = require('./base_project_service.js');
8 | const setupUtil = require('../../../framework/utils/setup/setup_util.js');
9 | const constants = require('../public/constants.js');
10 | const NewsModel = require('../model/news_model.js');
11 |
12 | class HomeService extends BaseProjectService {
13 |
14 | async getSetup(key) {
15 | return await setupUtil.get(key);
16 | }
17 |
18 | /**首页列表 */
19 | async getHomeList() {
20 | let list = await setupUtil.get(constants.SETUP_HOME_VOUCH_KEY);
21 | if (!list || !Array.isArray(list)) list = [];
22 |
23 |
24 | if (list.length == 0) {
25 | let orderBy = {
26 | 'NEWS_ORDER': 'asc',
27 | 'NEWS_ADD_TIME': 'desc'
28 | };
29 | let fields = 'NEWS_PIC,NEWS_CATE_NAME,NEWS_TITLE,NEWS_DESC,NEWS_ADD_TIME';
30 |
31 | let where = {};
32 | where.NEWS_STATUS = 1; // 状态
33 |
34 | let retList = await NewsModel.getAll(where, fields, orderBy, 10);
35 | for (let k = 0; k < retList.length; k++) {
36 | list.push({
37 | type: 'news',
38 | ext: retList[k].NEWS_CATE_NAME,
39 | title: retList[k].NEWS_TITLE,
40 | id: retList[k]._id,
41 | desc: retList[k].NEWS_DESC,
42 | pic: retList[k].NEWS_PIC
43 | })
44 | }
45 | }
46 |
47 | return list;
48 | }
49 | }
50 |
51 | module.exports = HomeService;
--------------------------------------------------------------------------------
/cloudfunctions/mcloud/project/VOTE1/service/news_service.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 资讯模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2020-10-29 07:48:00
5 | */
6 |
7 | const BaseProjectService = require('./base_project_service.js');
8 | const util = require('../../../framework/utils/util.js');
9 | const NewsModel = require('../model/news_model.js');
10 |
11 | class NewsService extends BaseProjectService {
12 |
13 | /** 浏览资讯信息 */
14 | async viewNews(id) {
15 |
16 | let fields = '*';
17 |
18 | let where = {
19 | _id: id,
20 | NEWS_STATUS: 1
21 | }
22 | let news = await NewsModel.getOne(where, fields);
23 | if (!news) return null;
24 |
25 |
26 |
27 | return news;
28 | }
29 |
30 |
31 | /** 取得分页列表 */
32 | async getNewsList({
33 | search, // 搜索条件
34 | sortType, // 搜索菜单
35 | sortVal, // 搜索菜单
36 | orderBy, // 排序
37 | cateId, //附加查询条件
38 | page,
39 | size,
40 | isTotal = true,
41 | oldTotal
42 | }) {
43 |
44 | orderBy = orderBy || {
45 | 'NEWS_ORDER': 'asc',
46 | 'NEWS_ADD_TIME': 'desc'
47 | };
48 | let fields = 'NEWS_PIC,NEWS_VIEW_CNT,NEWS_TITLE,NEWS_DESC,NEWS_CATE_ID,NEWS_ADD_TIME,NEWS_ORDER,NEWS_STATUS,NEWS_CATE_NAME';
49 |
50 | let where = {};
51 | where.NEWS_STATUS = 1; // 状态
52 |
53 | if (cateId && cateId !== '0') where.NEWS_CATE_ID = cateId;
54 |
55 | if (util.isDefined(search) && search) {
56 | where.NEWS_TITLE = {
57 | $regex: '.*' + search,
58 | $options: 'i'
59 | };
60 | } else if (sortType && util.isDefined(sortVal)) {
61 | // 搜索菜单
62 | switch (sortType) {
63 | case 'sort':
64 | // 排序
65 | if (sortVal == 'new') {
66 | orderBy = {
67 | 'NEWS_ADD_TIME': 'desc'
68 | };
69 | }
70 | break;
71 | }
72 | }
73 |
74 | return await NewsModel.getList(where, fields, orderBy, page, size, isTotal, oldTotal);
75 | }
76 |
77 | }
78 |
79 | module.exports = NewsService;
--------------------------------------------------------------------------------
/miniprogram/app.js:
--------------------------------------------------------------------------------
1 | const setting = require('./setting/setting.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 | env: setting.CLOUD_ID,
16 | traceUser: true,
17 | })
18 | }
19 |
20 | this.globalData = {};
21 |
22 | // 用于自定义导航栏
23 | wx.getSystemInfo({
24 | success: e => {
25 | this.globalData.statusBar = e.statusBarHeight;
26 | let capsule = wx.getMenuButtonBoundingClientRect();
27 | if (capsule) {
28 | this.globalData.custom = capsule;
29 | this.globalData.customBar = capsule.bottom + capsule.top - e.statusBarHeight;
30 | } else {
31 | this.globalData.customBar = e.statusBarHeight + 50;
32 | }
33 | }
34 | });
35 | },
36 |
37 | })
--------------------------------------------------------------------------------
/miniprogram/app.wxss:
--------------------------------------------------------------------------------
1 | @import "style/base/comm.wxss";
2 | @import "style/public/project.wxss";
3 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/biz/detail/detail_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "cmpt-poster": "/cmpts/public/poster/poster_cmpt"
5 | }
6 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/biz/foot/foot_cmpt.js:
--------------------------------------------------------------------------------
1 | const pageHelper = require('../../../helper/page_helper');
2 | const setting = require('../../../setting/setting.js');
3 |
4 | Component({
5 | options: {
6 | addGlobalClass: true
7 | },
8 |
9 | /**
10 | * 组件的属性列表
11 | */
12 | properties: {
13 | color: {
14 | type: String,
15 | value: ''
16 | },
17 | },
18 |
19 | /**
20 | * 组件的初始数据
21 | */
22 | data: {
23 |
24 | },
25 |
26 | lifetimes: {
27 | created: function () {
28 | // 组件实例化,但节点树还未导入,因此这时不能用setData
29 | },
30 | attached: function () {
31 | // 在组件实例进入页面节点树时执行
32 | // 节点树完成,可以用setData渲染节点,但无法操作节点
33 | },
34 | ready: async function () {
35 | // 组件布局完成,这时可以获取节点信息,也可以操作节点
36 | // 当前用户,用于评论删除
37 | this._loadDetail();
38 | },
39 | move: function () {
40 | // 组件实例被移动到树的另一个位置
41 | },
42 | detached: function () {
43 | // 在组件实例被从页面节点树移除时执行
44 | },
45 | },
46 |
47 | /**
48 | * 组件的方法列表
49 | */
50 | methods: {
51 | _loadDetail: async function () {
52 | this.setData({
53 | company: setting.COMPANY,
54 | ver: setting.VER
55 | });
56 | },
57 | url: function (e) {
58 | pageHelper.url(e, this);
59 | }
60 | }
61 | })
--------------------------------------------------------------------------------
/miniprogram/cmpts/biz/foot/foot_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/biz/foot/foot_cmpt.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/biz/foot/foot_cmpt.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../style/public/project.wxss";
2 |
3 | .site-footer {
4 | width: 100%;
5 | display: flex;
6 | flex-direction: column;
7 | justify-content: center;
8 | align-items: center;
9 | font-size: 24rpx;
10 | color: #aaa;
11 | margin-top: 20rpx;
12 | margin-bottom: 20rpx;
13 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/calendar/calendar_comm/calendar_comm_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/calendar/calendar_meet/calendar_meet_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/checkbox/checkbox_cmpt.js:
--------------------------------------------------------------------------------
1 | Component({
2 | externalClasses: ['outside-picker-multi-class'],
3 |
4 | /**
5 | * 组件的属性列表
6 | */
7 | properties: {
8 | sourceData: { //源数组
9 | type: Array,
10 | value: [],
11 | },
12 | // 默认选中项的值数组
13 | itemMulti: {
14 | type: Array,
15 | value: [],
16 | observer: function (newVal, oldVal) {
17 | if (JSON.stringify(newVal) != JSON.stringify(oldVal)) {
18 | console.log('checkbox observer');
19 | this._fixDefaultVal();
20 | }
21 | }
22 | },
23 | disabled: { // 是否禁用
24 | type: Boolean,
25 | value: false,
26 | },
27 | },
28 |
29 | /**
30 | * 生命周期方法
31 | */
32 | lifetimes: {
33 | attached: function () { },
34 |
35 | ready: function () {
36 | this._fixDefaultVal();
37 | },
38 |
39 | detached: function () {
40 | // 在组件实例被从页面节点树移除时执行
41 | },
42 |
43 | },
44 |
45 | /**
46 | * 组件的初始数据
47 | */
48 | data: {
49 |
50 | },
51 |
52 | /**
53 | * 组件的方法列表
54 | */
55 | methods: {
56 | bindChange: function (e) {
57 | this.triggerEvent('select', e.detail.value);
58 | },
59 |
60 | _fixDefaultVal() { //传入数据不匹配的时候,修正父页面传入的的数组默认值
61 | if (!Array.isArray(this.data.itemMulti)) {
62 | this.triggerEvent('select', []);
63 | }
64 |
65 | if (this.data.itemMulti.length == 0) return;
66 |
67 | let ret = [];
68 | let sourceData = this.data.sourceData;
69 | let itemMulti = this.data.itemMulti;
70 | for (let k = 0; k < sourceData.length; k++) {
71 | for (let j in itemMulti) {
72 | if (sourceData[k] == itemMulti[j])
73 | ret.push(itemMulti[j]);
74 | }
75 | }
76 |
77 | this.triggerEvent('select', ret);
78 | }
79 | }
80 | })
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/checkbox/checkbox_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/checkbox/checkbox_cmpt.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/checkbox/checkbox_cmpt.wxss:
--------------------------------------------------------------------------------
1 | .checkbox-group {
2 | width: 100%;
3 | display: flex;
4 | justify-content: center;
5 | flex-direction: column;
6 | align-items: center;
7 | padding: 0rpx 10rpx;
8 | }
9 |
10 | .checkbox-group .item {
11 | width: 100%;
12 | display: flex;
13 | flex-direction: row;
14 | justify-content: flex-start;
15 | align-items: center;
16 | line-height: 2.1;
17 | min-height: 70rpx;
18 | border-bottom: 1rpx solid #eee;
19 | font-size: 28rpx;
20 | }
21 |
22 | .checkbox-group .item .item-label{
23 | width: 100%;
24 | display: flex;
25 | flex-direction: row;
26 | justify-content: flex-start;
27 | align-items: center;
28 | }
29 |
30 |
31 | .checkbox-group .item:last-child {
32 | border-bottom: 0;
33 | }
34 |
35 | .checkbox-group .item:nth-child(odd) {
36 | background-color: #fcfcfc;
37 | }
38 |
39 |
40 | .checkbox-group .item .item-checkbox {
41 | margin-right: 20rpx;
42 | padding-left: 10rpx;
43 | }
44 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/editor/editor_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/form/form_set/field/form_set_field.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-picker-multi": "/cmpts/public/picker_multi/picker_multi_cmpt"
4 | },
5 | "navigationBarBackgroundColor": "#ffffff",
6 | "navigationBarTextStyle": "black",
7 | "enablePullDownRefresh": true,
8 | "backgroundTextStyle": "dark",
9 | "navigationBarTitleText": "后台-字段添加"
10 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/form/form_set/field/form_set_field.wxss:
--------------------------------------------------------------------------------
1 | .main {
2 | margin-bottom: 150rpx;
3 | }
4 |
5 | .oprt {
6 | display: flex;
7 | width: 100%;
8 | justify-content: space-around;
9 | }
10 |
11 | .oprt button {
12 | width: 45%;
13 | }
14 |
15 | .select-close {
16 | width: 60rpx;
17 | font-size: 40rpx !important;
18 | font-weight: bold;
19 | text-align: right;
20 | }
21 |
22 | .title-desc {
23 | padding-left: 24rpx;
24 | color: #aaa;
25 | padding-bottom: 30rpx;
26 | border-bottom: 1rpx solid #eee;
27 | }
28 |
29 | .title-info {
30 | margin-left: 4rpx;
31 | color: #aaa;
32 | font-weight: normal;
33 | font-size: 24rpx;
34 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/form/form_set/form_set_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/form/form_set/form_set_cmpt.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item.title}}
9 |
10 |
11 |
12 | 单行文本,
13 | 日期,
14 | 时间点,
15 | 单项选择,
16 | 多项选择,
17 | 开关选择,
18 | 省市区,
19 | 多行文本,
20 | 年份,
21 | 月份,
22 | 整数数字,
23 | 小数数字,
24 | 身份证,
25 | 手机,
26 |
27 | 必填
28 | 选填
29 |
30 |
31 |
32 |
33 |
34 | 添加新字段
35 |
36 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/form/form_set/form_set_cmpt.wxss:
--------------------------------------------------------------------------------
1 | .picker-set {
2 | line-height: 100rpx;
3 | font-size: 24rpx;
4 | width: 100%;
5 | text-align: right;
6 | color: #999;
7 | width: 210rpx;
8 | }
9 |
10 | .form-group .picker-set {
11 | padding-right: 40rpx;
12 | overflow: hidden;
13 | position: relative;
14 | }
15 |
16 | .form-group.cur {
17 | animation: glow 800ms linear 1 alternate;
18 | }
19 |
20 | @keyframes glow {
21 | 0% {
22 | background-color: #ececec;
23 | }
24 | 100% {
25 | background-color: #fff;
26 | }
27 | }
28 |
29 | .form-group-active{
30 | background-color: #ececec;
31 | }
32 |
33 | .form-group .title {
34 | font-weight: normal;
35 | color: #333;
36 | flex: 1;
37 | padding-right: 10rpx;
38 | }
39 |
40 | .form-group .field-oprt {
41 | color: #777;
42 | background: hsla(0, 0%, 100%, .95);
43 | border-radius: 5rpx;
44 | box-shadow: 0 0 5px rgba(0, 0, 0, .1);
45 | display: flex;
46 | text-align: center;
47 | align-items: center;
48 | justify-content: center;
49 | margin-right: 15rpx;
50 | }
51 |
52 | .form-group .field-oprt>view{
53 | width:70rpx;
54 | height:55rpx;
55 | display: flex;
56 | text-align: center;
57 | align-items: center;
58 | justify-content: center;
59 | font-size:36rpx;
60 | }
61 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/form/form_show/content/form_show_content.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-editor": "/cmpts/public/editor/editor_cmpt"
4 | },
5 | "navigationBarTitleText": "详细内容"
6 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/form/form_show/content/form_show_content.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 不保存,返回
11 | 保存
12 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/form/form_show/content/form_show_content.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../style/public/admin.wxss';
2 |
3 | .main-admin {
4 | width: 100%;
5 | box-sizing: border-box;
6 | padding: 30rpx 20rpx;
7 | padding-bottom: 200rpx;
8 | }
9 |
10 | .form-group {
11 | padding: 1rpx 1rpx;
12 | overflow: hidden;
13 | }
14 |
15 | .oprt {
16 | display: flex;
17 | width: 100%;
18 | justify-content: space-around;
19 | }
20 |
21 | .oprt button {
22 | width: 45%;
23 | }
24 |
25 | .bottom-oprt {
26 | position: fixed;
27 | bottom: 0;
28 | height: 130rpx;
29 | background-color: #f8f8f8;
30 | display: flex;
31 | justify-content: space-around;
32 | align-items: center;
33 | border-top: 1rpx solid #ccc;
34 | z-index: 99999;
35 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/form/form_show/form_show_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "cmpt-checkbox": "/cmpts/public/checkbox/checkbox_cmpt",
5 | "cmpt-img-upload": "/cmpts/public/img/img_upload_cmpt"
6 | }
7 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/form/form_show/form_show_cmpt.wxss:
--------------------------------------------------------------------------------
1 | .form-group .picker-base {
2 | flex: 1;
3 | text-align: right;
4 | height: 60rpx;
5 | line-height: 60rpx;
6 | }
7 |
8 | .form-group .picker-select {
9 | padding-right: 40rpx;
10 | overflow: hidden;
11 | position: relative;
12 | }
13 |
14 | .form-group .phone-text {
15 | font-size: 30rpx;
16 | color: #555;
17 | flex: 1;
18 | text-align: left;
19 | }
20 |
21 | .form-group .title {
22 | height: unset !important;
23 | min-height: 60rpx;
24 | }
25 |
26 | .form-group-line {
27 | width: 100%;
28 | padding: 1rpx 30rpx;
29 | display: flex;
30 | align-items: center;
31 | min-height: 100rpx;
32 | justify-content: center;
33 | position: relative;
34 | color: #888;
35 | font-size: 28rpx;
36 | margin-top: 10rpx;
37 | }
38 |
39 |
40 | /* 核对信息窗口 */
41 | .modal-check-info {
42 | width: 100%;
43 | }
44 |
45 | .slot-class {
46 | padding: 0 20rpx 30rpx;
47 | }
48 |
49 | .modal-check-info .item {
50 | width: 100%;
51 | display: flex;
52 | justify-content: flex-start;
53 | align-items: flex-start;
54 | line-height: 1.8;
55 | font-size: 30rpx;
56 | border-bottom: 1rpx dotted #ddd;
57 | color: #000;
58 | padding: 10rpx 10rpx;
59 | }
60 |
61 | .modal-check-info .item:nth-child(odd) {
62 | background-color: #f8f8f8;
63 | }
64 |
65 | .modal-check-info .item:last-child {
66 | border-bottom: 0rpx;
67 | }
68 |
69 | .modal-check-info .item .title {
70 | font-weight: bold;
71 | max-width: 150rpx;
72 | margin-right: 20rpx;
73 | text-align: left;
74 | }
75 |
76 | .modal-check-info .item .content {
77 | flex: 1;
78 | color: #333;
79 | display: flex;
80 | justify-content: flex-start;
81 | align-items: flex-start;
82 | text-align: left;
83 | }
--------------------------------------------------------------------------------
/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 | *{{title}} (每张不超过{{imgUploadSize}}M)
3 |
4 |
5 | {{imgList.length}}/{{imgMax}}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | #{{index}}
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/img/img_upload_cmpt.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../style/base/comm.wxss";
2 | @import "../../../style/public/project.wxss";
3 |
4 | .form-group .upload-img .img-no {
5 | position: absolute;
6 | right: 0;
7 | bottom: 0;
8 | border-top-left-radius: 6rpx;
9 | padding: 6rpx 12rpx;
10 | height: 35rpx;
11 | opacity: .9;
12 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/list/comm_list_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/modal/modal_cmpt.js:
--------------------------------------------------------------------------------
1 | // cmpts/public/modal/modal.js
2 | Component({
3 | options: {
4 | addGlobalClass: true,
5 | multipleSlots: true
6 | },
7 |
8 | externalClasses: ['slot-class'],
9 |
10 | /**
11 | * 组件的属性列表
12 | */
13 | properties: {
14 | type: { // 类型 comm/bottom/dialog/image
15 | type: String,
16 | value: 'comm'
17 | },
18 | title: {
19 | type: String,
20 | value: '温馨提示'
21 | },
22 | subtitle: {
23 | type: String,
24 | value: ''
25 | },
26 | subtitleAlign: {
27 | type: String,
28 | value: 'center'
29 | },
30 | show: {
31 | type: Boolean,
32 | value: true
33 | },
34 | cancelText: {
35 | type: String,
36 | value: '取消'
37 | },
38 | confirmText: {
39 | type: String,
40 | value: '确定'
41 | },
42 | showConfirm: {
43 | type: Boolean,
44 | value: true
45 | },
46 | imgURL: {
47 | type: String,
48 | value: ''
49 | },
50 |
51 | height: {
52 | type: Number,
53 | value: 600
54 | },
55 | },
56 |
57 | /**
58 | * 组件的初始数据
59 | */
60 | data: {
61 |
62 | },
63 |
64 | /**
65 | * 组件的方法列表
66 | */
67 | methods: {
68 | bindHideModalTap: function (e) {
69 | this.setData({
70 | show: ''
71 | })
72 | },
73 |
74 | nomove: function () {},
75 |
76 | bindComfirmTap: function (e) {
77 | this.triggerEvent('click', {});
78 | }
79 | }
80 | })
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/modal/modal_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/modal/modal_cmpt.wxss:
--------------------------------------------------------------------------------
1 | .bg-img {
2 | width: 100%;
3 | height: 100%;
4 | position: relative;
5 | }
6 |
7 | .bg-img .bg-img-image {
8 | top: 0;
9 | left: 0;
10 | position: absolute;
11 | width: 100%;
12 | height: 100%;
13 | }
14 |
15 | .bg-img .action .icon-close {
16 | font-size: 50rpx !important;
17 | font-weight: bold;
18 | }
19 |
20 | .modal .dialog {
21 | padding: 20rpx 0rpx;
22 | margin-top:30rpx;
23 | }
24 |
25 | .modal .dialog .bar {
26 | background-color: #f8f8f8;
27 | }
28 |
29 | .modal .dialog .bar .content {
30 | color: #333;
31 | font-size: 36rpx;
32 | }
33 |
34 | .modal-bar {
35 | width: 100%;
36 | display: flex;
37 | align-items: center;
38 | justify-content: center;
39 | border-top: 1rpx solid #ccc;
40 | line-height: 3;
41 | }
42 |
43 | .modal-bar .modal-bar-view {
44 | width: 50%;
45 | font-size: 36rpx;
46 | font-weight: bold;
47 | }
48 |
49 | .modal-bar .modal-bar-comfirm {
50 | color: #576B95;
51 | border-left: 1rpx solid #ccc;
52 | }
53 |
54 | .modal .modal-dialog {
55 | padding: 10rpx 0rpx 0;
56 | }
57 |
58 | .modal .modal-dialog .subtitle {
59 | width:100%;
60 | text-align: center;
61 | font-size:30rpx;
62 | color:#777;
63 | padding:0 60rpx;
64 | margin-top:10rpx;
65 | margin-bottom:20rpx;
66 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/picker/picker_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/picker/picker_cmpt.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{options[idx].label || noDataHint}}
4 | {{options[idx] || noDataHint}}
5 |
6 |
7 |
8 |
9 |
10 |
11 | {{multiDesc || noDataHint}}
12 |
13 |
14 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/picker/picker_cmpt.wxss:
--------------------------------------------------------------------------------
1 | .picker-cmpt {
2 | line-height: 100rpx;
3 | font-size: 28rpx;
4 | text-overflow: ellipsis;
5 | white-space: nowrap;
6 | overflow: hidden;
7 | width: 100%;
8 | text-align: right;
9 | padding-right: 40rpx;
10 | }
11 |
12 | .disabled {
13 | background-color: #eee;
14 | color:#999;
15 | }
16 |
17 | .picker-cmpt::before {
18 | position: absolute;
19 | top: 0;
20 | right: 30rpx;
21 | bottom: 0;
22 | display: block;
23 | margin: auto;
24 | width: 30rpx;
25 | height: 30rpx;
26 | color: var(--grey);
27 | content: "\e6a3";
28 | text-align: center;
29 | font-size: 34rpx;
30 | font-family: "icon";
31 | line-height: 30rpx;
32 | margin-top: auto;
33 | margin-right: auto;
34 | margin-bottom: auto;
35 | margin-left: auto;
36 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/picker_multi/picker_multi_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/picker_multi/picker_multi_cmpt.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{multiArray[0][multiIndex[0]]}},{{multiArray[1][multiIndex[1]]}}
6 |
7 |
8 | {{multiArray[0][multiIndex[0]]}},{{multiArray[1][multiIndex[1]]}},{{multiArray[2][multiIndex[2]]}}
9 |
10 |
11 | {{multiArray[0][multiIndex[0]]}},{{multiArray[1][multiIndex[1]]}},{{multiArray[2][multiIndex[2]]}},{{multiArray[3][multiIndex[3]]}}
12 |
13 |
14 | {{multiArray[0][multiIndex[0]]}},{{multiArray[1][multiIndex[1]]}},{{multiArray[2][multiIndex[2]]}},{{multiArray[3][multiIndex[3]]}},{{multiArray[4][multiIndex[4]]}}
15 |
16 |
17 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/picker_multi/picker_multi_cmpt.wxss:
--------------------------------------------------------------------------------
1 | .picker-cmpt {
2 | line-height: 100rpx;
3 | font-size: 28rpx;
4 | text-overflow: ellipsis;
5 | white-space: nowrap;
6 | overflow: hidden;
7 | width: 100%;
8 | text-align: right;
9 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/picker_time/picker_time_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/picker_time/picker_time_cmpt.wxml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/picker_time/picker_time_cmpt.wxss:
--------------------------------------------------------------------------------
1 | /* cmpts/public/picker_time/picker_time_cmpt.wxss */
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/poster/images/friend.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/cmpts/public/poster/images/friend.png
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/poster/images/wechat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/cmpts/public/poster/images/wechat.png
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/poster/poster_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "poster": "./wxa-plugin-canvas/poster"
5 | }
6 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/poster/poster_cmpt.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 长按图片保存或者转发
11 |
12 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 | 生成海报
26 |
27 |
28 |
29 |
30 | 关闭
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/poster/poster_cmpt.wxss:
--------------------------------------------------------------------------------
1 | .main-poster .poster-share {
2 | width: 100%;
3 | display: flex;
4 | justify-content: space-around;
5 | align-items: center;
6 | padding: 30rpx 50rpx 10rpx;
7 | }
8 |
9 | .main-poster .poster-share .item {
10 | flex: 1 0 0;
11 | display: flex;
12 | flex-direction: column;
13 | justify-content: flex-start;
14 | align-items: center;
15 | color: #333;
16 | }
17 |
18 | .main-poster .poster-share .item .pic {
19 | height: 100rpx;
20 | width: 100rpx;
21 | background-color: #f2f2f2;
22 | border-radius: 50%;
23 | display: flex;
24 | justify-content: center;
25 | align-items: center;
26 | }
27 |
28 | .main-poster .poster-share .item-share {
29 | margin-top: 15rpx;
30 | }
31 |
32 | .main-poster .poster-share .item-share>text {
33 | margin-top: 15rpx !important;
34 | }
35 |
36 | .main-poster .poster-share .item .pic image {
37 | height: 50rpx;
38 | width: 50rpx;
39 | }
40 |
41 | .main-poster .poster-share .item .pic .friend {
42 | height: 60rpx;
43 | width: 60rpx;
44 | }
45 |
46 | .main-poster .poster-share .item>text {
47 | margin-top: 15rpx;
48 | font-size: 30rpx;
49 | text-align: center;
50 | }
51 |
52 | .main-poster .poster-img {
53 | display: flex;
54 | justify-content: center;
55 | align-items: center;
56 | padding-top: 0rpx;
57 | padding-bottom: 0rpx;
58 | min-height: 600rpx;
59 | margin-top: 30rpx;
60 | flex-direction: column;
61 | }
62 |
63 | .main-poster .poster-img .save-hint {
64 | font-size: 30rpx;
65 | color: #555;
66 | margin-top: 10rpx;
67 | }
68 |
69 | .load.loading::after {
70 | content: "海报生成中...";
71 | }
72 |
73 | .main-poster .poster-img image {
74 | width: 375rpx;
75 | border-radius: 15rpx;
76 | }
77 |
78 | .main-poster .line {
79 | width: 100%;
80 | margin: 30rpx 0 30rpx;
81 | border-top: 1rpx solid #ddd;
82 | padding: 30rpx 0 20rpx;
83 | font-size: 32rpx;
84 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/poster/poster_cmpt_helper.js:
--------------------------------------------------------------------------------
1 | const cloudHelper = require('../../../helper/cloud_helper.js');
2 |
3 | async function config1({
4 | cover,
5 | title,
6 | desc,
7 | qr,
8 | bg = ''
9 | }) {
10 | if (cover.startsWith('cloud'))
11 | cover = await cloudHelper.getTempFileURLOne(cover);
12 |
13 | if (qr.startsWith('cloud'))
14 | qr = await cloudHelper.getTempFileURLOne(qr);
15 |
16 | let posterConfig = {
17 | width: 480, // rpx
18 | height: 650,
19 | backgroundColor: '#eeeeee'
20 | };
21 | if (bg) posterConfig.backgroundColor = bg;
22 |
23 |
24 | let blocks = [];
25 | blocks = [{
26 | x: 30,
27 | y: 30,
28 | backgroundColor: '#ffffff',
29 | width: 420,
30 | height: 590,
31 | borderRadius: 20
32 | }];
33 |
34 | let texts = [];
35 | texts = [{
36 | x: 50,
37 | y: 350,
38 | text: title,
39 | width: 360,
40 | lineNum: 2,
41 | lineHeight: 40,
42 | fontSize: 26,
43 | color: '#000000',
44 | textAlign: 'left',
45 | zIndex: 9999
46 | },
47 | {
48 | x: 55,
49 | y: 510,
50 | text: '长按识别小程序码',
51 | fontSize: 18,
52 | color: '#aaaaaa',
53 | zIndex: 9999
54 | }, {
55 | x: 55,
56 | y: 540,
57 | text: desc,
58 | fontSize: 18,
59 | color: '#aaaaaa',
60 | zIndex: 9999
61 | }];
62 |
63 | let images = [];
64 | if (cover) {
65 | images.push({ // 底图
66 | x: 40,
67 | y: 40,
68 | url: cover,
69 | width: 400,
70 | height: 260,
71 | zIndex: 999
72 | });
73 | }
74 |
75 | if (qr) {
76 | images.push({ // 小程序码
77 | x: 310,
78 | y: 460,
79 | url: qr,
80 | width: 120,
81 | height: 120
82 | });
83 | }
84 |
85 | posterConfig.texts = texts;
86 | posterConfig.blocks = blocks
87 | posterConfig.images = images;
88 |
89 | return posterConfig;
90 | }
91 |
92 |
93 | module.exports = {
94 | config1
95 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/poster/wxa-plugin-canvas/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/poster/wxa-plugin-canvas/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/poster/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/public/poster/wxa-plugin-canvas/poster/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "we-canvas": "../index/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/poster/wxa-plugin-canvas/poster/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/poster/wxa-plugin-canvas/poster/index.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/cmpts/public/poster/wxa-plugin-canvas/poster/index.wxss
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/poster/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/swiper/swiper_cmpt.js:
--------------------------------------------------------------------------------
1 | const pageHelper = require('../../../helper/page_helper.js');
2 | Component({
3 | options: {
4 | addGlobalClass: true,
5 | },
6 |
7 | /**
8 | * 组件的属性列表
9 | */
10 | properties: {
11 | images: {
12 | type: Array,
13 | value: []
14 | },
15 | height: {
16 | type: Number,
17 | value: 350
18 | },
19 | mode: {
20 | type: String,
21 | value: 'aspectFill'
22 | },
23 | indicatorActiveColor: {
24 | type: String,
25 | value: '#000000'
26 | },
27 | interval: {
28 | type: Number,
29 | value: 3000
30 | },
31 | duration: {
32 | type: Number,
33 | value: 500
34 | },
35 | previousMargin: {
36 | type: Number,
37 | value: 0
38 | },
39 | nextMargin: {
40 | type: Number,
41 | value: 0
42 | },
43 | indicatorDots: {
44 | type: Boolean,
45 | value: true
46 | },
47 | autoplay: {
48 | type: Boolean,
49 | value: true
50 | },
51 | circular: {
52 | type: Boolean,
53 | value: true
54 | },
55 | vertical: {
56 | type: Boolean,
57 | value: false
58 | },
59 | },
60 |
61 | /**
62 | * 组件的初始数据
63 | */
64 | data: {
65 |
66 | },
67 |
68 | /**
69 | * 组件的方法列表
70 | */
71 | methods: {
72 | url: function (e) {
73 | pageHelper.url(e, this);
74 | }
75 | }
76 | })
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/swiper/swiper_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/swiper/swiper_cmpt.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/swiper/swiper_cmpt.wxss:
--------------------------------------------------------------------------------
1 | .swiper {
2 | width: 100%;
3 | }
4 | .swiper-item-images {
5 | width: 100%;
6 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/table/table_cmpt.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | Component({
5 | /**
6 | * 外部样式类
7 | */
8 | externalClasses: ['header-row-class-name', 'row-class-name', 'cell-class-name'],
9 |
10 | /**
11 | * 组件样式隔离
12 | */
13 | options: {
14 | styleIsolation: "isolated",
15 | multipleSlots: true // 支持多个slot
16 | },
17 |
18 | /**
19 | * 组件的属性列表
20 | */
21 | properties: {
22 | data: {
23 | type: Array,
24 | value: []
25 | },
26 | headers: {
27 | type: Array,
28 | value: []
29 | },
30 | // table的高度, 溢出可滚动
31 | height: {
32 | type: String,
33 | value: 'auto'
34 | },
35 | width: {
36 | type: Number || String,
37 | value: '100%'
38 | },
39 | // 单元格的宽度
40 | tdWidth: {
41 | type: Number,
42 | value: 35
43 | },
44 | // 固定表头 thead达到Header的位置时就应该被fixed了
45 | offsetTop: {
46 | type: Number,
47 | value: 150
48 | },
49 | // 是否带有纵向边框
50 | stripe: {
51 | type: Boolean,
52 | value: false
53 | },
54 | // 是否带有纵向边框
55 | border: {
56 | type: Boolean,
57 | value: false
58 | },
59 | msg: {
60 | type: String,
61 | value: '暂无数据~'
62 | }
63 | },
64 |
65 | /**
66 | * 组件的初始数据
67 | */
68 | data: {
69 | scrolWidth: '20%'
70 | },
71 |
72 | lifetimes: {
73 | attached: function () {
74 |
75 | },
76 | ready: function () {
77 |
78 | },
79 | detached: function () {
80 | // 在组件实例被从页面节点树移除时执行
81 | },
82 | },
83 |
84 | /**
85 | * 组件的方法列表
86 | */
87 | methods: {
88 |
89 | }
90 | })
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/table/table_cmpt.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/table/table_cmpt.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{ item.label }}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | {{it[head["prop"]]}}
16 |
17 |
18 |
19 |
20 |
21 | {{ msg }}
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/miniprogram/cmpts/public/table/table_cmpt.wxss:
--------------------------------------------------------------------------------
1 | .reset {
2 | background: white;
3 | }
4 |
5 | .other {
6 | font-size: 20px;
7 | }
8 |
9 | .table {
10 | position: relative;
11 | font-size: 28rpx;
12 | background: #fff;
13 | border-right:none;
14 | border-radius: 8rpx;
15 | overflow: hidden;
16 | }
17 | .thead{
18 | border-bottom: none;
19 | display: flex;
20 | justify-content: flex-start;
21 | border-top-right-radius: 8rpx;
22 | border-top-left-radius: 8rpx;
23 | overflow: visible;
24 | color: #909399;
25 | border: 1px solid #ebeef5;
26 | box-sizing: border-box;
27 | }
28 | .thead .td {
29 | padding: 20rpx 10rpx;
30 | font-weight: bold;
31 | display: inline-block;
32 | white-space:nowrap;
33 | text-align: center;
34 | border-right: 1rpx solid #fff;
35 | }
36 | .thead .td:last-child {
37 | border-right: none;
38 | }
39 | .thead-border .td {
40 | border-right: 1rpx solid #ebeef5;
41 | }
42 | .thead-border .td:last-child {
43 | border-right: none;
44 | }
45 | /* .tr{
46 | display: flex;
47 | white-space:nowrap;
48 | } */
49 | .tbody {
50 | box-sizing: border-box;
51 | font-size: 28rpx;
52 | color: #666;
53 | border: 1px solid #ebeef5;
54 | border-top: none;
55 | border-bottom-left-radius: 8rpx;
56 | border-bottom-right-radius: 8rpx;
57 | }
58 | .tbody-tr {
59 | display: flex;
60 | border-bottom: 1px solid #ebeef5;
61 | }
62 | .tbody-tr:last-child {
63 | border-bottom-left-radius: 8rpx;
64 | border-bottom-right-radius: 8rpx;
65 | }
66 |
67 | .tbody-tr-stripe {
68 | background: #fff;
69 | border-bottom: none;
70 | }
71 | .tbody-tr-stripe:nth-child(2n) {
72 | background: #F6F6F6;
73 | }
74 | .tbody-tr .td {
75 | white-space: wrap;
76 | padding:20rpx 10rpx;
77 | text-align: center;
78 | }
79 |
80 | .tbody-tr-border .td {
81 | border-right: 1rpx solid #F6F6F6;
82 | }
83 | .tbody-tr-border .td:last-child {
84 | border-right: none;
85 | }
86 | .no-data {
87 | display: flex;
88 | padding: 50rpx;
89 | color: #666;
90 | justify-content: center;
91 | }
--------------------------------------------------------------------------------
/miniprogram/comm/behavior/my_fav_bh.js:
--------------------------------------------------------------------------------
1 | const pageHelper = require('../../helper/page_helper.js');
2 | const cloudHelper = require('../../helper/cloud_helper.js');
3 |
4 | module.exports = Behavior({
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | },
10 |
11 | methods: {
12 | /**
13 | * 生命周期函数--监听页面加载
14 | */
15 | onLoad: async function (options) {
16 | },
17 |
18 | myCommListListener: function (e) {
19 | pageHelper.commListListener(this, e);
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 |
51 | /**
52 | * 页面上拉触底事件的处理函数
53 | */
54 | onReachBottom: function () {
55 |
56 | },
57 |
58 | url: function (e) {
59 | pageHelper.url(e, this);
60 | },
61 |
62 | bindDelTap: async function (e) {
63 |
64 | let oid = e.currentTarget.dataset.oid;
65 | if (!oid) return;
66 | let that = this;
67 | let callback = async function () {
68 | await cloudHelper.callCloudSumbit('fav/del', {
69 | oid
70 | }).then(res => {
71 | pageHelper.delListNode(oid, that.data.dataList.list, 'FAV_OID');
72 | that.data.dataList.total--;
73 | that.setData({
74 | dataList: that.data.dataList
75 | });
76 | pageHelper.showSuccToast('删除成功');
77 | }).catch(err => {
78 | console.log(err);
79 | });
80 | }
81 | pageHelper.showConfirm('您确认删除?', callback);
82 | }
83 | }
84 | })
--------------------------------------------------------------------------------
/miniprogram/comm/behavior/my_foot_bh.js:
--------------------------------------------------------------------------------
1 | const FootBiz = require('../biz/foot_biz.js');
2 | const pageHelper = require('../../helper/page_helper.js');
3 |
4 | module.exports = Behavior({
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | },
10 |
11 | methods: {
12 | /**
13 | * 生命周期函数--监听页面加载
14 | */
15 | onLoad: async function (options) {
16 | this._loadList();
17 | },
18 |
19 | _loadList: async function (e) {
20 | let footList = FootBiz.getFootList();
21 | this.setData({
22 | footList
23 | });
24 | },
25 | /**
26 | * 生命周期函数--监听页面初次渲染完成
27 | */
28 | onReady: function () {
29 |
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面显示
34 | */
35 | onShow: function () {
36 |
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面隐藏
41 | */
42 | onHide: function () {
43 |
44 | },
45 |
46 | /**
47 | * 生命周期函数--监听页面卸载
48 | */
49 | onUnload: function () {
50 |
51 | },
52 |
53 | /**
54 | * 页面相关事件处理函数--监听用户下拉动作
55 | */
56 | onPullDownRefresh: async function () {
57 | await this._loadList();
58 | wx.stopPullDownRefresh();
59 | },
60 |
61 | /**
62 | * 页面上拉触底事件的处理函数
63 | */
64 | onReachBottom: function () {
65 |
66 | },
67 |
68 | url: function (e) {
69 | pageHelper.url(e, this);
70 | }
71 | }
72 | })
--------------------------------------------------------------------------------
/miniprogram/comm/behavior/news_index_bh.js:
--------------------------------------------------------------------------------
1 | const pageHelper = require('../../helper/page_helper.js');
2 | let PassortBiz = require('../biz/passport_biz.js');
3 | module.exports = Behavior({
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | },
9 |
10 | methods: {
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: async function (options) {
15 |
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面初次渲染完成
20 | */
21 | onReady: function () { },
22 |
23 | /**
24 | * 生命周期函数--监听页面显示
25 | */
26 | onShow: async function () {
27 |
28 | },
29 |
30 | /**
31 | * 生命周期函数--监听页面隐藏
32 | */
33 | onHide: function () {
34 |
35 | },
36 |
37 | /**
38 | * 生命周期函数--监听页面卸载
39 | */
40 | onUnload: function () {
41 |
42 | },
43 |
44 | url: async function (e) {
45 | pageHelper.url(e, this);
46 | },
47 |
48 | bindCommListCmpt: function (e) {
49 | pageHelper.commListListener(this, e);
50 | },
51 |
52 | /**
53 | * 用户点击右上角分享
54 | */
55 | onShareAppMessage: function () {
56 |
57 | },
58 |
59 | _setCate(cateList, options, cateId = 0) {
60 | if (!cateId) {
61 | if (options && options.id) {
62 | cateId = options.id;
63 | }
64 | }
65 |
66 | this.setData({
67 | _params: {
68 | cateId,
69 | }
70 | });
71 |
72 |
73 |
74 | for (let k = 0; k < cateList.length; k++) {
75 | if (cateList[k].id == cateId) {
76 | wx.setNavigationBarTitle({
77 | title: cateList[k].title
78 | });
79 |
80 | if (cateList[k].style) { //样式
81 | this.setData({
82 | listMode: cateList[k].style
83 | });
84 | } else {
85 | this.setData({
86 | listMode: 'leftpic'
87 | });
88 | }
89 |
90 | }
91 | }
92 | }
93 |
94 | }
95 | })
--------------------------------------------------------------------------------
/miniprogram/comm/biz/base_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 基础模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | const pageHelper = require('../../helper/page_helper.js');
8 |
9 | class BaseBiz {
10 |
11 | static getCateName(cateId, cateList) {
12 | for (let k = 0; k < cateList.length; k++) {
13 | if (cateList[k].id == cateId) {
14 | return cateList[k].title;
15 | }
16 | }
17 | return '';
18 | }
19 |
20 | static getCateList(cateList) {
21 |
22 | let arr = [];
23 | for (let k = 0; k < cateList.length; k++) {
24 | arr.push({
25 | label: cateList[k].title,
26 | type: 'cateId',
27 | val: cateList[k].id, //for options form
28 | value: cateList[k].id, //for list menu
29 | })
30 | }
31 |
32 | return arr;
33 | }
34 |
35 | static setCateTitle(cateList) {
36 |
37 | let curPage = pageHelper.getPrevPage(1);
38 | if (!curPage) return;
39 |
40 | let cateId = null;
41 | if (curPage.options && curPage.options.id) {
42 | cateId = curPage.options.id;
43 | }
44 |
45 | for (let k = 0; k < cateList.length; k++) {
46 | if (cateList[k].id == cateId) {
47 | wx.setNavigationBarTitle({
48 | title: cateList[k].title
49 | });
50 | return;
51 | }
52 | }
53 |
54 | }
55 | }
56 |
57 | module.exports = BaseBiz;
--------------------------------------------------------------------------------
/miniprogram/comm/biz/fav_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 预约模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2021-12-10 07:48:00
5 | */
6 |
7 | const BaseBiz = require('./base_biz.js');
8 | const cloudHelper = require('../../helper/cloud_helper.js');
9 | const pageHelper = require('../../helper/page_helper.js');
10 |
11 | class FavBiz extends BaseBiz {
12 |
13 | static async isFav(that, oid) {
14 | if (!oid) return;
15 |
16 | that.setData({
17 | isFav: -1
18 | });
19 |
20 | // 异步获取是否收藏
21 | let params = {
22 | oid
23 | };
24 | cloudHelper.callCloudSumbit('fav/is_fav', params, { title: 'bar' }).then(result => {
25 | that.setData({
26 | isFav: result.data.isFav
27 | });
28 | }).catch(error => { })
29 | }
30 |
31 | static async updateFav(that, oid, isFav, type, title) {
32 | let path = pageHelper.getCurrentPageUrlWithArgs();
33 | if (!oid || !path || !title || !type) return;
34 |
35 | let params = {
36 | oid,
37 | title,
38 | type,
39 | path
40 | }
41 | let opts = {
42 | title: (isFav == 0) ? '收藏中' : '取消中'
43 | }
44 | try {
45 | let result = await cloudHelper.callCloudSumbit('fav/update', params, opts);
46 | that.setData({
47 | isFav: result.data.isFav,
48 | });
49 | } catch (e) {
50 | console.log(e);
51 | }
52 | }
53 |
54 | }
55 |
56 | module.exports = FavBiz;
--------------------------------------------------------------------------------
/miniprogram/comm/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 timeHelper = require('../../helper/time_helper.js');
10 | const pageHelper = require('../../helper/page_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 = timeHelper.timestamp2Time(foot[i].time);
20 | }
21 | }
22 |
23 | return foot;
24 | }
25 |
26 | /**添加足迹缓存
27 | *
28 | * @param {*} key 键
29 | * @param {*} val 值
30 | * 格式 key:{
31 | * type:类型
32 | * title:标题
33 | * time:加入时间
34 | * }
35 | * @param {*} size 最大个数
36 | * @param {*} expire 过期时间
37 | */
38 | static addFoot(type, title, size = 60, expire = 86400 * 365 * 3) {
39 | let path = pageHelper.getCurrentPageUrlWithArgs();
40 | if (!path || !title || !type) return [];
41 |
42 | let foot = cacheHelper.get(CACHE_FOOT, []);
43 |
44 | //查询是否存在 并删除
45 | for (let k = 0; k < foot.length; k++) {
46 | if (path == foot[k].path)
47 | foot.splice(k, 1);
48 | }
49 |
50 | // 加到头部
51 | let val = {
52 | path,
53 | type,
54 | title,
55 | time: timeHelper.time()
56 | }
57 | foot.unshift(val);
58 |
59 | // 判断个数, 多的删除
60 | if (foot.length > size)
61 | foot.splice(foot.length - 1, 1);
62 |
63 | // 存缓存
64 | cacheHelper.set(CACHE_FOOT, foot, expire);
65 |
66 | return foot;
67 | }
68 | }
69 |
70 | module.exports = FootBiz;
--------------------------------------------------------------------------------
/miniprogram/comm/biz/public_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 通用业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2022-05-22 07:48:00
5 | */
6 |
7 | const BaseBiz = require('./base_biz.js');
8 | const setting = require('../../setting/setting.js');
9 | const cacheHelper = require('../../helper/cache_helper.js');
10 | const dataHelper = require('../../helper/data_helper.js');
11 |
12 | class PublicBiz extends BaseBiz {
13 | /**
14 | * 页面初始化
15 | * @param {*} skin
16 | * @param {*} that
17 | */
18 | static initPageBase(that, { skin, isSetNavColor = true }) {
19 | if (skin) {
20 | skin.IS_SUB = setting.IS_SUB;
21 |
22 | if ((setting.IS_SUB)) {
23 |
24 | wx.hideHomeButton();
25 |
26 | // 顶部
27 | if (isSetNavColor)
28 | wx.setNavigationBarColor({
29 | backgroundColor: skin.NAV_BG,
30 | frontColor: skin.NAV_COLOR,
31 | });
32 | }
33 |
34 | that.setData({
35 | skin
36 | })
37 | }
38 |
39 | }
40 |
41 | // 从富文本提取简介
42 | static getRichEditorDesc(desc, content) {
43 | if (desc) return dataHelper.fmtText(desc, 100);
44 | if (!Array.isArray(content)) return desc;
45 |
46 | for (let k = 0; k < content.length; k++) {
47 | if (content[k].type == 'text') return dataHelper.fmtText(content[k].val, 100);
48 | }
49 | return desc;
50 | }
51 |
52 | static isCacheList(key) {
53 | key = key.toUpperCase();
54 | if (setting.CACHE_IS_LIST)
55 | return cacheHelper.get(key + '_LIST');
56 | else
57 | return false;
58 | }
59 |
60 | static removeCacheList(key) {
61 | key = key.toUpperCase();
62 | if (setting.CACHE_IS_LIST)
63 | cacheHelper.remove(key + '_LIST');
64 | }
65 |
66 | static setCacheList(key, time = setting.CACHE_LIST_TIME) {
67 | key = key.toUpperCase();
68 | if (setting.CACHE_IS_LIST)
69 | cacheHelper.set(key + '_LIST', 'TRUE', time);
70 | }
71 |
72 | }
73 |
74 | module.exports = PublicBiz;
--------------------------------------------------------------------------------
/miniprogram/comm/biz/search_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 搜索模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
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/comm/constants.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 通用常量
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | module.exports = {
8 | CACHE_TOKEN: 'CACHE_TOKEN', // 登录
9 | CACHE_TOKEN_EXPIRE: 86400, //登录有效时间 秒
10 |
11 | CACHE_ADMIN: 'ADMIN_TOKEN', // 管理员登录
12 | ADMIN_TOKEN_EXPIRE: 3600 * 2, //管理员过期时间2小时有效 秒
13 |
14 | // #### setup相关
15 | SETUP_ABOUT_KEY: 'SETUP_ABOUT_KEY',
16 | }
--------------------------------------------------------------------------------
/miniprogram/helper/cache_helper.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 微信缓存二次封装,有设置时效性的封装
3 | * Ver : CCMiniCloud Framework 3.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2022-11-14 07:48:00
5 | */
6 | const helper = require('./helper.js');
7 |
8 | const TIME_SUFFIX = "_deadtime"
9 |
10 | /**
11 | * 设置
12 | * k 键key
13 | * v 值value
14 | * t 秒
15 | */
16 | function set(k, v, t = 86400 * 30) {
17 | if (!k) return null;
18 |
19 | wx.setStorageSync(k, v);
20 | let seconds = parseInt(t);
21 | if (seconds > 0) {
22 | let newtime = Date.parse(new Date());
23 | newtime = newtime / 1000 + seconds;
24 | wx.setStorageSync(k + TIME_SUFFIX, newtime + "");
25 | } else {
26 | wx.removeStorageSync(k + TIME_SUFFIX);
27 | }
28 | }
29 |
30 |
31 | /**
32 | * 获取
33 | * k 键key
34 | * def 默认值
35 | */
36 | function get(k, def = null) {
37 | if (!k) return null;
38 |
39 | let deadtime = wx.getStorageSync(k + TIME_SUFFIX);
40 | if (!deadtime) return def;
41 |
42 | deadtime = parseInt(deadtime);
43 | if (!deadtime) return def;
44 |
45 | if (deadtime) {
46 | if (parseInt(deadtime) < Date.parse(new Date()) / 1000) {
47 | wx.removeStorageSync(k);
48 | wx.removeStorageSync(k + TIME_SUFFIX);
49 | return def;
50 | }
51 | }
52 |
53 | let res = wx.getStorageSync(k);
54 |
55 | if (helper.isDefined(res)) {
56 | return res;
57 | } else {
58 | return def;
59 | }
60 | }
61 |
62 | /**
63 | * 删除
64 | */
65 | function remove(k) {
66 | if (!k) return null;
67 |
68 | wx.removeStorageSync(k);
69 | wx.removeStorageSync(k + TIME_SUFFIX);
70 | }
71 |
72 | /**
73 | * 清除所有key
74 | */
75 | function clear() {
76 | wx.clearStorageSync();
77 | }
78 |
79 | module.exports = {
80 | set,
81 | get,
82 | remove,
83 | clear
84 | }
85 |
--------------------------------------------------------------------------------
/miniprogram/helper/file_helper.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 文件处理相关函数
3 | * Ver : CCMiniCloud Framework 2.7.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2022-02-05 04:00:00
5 | */
6 | const pageHelper = require('./page_helper.js');
7 | const timeHelper = require('./time_helper.js');
8 |
9 | function openDoc(name, url, ext = '.xlsx') {
10 |
11 | wx.showLoading({
12 | title: '文件下载中',
13 | });
14 |
15 | wx.downloadFile({
16 | url,
17 | //fileID:' ',
18 | filePath: wx.env.USER_DATA_PATH + '/' + name + timeHelper.time('YMDhms') + ext,
19 | success: function (res) {
20 | wx.hideLoading();
21 | if (res.statusCode != 200)
22 | return pageHelper.showModal('打开文件失败,请重试或者采取别的下载方式');
23 |
24 | const filePath = res.filePath;
25 | wx.openDocument({
26 | showMenu: true,
27 | filePath: filePath,
28 | success: function (res) {
29 | console.log('打开文档成功');
30 | }
31 | })
32 | },
33 | fail: function (err) {
34 | wx.hideLoading();
35 | console.log(err);
36 | pageHelper.showModal('打开文件失败,请重试或者采取别的下载方式');
37 | }
38 | })
39 | }
40 |
41 | module.exports = {
42 | openDoc
43 | }
--------------------------------------------------------------------------------
/miniprogram/helper/form_helper.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 表单通用类库
3 | * Ver : CCMiniCloud Framework 2.8.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2021-02-28 07:48:00
5 | */
6 |
7 |
8 | /**
9 | * model变表单
10 | * @param {*} model
11 | */
12 | function model2Form(model) {
13 | let newModel = {};
14 | for (let key in model) {
15 | let arr = key.split('_');
16 | let result = '';
17 | for (let i = 1; i < arr.length; i++) {
18 | let name = arr[i].toLowerCase();
19 | name = name.charAt(0).toUpperCase() + name.slice(1);
20 | result = result + name;
21 | }
22 |
23 | newModel['form' + result] = model[key];
24 | }
25 | return newModel;
26 | }
27 |
28 | // picker表单赋值到页面data
29 | function setOptions(that, options, name, val) {
30 | let idx = options.indexOf(val);
31 | idx = (idx < 0) ? 0 : idx;
32 | that.setData({
33 | [name]: idx
34 | })
35 | }
36 |
37 | module.exports = {
38 | model2Form,
39 | setOptions
40 | }
--------------------------------------------------------------------------------
/miniprogram/helper/helper.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 通用类库
3 | * Ver : CCMiniCloud Framework 2.9.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | /**
8 | * 判断变量,参数,对象属性是否定义
9 | * @param {*} val
10 | */
11 | function isDefined(val) {
12 | // == 不能判断是否为null
13 | if (val === undefined)
14 | return false;
15 | else
16 | return true;
17 | }
18 |
19 | /**
20 | * 判断对象是否为空
21 | * @param {*} obj
22 | */
23 | function isObjectNull(obj) {
24 | return (Object.keys(obj).length == 0);
25 | }
26 |
27 |
28 | function sleep(time) {
29 | return new Promise((resolve) => setTimeout(resolve, time));
30 | };
31 |
32 |
33 | function formatNumber(n) {
34 | n = n.toString()
35 | return n[1] ? n : '0' + n
36 | }
37 |
38 | /**
39 | * 从picker options中 获取索引值
40 | * @param {*} options
41 | * [{
42 | value: 0,
43 | label: '猎头'
44 | }]
45 | * @param {*} val
46 | */
47 | function getOptionsIdx(options, val) {
48 | for (let i = 0; i < options.length; i++) {
49 | if (options[i].value === val)
50 | return i;
51 | }
52 | return 0;
53 | }
54 |
55 |
56 |
57 | module.exports = {
58 | isDefined,
59 | isObjectNull,
60 | sleep,
61 |
62 |
63 | getOptionsIdx,
64 |
65 | }
--------------------------------------------------------------------------------
/miniprogram/helper/pic_helper.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 图片处理相关函数
3 | * Ver : CCMiniCloud Framework 2.0.13 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2021-10-25 04:00:00
5 | */
6 |
7 |
8 | function getWritePhotosAlbum(callback) {
9 | wx.getSetting({
10 | success: res => {
11 | console.log('res=', res);
12 | if (res.authSetting['scope.writePhotosAlbum']) {
13 | console.log('true');
14 | callback && callback();
15 | } else if (res.authSetting['scope.writePhotosAlbum'] === undefined) {
16 | wx.showModal({
17 | title: '提示',
18 | content: '您未开启保存图片到相册的权限,请点击确定去开启权限!',
19 | success: (res) => {
20 | if (res.confirm) {
21 | wx.authorize({
22 | scope: 'scope.writePhotosAlbum',
23 | success: (res) => {
24 | callback && callback()
25 | console.log('授权下载成功', res);
26 | },
27 | fail: (res) => {
28 | console.log('您没有授权 fail=', res);
29 | wx.showToast({
30 | title: '您没有授权,无法保存到相册',
31 | icon: 'none'
32 | });
33 | }
34 | });
35 | } else {
36 | console.log('取消了');
37 | }
38 | }
39 | });
40 | } else {
41 | wx.showModal({
42 | title: '提示',
43 | content: '您未开启保存图片到相册的权限,请点击确定去开启权限!',
44 | success: (res) => {
45 | if (res.confirm) {
46 | wx.openSetting({
47 | success: (res) => {
48 | wx.showToast({
49 | icon: 'none',
50 | title: '正在保存图片',
51 | });
52 | if (res.authSetting['scope.writePhotosAlbum']) {
53 | console.log('false success res=', res);
54 | callback && callback();
55 | } else {
56 | wx.showToast({
57 | title: '您没有授权,无法保存到相册!',
58 | icon: 'none'
59 | });
60 | }
61 | },
62 | fail: (res) => {
63 | console.log('false file res=', res);
64 | }
65 | });
66 | } else {
67 | wx.showToast({
68 | title: '您没有授权,无法保存到相册',
69 | icon: 'none'
70 | });
71 | }
72 | }
73 | });
74 | }
75 | }
76 | });
77 | }
78 |
79 | module.exports = {
80 | getWritePhotosAlbum
81 | }
--------------------------------------------------------------------------------
/miniprogram/images/cover.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/images/cover.gif
--------------------------------------------------------------------------------
/miniprogram/pages/test1/test1.js:
--------------------------------------------------------------------------------
1 | // pages/test1/test1.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad(options) {
15 |
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面初次渲染完成
20 | */
21 | onReady() {
22 |
23 | },
24 |
25 | /**
26 | * 生命周期函数--监听页面显示
27 | */
28 | onShow() {
29 |
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面隐藏
34 | */
35 | onHide() {
36 |
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面卸载
41 | */
42 | onUnload() {
43 |
44 | },
45 |
46 | /**
47 | * 页面相关事件处理函数--监听用户下拉动作
48 | */
49 | onPullDownRefresh() {
50 |
51 | },
52 |
53 | /**
54 | * 页面上拉触底事件的处理函数
55 | */
56 | onReachBottom() {
57 |
58 | },
59 |
60 | /**
61 | * 用户点击右上角分享
62 | */
63 | onShareAppMessage() {
64 |
65 | }
66 | })
--------------------------------------------------------------------------------
/miniprogram/pages/test1/test1.wxml:
--------------------------------------------------------------------------------
1 |
2 | pages/test1/test1.wxml
3 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/biz/admin_news_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 资讯后台管理模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | const BaseBiz = require('../../../comm/biz/base_biz.js');
8 | const NewsBiz = require('./news_biz.js');
9 | const projectSetting = require('../public/project_setting.js');
10 |
11 | class AdminNewsBiz extends BaseBiz {
12 |
13 |
14 | /** 表单初始化相关数据 */
15 | static initFormData(id = '') {
16 | let cateIdOptions = NewsBiz.getCateList();
17 |
18 | return {
19 | id,
20 |
21 | contentDesc: '',
22 |
23 | // 分类
24 | cateIdOptions,
25 |
26 | // 图片数据
27 | imgList: [],
28 |
29 |
30 | // 表单数据
31 | formOrder: 9999,
32 | formTitle: '',
33 | formDesc: '',
34 | formContent: [],
35 | formCateId: (cateIdOptions.length == 1) ? cateIdOptions[0].val : '',
36 | }
37 |
38 | }
39 |
40 | static getCateName(cateId) {
41 | let cateList = projectSetting.NEWS_CATE;
42 |
43 | for (let k = 0; k < cateList.length; k++) {
44 | if (cateList[k].id == cateId) return cateList[k].title;
45 | }
46 | return '';
47 | }
48 |
49 | }
50 |
51 |
52 | /** 表单校验 本地 */
53 | AdminNewsBiz.CHECK_FORM = {
54 | title: 'formTitle|must|string|min:4|max:50|name=标题',
55 | cateId: 'formCateId|must|id|name=分类',
56 | order: 'formOrder|must|int|min:1|max:9999|name=排序号',
57 | desc: 'formDesc|string|min:10|max:200|name=简介',
58 | };
59 |
60 |
61 | module.exports = AdminNewsBiz;
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/biz/admin_vote_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 投票模块后台管理模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2022-07-05 07:48:00
5 | */
6 |
7 | const BaseBiz = require('../../../comm/biz/base_biz.js');
8 | const VoteBiz = require('./vote_biz.js');
9 | const projectSetting = require('../public/project_setting.js');
10 |
11 | class AdminVoteBiz extends BaseBiz {
12 |
13 |
14 | static initFormData(id = '') {
15 | let cateIdOptions = VoteBiz.getCateList();
16 |
17 | return {
18 | id,
19 |
20 | cateIdOptions,
21 | fields: projectSetting.VOTE_FIELDS,
22 |
23 | formTitle: '',
24 | formCateId: (cateIdOptions.length == 1) ? cateIdOptions[0].val : '',
25 | formOrder: 9999,
26 |
27 | formStart: '',
28 | formEnd: '',
29 |
30 | formTheme: 0,
31 |
32 | formIsReg: 0,
33 | formShowStart: 1,
34 | formMaxCnt: 1,
35 | formType: 0,
36 | formItem:
37 | [
38 | { label: '', cnt: 0, pic: '', content: [] },
39 | { label: '', cnt: 0, pic: '', content: [] }
40 | ],
41 |
42 | formForms: [],
43 |
44 | }
45 |
46 | }
47 | }
48 |
49 | AdminVoteBiz.CHECK_FORM = {
50 | title: 'formTitle|must|string|min:2|max:50|name=标题',
51 | cateId: 'formCateId|must|id|name=分类',
52 | order: 'formOrder|must|int|min:0|max:9999|name=排序号',
53 | start: 'formStart|must|string|name=开始时间',
54 | end: 'formEnd|must|string|name=截止时间',
55 | isReg: 'formIsReg|must|int|name=是否注册',
56 | showStart: 'formShowStart|must|int|name=是否显示开始时间',
57 | theme: 'formTheme|must|int|name=主题色',
58 | type: 'formType|must|int|name=投票模式',
59 | maxCnt: 'formMaxCnt|must|int|name=可投票数',
60 | item: 'formItem|must|array|name=投票选项',
61 | forms: 'formForms|array'
62 | };
63 |
64 | module.exports = AdminVoteBiz;
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/biz/news_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 资讯模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2020-11-14 07:48:00
5 | */
6 |
7 | const BaseBiz = require('../../../comm/biz/base_biz.js');
8 | const dataHelper = require('../../../helper/data_helper.js');
9 | const pageHelper = require('../../../helper/page_helper.js');
10 | const projectSetting = require('../public/project_setting.js');
11 |
12 | class NewsBiz extends BaseBiz {
13 |
14 | /** 取得分类 */
15 | static getCateList() {
16 | let cateList = projectSetting.NEWS_CATE;
17 |
18 | let arr = [];
19 | for (let k = 0; k < cateList.length; k++) {
20 | arr.push({
21 | label: cateList[k].title,
22 | type: 'cateId',
23 | val: cateList[k].id, //for options
24 | value: cateList[k].id, //for list
25 | })
26 | }
27 | return arr;
28 | }
29 |
30 |
31 | static setCateTitle(cateId = null, that) {
32 |
33 | // 获取当前小程序的页面栈
34 | let pages = getCurrentPages();
35 | // 数组中索引最大的页面--当前页面
36 | let currentPage = pages[pages.length - 1];
37 | // 附加参数
38 | if (currentPage.options && currentPage.options.id) {
39 | cateId = currentPage.options.id;
40 | }
41 | let cateList = dataHelper.getSelectOptions(projectSetting.NEWS_CATE);
42 | for (let k = 0; k < cateList.length; k++) {
43 | if (cateList[k].val == cateId) {
44 | wx.setNavigationBarTitle({
45 | title: cateList[k].label
46 | });
47 |
48 | if (cateList[k].ext) { //样式
49 | that.setData({
50 | listMode: cateList[k].ext
51 | });
52 | } else {
53 | that.setData({
54 | listMode: 'leftbig'
55 | });
56 | }
57 |
58 | }
59 | }
60 |
61 | }
62 |
63 | /** 搜索菜单设置 */
64 | static async getSearchMenu() {
65 | let sortMenus = [{
66 | label: '全部',
67 | type: '',
68 | value: ''
69 | }];
70 | let sortMenusAfter = [{
71 | label: '最新',
72 | type: 'sort',
73 | value: 'new'
74 | },];
75 | let sortItems = [];
76 |
77 | sortMenus = sortMenus.concat(sortMenusAfter);
78 |
79 | return {
80 | sortItems,
81 | sortMenus
82 | }
83 | }
84 | }
85 |
86 | module.exports = NewsBiz;
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/biz/project_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 项目通用业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2022-05-22 07:48:00
5 | */
6 |
7 | const BaseBiz = require('../../../comm/biz/base_biz.js');
8 | const projectSetting = require('../public/project_setting.js');
9 | const PubilcBiz = require('../../../comm/biz/public_biz.js');
10 | const PassportBiz = require('../../../comm/biz/passport_biz.js');
11 |
12 | class ProjectBiz extends BaseBiz {
13 |
14 | /**
15 | * 页面初始化
16 | * @param {*} that
17 | */
18 | static initPage(that, { isSetNavColor = true } = {}) {
19 | if (that) PassportBiz.loginSilence(that);
20 |
21 | let skin = {};
22 | skin.NAV_BG = projectSetting.NAV_BG;
23 | skin.NAV_COLOR = projectSetting.NAV_COLOR;
24 | skin.PROJECT_COLOR = projectSetting.PROJECT_COLOR;
25 |
26 | PubilcBiz.initPageBase(that, { skin, isSetNavColor });
27 | }
28 |
29 | }
30 |
31 | module.exports = ProjectBiz;
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/biz/vote_biz.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Notes: 投票模块业务逻辑
3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
4 | * Date: 2022-06-24 07:48:00
5 | */
6 |
7 | const BaseBiz = require('../../../comm/biz/base_biz.js');
8 | const projectSetting = require('../public/project_setting.js');
9 | const dataHelper = require('../../../helper/data_helper.js');
10 |
11 | class VoteBiz extends BaseBiz {
12 |
13 | static setOrderVoteItem(voteItem) {
14 | voteItem.sort(dataHelper.objArrSortDesc('cnt'));
15 | let oldCnt = -1;
16 | let orderTotal = 0;
17 | for (let k = 0; k < voteItem.length; k++) {
18 | if (voteItem[k].cnt != oldCnt) {
19 | orderTotal++;
20 | oldCnt = voteItem[k].cnt;
21 | }
22 | voteItem[k].order = orderTotal;
23 | }
24 | }
25 |
26 | static getCateName(cateId) {
27 | return BaseBiz.getCateName(cateId, projectSetting.VOTE_CATE);
28 | }
29 |
30 | static getCateList() {
31 | return BaseBiz.getCateList(projectSetting.VOTE_CATE);
32 | }
33 |
34 | static setCateTitle() {
35 | return BaseBiz.setCateTitle(projectSetting.VOTE_CATE);
36 | }
37 |
38 | }
39 |
40 | module.exports = VoteBiz;
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/home.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/home.jpg
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/menu/news_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/menu/news_1.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/menu/vote_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/menu/vote_1.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/menu/vote_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/menu/vote_2.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/menu/vote_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/menu/vote_3.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/menu/vote_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/menu/vote_4.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/menu/vote_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/menu/vote_5.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/tabbar/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/tabbar/home.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/tabbar/home_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/tabbar/home_cur.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/tabbar/my.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/tabbar/my.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/tabbar/my_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/tabbar/my_cur.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/tabbar/news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/tabbar/news.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/tabbar/news_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/tabbar/news_cur.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/tabbar/vote.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/tabbar/vote.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/images/tabbar/vote_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linxizhi2021/SmartVote/213f37c3d46f266b671c394cada75b4a1bc9df88/miniprogram/projects/VOTE1/images/tabbar/vote_cur.png
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/about/index/about_index.js:
--------------------------------------------------------------------------------
1 | const cloudHelper = require('../../../../../helper/cloud_helper.js');
2 | const pageHelper = require('../../../../../helper/page_helper.js');
3 | const ProjectBiz = require('../../../biz/project_biz.js');
4 | const constants = require('../../../../../comm/constants.js');
5 |
6 | Page({
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | isLoad: false
12 | },
13 |
14 | /**
15 | * 生命周期函数--监听页面加载
16 | */
17 | onLoad: async function (options) {
18 | ProjectBiz.initPage(this);
19 |
20 | const accountInfo = wx.getAccountInfoSync();
21 | this.setData({
22 | accountInfo
23 | });
24 |
25 | this._loadDetail();
26 | },
27 |
28 | _loadDetail: async function () {
29 | let opts = {
30 | title: 'bar'
31 | }
32 | let params = {
33 | key: constants.SETUP_ABOUT_KEY
34 | }
35 | let about = await cloudHelper.callCloudData('home/setup_get', params, opts);
36 | if (!about) {
37 | about = [{ 'type': 'text', 'val': '关于我们' }];
38 | }
39 |
40 | if (about) this.setData({
41 | about,
42 | isLoad: true
43 | });
44 | },
45 |
46 | /**
47 | * 生命周期函数--监听页面初次渲染完成
48 | */
49 | onReady: function () {
50 |
51 | },
52 |
53 | /**
54 | * 生命周期函数--监听页面显示
55 | */
56 | onShow: function () {
57 |
58 | },
59 |
60 | /**
61 | * 生命周期函数--监听页面隐藏
62 | */
63 | onHide: function () {
64 |
65 | },
66 |
67 | /**
68 | * 生命周期函数--监听页面卸载
69 | */
70 | onUnload: function () {
71 |
72 | },
73 |
74 | /**
75 | * 页面相关事件处理函数--监听用户下拉动作
76 | */
77 | onPullDownRefresh: function () {
78 | this._loadDetail();
79 | wx.stopPullDownRefresh();
80 | },
81 |
82 |
83 | /**
84 | * 用户点击右上角分享
85 | */
86 | onShareAppMessage: function () {
87 |
88 | },
89 |
90 | url: function (e) {
91 | pageHelper.url(e, this);
92 | }
93 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/about/index/about_index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | },
4 | "enablePullDownRefresh": true,
5 | "navigationBarTitleText": "关于我们"
6 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/about/index/about_index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | {{item.val}}
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | v{{accountInfo.miniProgram.version}} {{accountInfo.miniProgram.envVersion}}
33 |
34 |
35 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/about/index/about_index.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../../../style/public/detail.wxss";
2 | @import "../../../style/skin.wxss";
3 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/content/admin_content.js:
--------------------------------------------------------------------------------
1 | const AdminBiz = require('../../../../../comm/biz/admin_biz.js');
2 | const pageHelper = require('../../../../../helper/page_helper.js');
3 |
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | formContent: [{
11 | type: 'text',
12 | val: '',
13 | }]
14 | },
15 |
16 | /**
17 | * 生命周期函数--监听页面加载
18 | */
19 | onLoad: async function (options) {
20 | if (!AdminBiz.isAdmin(this)) return;
21 |
22 | let parent = pageHelper.getPrevPage(2);
23 | if (!parent) return;
24 |
25 | let formContent = parent.data.formContent;
26 | if (formContent && formContent.length > 0)
27 | this.setData({
28 | formContent
29 | });
30 | },
31 |
32 |
33 |
34 |
35 | /**
36 | * 生命周期函数--监听页面初次渲染完成
37 | */
38 | onReady: function () {},
39 |
40 | /**
41 | * 生命周期函数--监听页面显示
42 | */
43 | onShow: function () {},
44 |
45 | /**
46 | * 生命周期函数--监听页面隐藏
47 | */
48 | onHide: function () {},
49 |
50 | /**
51 | * 生命周期函数--监听页面卸载
52 | */
53 | onUnload: function () {},
54 |
55 | /**
56 | * 页面相关事件处理函数--监听用户下拉动作
57 | */
58 | onPullDownRefresh: async function () {
59 |
60 | },
61 |
62 | model: function (e) {
63 | pageHelper.model(this, e);
64 | },
65 |
66 | url: function (e) {
67 | pageHelper.url(e, this);
68 | },
69 |
70 | bindSaveTap: function (e) {
71 | let formContent = this.selectComponent("#contentEditor").getNodeList();
72 |
73 | let parent = pageHelper.getPrevPage(2);
74 | if (!parent) return;
75 |
76 | parent.setData({
77 | formContent
78 | }, () => {
79 | parent._setContentDesc();
80 | });
81 |
82 | wx.navigateBack();
83 | }
84 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/content/admin_content.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-editor": "/cmpts/public/editor/editor_cmpt"
4 | },
5 | "navigationBarBackgroundColor": "#2499f2",
6 | "navigationBarTextStyle": "white",
7 | "navigationBarTitleText": "后台-详细内容编辑"
8 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/content/admin_content.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 不保存,返回
12 | 保存
13 |
14 |
15 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/content/admin_content.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../style/public/admin.wxss';
2 |
3 | .main-admin {
4 | width: 100%;
5 | box-sizing: border-box;
6 | padding: 30rpx 20rpx;
7 | padding-bottom: 200rpx;
8 | }
9 |
10 | .form-group {
11 | padding: 1rpx 1rpx;
12 | overflow: hidden;
13 | }
14 |
15 | .oprt {
16 | display: flex;
17 | width: 100%;
18 | justify-content: space-around;
19 | }
20 |
21 | .oprt button {
22 | width: 45%;
23 | }
24 |
25 | .bottom-oprt {
26 | position: fixed;
27 | bottom: 0;
28 | height: 130rpx;
29 | background-color: #f8f8f8;
30 | display: flex;
31 | justify-content: space-around;
32 | align-items: center;
33 | border-top: 1rpx solid #ccc;
34 | z-index: 99999;
35 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/index/home/admin_home.js:
--------------------------------------------------------------------------------
1 | const AdminBiz = require('../../../../../../comm/biz/admin_biz.js');
2 | const pageHelper = require('../../../../../../helper/page_helper.js');
3 | const cloudHelper = require('../../../../../../helper/cloud_helper.js');
4 |
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {},
11 |
12 | /**
13 | * 生命周期函数--监听页面加载
14 | */
15 | onLoad: async function (options) {
16 | if (!AdminBiz.isAdmin(this)) return;
17 |
18 | this._loadDetail();
19 | },
20 |
21 | /**
22 | * 页面相关事件处理函数--监听用户下拉动作
23 | */
24 | onPullDownRefresh: async function () {
25 | await this._loadDetail();
26 | wx.stopPullDownRefresh();
27 | },
28 |
29 | _loadDetail: async function () {
30 |
31 | let admin = AdminBiz.getAdminToken();
32 | this.setData({
33 | isLoad: true,
34 | admin
35 | });
36 |
37 | try {
38 | let opts = {
39 | title: 'bar'
40 | }
41 | let res = await cloudHelper.callCloudData('admin/home', {}, opts);
42 | this.setData({
43 | stat: res
44 | });
45 |
46 | } catch (err) {
47 | console.log(err);
48 | }
49 | },
50 |
51 | /**
52 | * 生命周期函数--监听页面初次渲染完成
53 | */
54 | onReady: function () {
55 |
56 | },
57 |
58 | /**
59 | * 生命周期函数--监听页面显示
60 | */
61 | onShow: function () {
62 |
63 | },
64 |
65 | /**
66 | * 生命周期函数--监听页面隐藏
67 | */
68 | onHide: function () {
69 |
70 | },
71 |
72 | /**
73 | * 生命周期函数--监听页面卸载
74 | */
75 | onUnload: function () {
76 |
77 | },
78 |
79 | url: function (e) {
80 | pageHelper.url(e, this);
81 | },
82 |
83 | bindExitTap: function (e) {
84 |
85 | let callback = function () {
86 | AdminBiz.clearAdminToken();
87 | wx.reLaunch({
88 | url: pageHelper.fmtURLByPID('/pages/my/index/my_index'),
89 | });
90 | }
91 | pageHelper.showConfirm('您确认退出?', callback);
92 | },
93 |
94 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/index/home/admin_home.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-foot": "/cmpts/biz/foot/foot_cmpt"
4 | },
5 | "enablePullDownRefresh": true,
6 | "navigationBarBackgroundColor": "#2499f2",
7 | "navigationBarTextStyle": "white",
8 | "navigationBarTitleText": "后台管理"
9 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/index/home/admin_home.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
3 | .main-admin {
4 | padding: 0;
5 | }
6 |
7 | .admin-info {
8 | height: 200rpx;
9 | width: 100%;
10 | color: #fff;
11 | display: flex;
12 | justify-content: flex-start;
13 | align-items: center;
14 | position: relative;
15 | }
16 |
17 | .admin-info .pic {
18 | width: 100rpx;
19 | height: 100rpx;
20 | font-size: 70rpx;
21 | display: flex;
22 | justify-content: center;
23 | align-items: center;
24 | margin-right: 20rpx;
25 | border-radius:20rpx;
26 | margin-left:20rpx;
27 | }
28 |
29 | .admin-info .right {
30 | flex: 1;
31 | display: flex;
32 | flex-direction: column;
33 | }
34 |
35 | .admin-info .right .name {
36 | font-size: 32rpx;
37 | line-height: 1.8;
38 | }
39 |
40 | .admin-info .right .desc {
41 | font-size: 24rpx;
42 | line-height: 1.3;
43 | }
44 |
45 | .admin-info .exit-admin {
46 | position: absolute;
47 | top: 12rpx;
48 | right: 12rpx;
49 | font-size: 45rpx;
50 | }
51 |
52 |
53 | .main-admin .comm-list,
54 | .main-admin .bar {
55 | background-color: #fff;
56 | width: 100%;
57 | }
58 |
59 | .main-admin .exit {
60 | width: 100%;
61 | padding: 0 20rpx;
62 | margin-bottom: 50rpx;
63 | }
64 |
65 | .main-admin .exit button {
66 | width: 100%;
67 | color: #fff;
68 | height: 70rpx;
69 | }
70 |
71 | .grid.col-6>view {
72 | width: 16.66%;
73 | }
74 |
75 | .foot-bottom {
76 | width: 100%;
77 | display: flex;
78 | justify-content: center;
79 | align-items: center;
80 | bottom: 50rpx;
81 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/index/login/admin_login.js:
--------------------------------------------------------------------------------
1 | const AdminBiz = require('../../../../../../comm/biz/admin_biz.js');
2 | const pageHelper = require('../../../../../../helper/page_helper.js');
3 |
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | name: '',
11 | pwd: '',
12 | },
13 |
14 | /**
15 | * 生命周期函数--监听页面加载
16 | */
17 | onLoad: function (options) {
18 | AdminBiz.clearAdminToken();
19 | },
20 |
21 | /**
22 | * 生命周期函数--监听页面初次渲染完成
23 | */
24 | onReady: function () {
25 |
26 | },
27 |
28 | /**
29 | * 生命周期函数--监听页面显示
30 | */
31 | onShow: function () {},
32 |
33 | /**
34 | * 生命周期函数--监听页面隐藏
35 | */
36 | onHide: function () {
37 |
38 | },
39 |
40 | /**
41 | * 生命周期函数--监听页面卸载
42 | */
43 | onUnload: function () {
44 |
45 | },
46 |
47 | url: function (e) {
48 | pageHelper.url(e, this);
49 | },
50 |
51 | bindBackTap: function (e) {
52 | wx.reLaunch({
53 | url: pageHelper.fmtURLByPID('/pages/my/index/my_index'),
54 | });
55 | },
56 |
57 | bindLoginTap: async function (e) {
58 | return AdminBiz.adminLogin(this, this.data.name, this.data.pwd);
59 | }
60 |
61 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/index/login/admin_login.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-foot": "/cmpts/biz/foot/foot_cmpt"
4 | },
5 | "disableScroll": true,
6 | "navigationBarBackgroundColor": "#ffffff",
7 | "navigationBarTextStyle": "black"
8 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/index/login/admin_login.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 |
28 |
29 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/index/login/admin_login.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
3 | .main-admin {
4 | width: 100%;
5 | min-height: 100vh;
6 | display: flex;
7 | flex-direction: column;
8 | align-items: center;
9 | justify-content: center;
10 | position: relative;
11 | }
12 |
13 | .login {
14 | width: 500rpx;
15 | background-color: #fff;
16 | min-height: 550rpx;
17 | border-radius: 20rpx;
18 | display: flex;
19 | flex-direction: column;
20 | justify-content: space-between;
21 | align-items: center;
22 | padding: 50rpx 20rpx;
23 | margin-top: -100rpx;
24 | }
25 |
26 | .login button {
27 | width: 85%;
28 | color: #fff;
29 | font-size: 32rpx;
30 | }
31 |
32 | .login .hint {
33 | width: 100%;
34 | color: #000;
35 | font-weight: bold;
36 | font-size: 36rpx;
37 | text-align: center;
38 | }
39 |
40 | .login .return {
41 | width: 100%;
42 | font-size: 30rpx;
43 | text-align: center;
44 | font-size: 26rpx;
45 | }
46 |
47 | .pic {
48 | width: 180rpx;
49 | height: 180rpx;
50 | font-size: 130rpx;
51 | display: flex;
52 | justify-content: center;
53 | align-items: center;
54 | }
55 |
56 | .foot-bottom {
57 | width: 100%;
58 | display: flex;
59 | justify-content: center;
60 | align-items: center;
61 | position: absolute;
62 | bottom: 50rpx;
63 | }
64 |
65 | .site-footer {
66 | color: #fff !important;
67 | }
68 |
69 | .form-group .title {
70 | color:#333;
71 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/add/admin_mgr_add.js:
--------------------------------------------------------------------------------
1 | const AdminBiz = require('../../../../../../comm/biz/admin_biz.js');
2 | const PublicBiz = require('../../../../../../comm/biz/public_biz.js');
3 | const pageHelper = require('../../../../../../helper/page_helper.js');
4 | const cloudHelper = require('../../../../../../helper/cloud_helper.js');
5 | const validate = require('../../../../../../helper/validate.js');
6 |
7 | Page({
8 |
9 | /**
10 | * 页面的初始数据
11 | */
12 | data: {
13 | formName: '',
14 | formDesc: '',
15 | formPhone: '',
16 | formPassword: '',
17 | },
18 |
19 | /**
20 | * 生命周期函数--监听页面加载
21 | */
22 | onLoad: function (options) {
23 | if (!AdminBiz.isAdmin(this, true)) return;
24 | },
25 |
26 | /**
27 | * 生命周期函数--监听页面初次渲染完成
28 | */
29 | onReady: function () {
30 |
31 | },
32 |
33 | /**
34 | * 生命周期函数--监听页面显示
35 | */
36 | onShow: function () {
37 |
38 | },
39 |
40 | /**
41 | * 生命周期函数--监听页面隐藏
42 | */
43 | onHide: function () {
44 |
45 | },
46 |
47 | /**
48 | * 生命周期函数--监听页面卸载
49 | */
50 | onUnload: function () {
51 |
52 | },
53 |
54 |
55 |
56 | /**
57 | * 数据提交
58 | */
59 | bindFormSubmit: async function () {
60 | if (!AdminBiz.isAdmin(this, true)) return;
61 |
62 | let data = this.data;
63 |
64 | // 数据校验
65 | data = validate.check(data, AdminBiz.CHECK_FORM_MGR_ADD, this);
66 | if (!data) return;
67 |
68 | try {
69 | let adminId = this.data.id;
70 | data.id = adminId;
71 |
72 | await cloudHelper.callCloudSumbit('admin/mgr_insert', data).then(res => {
73 |
74 | let callback = async function () {
75 | PublicBiz.removeCacheList('admin-mgr');
76 | wx.navigateBack();
77 |
78 | }
79 | pageHelper.showSuccToast('添加成功', 1500, callback);
80 | });
81 |
82 |
83 | } catch (err) {
84 | console.log(err);
85 | }
86 |
87 | },
88 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/add/admin_mgr_add.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "navigationBarBackgroundColor": "#2499f2",
4 | "navigationBarTextStyle": "white",
5 | "navigationBarTitleText": "添加管理员"
6 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/add/admin_mgr_add.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 登录账号
6 |
7 |
8 | {{formNameFocus}}
9 |
10 |
11 | 姓名
12 |
13 |
14 | {{formDescFocus}}
15 |
16 |
17 | 手机
18 |
19 |
20 | {{formPhoneFocus}}
21 |
22 |
23 | 密码
24 |
25 |
26 | {{formPasswordFocus}}
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/add/admin_mgr_add.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/edit/admin_mgr_edit.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "navigationBarBackgroundColor": "#2499f2",
4 | "navigationBarTextStyle": "white",
5 | "enablePullDownRefresh": true,
6 | "navigationBarTitleText": "修改管理员"
7 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/edit/admin_mgr_edit.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 登录账号
9 |
10 |
11 | {{formNameFocus}}
12 |
13 |
14 | 姓名
15 |
16 |
17 | {{formDescFocus}}
18 |
19 |
20 | 手机
21 |
22 |
23 | {{formPhoneFocus}}
24 |
25 |
26 |
27 |
28 | 不修改密码则保持以下为空
29 |
30 |
31 | 新密码
32 |
33 |
34 | {{formPasswordFocus}}
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/edit/admin_mgr_edit.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/list/admin_mgr_list.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "navigationBarBackgroundColor": "#2499f2",
4 | "navigationBarTextStyle": "white",
5 | "navigationBarTitleText": "管理员管理"
6 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/list/admin_mgr_list.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/log/admin_log_list.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | },
4 | "navigationBarBackgroundColor": "#2499f2",
5 | "navigationBarTextStyle": "white",
6 | "disableScroll": true,
7 | "navigationBarTitleText": "后台-操作日志"
8 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/log/admin_log_list.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 共有{{dataList.total}}条符合条件记录
11 |
12 |
13 | {{index+1}}
14 |
18 |
19 |
20 | 操作人
21 | :
22 | {{item.LOG_ADMIN_NAME}} ({{item.LOG_ADMIN_DESC}})
23 |
24 |
25 | 操作时间
26 | :
27 | {{item.LOG_ADD_TIME}}
28 |
29 |
30 | 操作内容
31 | :
32 | {{item.LOG_CONTENT}}
33 |
34 |
35 | IP地址
36 | :
37 | {{item.LOG_ADD_IP}}
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/log/admin_log_list.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
3 | page {
4 | background-color: #f8f8f8;
5 | }
6 |
7 | .admin-comm-list .item .info {
8 | padding: 15rpx 20rpx 0rpx;
9 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/pwd/admin_mgr_pwd.js:
--------------------------------------------------------------------------------
1 | const AdminBiz = require('../../../../../../comm/biz/admin_biz.js');
2 | const pageHelper = require('../../../../../../helper/page_helper.js');
3 | const cloudHelper = require('../../../../../../helper/cloud_helper.js');
4 | const validate = require('../../../../../../helper/validate.js');
5 |
6 | Page({
7 |
8 | /**
9 | * 页面的初始数据
10 | */
11 | data: {
12 | formOldPassword: '',
13 | formPassword: '',
14 | formPassword2: '',
15 | },
16 |
17 | /**
18 | * 生命周期函数--监听页面加载
19 | */
20 | onLoad: function (options) {
21 | if (!AdminBiz.isAdmin(this)) return;
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 | bindFormSubmit: async function () {
56 | if (!AdminBiz.isAdmin(this)) return;
57 |
58 | let data = this.data;
59 |
60 | // 数据校验
61 | data = validate.check(data, AdminBiz.CHECK_FORM_MGR_PWD, this);
62 | if (!data) return;
63 |
64 | if (data.password != data.password2) {
65 | return pageHelper.showModal('两次输入的新密码不一致');
66 | }
67 |
68 | try {
69 | await cloudHelper.callCloudSumbit('admin/mgr_pwd', data).then(res => {
70 | let callback = () => {
71 | wx.navigateBack();
72 | }
73 | pageHelper.showSuccToast('修改成功', 1500, callback);
74 | });
75 |
76 |
77 | } catch (err) {
78 | console.log(err);
79 | }
80 |
81 | },
82 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/pwd/admin_mgr_pwd.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "navigationBarBackgroundColor": "#2499f2",
4 | "navigationBarTextStyle": "white",
5 | "navigationBarTitleText": "管理员密码修改"
6 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/pwd/admin_mgr_pwd.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 旧密码
6 |
7 |
8 | {{formOldPasswordFocus}}
9 |
10 |
11 | 新密码
12 |
13 |
14 | {{formPasswordFocus}}
15 |
16 |
17 | 新密码再次填写
18 |
19 |
20 | {{formPassword2Focus}}
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/mgr/pwd/admin_mgr_pwd.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/news/add/admin_news_add.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-img-upload": "/cmpts/public/img/img_upload_cmpt"
4 | },
5 | "navigationBarBackgroundColor": "#2499f2",
6 | "navigationBarTextStyle": "white",
7 | "enablePullDownRefresh": true,
8 | "navigationBarTitleText": "后台-文章添加"
9 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/news/add/admin_news_add.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/news/add/admin_news_add.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/news/edit/admin_news_edit.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-img-upload": "/cmpts/public/img/img_upload_cmpt"
4 | },
5 | "navigationBarBackgroundColor": "#2499f2",
6 | "navigationBarTextStyle": "white",
7 | "enablePullDownRefresh": true,
8 | "navigationBarTitleText": "后台-文章修改"
9 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/news/edit/admin_news_edit.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/news/edit/admin_news_edit.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/news/list/admin_news_list.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | },
4 | "navigationBarBackgroundColor": "#2499f2",
5 | "navigationBarTextStyle": "white",
6 | "disableScroll": true,
7 | "navigationBarTitleText": "后台-内容模块"
8 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/news/list/admin_news_list.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
3 | page {
4 | background-color: #f8f8f8;
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/setup/about/admin_setup_about.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-editor": "/cmpts/public/editor/editor_cmpt"
4 | },
5 | "navigationBarBackgroundColor": "#2499f2",
6 | "navigationBarTextStyle": "white",
7 | "enablePullDownRefresh": true,
8 | "navigationBarTitleText": "编辑关于我们"
9 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/setup/about/admin_setup_about.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | 保存修改
13 |
14 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/setup/about/admin_setup_about.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
3 | .main-admin {
4 | width: 100%;
5 | box-sizing: border-box;
6 | padding: 30rpx 20rpx;
7 | padding-bottom: 200rpx;
8 | }
9 |
10 | .form-group {
11 | padding: 1rpx 1rpx;
12 | overflow: hidden;
13 | }
14 |
15 | .btn-bottom-admin>view {
16 | width: 100%;
17 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/setup/qr/admin_setup_qr.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 |
4 | },
5 | "navigationBarBackgroundColor": "#2499f2",
6 | "navigationBarTextStyle": "white",
7 | "enablePullDownRefresh": true,
8 | "navigationBarTitleText": "小程序码"
9 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/setup/qr/admin_setup_qr.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 放在推广的地方展示
10 |
11 |
12 | 长按图片保存小程序码
13 |
14 | 《{{title}}》小程序码
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/setup/qr/admin_setup_qr.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
3 | .load.loading::after {
4 | content: "小程序码生成中...";
5 | }
6 |
7 | .form-box .checkin {
8 | width: 100%;
9 | padding: 40rpx 40rpx 80rpx;
10 | padding-bottom: 150rpx;
11 | display: flex;
12 | flex-direction: column;
13 | justify-content: flex-start;
14 | align-items: center;
15 | }
16 |
17 | .form-box .checkin .notice {
18 | width: 100%;
19 | font-size: 36rpx;
20 | text-align: center;
21 | color: #000;
22 | margin-bottom: 30rpx;
23 | }
24 |
25 | .form-box .checkin image {
26 | width: 500rpx;
27 | height: 500rpx;
28 | margin: 30rpx 0rpx;
29 | }
30 |
31 | .form-box .checkin .oprt {
32 | margin-top: 0rpx;
33 | text-align: center;
34 | font-size: 30rpx;
35 | color: var(--adminColor);
36 | padding: 20rpx 10rpx;
37 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/user/detail/admin_user_detail.js:
--------------------------------------------------------------------------------
1 | const AdminBiz = require('../../../../../../comm/biz/admin_biz.js');
2 | const pageHelper = require('../../../../../../helper/page_helper.js');
3 | const cloudHelper = require('../../../../../../helper/cloud_helper.js');
4 |
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | isLoad: false,
12 | },
13 |
14 | /**
15 | * 生命周期函数--监听页面加载
16 | */
17 | async onLoad(options) {
18 | if (!AdminBiz.isAdmin(this)) return;
19 | if (!pageHelper.getOptions(this, options)) return;
20 |
21 | this._loadDetail();
22 | },
23 |
24 | /**
25 | * 生命周期函数--监听页面初次渲染完成
26 | */
27 | onReady() {
28 |
29 | },
30 |
31 | /**
32 | * 生命周期函数--监听页面显示
33 | */
34 | onShow() {
35 |
36 | },
37 |
38 | /**
39 | * 生命周期函数--监听页面隐藏
40 | */
41 | onHide() {
42 |
43 | },
44 |
45 | /**
46 | * 生命周期函数--监听页面卸载
47 | */
48 | onUnload() {
49 |
50 | },
51 |
52 | /**
53 | * 页面相关事件处理函数--监听用户下拉动作
54 | */
55 | async onPullDownRefresh() {
56 | await this._loadDetail();
57 | wx.stopPullDownRefresh();
58 | },
59 |
60 | /**
61 | * 页面上拉触底事件的处理函数
62 | */
63 | onReachBottom() {
64 |
65 | },
66 |
67 | /**
68 | * 用户点击右上角分享
69 | */
70 | onShareAppMessage() {
71 |
72 | },
73 |
74 | _loadDetail: async function () {
75 | if (!AdminBiz.isAdmin(this)) return;
76 |
77 | let id = this.data.id;
78 | if (!id) return;
79 |
80 | let params = {
81 | id
82 | }
83 | let opts = {
84 | hint: false
85 | }
86 | let user = await cloudHelper.callCloudData('admin/user_detail', params, opts);
87 | if (!user) {
88 | this.setData({
89 | isLoad: null,
90 | })
91 | return;
92 | };
93 |
94 | this.setData({
95 | isLoad: true,
96 | user
97 | })
98 | },
99 | url(e) {
100 | pageHelper.url(e, this);
101 | }
102 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/user/detail/admin_user_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 |
4 | },
5 | "navigationBarBackgroundColor": "#2499f2",
6 | "navigationBarTextStyle": "white",
7 | "enablePullDownRefresh": true,
8 | "navigationBarTitleText": "用户详情"
9 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/user/detail/admin_user_detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 用户昵称
10 | :
11 | {{user.USER_NAME}}
12 |
13 |
14 | 手机号码
15 | :
16 | {{user.USER_MOBILE}}
17 |
18 |
19 | 注册时间
20 | :
21 | {{user.USER_ADD_TIME}}
22 |
23 |
24 |
25 | {{item.title}}
26 | :
27 | {{item.val}}
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/user/detail/admin_user_detail.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
3 | .main-admin {
4 | padding: 30rpx 0rpx;
5 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/user/export/admin_user_export.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 |
4 | },
5 | "navigationBarBackgroundColor": "#2499f2",
6 | "navigationBarTextStyle": "white",
7 | "enablePullDownRefresh": true,
8 | "navigationBarTitleText": "用户资料导出"
9 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/user/export/admin_user_export.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | ※ 数据说明: 针对本次查询结果导出全部数据
8 |
9 |
10 |
11 | 数据下载链接({{time}} 生成)
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | ※ 链接使用说明
22 | 1. 复制以上链接地址,建议在电脑浏览器中打开链接下载数据文件
23 | 2. 为保障信息安全,请勿外传数据链接
24 | 3. 为了防止隐私数据泄露,请在下载后及时点击下方按钮删除
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | 为了防止隐私数据泄露,请在下载上述文件后及时点击按钮删除
39 |
40 |
41 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/user/export/admin_user_export.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
3 | .form-box .title-desc {
4 | padding-bottom: 10rpx;
5 | border: 0;
6 | font-size: 29rpx;
7 | color: #888;
8 | }
9 |
10 | .btn-admin{
11 | margin-bottom: 20rpx;
12 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/user/list/admin_user_list.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 |
4 | },
5 | "navigationBarBackgroundColor": "#2499f2",
6 | "navigationBarTextStyle": "white",
7 | "disableScroll": true,
8 | "navigationBarTitleText": "用户管理"
9 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/user/list/admin_user_list.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
3 | page {
4 | background-color: #f8f8f8;
5 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/add/admin_vote_add.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-img-upload": "/cmpts/public/img/img_upload_cmpt",
4 | "cmpt-picker-time": "/cmpts/public/picker_time/picker_time_cmpt",
5 | "cmpt-form-show": "/cmpts/public/form/form_show/form_show_cmpt"
6 | },
7 | "navigationBarBackgroundColor": "#2499f2",
8 | "navigationBarTextStyle": "white",
9 | "enablePullDownRefresh": true,
10 | "navigationBarTitleText": "后台-添加投票"
11 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/add/admin_vote_add.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/add/admin_vote_add.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
3 | .form-group .select-close {
4 | width: 80rpx;
5 | font-size: 40rpx !important;
6 | font-weight: bold;
7 | text-align: center;
8 | height: 90rpx;
9 | line-height: 90rpx;
10 | }
11 |
12 | .form-group .detail-set {
13 | width: 80rpx;
14 | font-size: 26rpx !important;
15 | text-align: center;
16 | height: 90rpx;
17 | line-height: 90rpx;
18 | }
19 |
20 | .vote-item {
21 | height: 100rpx;
22 | }
23 |
24 | .vote-item .pic {
25 | width: 90rpx;
26 | height: 90rpx;
27 | background-color: #f2f2f2;
28 | margin-right: 10rpx;
29 | display: flex;
30 | align-items: center;
31 | justify-content: center;
32 | font-size: 50rpx;
33 | color: #999;
34 | }
35 |
36 | .vote-item image {
37 | width: 70rpx;
38 | height: 70rpx;
39 | }
40 |
41 | .theme-list {
42 | width: 100%;
43 | padding: 20rpx 0rpx;
44 | display: flex;
45 | justify-content: center;
46 | align-items: center;
47 | flex-wrap: wrap;
48 | }
49 |
50 | .theme-list .item {
51 | width: 150rpx;
52 | height: 150rpx;
53 | display: flex;
54 | justify-content: center;
55 | align-items: center;
56 | }
57 |
58 | .theme-list .item .item-inner {
59 | width: 100rpx;
60 | height: 100rpx;
61 | border-radius: 50%;
62 | background-color: #999;
63 | display: flex;
64 | justify-content: center;
65 | align-items: center;
66 | color: #fff;
67 | font-size: 50rpx;
68 | font-weight: bold;
69 | }
70 |
71 | .theme-form {
72 | width: 50rpx;
73 | height: 50rpx;
74 | border-radius: 50%;
75 | background-color: #999;
76 | margin-right: 40rpx;
77 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/content/admin_vote_content.js:
--------------------------------------------------------------------------------
1 | const AdminBiz = require('../../../../../../comm/biz/admin_biz.js');
2 | const pageHelper = require('../../../../../../helper/page_helper.js');
3 | const setting = require('../../../../../../setting/setting.js');
4 |
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | formContent: [{
12 | type: 'text',
13 | val: '',
14 | }],
15 | upDirect: !setting.IS_DEMO
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面加载
20 | */
21 | onLoad: async function (options) {
22 | if (!AdminBiz.isAdmin(this)) return;
23 |
24 | let parent = pageHelper.getPrevPage(2);
25 | if (!parent) return;
26 |
27 | let idx = options.idx;
28 | if (!idx) idx = 0;
29 | this.setData({
30 | idx
31 | });
32 |
33 | let formItem = parent.data.formItem;
34 | let formContent = formItem[idx].content;
35 | if (formContent && formContent.length > 0)
36 | this.setData({
37 | formContent
38 | });
39 | },
40 |
41 | /**
42 | * 生命周期函数--监听页面初次渲染完成
43 | */
44 | onReady: function () { },
45 |
46 | /**
47 | * 生命周期函数--监听页面显示
48 | */
49 | onShow: function () { },
50 |
51 | /**
52 | * 生命周期函数--监听页面隐藏
53 | */
54 | onHide: function () { },
55 |
56 | /**
57 | * 生命周期函数--监听页面卸载
58 | */
59 | onUnload: function () { },
60 |
61 | /**
62 | * 页面相关事件处理函数--监听用户下拉动作
63 | */
64 | onPullDownRefresh: async function () {
65 |
66 | },
67 |
68 | model: function (e) {
69 | pageHelper.model(this, e);
70 | },
71 |
72 | url: function (e) {
73 | pageHelper.url(e, this);
74 | },
75 |
76 | bindSaveTap: function (e) {
77 | let formContent = this.selectComponent("#contentEditor").getNodeList();
78 |
79 | let parent = pageHelper.getPrevPage(2);
80 | if (!parent) return;
81 |
82 | let formItem = parent.data.formItem;
83 | formItem[this.data.idx].content = formContent;
84 |
85 | /*
86 | parent.setData({
87 | formItem
88 | });*/
89 |
90 | wx.navigateBack();
91 | }
92 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/content/admin_vote_content.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-editor": "/cmpts/public/editor/editor_cmpt"
4 | },
5 | "navigationBarBackgroundColor": "#2499f2",
6 | "navigationBarTextStyle": "white",
7 | "navigationBarTitleText": "后台-选项详情"
8 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/content/admin_vote_content.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 不保存,返回
12 | 保存
13 |
14 |
15 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/content/admin_vote_content.wxss:
--------------------------------------------------------------------------------
1 | @import '../../content/admin_content.wxss';
2 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/edit/admin_vote_edit.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-img-upload": "/cmpts/public/img/img_upload_cmpt",
4 | "cmpt-picker-time": "/cmpts/public/picker_time/picker_time_cmpt",
5 | "cmpt-form-show": "/cmpts/public/form/form_show/form_show_cmpt"
6 | },
7 | "navigationBarBackgroundColor": "#2499f2",
8 | "navigationBarTextStyle": "white",
9 | "enablePullDownRefresh": true,
10 | "navigationBarTitleText": "后台-投票修改"
11 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/edit/admin_vote_edit.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/edit/admin_vote_edit.wxss:
--------------------------------------------------------------------------------
1 | @import '../add/admin_vote_add.wxss';
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/export/admin_vote_export.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 |
4 | },
5 | "navigationBarBackgroundColor": "#2499f2",
6 | "navigationBarTextStyle": "white",
7 | "enablePullDownRefresh": true,
8 | "navigationBarTitleText": "投票结果导出"
9 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/export/admin_vote_export.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 数据下载链接({{time}} 生成)
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | ※ 链接使用说明
17 | 1. 复制以上链接地址,建议在电脑浏览器中打开链接下载数据文件
18 | 2. 为保障信息安全,请勿外传数据链接
19 | 3. 为了防止隐私数据泄露,请在下载后及时点击下方按钮删除
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | 为了防止隐私数据泄露,请在下载上述文件后及时点击按钮删除
34 |
35 |
36 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/export/admin_vote_export.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
3 | .form-box .title-desc {
4 | padding-bottom: 10rpx;
5 | border: 0;
6 | font-size: 29rpx;
7 | color: #888;
8 | }
9 |
10 | .btn-admin{
11 | margin-bottom: 20rpx;
12 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/list/admin_vote_list.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | },
4 | "navigationBarBackgroundColor": "#2499f2",
5 | "navigationBarTextStyle": "white",
6 | "disableScroll": true,
7 | "navigationBarTitleText": "后台-投票管理"
8 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/list/admin_vote_list.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 |
3 | page {
4 | background-color: #f8f8f8;
5 | }
6 |
7 | .admin-comm-list .item .info .oprt {
8 | padding: 0rpx 0rpx;
9 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/stat/admin_vote_stat.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | },
4 | "navigationBarBackgroundColor": "#2499f2",
5 | "navigationBarTextStyle": "white",
6 | "enablePullDownRefresh": true,
7 | "navigationBarTitleText": "后台-投票结果"
8 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/admin/vote/stat/admin_vote_stat.wxss:
--------------------------------------------------------------------------------
1 | @import '../../../../../../style/public/admin.wxss';
2 | @import '../../../../../../style/base/table.wxss';
3 | .main-admin {
4 | padding:20rpx 0;
5 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/default/index/default_index.js:
--------------------------------------------------------------------------------
1 | const pageHelper = require('../../../../../helper/page_helper.js');
2 | const cloudHelper = require('../../../../../helper/cloud_helper.js');
3 | const ProjectBiz = require('../../../biz/project_biz.js');
4 |
5 | Page({
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | },
11 |
12 | /**
13 | * 生命周期函数--监听页面加载
14 | */
15 | onLoad: async function (options) {
16 | ProjectBiz.initPage(this);
17 | },
18 |
19 | _loadList: async function () {
20 | let opts = {
21 | title: 'bar'
22 | }
23 | await cloudHelper.callCloudSumbit('home/list', {}, opts).then(res => {
24 | this.setData({
25 | dataList: res.data
26 | });
27 | })
28 | },
29 |
30 | /**
31 | * 生命周期函数--监听页面初次渲染完成
32 | */
33 | onReady: function () { },
34 |
35 | /**
36 | * 生命周期函数--监听页面显示
37 | */
38 | onShow: async function () {
39 | this._loadList();
40 | },
41 |
42 | onPullDownRefresh: async function () {
43 | await this._loadList();
44 | wx.stopPullDownRefresh();
45 | },
46 |
47 | /**
48 | * 生命周期函数--监听页面隐藏
49 | */
50 | onHide: function () {
51 |
52 | },
53 |
54 | /**
55 | * 生命周期函数--监听页面卸载
56 | */
57 | onUnload: function () {
58 |
59 | },
60 |
61 | url: async function (e) {
62 | pageHelper.url(e, this);
63 | },
64 |
65 |
66 | /**
67 | * 用户点击右上角分享
68 | */
69 | onShareAppMessage: function () {
70 |
71 | },
72 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/default/index/default_index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | },
4 | "enablePullDownRefresh": true,
5 | "navigationStyle": "custom",
6 | "navigationBarTitleText": "首页"
7 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/default/index/default_index.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../../../style/public/comm_box_list.wxss";
2 | @import "../../../style/skin.wxss";
3 |
4 | .main {
5 | padding: 0rpx 0rpx 100rpx;
6 | }
7 |
8 | .up {
9 | width: 100%;
10 | }
11 |
12 | .up image {
13 | width: 100%;
14 | height: 400rpx;
15 | }
16 |
17 | .down {
18 | width: 100%;
19 | box-sizing: border-box;
20 | padding: 10rpx 30rpx;
21 | margin-top: -70rpx;
22 | z-index: 9999;
23 | }
24 |
25 | .menu {
26 | width: 100%;
27 | display: flex;
28 | flex-wrap: wrap;
29 | background-color: #fff;
30 | padding: 20rpx 10rpx;
31 | border-radius: 20rpx;
32 | }
33 |
34 | .menu .item {
35 | width: 33.3%;
36 | display: flex;
37 | align-items: center;
38 | justify-content: center;
39 | height: 180rpx;
40 |
41 | }
42 |
43 | .menu .item .item-inner {
44 | width: 100%;
45 | display: flex;
46 | flex-direction: column;
47 | align-items: center;
48 | justify-content: center;
49 |
50 | }
51 |
52 | .menu .item-inner .img {
53 | width: 105rpx;
54 | height: 105rpx;
55 | display: flex;
56 | justify-content: center;
57 | align-items: center;
58 | background-color: #f2f2f2;
59 | border-radius:30rpx;
60 | }
61 |
62 | .menu .item-inner .img image {
63 | width: 75rpx;
64 | height: 75rpx;
65 | }
66 |
67 | .menu .item-inner .title {
68 | margin-top: 20rpx;
69 | font-size: 26rpx;
70 | color: #4f5368;
71 | }
72 |
73 | .home-list-box {
74 | width: 100%;
75 | margin-bottom: 200rpx;
76 | margin-top: 20rpx;
77 | }
78 |
79 | .home-list-box .comm-list-box {
80 | padding: 20rpx 0rpx 30rpx 0rpx;
81 | overflow: unset;
82 | }
83 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/edit/my_edit.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-form-show": "/cmpts/public/form/form_show/form_show_cmpt"
4 | },
5 | "enablePullDownRefresh": true,
6 | "navigationBarTitleText": "个人资料"
7 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/edit/my_edit.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/edit/my_edit.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../style/skin.wxss";
2 | .submit-line {
3 | width: 100%;
4 | }
5 |
6 | .form-group .mobile {
7 | flex: 1;
8 | text-align: left;
9 | }
10 |
11 | .submit-line {
12 | width: 100%;
13 | }
14 |
15 | .form-group .mobile {
16 | flex: 1;
17 | text-align: left;
18 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/edit/user_form.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 昵称
4 |
5 |
6 | {{formNameFocus}}
7 |
8 |
9 | 手机
10 |
11 |
12 |
13 | {{formMobile||'未填写'}}
14 |
15 |
16 |
17 | {{formMobileFocus}}
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/fav/my_fav.js:
--------------------------------------------------------------------------------
1 | const behavior = require('../../../../../comm/behavior/my_fav_bh.js');
2 | const ProjectBiz = require('../../../biz/project_biz.js');
3 |
4 | Page({
5 |
6 | behaviors: [behavior],
7 |
8 | onReady: function () {
9 | ProjectBiz.initPage(this);
10 | },
11 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/fav/my_fav.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "enablePullDownRefresh": true,
4 | "navigationBarTitleText": "我的收藏"
5 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/fav/my_fav.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/fav/my_fav.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../../../style/public/article_list.wxss";
2 | @import "../../../style/skin.wxss";
3 | @import "../../../../../style/project/my_fav_style.wxss";
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/foot/my_foot.js:
--------------------------------------------------------------------------------
1 | const behavior = require('../../../../../comm/behavior/my_foot_bh.js');
2 | const ProjectBiz = require('../../../biz/project_biz.js');
3 |
4 | Page({
5 |
6 | behaviors: [behavior],
7 |
8 | onReady: function () {
9 | ProjectBiz.initPage(this);
10 | },
11 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/foot/my_foot.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "enablePullDownRefresh": true,
4 | "navigationBarTitleText": "历史浏览"
5 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/foot/my_foot.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/foot/my_foot.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../../../style/public/article_list.wxss";
2 | @import "../../../style/skin.wxss";
3 | @import "../../../../../style/project/my_foot_style.wxss";
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/index/my_index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 |
4 | },
5 | "enablePullDownRefresh": true,
6 | "navigationBarTitleText": "我的"
7 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/reg/my_reg.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-form-show": "/cmpts/public/form/form_show/form_show_cmpt"
4 | },
5 | "enablePullDownRefresh": true,
6 | "navigationBarTitleText": "注册"
7 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/reg/my_reg.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/my/reg/my_reg.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../style/skin.wxss";
2 | .submit-line {
3 | width: 100%;
4 | }
5 |
6 | .form-group .mobile {
7 | flex: 1;
8 | text-align: left;
9 | }
10 |
11 | .submit-line {
12 | width: 100%;
13 | }
14 |
15 | .form-group .mobile {
16 | flex: 1;
17 | text-align: left;
18 | font-size:28rpx;
19 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/news/detail/news_detail.js:
--------------------------------------------------------------------------------
1 | const cloudHelper = require('../../../../../helper/cloud_helper.js');
2 | const pageHelper = require('../../../../../helper/page_helper.js');
3 | const ProjectBiz = require('../../../biz/project_biz.js');
4 |
5 | Page({
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | isLoad: false,
11 | },
12 |
13 | /**
14 | * 生命周期函数--监听页面加载
15 | */
16 | onLoad: async function (options) {
17 | ProjectBiz.initPage(this);
18 |
19 | if (!pageHelper.getOptions(this, options)) return;
20 |
21 | this._loadDetail();
22 |
23 | },
24 |
25 | _loadDetail: async function () {
26 | let id = this.data.id;
27 | if (!id) return;
28 |
29 | let params = {
30 | id,
31 | };
32 | let opt = {
33 | title: 'bar'
34 | };
35 | let news = await cloudHelper.callCloudData('news/view', params, opt);
36 | if (!news) {
37 | this.setData({
38 | isLoad: null
39 | })
40 | return;
41 | }
42 |
43 | this.setData({
44 | isLoad: true,
45 | news,
46 | });
47 |
48 | },
49 |
50 | /**
51 | * 生命周期函数--监听页面初次渲染完成
52 | */
53 | onReady: function () { },
54 |
55 | /**
56 | * 生命周期函数--监听页面显示
57 | */
58 | onShow: function () {
59 |
60 | },
61 |
62 | /**
63 | * 生命周期函数--监听页面隐藏
64 | */
65 | onHide: function () {
66 |
67 | },
68 |
69 | /**
70 | * 生命周期函数--监听页面卸载
71 | */
72 | onUnload: function () {
73 |
74 | },
75 |
76 | /**
77 | * 页面相关事件处理函数--监听用户下拉动作
78 | */
79 | onPullDownRefresh: async function () {
80 | await this._loadDetail();
81 | wx.stopPullDownRefresh();
82 | },
83 |
84 | /**
85 | * 页面上拉触底事件的处理函数
86 | */
87 | onReachBottom: function () {
88 |
89 | },
90 |
91 | url: function (e) {
92 | pageHelper.url(e, this);
93 | },
94 |
95 | onPageScroll: function (e) {
96 | // 回页首按钮
97 | pageHelper.showTopBtn(e, this);
98 |
99 | },
100 |
101 | /**
102 | * 用户点击右上角分享
103 | */
104 | onShareAppMessage: function (res) {
105 | return {
106 | title: this.data.news.NEWS_TITLE,
107 | imageUrl: this.data.news.NEWS_PIC[0]
108 | }
109 | }
110 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/news/detail/news_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-detail": "/cmpts/biz/detail/detail_cmpt"
4 | },
5 | "enablePullDownRefresh": true,
6 | "navigationBarTitleText": "详细内容"
7 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/news/detail/news_detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{news.NEWS_TITLE}}
10 | {{news.NEWS_ADD_TIME}} {{news.NEWS_CATE_NAME}}
11 |
12 |
13 |
14 |
15 | {{item.val}}
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/news/detail/news_detail.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../../../style/public/detail.wxss";
2 | @import "../../../style/skin.wxss";
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/news/index/news_index.js:
--------------------------------------------------------------------------------
1 | let behavior = require('../../../../../comm/behavior/news_index_bh.js');
2 | const ProjectBiz = require('../../../biz/project_biz.js');
3 | const projectSetting = require('../../../public/project_setting.js');
4 |
5 | Page({
6 |
7 | behaviors: [behavior],
8 |
9 | onLoad: function (options) {
10 | ProjectBiz.initPage(this);
11 | this._setCate(projectSetting.NEWS_CATE, options);
12 |
13 | },
14 |
15 |
16 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/news/index/news_index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | },
4 | "disableScroll": true,
5 | "navigationBarTitleText": "动态"
6 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/news/index/news_index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/news/index/news_index.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../../../style/public/comm_box_list.wxss";
2 | @import "../../../style/skin.wxss";
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/search/search.js:
--------------------------------------------------------------------------------
1 | const behavior = require('../../../../comm/behavior/search_bh.js');
2 | const ProjectBiz = require('../../biz/project_biz.js');
3 | const pageHelper = require('../../../../helper/page_helper.js');
4 |
5 | Page({
6 |
7 | behaviors: [behavior],
8 |
9 | onReady: function () {
10 | ProjectBiz.initPage(this);
11 |
12 |
13 | let curPage = pageHelper.getPrevPage(1);
14 | if (!curPage) return;
15 | if (curPage.options && curPage.options.source == 'admin') {
16 | wx.setNavigationBarColor({ //管理端顶部
17 | backgroundColor: '#2499f2',
18 | frontColor: '#ffffff',
19 | });
20 | }
21 |
22 | },
23 |
24 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/search/search.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | },
4 | "navigationBarTitleText": "搜索"
5 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/search/search.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/search/search.wxss:
--------------------------------------------------------------------------------
1 | @import "../../style/skin.wxss";
2 | @import "../../../../style/project/search_style.wxss";
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/tpls/menu_tpl.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/vote/detail/vote_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-detail": "/cmpts/biz/detail/detail_cmpt"
4 | },
5 | "enablePullDownRefresh": true,
6 | "navigationBarBackgroundColor": "#ffffff",
7 | "navigationBarTextStyle": "black",
8 | "navigationBarTitleText": "投票详情"
9 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/vote/index/vote_index.js:
--------------------------------------------------------------------------------
1 | const ProjectBiz = require('../../../biz/project_biz.js');
2 | const pageHelper = require('../../../../../helper/page_helper.js');
3 | const VoteBiz = require('../../../biz/vote_biz.js');
4 | const projectSetting = require('../../../public/project_setting.js');
5 |
6 | Page({
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | isShowCate: projectSetting.VOTE_CATE.length > 1
12 | },
13 |
14 | /**
15 | * 生命周期函数--监听页面加载
16 | */
17 | onLoad: async function (options) {
18 | ProjectBiz.initPage(this, { isSetNavColor: false });
19 |
20 | this._getSearchMenu();
21 |
22 | if (options && options.id) {
23 | this.setData({
24 | _params: { sortType: 'cateId', sortVal: options.id },
25 | sortMenusDefaultIndex: -1,
26 | });
27 | } else {
28 | this.setData({
29 | _params: { sortType: 'cateId', sortVal: '' },
30 | sortMenusDefaultIndex: 0,
31 | });
32 | }
33 | },
34 |
35 | /**
36 | * 生命周期函数--监听页面初次渲染完成
37 | */
38 | onReady: function () { },
39 |
40 | /**
41 | * 生命周期函数--监听页面显示
42 | */
43 | onShow: async function () {
44 |
45 | },
46 |
47 | /**
48 | * 生命周期函数--监听页面隐藏
49 | */
50 | onHide: function () {
51 |
52 | },
53 |
54 | /**
55 | * 生命周期函数--监听页面卸载
56 | */
57 | onUnload: function () {
58 |
59 | },
60 |
61 | url: async function (e) {
62 | pageHelper.url(e, this);
63 | },
64 |
65 | bindCommListCmpt: function (e) {
66 | pageHelper.commListListener(this, e);
67 | },
68 |
69 |
70 | onShareAppMessage: function () {
71 |
72 | },
73 |
74 | _getSearchMenu: function () {
75 | VoteBiz.setCateTitle();
76 |
77 | let sortItem1 = [{
78 | label: '全部',
79 | type: 'cateId',
80 | value: ''
81 | }];
82 |
83 | sortItem1 = sortItem1.concat(VoteBiz.getCateList());
84 |
85 | let sortItems = [];
86 | let sortMenus = sortItem1;
87 | this.setData({
88 | sortItems,
89 | sortMenus
90 | })
91 |
92 | },
93 |
94 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/vote/index/vote_index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | },
4 | "disableScroll": true,
5 | "navigationBarBackgroundColor": "#347DFF",
6 | "navigationBarTextStyle": "white",
7 | "navigationBarTitleText": "投票"
8 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/vote/item/vote_item.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "cmpt-detail": "/cmpts/biz/detail/detail_cmpt"
4 | },
5 | "navigationBarBackgroundColor": "#ffffff",
6 | "navigationBarTextStyle": "black",
7 | "navigationBarTitleText": "详情"
8 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/vote/item/vote_item.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{voteItem.label}}
7 | 编号:{{voteItem.idx+1}}号
8 |
9 |
10 |
11 |
12 |
13 |
14 | {{item.val}}
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/vote/item/vote_item.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../../../style/public/detail.wxss";
2 | @import "../vote.wxss";
3 |
4 | page {
5 | background-image: unset !important;
6 | background-color: #fff !important;
7 | }
8 |
9 | .main {
10 | padding: 0 0;
11 | --mainColor: var(--color1--);
12 | --mainColor2: var(--color2--);
13 | background-image: linear-gradient(var(--mainColor), var(--mainColor2), var(--mainColor));
14 | padding-bottom: 200rpx;
15 | min-height: 100vh;
16 | }
17 |
18 |
19 | .vote-content {
20 | width: 100%;
21 | padding: 20rpx 20rpx 200rpx;
22 | display: flex;
23 | flex-direction: unset;
24 | align-items: flex-start;
25 | justify-content: flex-start;
26 | }
27 |
28 | .vote-content .content-inner {
29 | width: 100%;
30 | background-color: #fff;
31 | border-radius: 10rpx;
32 | min-height: 500rpx;
33 | }
34 |
35 | .vote-content .content-inner .line0 {
36 | width: 100%;
37 | text-align: center;
38 | padding: 50rpx 0 0rpx;
39 | }
40 |
41 | .vote-content .content-inner .line0 image {
42 | width: 200rpx;
43 | height: 200rpx;
44 | border-radius: 50%;
45 | }
46 |
47 | .vote-content .content-inner .line1 {
48 | width: 100%;
49 | font-size: 36rpx;
50 | padding: 20rpx;
51 | color: #000;
52 | text-align: center;
53 | }
54 |
55 | .vote-content .content-inner .line2 {
56 | width: 100%;
57 | font-size: 28rpx;
58 | padding: 10rpx 20rpx 10rpx 20rpx;
59 | text-align: center;
60 | color: var(--mainColor);
61 | background-color: #f2f2f2;
62 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/vote/my_join_list/vote_my_join_list.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat)
3 | * Date: 2022-07-16 07:48:00
4 | */
5 | const pageHelper = require('../../../../../helper/page_helper.js');
6 | const ProjectBiz = require('../../../biz/project_biz.js');
7 |
8 | Page({
9 |
10 | /**
11 | * 页面的初始数据
12 | */
13 | data: {
14 |
15 | },
16 |
17 | /**
18 | * 生命周期函数--监听页面加载
19 | */
20 | onLoad(options) {
21 | ProjectBiz.initPage(this);
22 | },
23 |
24 | /**
25 | * 生命周期函数--监听页面初次渲染完成
26 | */
27 | onReady() {
28 |
29 | },
30 |
31 | /**
32 | * 生命周期函数--监听页面显示
33 | */
34 | onShow() {
35 |
36 | },
37 |
38 | /**
39 | * 生命周期函数--监听页面隐藏
40 | */
41 | onHide() {
42 |
43 | },
44 |
45 | /**
46 | * 生命周期函数--监听页面卸载
47 | */
48 | onUnload() {
49 |
50 | },
51 |
52 | /**
53 | * 页面相关事件处理函数--监听用户下拉动作
54 | */
55 | onPullDownRefresh() {
56 |
57 | },
58 |
59 | /**
60 | * 页面上拉触底事件的处理函数
61 | */
62 | onReachBottom() {
63 |
64 | },
65 |
66 | url: function (e) {
67 | pageHelper.url(e, this);
68 | },
69 | myCommListListener: function (e) {
70 | pageHelper.commListListener(this, e);
71 | },
72 | })
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/vote/my_join_list/vote_my_join_list.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "enablePullDownRefresh": true,
4 | "navigationBarTitleText": "我的投票"
5 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/vote/my_join_list/vote_my_join_list.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item.VOTE_JOIN_VOTE_TITLE}}
9 |
10 | {{item.VOTE_JOIN_ITEM_LABEL}}
11 | {{item.VOTE_JOIN_ADD_TIME}}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/vote/my_join_list/vote_my_join_list.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../../../style/public/article_list.wxss";
2 | @import "../../../style/skin.wxss";
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/pages/vote/vote.wxss:
--------------------------------------------------------------------------------
1 | @import "../../style/skin.wxss";
2 |
3 | page {
4 | --mainColor: #347DFF;
5 | --mainColor2: #A376FB;
6 | background-image: linear-gradient(var(--mainColor), var(--mainColor2), var(--mainColor));
7 | }
8 |
9 | .text-main {
10 | color: var(--mainColor);
11 | }
12 |
13 | .text-main2 {
14 | color: var(--mainColor2);
15 | }
--------------------------------------------------------------------------------
/miniprogram/projects/VOTE1/public/project_setting.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | PROJECT_COLOR: '#347DFF',
3 | NAV_COLOR: '#ffffff',
4 | NAV_BG: '#347DFF',
5 |
6 | // 用户
7 | USER_FIELDS: [
8 | { mark: 'sex', title: '性别', type: 'select', selectOptions: ['男', '女'], must: true },
9 | { mark: 'area', title: '所在地区', type: 'text' },
10 | { mark: 'work', title: '行业领域', type: 'area' },
11 | ],
12 |
13 | // 资讯
14 | NEWS_CATE: [
15 | { id: 1, title: '动态', style: 'leftbig1' }
16 | ],
17 |
18 |
19 | // 投票
20 | VOTE_THEME: [
21 | { color1: '#347DFF', color2: '#A376FB' },
22 | { color1: '#c3272b', color2: '#827100' },
23 | { color1: '#21a675', color2: '#ffa400' },
24 | { color1: '#1685a9', color2: '#16a951' },
25 | { color1: '#75664d', color2: '#f2be45' },
26 | { color1: '#2e4e7e', color2: '#177cb0' },
27 | { color1: '#424c50', color2: '#20CE96' },
28 | { color1: '#c93756', color2: '#ffb3a7' },
29 | { color1: '#e54d42', color2: '#f37b1d' },
30 | { color1: '#0E9489', color2: '#8dc63f' },
31 | { color1: '#347DFF', color2: '#50BFFF' },
32 | { color1: '#6739b6', color2: '#9B7ACD' },
33 | { color1: '#9c26b0', color2: '#CF97D9' },
34 | { color1: '#e03997', color2: '#EF94C6' },
35 | { color1: '#a5673f', color2: '#CEAD97' },
36 | { color1: '#000000', color2: '#999999' },
37 | ],
38 | VOTE_CATE: [
39 | { id: 1, title: '节日投票' },
40 | { id: 2, title: '活动评比' },
41 | { id: 3, title: '才艺比拼' },
42 | { id: 4, title: '单位政企' },
43 | { id: 5, title: '其他投票' }
44 | ],
45 | VOTE_FIELDS: [
46 | { mark: 'cover', title: '封面图片', type: 'image', min: 1, max: 1, must: true },
47 | { mark: 'desc', title: '投票简介与须知', type: 'content', must: false },
48 | ],
49 |
50 | }
--------------------------------------------------------------------------------
/miniprogram/setting/setting.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | //### 环境相关
3 | CLOUD_ID: 'init-5go8b8pdc98ea814', //云服务id ,本地测试环境
4 |
5 | // #### 版本信息
6 | VER: 'Vote build 2022.07.26',
7 | COMPANY: '联系作者',
8 |
9 | // #### 系统参数
10 | IS_SUB: false, //分包模式
11 | IS_DEMO: false, //是否演示版
12 |
13 | MOBILE_CHECK: false, //手机号码是否真实性校验
14 |
15 |
16 | //#################
17 | IMG_UPLOAD_SIZE: 20, //图片上传大小M兆
18 |
19 | // #### 缓存相关
20 | CACHE_IS_LIST: true, //列表是否缓存
21 | CACHE_LIST_TIME: 60 * 30, //列表缓存时间秒
22 |
23 | }
--------------------------------------------------------------------------------
/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/base/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/base/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";
19 | @import "animation.wxss";
--------------------------------------------------------------------------------
/miniprogram/style/base/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/base/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 |
26 |
--------------------------------------------------------------------------------
/miniprogram/style/project/my_fav_style.wxss:
--------------------------------------------------------------------------------
1 | .text-pic-list-box .item .simple .simple-title {
2 | width: 100%;
3 | }
--------------------------------------------------------------------------------
/miniprogram/style/project/my_foot_style.wxss:
--------------------------------------------------------------------------------
1 | .text-pic-list-box .item .simple .simple-title {
2 | width: 100%;
3 | }
--------------------------------------------------------------------------------
/miniprogram/style/project/search_style.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/tpls/project/my_fav_tpl.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item.FAV_TITLE}}
9 |
10 | {{item.FAV_TYPE}}
11 | {{item.FAV_ADD_TIME}}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/miniprogram/tpls/project/my_foot_tpl.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 暂无记录哦~
4 |
5 |
6 |
7 | {{item.title}}
8 |
9 | {{item.type}}
10 | {{item.time}}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/miniprogram/tpls/project/news_index_tpl.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/miniprogram/tpls/project/search_tpl.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | 历史记录
16 |
17 |
18 |
19 | {{item}}
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/miniprogram/tpls/public/list_load_tpl.wxml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | {{noHint?noHint:'暂无记录哦~'}}
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/miniprogram/tpls/public/top_tpl.wxml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/miniprogram/tpls/wxs/tools.wxs:
--------------------------------------------------------------------------------
1 | function indexOf(data, key) {
2 | return data.indexOf(key);
3 | }
4 |
5 | function includes(data, key) {
6 | return data.indexOf(key) > -1 ? true : false;
7 | }
8 |
9 | function split(str, chr) {
10 | var arr = str.split(chr);
11 | if (arr.length == 0) return [];
12 |
13 | return arr;
14 | }
15 |
16 | module.exports = {
17 | split: split,
18 | indexOf: indexOf,
19 | includes: includes
20 | };
21 | module.exports.msg = "hello tools";
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "miniprogramRoot": "miniprogram/",
3 | "cloudfunctionRoot": "cloudfunctions/",
4 | "setting": {
5 | "urlCheck": false,
6 | "es6": true,
7 | "enhance": true,
8 | "postcss": true,
9 | "preloadBackgroundData": false,
10 | "minified": true,
11 | "newFeature": true,
12 | "coverView": true,
13 | "nodeModules": false,
14 | "autoAudits": false,
15 | "showShadowRootInWxmlPanel": true,
16 | "scopeDataCheck": false,
17 | "uglifyFileName": true,
18 | "checkInvalidKey": true,
19 | "checkSiteMap": true,
20 | "uploadWithSourceMap": true,
21 | "compileHotReLoad": false,
22 | "lazyloadPlaceholderEnable": false,
23 | "useMultiFrameRuntime": true,
24 | "useApiHook": true,
25 | "useApiHostProcess": true,
26 | "babelSetting": {
27 | "ignore": [],
28 | "disablePlugins": [],
29 | "outputPath": ""
30 | },
31 | "useIsolateContext": false,
32 | "userConfirmedUseIsolateContext": true,
33 | "userConfirmedBundleSwitch": false,
34 | "packNpmManually": false,
35 | "packNpmRelationList": [],
36 | "minifyWXSS": true,
37 | "disableUseStrict": false,
38 | "minifyWXML": true,
39 | "showES6CompileOption": false,
40 | "useCompilerPlugins": false,
41 | "ignoreUploadUnusedFiles": true,
42 | "useStaticServer": true
43 | },
44 | "appid": "wxb100b44af794708e",
45 | "projectname": "Multi多功能平台",
46 | "libVersion": "2.17.0",
47 | "simulatorType": "wechat",
48 | "simulatorPluginLibVersion": {},
49 | "cloudfunctionTemplateRoot": "cloudfunctionTemplate/",
50 | "compileType": "miniprogram",
51 | "srcMiniprogramRoot": "miniprogram/",
52 | "packOptions": {
53 | "ignore": [],
54 | "include": []
55 | },
56 | "editorSetting": {
57 | "tabIndent": "tab",
58 | "tabSize": 4
59 | },
60 | "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
61 | "condition": {}
62 | }
--------------------------------------------------------------------------------
/project.private.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "setting": {
3 | "compileHotReLoad": true,
4 | "urlCheck": false
5 | },
6 | "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
7 | "projectname": "CC投票小程序github",
8 | "condition": {},
9 | "libVersion": "2.17.0"
10 | }
--------------------------------------------------------------------------------