├── .gitignore ├── 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 │ └── visit │ ├── controller │ ├── admin │ │ ├── admin_home_controller.js │ │ ├── admin_mgr_controller.js │ │ ├── admin_news_controller.js │ │ ├── admin_setup_controller.js │ │ ├── admin_task_controller.js │ │ ├── admin_user_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 │ └── task_controller.js │ ├── model │ ├── admin_model.js │ ├── base_project_model.js │ ├── fav_model.js │ ├── news_model.js │ ├── task_model.js │ └── user_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_task_service.js │ ├── admin_user_service.js │ └── base_project_admin_service.js │ ├── base_project_service.js │ ├── fav_service.js │ ├── home_service.js │ ├── msg_service.js │ ├── news_service.js │ ├── passport_service.js │ └── task_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 │ │ ├── date_select │ │ │ ├── date_select_cmpt.js │ │ │ ├── date_select_cmpt.json │ │ │ ├── date_select_cmpt.wxml │ │ │ └── date_select_cmpt.wxss │ │ └── time_select │ │ │ ├── time_select_cmpt.js │ │ │ ├── time_select_cmpt.json │ │ │ ├── time_select_cmpt.wxml │ │ │ └── time_select_cmpt.wxss │ │ ├── checkbox │ │ ├── checkbox_cmpt.js │ │ ├── checkbox_cmpt.json │ │ ├── checkbox_cmpt.wxml │ │ └── checkbox_cmpt.wxss │ │ ├── custom_nav │ │ ├── custom_nav_cmpt.js │ │ ├── custom_nav_cmpt.json │ │ ├── custom_nav_cmpt.wxml │ │ └── custom_nav_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 │ │ ├── radio │ │ ├── radio_cmpt.js │ │ ├── radio_cmpt.json │ │ ├── radio_cmpt.wxml │ │ └── radio_cmpt.wxss │ │ ├── rows │ │ ├── rows_cmpt.js │ │ ├── rows_cmpt.json │ │ ├── rows_cmpt.wxml │ │ ├── rows_cmpt.wxss │ │ └── rows_set_helper.js │ │ ├── simple_list │ │ ├── simple_list_cmpt.js │ │ ├── simple_list_cmpt.json │ │ ├── simple_list_cmpt.wxml │ │ └── simple_list_cmpt.wxss │ │ ├── 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 │ │ ├── about_bh.js │ │ ├── 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 │ │ └── wxcharts-min.js ├── pages │ └── test1 │ │ ├── test1.js │ │ ├── test1.json │ │ ├── test1.wxml │ │ └── test1.wxss ├── projects │ └── visit │ │ ├── biz │ │ ├── admin_news_biz.js │ │ ├── admin_work_biz.js │ │ ├── news_biz.js │ │ ├── project_biz.js │ │ └── task_biz.js │ │ ├── cmpts │ │ ├── form │ │ │ ├── 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 │ │ └── picker │ │ │ ├── picker_cmpt.js │ │ │ ├── picker_cmpt.json │ │ │ ├── picker_cmpt.wxml │ │ │ └── picker_cmpt.wxss │ │ ├── images │ │ ├── check.png │ │ ├── home.jpg │ │ ├── home │ │ │ ├── add.png │ │ │ ├── list.png │ │ │ ├── my.png │ │ │ └── news.png │ │ ├── menu │ │ │ ├── news_1.png │ │ │ ├── news_2.png │ │ │ ├── news_3.png │ │ │ └── news_4.png │ │ ├── my.jpg │ │ ├── my.png │ │ ├── my │ │ │ ├── task_0.png │ │ │ ├── task_1.png │ │ │ ├── task_2.png │ │ │ └── task_9.png │ │ └── tabbar │ │ │ ├── add.png │ │ │ ├── add_cur.png │ │ │ ├── album.png │ │ │ ├── album_cur.png │ │ │ ├── enroll.png │ │ │ ├── enroll_cur.png │ │ │ ├── home.png │ │ │ ├── home_cur.png │ │ │ ├── my.png │ │ │ ├── my_cur.png │ │ │ ├── news.png │ │ │ ├── news_cur.png │ │ │ ├── task.png │ │ │ └── task_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 │ │ │ │ ├── about_list │ │ │ │ │ ├── admin_setup_about_list.js │ │ │ │ │ ├── admin_setup_about_list.json │ │ │ │ │ ├── admin_setup_about_list.wxml │ │ │ │ │ └── admin_setup_about_list.wxss │ │ │ │ └── qr │ │ │ │ │ ├── admin_setup_qr.js │ │ │ │ │ ├── admin_setup_qr.json │ │ │ │ │ ├── admin_setup_qr.wxml │ │ │ │ │ └── admin_setup_qr.wxss │ │ │ ├── task │ │ │ │ ├── add │ │ │ │ │ ├── admin_task_add.js │ │ │ │ │ ├── admin_task_add.json │ │ │ │ │ ├── admin_task_add.wxml │ │ │ │ │ └── admin_task_add.wxss │ │ │ │ ├── detail │ │ │ │ │ ├── admin_task_detail.js │ │ │ │ │ ├── admin_task_detail.json │ │ │ │ │ ├── admin_task_detail.wxml │ │ │ │ │ └── admin_task_detail.wxss │ │ │ │ ├── edit │ │ │ │ │ ├── admin_task_edit.js │ │ │ │ │ ├── admin_task_edit.json │ │ │ │ │ ├── admin_task_edit.wxml │ │ │ │ │ └── admin_task_edit.wxss │ │ │ │ ├── export │ │ │ │ │ ├── admin_task_export.js │ │ │ │ │ ├── admin_task_export.json │ │ │ │ │ ├── admin_task_export.wxml │ │ │ │ │ └── admin_task_export.wxss │ │ │ │ ├── list │ │ │ │ │ ├── admin_task_list.js │ │ │ │ │ ├── admin_task_list.json │ │ │ │ │ ├── admin_task_list.wxml │ │ │ │ │ └── admin_task_list.wxss │ │ │ │ └── scan │ │ │ │ │ ├── admin_task_scan.js │ │ │ │ │ ├── admin_task_scan.json │ │ │ │ │ ├── admin_task_scan.wxml │ │ │ │ │ └── admin_task_scan.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 │ │ ├── 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 │ │ │ ├── cate1 │ │ │ │ ├── news_cate1.js │ │ │ │ ├── news_cate1.json │ │ │ │ ├── news_cate1.wxml │ │ │ │ └── news_cate1.wxss │ │ │ ├── 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 │ │ ├── task │ │ │ ├── add │ │ │ │ ├── task_add.js │ │ │ │ ├── task_add.json │ │ │ │ ├── task_add.wxml │ │ │ │ └── task_add.wxss │ │ │ ├── edit │ │ │ │ ├── task_edit.js │ │ │ │ ├── task_edit.json │ │ │ │ ├── task_edit.wxml │ │ │ │ └── task_edit.wxss │ │ │ ├── index │ │ │ │ ├── task_index.js │ │ │ │ ├── task_index.json │ │ │ │ ├── task_index.wxml │ │ │ │ └── task_index.wxss │ │ │ └── my_list │ │ │ │ ├── task_my_list.js │ │ │ │ ├── task_my_list.json │ │ │ │ ├── task_my_list.wxml │ │ │ │ ├── task_my_list.wxss │ │ │ │ └── task_my_list_tpl.wxml │ │ └── tpls │ │ │ └── menu_tpl.wxml │ │ ├── public │ │ └── project_setting.js │ │ └── style │ │ ├── skin.wxss │ │ └── work.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 │ │ ├── admin_list_style.wxss │ │ ├── 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 │ ├── about_tpl.wxml │ ├── my_fav_tpl.wxml │ ├── my_foot_tpl.wxml │ ├── news_index_tpl.wxml │ └── search_tpl.wxml │ ├── public │ ├── admin_forms_detail_tpl.wxml │ ├── base_list_tpl.wxml │ ├── list_load_tpl.wxml │ └── top_tpl.wxml │ └── wxs │ └── tools.wxs ├── project.config.json ├── project.private.config.json └── 访客预约审批小程序安装使用手册.docx /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows 2 | [Dd]esktop.ini 3 | Thumbs.db 4 | $RECYCLE.BIN/ 5 | 6 | # macOS 7 | .DS_Store 8 | .fseventsd 9 | .Spotlight-V100 10 | .TemporaryItems 11 | .Trashes 12 | 13 | # Node.js 14 | node_modules/ 15 | -------------------------------------------------------------------------------- /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: 'cloud1-3go08kosfd9d453c', //你的云环境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 | 23 | // ### 服务者相关 24 | WORK_LOGIN_EXPIRE: 86400, //服务者token过期时间 (秒) 25 | } -------------------------------------------------------------------------------- /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 | WORK_ERROR: 2501 //服务者错误 18 | } -------------------------------------------------------------------------------- /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 | 19 | this._route = route; // 路由 20 | this._openId = openId; //用户身份 21 | this._event = event; // 所有参数 22 | this._request = event.params; //数据参数 23 | 24 | if (!openId) { 25 | console.error('OPENID is unfined'); 26 | throw new AppError('OPENID is unfined', appCode.SVR); 27 | } 28 | 29 | let userId = openId; 30 | 31 | this._token = event.token || ''; 32 | this._userId = userId; 33 | 34 | // 当前时间戳 35 | this._timestamp = timeUtil.time(); 36 | let time = timeUtil.time('Y-M-D h:m:s'); 37 | 38 | console.log('------------------------'); 39 | console.log(`【${time}】【Request -- ↘↘↘】\n【↘Token = ${this._token}】\n【↘USER-ID = ${userId}】\n【↘↘IN DATA】=\n`, JSON.stringify(this._request, null, 4)); 40 | 41 | } 42 | 43 | /** 44 | * 数据校验 45 | * @param {*} rules 46 | */ 47 | validateData(rules = {}) { 48 | let input = this._request; 49 | return dataCheck.check(input, rules); 50 | } 51 | 52 | // 取得某个具体的参数值 53 | getParameter(name) { 54 | let input = this._request; 55 | if (util.isDefined(input[name])) 56 | return input[name]; 57 | else 58 | return ''; 59 | } 60 | } 61 | 62 | 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 | fmtSearchDate(where, search, field) { 29 | if (!search || search.length != 21 || !search.includes('#')) return where; 30 | 31 | let arr = search.split('#'); 32 | let start = arr[0]; 33 | let end = arr[1]; 34 | where[field] = ['between', start, end]; 35 | return where; 36 | } 37 | 38 | /* 数据库字段排序处理 */ 39 | fmtOrderBySort(sortVal, defaultSort) { 40 | let orderBy = { 41 | [defaultSort]: 'desc' 42 | }; 43 | 44 | if (sortVal.includes('|')) { 45 | let field = sortVal.split('|')[0]; 46 | let order = sortVal.split('|')[1]; 47 | orderBy = { 48 | [field]: order, 49 | }; 50 | if (defaultSort != field) orderBy[defaultSort] = 'desc'; 51 | } 52 | return orderBy; 53 | } 54 | 55 | } 56 | 57 | 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_TYPE: 'string|false', //content/cache/vouch 22 | SETUP_KEY: 'string|true', 23 | SETUP_VALUE: 'object|true', // {val:} 24 | 25 | SETUP_ADD_TIME: 'int|true', 26 | SETUP_EDIT_TIME: 'int|true', 27 | SETUP_ADD_IP: 'string|false', 28 | SETUP_EDIT_IP: 'string|false', 29 | }; 30 | 31 | // 字段前缀 32 | SetupModel.FIELD_PREFIX = "SETUP_"; 33 | 34 | 35 | module.exports = SetupModel; 36 | 37 | /* 38 | ### 富文本 39 | [{"type":"text","val":"xxx"},{"type":"img","val":"cloudId://xxxx"}] 40 | 41 | ### 导出 42 | {"EXPORT_CLOUD_ID":"","EXPORT_EDIT_TIME":""} 43 | */ -------------------------------------------------------------------------------- /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, type = '') { 16 | if (!key) return null; 17 | 18 | let where = { 19 | SETUP_KEY: key 20 | } 21 | 22 | let data = { 23 | SETUP_TYPE: type, 24 | SETUP_VALUE: { 25 | val 26 | }, 27 | } 28 | 29 | await SetupModel.insertOrUpdate(where, data); 30 | 31 | } 32 | 33 | /** 34 | * 获取 35 | * k 键key 36 | * def 默认值 37 | */ 38 | async function get(key) { 39 | 40 | if (!key) return null; 41 | 42 | let where = { 43 | SETUP_KEY: key 44 | } 45 | 46 | let setup = await SetupModel.getOne(where, 'SETUP_VALUE'); 47 | if (!setup) return null; 48 | 49 | 50 | let res = setup.SETUP_VALUE.val; 51 | 52 | if (res === undefined) { 53 | return null; 54 | } else { 55 | return res; 56 | } 57 | } 58 | 59 | async function get(key) { 60 | 61 | if (!key) return null; 62 | 63 | let where = { 64 | SETUP_KEY: key 65 | } 66 | 67 | let setup = await SetupModel.getOne(where, 'SETUP_VALUE'); 68 | if (!setup) return null; 69 | 70 | 71 | let res = setup.SETUP_VALUE.val; 72 | 73 | if (res === undefined) { 74 | return null; 75 | } else { 76 | return res; 77 | } 78 | } 79 | 80 | async function remove(key, fuzzy = false) { 81 | if (!key) return; 82 | 83 | let where = { 84 | SETUP_KEY: key 85 | } 86 | 87 | if (fuzzy) { 88 | where.SETUP_KEY = { 89 | $regex: '.*' + key, 90 | $options: 'i' 91 | }; 92 | } 93 | 94 | await SetupModel.del(where); 95 | } 96 | 97 | module.exports = { 98 | set, 99 | get, 100 | remove 101 | } -------------------------------------------------------------------------------- /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.6.2" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /cloudfunctions/mcloud/project/visit/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(this._admin); 27 | } 28 | 29 | 30 | // 清除首页推荐 31 | async clearVouchData() { 32 | await this.isAdmin(); 33 | 34 | // 数据校验 35 | let rules = { 36 | 37 | }; 38 | 39 | // 取得数据 40 | let input = this.validateData(rules); 41 | 42 | let service = new AdminHomeService(); 43 | return await service.clearVouchData(); 44 | } 45 | 46 | } 47 | 48 | module.exports = AdminHomeController; -------------------------------------------------------------------------------- /cloudfunctions/mcloud/project/visit/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.setContentSetup(input.id, input.content, '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/visit/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 | const BaseProjectAdminService = require('../../service/admin/base_project_admin_service.js'); 10 | 11 | class BaseProjectAdminController extends BaseAdminController { 12 | // TODO 13 | async initSetup() { 14 | let service = new BaseProjectService(); 15 | await service.initSetup(); 16 | } 17 | 18 | /** 是否管理员 */ 19 | async isAdmin() { 20 | // 判断是否管理员 21 | let service = new BaseProjectAdminService(); 22 | let admin = await service.isAdmin(this._token); 23 | this._admin = admin; 24 | this._adminId = admin._id; 25 | } 26 | 27 | } 28 | 29 | module.exports = BaseProjectAdminController; -------------------------------------------------------------------------------- /cloudfunctions/mcloud/project/visit/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/visit/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/visit/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/visit/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/visit/model/admin_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 AdminModel extends BaseProjectModel { 11 | 12 | } 13 | 14 | // 集合名 15 | AdminModel.CL = BaseProjectModel.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=超级管理员,2=审批人员,3=门卫', 29 | 30 | ADMIN_DEPT: 'array|true|default=[]|comment=审批部门', 31 | 32 | ADMIN_TOKEN: 'string|false|comment=当前登录token', 33 | ADMIN_TOKEN_TIME: 'int|true|default=0|comment=当前登录token time', 34 | 35 | ADMIN_ADD_TIME: 'int|true', 36 | ADMIN_EDIT_TIME: 'int|true', 37 | ADMIN_ADD_IP: 'string|false', 38 | ADMIN_EDIT_IP: 'string|false', 39 | }; 40 | 41 | // 字段前缀 42 | AdminModel.FIELD_PREFIX = "ADMIN_"; 43 | 44 | module.exports = AdminModel; -------------------------------------------------------------------------------- /cloudfunctions/mcloud/project/visit/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/visit/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/visit/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_FORMS: 'array|true|default=[]', 39 | NEWS_OBJ: 'object|true|default={}', 40 | 41 | NEWS_ADD_TIME: 'int|true', 42 | NEWS_EDIT_TIME: 'int|true', 43 | NEWS_ADD_IP: 'string|false', 44 | NEWS_EDIT_IP: 'string|false', 45 | }; 46 | 47 | // 字段前缀 48 | NewsModel.FIELD_PREFIX = "NEWS_"; 49 | 50 | 51 | module.exports = NewsModel; -------------------------------------------------------------------------------- /cloudfunctions/mcloud/project/visit/model/task_model.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Notes: 健康监测实体 3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat) 4 | * Date: 2022-08-12 19:20:00 5 | */ 6 | 7 | 8 | const BaseProjectModel = require('./base_project_model.js'); 9 | 10 | class TaskModel extends BaseProjectModel { 11 | 12 | } 13 | 14 | // 集合名 15 | TaskModel.CL = BaseProjectModel.C('task'); 16 | 17 | TaskModel.DB_STRUCTURE = { 18 | _pid: 'string|true', 19 | TASK_ID: 'string|true', 20 | 21 | TASK_TYPE: 'int|true|default=0|comment=类型 0=用户创建,1=系统创建', 22 | 23 | TASK_USER_ID: 'string|false|comment=用户ID', 24 | 25 | TASK_STATUS: 'int|true|default=0|comment=状态 0=待处理,1=审批通过,2=审批不通过, 9=已来访', 26 | 27 | 28 | TASK_FORMS: 'array|true|default=[]', 29 | TASK_OBJ: 'object|true|default={}', 30 | 31 | TASK_SUCC_ADMIN_ID: 'string|false|comment=审批人ID', 32 | TASK_SUCC_ADMIN_NAME: 'string|false', 33 | TASK_SUCC_TIME: 'int|true|default=0', 34 | 35 | TASK_FAIL_ADMIN_ID: 'string|false|comment=审批人ID', 36 | TASK_FAIL_ADMIN_NAME: 'string|false', 37 | TASK_FAIL_TIME: 'int|true|default=0', 38 | 39 | TASK_OVER_ADMIN_ID: 'string|false|comment=审批人ID', 40 | TASK_OVER_ADMIN_NAME: 'string|false', 41 | TASK_OVER_TIME: 'int|true|default=0', 42 | 43 | TASK_ADD_TIME: 'int|true', 44 | TASK_EDIT_TIME: 'int|true', 45 | TASK_ADD_IP: 'string|false', 46 | TASK_EDIT_IP: 'string|false', 47 | }; 48 | 49 | // 字段前缀 50 | TaskModel.FIELD_PREFIX = "TASK_"; 51 | 52 | /** 53 | * 状态 0=待处理,1=审批通过,2=审批不通过, 9=已来访 54 | */ 55 | TaskModel.STATUS = { 56 | WAIT: 0, 57 | SUCC: 1, 58 | FAIL: 2, 59 | OVER: 9 60 | }; 61 | 62 | TaskModel.STATUS_DESC = { 63 | WAIT: '待处理', 64 | SUCC: '审批通过', 65 | FAIL: '审批不通过', 66 | OVER: '已来访', 67 | }; 68 | 69 | 70 | 71 | 72 | module.exports = TaskModel; -------------------------------------------------------------------------------- /cloudfunctions/mcloud/project/visit/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=正常,8=审核未过,9=禁用', 20 | USER_CHECK_REASON: 'string|false|comment=审核未过的理由', 21 | 22 | USER_NAME: 'string|false|comment=用户昵称', 23 | USER_MOBILE: 'string|false|comment=联系电话', 24 | 25 | USER_FORMS: 'array|true|default=[]', 26 | USER_OBJ: 'object|true|default={}', 27 | 28 | USER_LOGIN_CNT: 'int|true|default=0|comment=登陆次数', 29 | USER_LOGIN_TIME: 'int|false|comment=最近登录时间', 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=正常,2=审核未过,9=禁用 43 | */ 44 | UserModel.STATUS = { 45 | UNUSE: 0, 46 | COMM: 1, 47 | UNCHECK: 8, 48 | FORBID: 9 49 | }; 50 | 51 | UserModel.STATUS_DESC = { 52 | UNUSE: '待审核', 53 | COMM: '正常', 54 | UNCHECK: '未通过审核', 55 | FORBID: '禁用' 56 | }; 57 | 58 | 59 | module.exports = UserModel; -------------------------------------------------------------------------------- /cloudfunctions/mcloud/project/visit/public/constants.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // 首页推荐 3 | SETUP_HOME_VOUCH_KEY : 'SETUP_HOME_VOUCH_KEY', 4 | } -------------------------------------------------------------------------------- /cloudfunctions/mcloud/project/visit/public/project_config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // ## 缓存相关 3 | CACHE_CALENDAR_TIME: 60 * 30, //日历缓存 4 | 5 | 6 | // ## 小程序订阅消息 7 | //来访申请结果通知(27527) 来访人/访问时间/来访事由/审批结果 8 | NOTICE_TEMP_APPT: 'ZgWZ-TMpr7UOyE4S5qsVZjhKgXS3ek83hTWoMwqyE0Y', 9 | } -------------------------------------------------------------------------------- /cloudfunctions/mcloud/project/visit/service/admin/admin_setup_service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Notes: 设置管理 3 | * Ver : CCMiniCloud Framework 2.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat) 4 | * Date: 2021-07-11 07:48:00 5 | */ 6 | 7 | const BaseProjectAdminService = require('./base_project_admin_service.js'); 8 | const cloudBase = require('../../../../framework/cloud/cloud_base.js'); 9 | const cloudUtil = require('../../../../framework/cloud/cloud_util.js'); 10 | const setupUtil = require('../../../../framework/utils/setup/setup_util.js'); 11 | const config = require('../../../../config/config.js'); 12 | const md5Lib = require('../../../../framework/lib/md5_lib.js'); 13 | 14 | class AdminSetupService extends BaseProjectAdminService { 15 | 16 | // 通用setup 17 | async setSetup(key, val, type = '') { 18 | await setupUtil.set(key, val, type); 19 | } 20 | 21 | // 富文本setup 22 | async setContentSetup(key, val, type = '') { 23 | let oldVal = await setupUtil.get(key); 24 | if (oldVal) 25 | await cloudUtil.handlerCloudFilesByRichEditor(oldVal, val); 26 | 27 | await setupUtil.set(key, val, type); 28 | } 29 | 30 | /** 小程序码 */ 31 | async genMiniQr(page, sc = 'qr') { 32 | //生成小程序qr buffer 33 | let cloud = cloudBase.getCloud(); 34 | 35 | if (page.startsWith('/')) page = page.substring(1); 36 | console.log('page=' + page, ', scene=' + sc); 37 | 38 | let result = await cloud.openapi.wxacode.getUnlimited({ 39 | scene: sc, 40 | width: 280, 41 | check_path: false, 42 | //env_version: 'trial', //release,trial,develop 43 | page 44 | }); 45 | 46 | let cloudPath = PID + '/' + 'setup/' + md5Lib.md5(page) + '.png'; 47 | let upload = await cloud.uploadFile({ 48 | cloudPath, 49 | fileContent: result.buffer, 50 | }); 51 | 52 | if (!upload || !upload.fileID) return; 53 | 54 | let ret = await cloudUtil.getTempFileURLOne(upload.fileID); 55 | return ret + '?rd=' + this._timestamp; 56 | } 57 | 58 | } 59 | 60 | module.exports = AdminSetupService; -------------------------------------------------------------------------------- /cloudfunctions/mcloud/project/visit/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_CATE_ID,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 | cateId: retList[k].NEWS_CATE_ID, 42 | desc: retList[k].NEWS_DESC, 43 | pic: retList[k].NEWS_PIC 44 | }) 45 | } 46 | } 47 | 48 | return list; 49 | } 50 | } 51 | 52 | module.exports = HomeService; -------------------------------------------------------------------------------- /cloudfunctions/mcloud/project/visit/service/msg_service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Notes: 消息模块业务逻辑 3 | * Date: 2022-09-26 07:48:00 4 | */ 5 | 6 | const BaseProjectService = require('./base_project_service.js'); 7 | const util = require('../../../framework/utils/util.js'); 8 | const timeUtil = require('../../../framework/utils/time_util.js'); 9 | const miniLib = require('../../../framework/lib/mini_lib.js'); 10 | const projectConfig = require('../public/project_config.js'); 11 | 12 | class MsgService extends BaseProjectService { 13 | 14 | getUserId(userId) { 15 | if (userId.includes('^^^')) 16 | return userId.split('^^^')[1]; 17 | else 18 | return userId; 19 | } 20 | 21 | 22 | // 审批结果 23 | async apptResult(userId, taskId, person, desc, date, result) { 24 | userId = userId.replace('visit^^^', ''); 25 | 26 | let page = '/projects/visit/pages/task/edit/task_edit?id=' + taskId; 27 | let body = { 28 | touser: userId, 29 | page, 30 | data: { 31 | thing7: { //来访人 32 | value: miniLib.fmtThing(person), 33 | }, 34 | time5: { //访问时间 35 | value: date, 36 | }, 37 | thing6: { //来访事由 38 | value: miniLib.fmtThing(desc), 39 | }, 40 | phrase2: { //审批结果 41 | value: miniLib.fmtPhrase(result) 42 | }, 43 | }, 44 | 45 | templateId: projectConfig.NOTICE_TEMP_APPT, 46 | } 47 | // 异步消息提醒 48 | miniLib.sendMiniOnceTempMsg(body, 'apptResult'); 49 | } 50 | 51 | 52 | 53 | } 54 | 55 | module.exports = MsgService; -------------------------------------------------------------------------------- /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.statusBarHeight = e.statusBarHeight; 26 | let capsule = wx.getMenuButtonBoundingClientRect(); 27 | if (capsule) { 28 | this.globalData.customBarHeight = capsule.bottom + capsule.top - e.statusBarHeight; 29 | this.globalData.capsule = capsule; 30 | } else { 31 | this.globalData.customBarHeight = e.statusBarHeight + 50; 32 | 33 | } 34 | } 35 | }); 36 | }, 37 | 38 | }) -------------------------------------------------------------------------------- /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 timeHelper = require('../../../helper/time_helper'); 3 | const setting = require('../../../setting/setting.js'); 4 | 5 | Component({ 6 | options: { 7 | addGlobalClass: true 8 | }, 9 | 10 | /** 11 | * 组件的属性列表 12 | */ 13 | properties: { 14 | color: { 15 | type: String, 16 | value: '' 17 | }, 18 | }, 19 | 20 | /** 21 | * 组件的初始数据 22 | */ 23 | data: { 24 | 25 | }, 26 | 27 | lifetimes: { 28 | created: function () { 29 | // 组件实例化,但节点树还未导入,因此这时不能用setData 30 | }, 31 | attached: function () { 32 | // 在组件实例进入页面节点树时执行 33 | // 节点树完成,可以用setData渲染节点,但无法操作节点 34 | }, 35 | ready: async function () { 36 | // 组件布局完成,这时可以获取节点信息,也可以操作节点 37 | // 当前用户,用于评论删除 38 | this._loadDetail(); 39 | 40 | this.setData({ time: timeHelper.time('Y.M') }); 41 | }, 42 | move: function () { 43 | // 组件实例被移动到树的另一个位置 44 | }, 45 | detached: function () { 46 | // 在组件实例被从页面节点树移除时执行 47 | }, 48 | }, 49 | 50 | /** 51 | * 组件的方法列表 52 | */ 53 | methods: { 54 | _loadDetail: async function () { 55 | this.setData({ 56 | company: setting.COMPANY, 57 | ver: setting.VER 58 | }); 59 | }, 60 | url: function (e) { 61 | pageHelper.url(e, this); 62 | } 63 | } 64 | }) -------------------------------------------------------------------------------- /miniprogram/cmpts/biz/foot/foot_cmpt.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/cmpts/biz/foot/foot_cmpt.wxml: -------------------------------------------------------------------------------- 1 | 2 | © {{company}} 3 | build {{time}} 4 | -------------------------------------------------------------------------------- /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/calendar/date_select/date_select_cmpt.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/cmpts/public/calendar/date_select/date_select_cmpt.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{month||'2022年'}} 4 | 刷新 5 | 6 | 7 | 8 | {{item.week}} 9 | {{item.show}} 10 | 11 | 12 | -------------------------------------------------------------------------------- /miniprogram/cmpts/public/calendar/date_select/date_select_cmpt.wxss: -------------------------------------------------------------------------------- 1 | @import "../calendar_comm/din.wxss"; 2 | 3 | .date-cmpt { 4 | width: 100%; 5 | } 6 | 7 | .date-cmpt .month { 8 | width: 100%; 9 | padding: 10rpx 15rpx; 10 | display: flex; 11 | align-items: center; 12 | justify-content: space-between; 13 | } 14 | 15 | .date-cmpt .month .left{ 16 | font-size: 32rpx; 17 | color: #000; 18 | font-weight: bold; 19 | font-family: 'din'; 20 | } 21 | 22 | .date-cmpt .month .right{ 23 | font-size: 28rpx; 24 | color: #777; 25 | padding: 0 10rpx 0rpx 60rpx; 26 | } 27 | 28 | 29 | 30 | .date-select { 31 | white-space: nowrap; 32 | } 33 | 34 | .date-select .item { 35 | margin: 10rpx 10rpx 10rpx 0rpx; 36 | text-align: center; 37 | font-size: 24rpx; 38 | line-height: 55rpx; 39 | height: 110rpx; 40 | width: 85rpx; 41 | border: 2rpx solid #ddd; 42 | border-radius: 17rpx; 43 | display: inline-block; 44 | } 45 | 46 | .date-select .item:first-child { 47 | margin-left: 5rpx; 48 | } 49 | 50 | .date-select .item .date { 51 | font-size: 32rpx; 52 | color: #000; 53 | font-family: 'din'; 54 | } 55 | 56 | .date-select .item .week { 57 | font-size: 24rpx; 58 | color: #666; 59 | } 60 | 61 | .date-select .item.cur { 62 | background-color: #f37445; 63 | } 64 | 65 | .date-select .item.cur .week, 66 | .date-select .item.cur .date { 67 | color: #fff; 68 | } -------------------------------------------------------------------------------- /miniprogram/cmpts/public/calendar/time_select/time_select_cmpt.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/cmpts/public/calendar/time_select/time_select_cmpt.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{item.title}} 6 | {{item.usedText}} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 确认预约 ({{selectedStart}}~{{selectedEndPoint}}) 14 | -------------------------------------------------------------------------------- /miniprogram/cmpts/public/checkbox/checkbox_cmpt.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | externalClasses: ['outside-picker-multi-class'], 3 | 4 | options: { 5 | addGlobalClass: true 6 | }, 7 | 8 | /** 9 | * 组件的属性列表 10 | */ 11 | properties: { 12 | sourceData: { //源数组 13 | type: Array, 14 | value: [], 15 | }, 16 | // 默认选中项的值数组 17 | itemMulti: { 18 | type: Array, 19 | value: [], 20 | observer: function (newVal, oldVal) { 21 | if (Array.isArray(newVal) && Array.isArray(oldVal) && JSON.stringify(newVal) != JSON.stringify(oldVal)) { 22 | console.log('checkbox observer'); 23 | this._fixDefaultVal(); 24 | } 25 | } 26 | }, 27 | show: { // 排列模式 column/row 28 | type: String, 29 | value: 'column', 30 | }, 31 | disabled: { // 是否禁用 32 | type: Boolean, 33 | value: false, 34 | }, 35 | }, 36 | 37 | /** 38 | * 生命周期方法 39 | */ 40 | lifetimes: { 41 | attached: function () { }, 42 | 43 | ready: function () { 44 | this._fixDefaultVal(); 45 | }, 46 | 47 | detached: function () { 48 | // 在组件实例被从页面节点树移除时执行 49 | }, 50 | 51 | }, 52 | 53 | /** 54 | * 组件的初始数据 55 | */ 56 | data: { 57 | 58 | }, 59 | 60 | /** 61 | * 组件的方法列表 62 | */ 63 | methods: { 64 | bindChange: function (e) { 65 | this.triggerEvent('select', e.detail.value); 66 | }, 67 | 68 | _fixDefaultVal() { //传入数据不匹配的时候,修正父页面传入的的数组默认值 69 | if (!Array.isArray(this.data.itemMulti)) { 70 | this.triggerEvent('select', []); 71 | } 72 | 73 | if (this.data.itemMulti.length == 0) return; 74 | 75 | let ret = []; 76 | let sourceData = this.data.sourceData; 77 | let itemMulti = this.data.itemMulti; 78 | for (let k = 0; k < sourceData.length; k++) { 79 | for (let j in itemMulti) { 80 | if (sourceData[k] == itemMulti[j]) 81 | ret.push(itemMulti[j]); 82 | } 83 | } 84 | 85 | this.triggerEvent('select', ret); 86 | } 87 | } 88 | }) -------------------------------------------------------------------------------- /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 | 9 | 10 | -------------------------------------------------------------------------------- /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 20rpx; 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 | 45 | 46 | 47 | /*按行排列*/ 48 | .checkbox-group.row{ 49 | flex-direction: row!important; 50 | flex-wrap: wrap!important; 51 | justify-content: flex-start; 52 | } 53 | 54 | .checkbox-group.row .item{ 55 | width:unset!important; 56 | margin-right: 25rpx; 57 | } 58 | 59 | .checkbox-group.row .item .item-checkbox { 60 | margin-right: 5rpx; 61 | padding-left: 0rpx; 62 | } 63 | -------------------------------------------------------------------------------- /miniprogram/cmpts/public/custom_nav/custom_nav_cmpt.js: -------------------------------------------------------------------------------- 1 | 2 | const app = getApp(); 3 | Component({ 4 | /** 5 | * 组件的一些选项 6 | */ 7 | options: { 8 | addGlobalClass: true, 9 | multipleSlots: true 10 | }, 11 | /** 12 | * 组件的对外属性 13 | */ 14 | properties: { 15 | textColor: { 16 | type: String, 17 | value: 'text-white' 18 | }, 19 | url: { 20 | type: String, 21 | value: '/projects/home/index/home_index' 22 | } 23 | }, 24 | /** 25 | * 组件的初始数据 26 | */ 27 | data: { 28 | method: 'back', 29 | statusBarHeight: app.globalData.statusBarHeight, 30 | customBarHeight: app.globalData.customBarHeight, 31 | }, 32 | 33 | lifetimes: { 34 | attached() { 35 | let parentPages = getCurrentPages().length; 36 | if (parentPages == 1) 37 | this.setData({ 38 | method: 'home' 39 | }); 40 | } 41 | }, 42 | 43 | 44 | /** 45 | * 组件的方法列表 46 | */ 47 | methods: { 48 | bindTap() { 49 | if (this.data.method == 'back') { 50 | wx.navigateBack(); 51 | } else 52 | wx.reLaunch({ 53 | url: this.data.url, 54 | }); 55 | } 56 | } 57 | }) -------------------------------------------------------------------------------- /miniprogram/cmpts/public/custom_nav/custom_nav_cmpt.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/cmpts/public/custom_nav/custom_nav_cmpt.wxml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /miniprogram/cmpts/public/custom_nav/custom_nav_cmpt.wxss: -------------------------------------------------------------------------------- 1 | .bar { 2 | display: flex; 3 | position: relative; 4 | align-items: center; 5 | min-height: 100rpx; 6 | justify-content: space-between; 7 | } 8 | 9 | .custom { 10 | display: block; 11 | position: fixed; 12 | width:100%; 13 | z-index: 99999; 14 | } 15 | 16 | .custom .title{ 17 | color:#fff; 18 | } 19 | 20 | .custom .bar { 21 | width:100%; 22 | min-height: 0px; 23 | padding-right: 220rpx; 24 | box-shadow: 0rpx 0rpx 0rpx; 25 | z-index: 9999; 26 | } 27 | 28 | .custom .bar .action>.icc { 29 | background-color: rgba(0, 0, 0, .3); 30 | border-radius: 50% !important; 31 | color: #fff; 32 | width: 60rpx; 33 | height: 60rpx; 34 | display: flex; 35 | justify-content: center; 36 | align-items: center; 37 | font-size: 36rpx; 38 | } 39 | 40 | .custom .bar .content { 41 | width: 100%; 42 | } 43 | 44 | 45 | .custom .bar .content image { 46 | height: 60rpx; 47 | width: 240rpx; 48 | } -------------------------------------------------------------------------------- /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-radio": "/cmpts/public/radio/radio_cmpt", 6 | "cmpt-rows": "/cmpts/public/rows/rows_cmpt", 7 | "cmpt-img-upload": "/cmpts/public/img/img_upload_cmpt" 8 | } 9 | } -------------------------------------------------------------------------------- /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/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/cmpts/public/poster/images/friend.png -------------------------------------------------------------------------------- /miniprogram/cmpts/public/poster/images/wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/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/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/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/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/radio/radio_cmpt.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/cmpts/public/radio/radio_cmpt.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | {{item.label}}{{labelExt}} 13 | 14 | -------------------------------------------------------------------------------- /miniprogram/cmpts/public/rows/rows_cmpt.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/cmpts/public/rows/rows_set_helper.js: -------------------------------------------------------------------------------- 1 | 2 | const helper = require('../../../helper/helper.js'); 3 | const dataHelper = require('../../../helper/data_helper.js'); 4 | 5 | const BASE_ROW = { mark: '', title: '', val: '', pic: '', detail: [], edit: true }; 6 | 7 | function fmtRows(rows) { 8 | for (let k = 0; k < rows.length; k++) { 9 | let node = rows[k]; 10 | 11 | // 补充编号 12 | if (!node['mark']) node['mark'] = mark(); 13 | 14 | if (!helper.isDefined(node['title'])) node['title'] = ''; 15 | if (!helper.isDefined(node['val'])) node['val'] = ''; 16 | if (!helper.isDefined(node['pic'])) node['pic'] = ''; 17 | 18 | if (!helper.isDefined(node['detail'])) node['detail'] = []; 19 | if (!Array.isArray(node['detail'])) node['detail'] = []; 20 | 21 | if (!helper.isDefined(node['edit'])) node['edit'] = true; 22 | } 23 | 24 | return rows; 25 | } 26 | 27 | function mark() { 28 | return dataHelper.genRandomAlpha(10).toUpperCase(); 29 | }; 30 | 31 | module.exports = { 32 | BASE_ROW, 33 | fmtRows, 34 | mark 35 | } -------------------------------------------------------------------------------- /miniprogram/cmpts/public/simple_list/simple_list_cmpt.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/cmpts/public/simple_list/simple_list_cmpt.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{dataNoHint}} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | {{dataNoHint}} 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /miniprogram/cmpts/public/simple_list/simple_list_cmpt.wxss: -------------------------------------------------------------------------------- 1 | .scroll-view { 2 | height: 100vh; 3 | } -------------------------------------------------------------------------------- /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/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/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, cateId = null) { 36 | 37 | let curPage = pageHelper.getPrevPage(1); 38 | if (!curPage) return; 39 | 40 | if (!cateId) { 41 | if (curPage.options && curPage.options.id) { 42 | cateId = curPage.options.id; 43 | } 44 | } 45 | 46 | for (let k = 0; k < cateList.length; k++) { 47 | if (cateList[k].id == cateId) { 48 | wx.setNavigationBarTitle({ 49 | title: cateList[k].title 50 | }); 51 | curPage.setData({ 52 | listMode: cateList[k].style || '' 53 | }) 54 | return; 55 | } 56 | } 57 | 58 | } 59 | } 60 | 61 | 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 | 15 | CACHE_WORK: 'WORK_TOKEN', // 服务者登录 16 | WORK_TOKEN_EXPIRE: 3600 * 10, //服务者过期时间 秒 17 | 18 | } -------------------------------------------------------------------------------- /miniprogram/helper/cache_helper.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Notes: 微信缓存二次封装,有设置时效性的封装 3 | * Ver : CCMiniCloud Framework 3.0.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat) 4 | * Date: 2020-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 | } -------------------------------------------------------------------------------- /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/images/cover.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/images/cover.gif -------------------------------------------------------------------------------- /miniprogram/pages/test1/test1.js: -------------------------------------------------------------------------------- 1 | const myFavBh = require('../../comm/behavior/my_fav_bh.js'); 2 | const myFootBh = require('../../comm/behavior/my_foot_bh.js'); 3 | const newsIndexBh = require('../../comm/behavior/news_index_bh.js'); 4 | const searchBh = require('../../comm/behavior/search_bh.js'); 5 | const favBiz = require('../../comm/biz/fav_biz.js'); 6 | const fileHelper = require('../../helper/file_helper.js'); 7 | const qr = require('../../lib/tools/qrcode_lib.js'); 8 | const base64 = require('../../lib/tools/base64_lib.js') 9 | const miniHelper = require('../../helper/mini_helper.js') 10 | const formHelper = require('../../helper/form_helper.js') 11 | Page({ 12 | 13 | /** 14 | * 页面的初始数据 15 | */ 16 | data: { 17 | 18 | }, 19 | 20 | /** 21 | * 生命周期函数--监听页面加载 22 | */ 23 | onLoad(options) { 24 | 25 | }, 26 | 27 | /** 28 | * 生命周期函数--监听页面初次渲染完成 29 | */ 30 | onReady() { 31 | 32 | }, 33 | 34 | /** 35 | * 生命周期函数--监听页面显示 36 | */ 37 | onShow() { 38 | 39 | }, 40 | 41 | /** 42 | * 生命周期函数--监听页面隐藏 43 | */ 44 | onHide() { 45 | 46 | }, 47 | 48 | /** 49 | * 生命周期函数--监听页面卸载 50 | */ 51 | onUnload() { 52 | 53 | }, 54 | 55 | /** 56 | * 页面相关事件处理函数--监听用户下拉动作 57 | */ 58 | onPullDownRefresh() { 59 | 60 | }, 61 | 62 | /** 63 | * 页面上拉触底事件的处理函数 64 | */ 65 | onReachBottom() { 66 | 67 | }, 68 | 69 | /** 70 | * 用户点击右上角分享 71 | */ 72 | onShareAppMessage() { 73 | 74 | } 75 | }) -------------------------------------------------------------------------------- /miniprogram/pages/test1/test1.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "cmpt-customer-nav": "/cmpts/public/custom_nav/custom_nav_cmpt", 4 | "cmpt-swiper": "/cmpts/public/swiper/swiper_cmpt", 5 | "cmpt-date-select": "/cmpts/public/calendar/date_select/date_select_cmpt", 6 | "cmpt-time-select": "/cmpts/public/calendar/time_select/time_select_cmpt", 7 | "cmpt-picker-time": "/cmpts/public/picker_time/picker_time_cmpt", 8 | "cmpt-poster": "/cmpts/public/poster/poster_cmpt", 9 | "cmpt-picker": "/cmpts/public/picker/picker_cmpt", 10 | "cmpt-checkbox": "/cmpts/public/checkbox/checkbox_cmpt", 11 | "cmpt-editor": "/cmpts/public/editor/editor_cmpt", 12 | "cmpt-table": "/cmpts/public/table/table_cmpt", 13 | "cmpt-ex-form": "/cmpts/public/form/form_show/form_show_cmpt", 14 | "cmpt-picker-multi": "/cmpts/public/picker_multi/picker_multi_cmpt" 15 | } 16 | } -------------------------------------------------------------------------------- /miniprogram/pages/test1/test1.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /miniprogram/pages/test1/test1.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/pages/test1/test1.wxss -------------------------------------------------------------------------------- /miniprogram/projects/visit/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 | fields: projectSetting.NEWS_FIELDS, 27 | 28 | // 图片数据 29 | imgList: [], 30 | 31 | 32 | // 表单数据 33 | formOrder: 9999, 34 | formTitle: '', 35 | formDesc: '', 36 | formContent: [], 37 | formCateId: (cateIdOptions.length == 1) ? cateIdOptions[0].val : '', 38 | formForms: [], 39 | } 40 | 41 | } 42 | 43 | static getCateName(cateId) { 44 | let cateList = projectSetting.NEWS_CATE; 45 | 46 | for (let k = 0; k < cateList.length; k++) { 47 | if (cateList[k].id == cateId) return cateList[k].title; 48 | } 49 | return ''; 50 | } 51 | 52 | } 53 | 54 | 55 | /** 表单校验 本地 */ 56 | AdminNewsBiz.CHECK_FORM = { 57 | title: 'formTitle|must|string|min:4|max:50|name=标题', 58 | cateId: 'formCateId|must|id|name=分类', 59 | order: 'formOrder|must|int|min:0|max:9999|name=排序号', 60 | desc: 'formDesc|string|min:10|max:200|name=简介', 61 | forms: 'formForms|array', 62 | }; 63 | 64 | 65 | module.exports = AdminNewsBiz; -------------------------------------------------------------------------------- /miniprogram/projects/visit/biz/admin_work_biz.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/biz/admin_work_biz.js -------------------------------------------------------------------------------- /miniprogram/projects/visit/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 | 20 | let skin = {}; 21 | skin.NAV_BG = projectSetting.NAV_BG; 22 | skin.NAV_COLOR = projectSetting.NAV_COLOR; 23 | skin.PROJECT_COLOR = projectSetting.PROJECT_COLOR; 24 | 25 | PubilcBiz.initPageBase(that, { skin, isSetNavColor }); 26 | } 27 | 28 | } 29 | 30 | module.exports = ProjectBiz; -------------------------------------------------------------------------------- /miniprogram/projects/visit/biz/task_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 pageHelper = require('../../../helper/page_helper.js'); 10 | const dataHelper = require('../../../helper/data_helper.js'); 11 | const cloudHelper = require('../../../helper/cloud_helper.js'); 12 | 13 | class TaskBiz extends BaseBiz { 14 | 15 | static async loadDetail(that) { 16 | let id = that.data.id; 17 | if (!id) return; 18 | 19 | let params = { 20 | id, 21 | }; 22 | let opt = { 23 | title: 'bar' 24 | }; 25 | let task = await cloudHelper.callCloudData('task/detail', params, opt); 26 | if (!task) { 27 | that.setData({ 28 | isLoad: null 29 | }) 30 | return; 31 | } 32 | 33 | that.setData({ 34 | isLoad: true, 35 | task, 36 | }); 37 | 38 | } 39 | 40 | 41 | static initFormData(id = '',) { 42 | return { 43 | id, 44 | fields: dataHelper.deepClone(projectSetting.TASK_FIELDS) 45 | } 46 | } 47 | 48 | 49 | static async delTask(id, callback) { 50 | let cb = async () => { 51 | try { 52 | let params = { 53 | id 54 | } 55 | let opts = { 56 | title: '删除中' 57 | } 58 | 59 | await cloudHelper.callCloudSumbit('task/del', params, opts).then(res => { 60 | pageHelper.showSuccToast('删除成功', 1500, callback); 61 | }); 62 | } catch (err) { 63 | console.log(err); 64 | } 65 | } 66 | 67 | pageHelper.showConfirm('确认删除? 删除不可恢复', cb); 68 | } 69 | } 70 | 71 | TaskBiz.CHECK_FORM = { 72 | forms: 'formForms|array', 73 | }; 74 | 75 | module.exports = TaskBiz; -------------------------------------------------------------------------------- /miniprogram/projects/visit/cmpts/form/content/form_show_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "cmpt-editor": "/cmpts/public/editor/editor_cmpt" 4 | }, 5 | "navigationBarTitleText": "详细内容" 6 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/cmpts/form/content/form_show_content.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 不保存,返回 11 | 保存 12 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/cmpts/form/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/projects/visit/cmpts/form/form_show_cmpt.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "cmpt-picker": "../picker/picker_cmpt", 5 | "cmpt-checkbox": "/cmpts/public/checkbox/checkbox_cmpt", 6 | "cmpt-radio": "/cmpts/public/radio/radio_cmpt", 7 | "cmpt-rows": "/cmpts/public/rows/rows_cmpt", 8 | "cmpt-img-upload": "/cmpts/public/img/img_upload_cmpt" 9 | } 10 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/cmpts/picker/picker_cmpt.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/cmpts/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/projects/visit/cmpts/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/projects/visit/images/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/check.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/home.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/home.jpg -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/home/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/home/add.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/home/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/home/list.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/home/my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/home/my.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/home/news.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/home/news.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/menu/news_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/menu/news_1.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/menu/news_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/menu/news_2.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/menu/news_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/menu/news_3.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/menu/news_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/menu/news_4.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/my.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/my.jpg -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/my.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/my/task_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/my/task_0.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/my/task_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/my/task_1.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/my/task_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/my/task_2.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/my/task_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/my/task_9.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/add.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/add_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/add_cur.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/album.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/album.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/album_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/album_cur.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/enroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/enroll.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/enroll_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/enroll_cur.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/home.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/home_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/home_cur.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/my.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/my_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/my_cur.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/news.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/news.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/news_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/news_cur.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/task.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/images/tabbar/task_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nanshanshiyan/WeVisitor/6d87a851f62a2c4e074ab0cd8b69d9436e4c1c3c/miniprogram/projects/visit/images/tabbar/task_cur.png -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/about/index/about_index.js: -------------------------------------------------------------------------------- 1 | const behavior = require('../../../../../comm/behavior/about_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 | /** 10 | * 生命周期函数--监听页面加载 11 | */ 12 | onLoad: async function (options) { 13 | ProjectBiz.initPage(this); 14 | 15 | if (options && options.key) 16 | this._loadDetail(options.key, projectSetting.SETUP_CONTENT_ITEMS); 17 | }, 18 | 19 | }) -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/about/index/about_index.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | }, 4 | "enablePullDownRefresh": true 5 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/about/index/about_index.wxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/about/index/about_index.wxss: -------------------------------------------------------------------------------- 1 | @import "../../../../../style/public/detail.wxss"; 2 | @import "../../../style/skin.wxss"; 3 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/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/visit/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/visit/pages/admin/content/admin_content.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 不保存,返回 12 | 保存 13 | 14 | 15 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/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/visit/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/visit/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/visit/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 | const cacheHelper = require('../../../../../../helper/cache_helper.js'); 4 | 5 | Page({ 6 | 7 | /** 8 | * 页面的初始数据 9 | */ 10 | data: { 11 | name: '', 12 | pwd: '', 13 | remember: false 14 | }, 15 | 16 | /** 17 | * 生命周期函数--监听页面加载 18 | */ 19 | onLoad: function (options) { 20 | AdminBiz.clearAdminToken(); 21 | 22 | // 记住密码 23 | let pwd = cacheHelper.get('admin-pwd'); 24 | if (pwd) { 25 | this.setData({ 26 | name: pwd.name, 27 | pwd: pwd.pwd, 28 | remember: true 29 | }); 30 | } 31 | 32 | }, 33 | 34 | /** 35 | * 生命周期函数--监听页面初次渲染完成 36 | */ 37 | onReady: function () { 38 | 39 | }, 40 | 41 | /** 42 | * 生命周期函数--监听页面显示 43 | */ 44 | onShow: function () { }, 45 | 46 | /** 47 | * 生命周期函数--监听页面隐藏 48 | */ 49 | onHide: function () { 50 | 51 | }, 52 | 53 | /** 54 | * 生命周期函数--监听页面卸载 55 | */ 56 | onUnload: function () { 57 | 58 | }, 59 | 60 | url: function (e) { 61 | pageHelper.url(e, this); 62 | }, 63 | 64 | bindBackTap: function (e) { 65 | wx.reLaunch({ 66 | url: pageHelper.fmtURLByPID('/pages/my/index/my_index'), 67 | }); 68 | }, 69 | 70 | bindLoginTap: async function (e) { 71 | // 记住密码 72 | if (this.data.remember) { 73 | cacheHelper.set('admin-pwd', { pwd: this.data.pwd, name: this.data.name }, 86400 * 30); 74 | } 75 | else { 76 | cacheHelper.clear('admin-pwd'); 77 | } 78 | 79 | return AdminBiz.adminLogin(this, this.data.name, this.data.pwd); 80 | }, 81 | 82 | bindRememberTap: function (e) { 83 | this.setData({ 84 | remember: !this.data.remember 85 | }) 86 | } 87 | 88 | }) -------------------------------------------------------------------------------- /miniprogram/projects/visit/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/visit/pages/admin/index/login/admin_login.wxml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/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 | } 72 | 73 | .form-group-pwd { 74 | width: 100%; 75 | padding: 25rpx 30rpx; 76 | color: #777 !important; 77 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/mgr/add/admin_mgr_add.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "cmpt-checkbox": "/cmpts/public/checkbox/checkbox_cmpt" 4 | }, 5 | "navigationBarBackgroundColor": "#2499f2", 6 | "navigationBarTextStyle": "white", 7 | "navigationBarTitleText": "添加管理人员" 8 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/mgr/add/admin_mgr_add.wxss: -------------------------------------------------------------------------------- 1 | @import '../../../../../../style/public/admin.wxss'; -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/mgr/edit/admin_mgr_edit.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "cmpt-checkbox": "/cmpts/public/checkbox/checkbox_cmpt" 4 | }, 5 | "navigationBarBackgroundColor": "#2499f2", 6 | "navigationBarTextStyle": "white", 7 | "enablePullDownRefresh": true, 8 | "navigationBarTitleText": "修改管理人员" 9 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/mgr/edit/admin_mgr_edit.wxss: -------------------------------------------------------------------------------- 1 | @import '../../../../../../style/public/admin.wxss'; -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/mgr/list/admin_mgr_list.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {}, 3 | "navigationBarBackgroundColor": "#2499f2", 4 | "navigationBarTextStyle": "white", 5 | "navigationBarTitleText": "管理人员管理" 6 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/mgr/list/admin_mgr_list.wxss: -------------------------------------------------------------------------------- 1 | @import '../../../../../../style/public/admin.wxss'; 2 | 3 | .admin-comm-list .item .info.title-mid .info-item .title { 4 | width: 150rpx; 5 | justify-content: flex-end; 6 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/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/visit/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/visit/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/visit/pages/admin/mgr/pwd/admin_mgr_pwd.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {}, 3 | "navigationBarBackgroundColor": "#2499f2", 4 | "navigationBarTextStyle": "white", 5 | "navigationBarTitleText": "登录密码修改" 6 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/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/visit/pages/admin/mgr/pwd/admin_mgr_pwd.wxss: -------------------------------------------------------------------------------- 1 | @import '../../../../../../style/public/admin.wxss'; -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/news/add/admin_news_add.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "cmpt-img-upload": "/cmpts/public/img/img_upload_cmpt", 4 | "cmpt-form-show": "/cmpts/public/form/form_show/form_show_cmpt" 5 | }, 6 | "navigationBarBackgroundColor": "#2499f2", 7 | "navigationBarTextStyle": "white", 8 | "enablePullDownRefresh": true 9 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/news/add/admin_news_add.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/news/add/admin_news_add.wxss: -------------------------------------------------------------------------------- 1 | @import '../../../../../../style/public/admin.wxss'; 2 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/news/edit/admin_news_edit.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "cmpt-img-upload": "/cmpts/public/img/img_upload_cmpt", 4 | "cmpt-form-show": "/cmpts/public/form/form_show/form_show_cmpt" 5 | }, 6 | "navigationBarBackgroundColor": "#2499f2", 7 | "navigationBarTextStyle": "white", 8 | "enablePullDownRefresh": true 9 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/news/edit/admin_news_edit.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/news/edit/admin_news_edit.wxss: -------------------------------------------------------------------------------- 1 | @import '../../../../../../style/public/admin.wxss'; -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/news/list/admin_news_list.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | }, 4 | "navigationBarBackgroundColor": "#2499f2", 5 | "navigationBarTextStyle": "white", 6 | "disableScroll": true 7 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/news/list/admin_news_list.wxss: -------------------------------------------------------------------------------- 1 | @import '../../../../../../style/public/admin.wxss'; 2 | @import '../../../../../../style/project/admin_list_style.wxss'; 3 | 4 | page { 5 | background-color: #f8f8f8; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/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/visit/pages/admin/setup/about/admin_setup_about.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 保存修改 13 | 14 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/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/visit/pages/admin/setup/about_list/admin_setup_about_list.js: -------------------------------------------------------------------------------- 1 | const AdminBiz = require('../../../../../../comm/biz/admin_biz.js'); 2 | const projectSetting = require('../../../../public/project_setting.js'); 3 | const pageHelper = require('../../../../../../helper/page_helper.js'); 4 | 5 | Page({ 6 | 7 | /** 8 | * 页面的初始数据 9 | */ 10 | data: { 11 | 12 | }, 13 | 14 | /** 15 | * 生命周期函数--监听页面加载 16 | */ 17 | onLoad(options) { 18 | if (!AdminBiz.isAdmin(this)) return; 19 | 20 | this.setData({ 21 | list: projectSetting.SETUP_CONTENT_ITEMS 22 | }); 23 | }, 24 | 25 | /** 26 | * 生命周期函数--监听页面初次渲染完成 27 | */ 28 | onReady() { 29 | 30 | }, 31 | 32 | /** 33 | * 生命周期函数--监听页面显示 34 | */ 35 | onShow() { 36 | 37 | }, 38 | 39 | /** 40 | * 生命周期函数--监听页面隐藏 41 | */ 42 | onHide() { 43 | 44 | }, 45 | 46 | /** 47 | * 生命周期函数--监听页面卸载 48 | */ 49 | onUnload() { 50 | 51 | }, 52 | 53 | /** 54 | * 页面相关事件处理函数--监听用户下拉动作 55 | */ 56 | onPullDownRefresh() { 57 | 58 | }, 59 | 60 | /** 61 | * 页面上拉触底事件的处理函数 62 | */ 63 | onReachBottom() { 64 | 65 | }, 66 | 67 | url: function (e) { 68 | pageHelper.url(e, this); 69 | } 70 | }) -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/setup/about_list/admin_setup_about_list.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | 4 | }, 5 | "navigationBarBackgroundColor": "#2499f2", 6 | "navigationBarTextStyle": "white", 7 | "enablePullDownRefresh": true, 8 | "navigationBarTitleText": "单页文章" 9 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/setup/about_list/admin_setup_about_list.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 《{{item.title}}》 7 | 8 | 编辑 9 | 10 | 预览 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/setup/about_list/admin_setup_about_list.wxss: -------------------------------------------------------------------------------- 1 | @import '../../../../../../style/public/admin.wxss'; 2 | 3 | page { 4 | background-color: #f8f8f8; 5 | } 6 | 7 | .main-admin { 8 | padding: 40rpx 0; 9 | } 10 | 11 | .admin-comm-list .item { 12 | margin-bottom: 40rpx; 13 | } 14 | 15 | .admin-comm-list .item .header .left { 16 | font-size: 32rpx !important; 17 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/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/visit/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/visit/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/visit/pages/admin/task/add/admin_task_add.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "cmpt-img-upload": "/cmpts/public/img/img_upload_cmpt", 4 | "cmpt-form-show": "/cmpts/public/form/form_show/form_show_cmpt" 5 | }, 6 | "navigationBarBackgroundColor": "#2499f2", 7 | "navigationBarTextStyle": "white", 8 | "enablePullDownRefresh": true, 9 | "navigationBarTitleText": "后台录入申请单" 10 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/task/add/admin_task_add.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/task/add/admin_task_add.wxss: -------------------------------------------------------------------------------- 1 | @import '../../../../../../style/public/admin.wxss'; -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/task/detail/admin_task_detail.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | 4 | }, 5 | "navigationBarBackgroundColor": "#2499f2", 6 | "navigationBarTextStyle": "white", 7 | "enablePullDownRefresh": true, 8 | "navigationBarTitleText": "申请单详情" 9 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/task/edit/admin_task_edit.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "cmpt-img-upload": "/cmpts/public/img/img_upload_cmpt", 4 | "cmpt-form-show": "/cmpts/public/form/form_show/form_show_cmpt" 5 | }, 6 | "navigationBarBackgroundColor": "#2499f2", 7 | "navigationBarTextStyle": "white", 8 | "enablePullDownRefresh": true, 9 | "navigationBarTitleText": "修改申请单" 10 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/task/edit/admin_task_edit.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/task/edit/admin_task_edit.wxss: -------------------------------------------------------------------------------- 1 | @import '../../../../../../style/public/admin.wxss'; -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/task/export/admin_task_export.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | 4 | }, 5 | "navigationBarBackgroundColor": "#2499f2", 6 | "navigationBarTextStyle": "white", 7 | "enablePullDownRefresh": true, 8 | "navigationBarTitleText": "申请记录导出" 9 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/task/export/admin_task_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/visit/pages/admin/task/export/admin_task_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/visit/pages/admin/task/list/admin_task_list.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "cmpt-img-upload": "/cmpts/public/img/img_upload_cmpt", 4 | "cmpt-form-show": "/cmpts/public/form/form_show/form_show_cmpt" 5 | }, 6 | "navigationBarBackgroundColor": "#2499f2", 7 | "navigationBarTextStyle": "white", 8 | "enablePullDownRefresh": true, 9 | "navigationBarTitleText": "后台--申请单" 10 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/task/scan/admin_task_scan.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | }, 4 | "navigationBarBackgroundColor": "#2499f2", 5 | "navigationBarTextStyle": "white", 6 | "enablePullDownRefresh": true, 7 | "navigationBarTitleText": "扫码核销" 8 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/task/scan/admin_task_scan.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 扫码核验 10 | 工作人员扫描用户通行码进行核验 11 | 立即核验 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /miniprogram/projects/visit/pages/admin/task/scan/admin_task_scan.wxss: -------------------------------------------------------------------------------- 1 | @import '../../../../../../style/public/admin.wxss'; 2 | 3 | .form-box .checkin { 4 | width: 100%; 5 | padding: 40rpx 40rpx 80rpx; 6 | padding-bottom: 150rpx; 7 | display: flex; 8 | flex-direction: column; 9 | justify-content: flex-start; 10 | align-items: center; 11 | } 12 | 13 | .form-box .checkin .notice { 14 | width: 100%; 15 | font-size: 46rpx; 16 | text-align: center; 17 | color: #000; 18 | margin-bottom: 30rpx; 19 | } 20 | 21 | .form-box .checkin .desc { 22 | width: 100%; 23 | font-size: 32rpx; 24 | text-align: center; 25 | color: #666; 26 | } 27 | 28 | .form-box .checkin .oprt { 29 | width: 600rpx; 30 | margin-top: 40rpx; 31 | text-align: center; 32 | font-size: 34rpx; 33 | color: var(--adminColor); 34 | border: 2rpx solid var(--adminColor); 35 | padding: 30rpx 20rpx; 36 | } -------------------------------------------------------------------------------- /miniprogram/projects/visit/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/visit/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/visit/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 | 26 | 27 | 28 | 29 |