commit 4b0112fe158ca1ecba3d328618c54e7d18a4b9df
Author: shijing
Date: Thu Mar 2 10:50:27 2023 +0800
first
diff --git a/app.js b/app.js
new file mode 100644
index 0000000..4a005b4
--- /dev/null
+++ b/app.js
@@ -0,0 +1,81 @@
+const api = require("utils/request.js");
+//app.js
+App({
+ onLaunch: function () {
+ // 展示本地存储能力
+ var logs = wx.getStorageSync('logs') || []
+ logs.unshift(Date.now())
+ wx.setStorageSync('logs', logs)
+
+ // 登录
+ wx.showLoading({
+ title: '加载中...',
+ mask:true,
+ icon:'none'
+ })
+ wx.login({
+ success: res => {
+ // 发送 res.code 到后台换取 openId, sessionKey, unionId
+ api.request('/crm/consumer/mplogin/','POST', {code:res.code}).then(res=>{
+ if(res.code==200){
+ this.globalData.token = res.data.token
+ this.globalData.session_key = res.data.session_key
+ this.globalData.userinfo = res.data.userinfo
+ //console.log(res.data.userinfo.perms)
+ // var pages = getCurrentPages() //获取加载的页面
+ // var currentPage = pages[pages.length - 1] //获取当前页面的对象
+ // currentPage.showExp()
+
+ if(res.data.userinfo.role_name == '游客' && this.globalData.rlogin){
+ //匿名用户
+ wx.reLaunch({
+ url: '/pages/login/login2',
+ })
+ }
+ }
+ }).then(res=>{
+ api.request('/crm/consumer/process/', 'GET').then(res => {
+
+ for (var key in res.data.process) {
+ try {
+ if(res.data.process[key]){
+ wx.setStorageSync(key.toString(), res.data.process[key])
+ }
+ } catch (e) { }
+ }
+ wx.hideLoading()
+ })
+ })
+ }
+ })
+ // 获取用户信息
+ wx.getSetting({
+ success: res => {
+ if (res.authSetting['scope.userInfo']) {
+ // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
+ wx.getUserInfo({
+ success: res => {
+ // 可以将 res 发送给后台解码出 unionId
+ this.globalData.userInfo = res.userInfo
+ // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
+ // 所以此处加入 callback 以防止这种情况
+ if (this.userInfoReadyCallback) {
+ this.userInfoReadyCallback(res)
+ }
+ }
+ })
+ }
+ }
+ })
+ },
+ globalData: {
+ userInfo: {},
+ userinfo: {}, // 服务器传回的消费者信息
+ // host: 'https://apitest.ahctc.cn',
+ mediahost: 'https://apitest.ahctc.cn',
+ host: 'http://127.0.0.1:8000',
+ //mediahost: 'http://127.0.0.1:8000',
+ token : '',
+ rlogin:true
+ }
+})
\ No newline at end of file
diff --git a/app.json b/app.json
new file mode 100644
index 0000000..c795d76
--- /dev/null
+++ b/app.json
@@ -0,0 +1,106 @@
+{
+ "pages": [
+ "pages/main/main",
+ "pages/index/index",
+ "pages/logs/logs",
+ "pages/login/login",
+ "pages/login/login2",
+ "pages/lianxi/index",
+ "pages/subject/index",
+ "pages/lianxi/main",
+ "pages/about/about",
+ "pages/cuoti/index",
+ "pages/moni/index",
+ "pages/moni/note",
+ "pages/test/test",
+ "pages/test/result",
+ "pages/test/detail",
+ "pages/test/sheet",
+ "pages/test/list",
+ "pages/my/index",
+ "pages/collect/main",
+ "pages/workscope/index",
+ "pages/yati/index",
+ "pages/article/index",
+ "pages/article/detail",
+ "pages/quota/quota",
+ "pages/material/index",
+ "pages/question/detail",
+ "pages/candidate/index",
+ "pages/candidate/detail",
+ "pages/material/video",
+ "pages/qtest/form",
+ "pages/main/start",
+ "pages/exam/index",
+ "pages/exam/note",
+ "pages/admin/index",
+ "pages/admin/login",
+ "pages/admin/exam/add",
+ "pages/admin/exam/add2",
+ "pages/admin/exam/detail",
+ "pages/admin/exam/index",
+ "pages/candidate/show",
+ "pages/admin/candidate/index",
+ "pages/candidate/my",
+ "pages/admin/exam/upimg",
+ "pages/video/index",
+ "pages/video/play"
+ ],
+ "window": {
+ "backgroundTextStyle": "light",
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTitleText": "中科辐射学堂",
+ "navigationBarTextStyle": "black"
+ },
+ "tabBar": {
+ "color": "#7A7E83",
+ "selectedColor": "#1296db",
+ "borderStyle": "black",
+ "backgroundColor": "#ffffff",
+ "list": [
+ {
+ "pagePath": "pages/main/main",
+ "iconPath": "images/home.png",
+ "selectedIconPath": "images/homec.png",
+ "text": "主页"
+ },
+ {
+ "pagePath": "pages/article/index",
+ "iconPath": "images/news.png",
+ "selectedIconPath": "images/newsc.png",
+ "text": "资讯"
+ },
+ {
+ "pagePath": "pages/material/index",
+ "iconPath": "images/data.png",
+ "selectedIconPath": "images/datac.png",
+ "text": "资料"
+ },
+ {
+ "pagePath": "pages/material/video",
+ "iconPath": "images/play.png",
+ "selectedIconPath": "images/playc.png",
+ "text": "视频"
+ },
+ {
+ "pagePath": "pages/my/index",
+ "iconPath": "images/me.png",
+ "selectedIconPath": "images/mec.png",
+ "text": "我的"
+ }
+ ]
+ },
+ "useExtendedLib": {
+ "kbone": true,
+ "weui": true
+ },
+ "usingComponents": {},
+ "plugins": {
+ "tencentvideo": {
+ "version": "1.4.0",
+ "provider": "wxa75efa648b60994b"
+ }
+ },
+ "style": "v2",
+ "sitemapLocation": "sitemap.json"
+}
\ No newline at end of file
diff --git a/app.wxss b/app.wxss
new file mode 100644
index 0000000..39584d7
--- /dev/null
+++ b/app.wxss
@@ -0,0 +1,6 @@
+/*!
+ * WeUI v2.3.0 (https://github.com/weui/weui-wxss)
+ * Copyright 2020 Tencent, Inc.
+ * Licensed under the MIT license
+ */
+[data-weui-theme=light],page{--weui-BTN-DISABLED-FONT-COLOR:rgba(0,0,0,.2)}[data-weui-theme=dark]{--weui-BTN-DISABLED-FONT-COLOR:hsla(0,0%,100%,.2)}[data-weui-theme=light],page{--weui-BTN-DEFAULT-BG:#f2f2f2}[data-weui-theme=dark]{--weui-BTN-DEFAULT-BG:hsla(0,0%,100%,.08)}[data-weui-theme=light],page{--weui-BTN-DEFAULT-COLOR:#06ae56}[data-weui-theme=dark]{--weui-BTN-DEFAULT-COLOR:hsla(0,0%,100%,.8)}[data-weui-theme=light],page{--weui-BTN-DEFAULT-ACTIVE-BG:#e6e6e6}[data-weui-theme=dark]{--weui-BTN-DEFAULT-ACTIVE-BG:hsla(0,0%,100%,.126)}[data-weui-theme=light],page{--weui-DIALOG-LINE-COLOR:rgba(0,0,0,.1)}[data-weui-theme=dark]{--weui-DIALOG-LINE-COLOR:hsla(0,0%,100%,.1)}page{line-height:1.6;font-family:-apple-system-font,Helvetica Neue,sans-serif}icon{vertical-align:middle}[data-weui-theme=light],page{--weui-BG-0:#ededed;--weui-BG-1:#f7f7f7;--weui-BG-2:#fff;--weui-BG-3:#f7f7f7;--weui-BG-4:#4c4c4c;--weui-BG-5:#fff;--weui-FG-0:rgba(0,0,0,.9);--weui-FG-HALF:rgba(0,0,0,.9);--weui-FG-1:rgba(0,0,0,.5);--weui-FG-2:rgba(0,0,0,.3);--weui-FG-3:rgba(0,0,0,.1);--weui-RED:#fa5151;--weui-ORANGE:#fa9d3b;--weui-YELLOW:#ffc300;--weui-GREEN:#91d300;--weui-LIGHTGREEN:#95ec69;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1485ee;--weui-PURPLE:#6467f0;--weui-WHITE:#fff;--weui-LINK:#576b95;--weui-TEXTGREEN:#06ae56;--weui-FG:#000;--weui-BG:#fff;--weui-TAG-TEXT-ORANGE:#fa9d3b;--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,.1);--weui-TAG-TEXT-GREEN:#06ae56;--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,.1);--weui-TAG-TEXT-BLUE:#10aeff;--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,.1);--weui-TAG-TEXT-BLACK:rgba(0,0,0,.5);--weui-TAG-BACKGROUND-BLACK:rgba(0,0,0,.05)}[data-weui-theme=dark]{--weui-BG-0:#191919;--weui-BG-1:#1f1f1f;--weui-BG-2:#232323;--weui-BG-3:#2f2f2f;--weui-BG-4:#606060;--weui-BG-5:#2c2c2c;--weui-FG-0:hsla(0,0%,100%,.8);--weui-FG-HALF:hsla(0,0%,100%,.6);--weui-FG-1:hsla(0,0%,100%,.5);--weui-FG-2:hsla(0,0%,100%,.3);--weui-FG-3:hsla(0,0%,100%,.05);--weui-RED:#fa5151;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#28b561;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-WHITE:hsla(0,0%,100%,.8);--weui-LINK:#7d90a9;--weui-TEXTGREEN:#259c5c;--weui-FG:#fff;--weui-BG:#000;--weui-TAG-TEXT-ORANGE:rgba(250,157,59,.6);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,.1);--weui-TAG-TEXT-GREEN:rgba(6,174,86,.6);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,.1);--weui-TAG-TEXT-BLUE:rgba(16,174,255,.6);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,.1);--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,.5);--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,.05)}[data-weui-theme=light],page{--weui-BG-COLOR-ACTIVE:#ececec}[data-weui-theme=dark]{--weui-BG-COLOR-ACTIVE:#373737}[class*=" weui-icon-"],[class^=weui-icon-]{display:inline-block;vertical-align:middle;width:24px;height:24px;-webkit-mask-position:50% 50%;mask-position:50% 50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor}.weui-icon-circle{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-download{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M11.25%2012.04l-1.72-1.72-1.06%201.06%202.828%202.83a1%201%200%20001.414-.001l2.828-2.828-1.06-1.061-1.73%201.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55%200%20.999.446.999.996v13.008a.998.998%200%2001-.996.996H4.996A.998.998%200%20014%2021.004V7.996A1%201%200%20014.999%207h6.251z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M11.25%2012.04l-1.72-1.72-1.06%201.06%202.828%202.83a1%201%200%20001.414-.001l2.828-2.828-1.06-1.061-1.73%201.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55%200%20.999.446.999.996v13.008a.998.998%200%2001-.996.996H4.996A.998.998%200%20014%2021.004V7.996A1%201%200%20014.999%207h6.251z%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-info{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.75-12v7h1.5v-7h-1.5zM12%209a1%201%200%20100-2%201%201%200%20000%202z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.75-12v7h1.5v-7h-1.5zM12%209a1%201%200%20100-2%201%201%200%20000%202z%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-safe-success{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.6C315.5%2046.7%20180.4%2093.1%2057.6%20132c0%20129.3.2%20231.7.2%20339.7%200%20304.2%20248.3%20471.6%20443.1%20523.7C695.7%20943.3%20944%20775.9%20944%20471.7c0-108%20.2-210.4.2-339.7C821.4%2093.1%20686.3%2046.7%20500.9%204.6zm248.3%20349.1l-299.7%20295c-2.1%202-5.3%202-7.4-.1L304.4%20506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3%205-2.8%207.2-1l112.2%2086c2.3%201.8%206%201.7%208.1-.1l274.7-228.9c2.2-1.8%205.7-1.7%207.7.3l17%2016.8c2.2%202.1%202.2%205.3.2%207.4z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23070202%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.6C315.5%2046.7%20180.4%2093.1%2057.6%20132c0%20129.3.2%20231.7.2%20339.7%200%20304.2%20248.3%20471.6%20443.1%20523.7C695.7%20943.3%20944%20775.9%20944%20471.7c0-108%20.2-210.4.2-339.7C821.4%2093.1%20686.3%2046.7%20500.9%204.6zm248.3%20349.1l-299.7%20295c-2.1%202-5.3%202-7.4-.1L304.4%20506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3%205-2.8%207.2-1l112.2%2086c2.3%201.8%206%201.7%208.1-.1l274.7-228.9c2.2-1.8%205.7-1.7%207.7.3l17%2016.8c2.2%202.1%202.2%205.3.2%207.4z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23070202%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-safe-warn{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.5c-185.4%2042-320.4%2088.4-443.2%20127.3%200%20129.3.2%20231.7.2%20339.6%200%20304.1%20248.2%20471.4%20443%20523.6%20194.7-52.2%20443-219.5%20443-523.6%200-107.9.2-210.3.2-339.6C821.3%2092.9%20686.2%2046.5%20500.9%204.5zm-26.1%20271.1h52.1c5.8%200%2010.3%204.7%2010.1%2010.4l-11.6%20313.8c-.1%202.8-2.5%205.2-5.4%205.2h-38.2c-2.9%200-5.3-2.3-5.4-5.2L464.8%20286c-.2-5.8%204.3-10.4%2010-10.4zm26.1%20448.3c-20.2%200-36.5-16.3-36.5-36.5s16.3-36.5%2036.5-36.5%2036.5%2016.3%2036.5%2036.5-16.4%2036.5-36.5%2036.5z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23020202%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.5c-185.4%2042-320.4%2088.4-443.2%20127.3%200%20129.3.2%20231.7.2%20339.6%200%20304.1%20248.2%20471.4%20443%20523.6%20194.7-52.2%20443-219.5%20443-523.6%200-107.9.2-210.3.2-339.6C821.3%2092.9%20686.2%2046.5%20500.9%204.5zm-26.1%20271.1h52.1c5.8%200%2010.3%204.7%2010.1%2010.4l-11.6%20313.8c-.1%202.8-2.5%205.2-5.4%205.2h-38.2c-2.9%200-5.3-2.3-5.4-5.2L464.8%20286c-.2-5.8%204.3-10.4%2010-10.4zm26.1%20448.3c-20.2%200-36.5-16.3-36.5-36.5s16.3-36.5%2036.5-36.5%2036.5%2016.3%2036.5%2036.5-16.4%2036.5-36.5%2036.5z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23020202%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-success{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-success-circle{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm-1.172-6.242l5.809-5.808.848.849-5.95%205.95a1%201%200%2001-1.414%200L7%2012.426l.849-.849%202.98%202.98z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm-1.172-6.242l5.809-5.808.848.849-5.95%205.95a1%201%200%2001-1.414%200L7%2012.426l.849-.849%202.98%202.98z%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-success-no-circle{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-waiting{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.75%2011.38V6h-1.5v6l4.243%204.243%201.06-1.06-3.803-3.804zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.75%2011.38V6h-1.5v6l4.243%204.243%201.06-1.06-3.803-3.804zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-waiting-circle{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.6%2011.503l3.891%203.891-.848.849L11.4%2012V6h1.2v5.503zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.6%2011.503l3.891%203.891-.848.849L11.4%2012V6h1.2v5.503zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-warn{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-info-circle{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zM11.4%2010h1.2v7h-1.2v-7zm.6-1a1%201%200%20110-2%201%201%200%20010%202z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zM11.4%2010h1.2v7h-1.2v-7zm.6-1a1%201%200%20110-2%201%201%200%20010%202z%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-cancel{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%20fill-rule%3D%22nonzero%22%2F%3E%3Cpath%20d%3D%22M12.849%2012l3.11%203.111-.848.849L12%2012.849l-3.111%203.11-.849-.848L11.151%2012l-3.11-3.111.848-.849L12%2011.151l3.111-3.11.849.848L12.849%2012z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%20fill-rule%3D%22nonzero%22%2F%3E%3Cpath%20d%3D%22M12.849%2012l3.11%203.111-.848.849L12%2012.849l-3.111%203.11-.849-.848L11.151%2012l-3.11-3.111.848-.849L12%2011.151l3.111-3.11.849.848L12.849%2012z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.weui-icon-search{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16.31%2015.561l4.114%204.115-.848.848-4.123-4.123a7%207%200%2011.857-.84zM16.8%2011a5.8%205.8%200%2010-11.6%200%205.8%205.8%200%200011.6%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16.31%2015.561l4.114%204.115-.848.848-4.123-4.123a7%207%200%2011.857-.84zM16.8%2011a5.8%205.8%200%2010-11.6%200%205.8%205.8%200%200011.6%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-clear{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.06%2012l3.006-3.005-1.06-1.06L12%2010.938%208.995%207.934l-1.06%201.06L10.938%2012l-3.005%203.005%201.06%201.06L12%2013.062l3.005%203.005%201.06-1.06L13.062%2012zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.06%2012l3.006-3.005-1.06-1.06L12%2010.938%208.995%207.934l-1.06%201.06L10.938%2012l-3.005%203.005%201.06%201.06L12%2013.062l3.005%203.005%201.06-1.06L13.062%2012zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-back{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm1.999-6.563L10.68%2012%2014%208.562%2012.953%207.5%209.29%2011.277a1.045%201.045%200%20000%201.446l3.663%203.777L14%2015.437z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm1.999-6.563L10.68%2012%2014%208.562%2012.953%207.5%209.29%2011.277a1.045%201.045%200%20000%201.446l3.663%203.777L14%2015.437z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-delete{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.774%206.4l.812%2013.648a.8.8%200%2000.798.752h7.232a.8.8%200%2000.798-.752L17.226%206.4H6.774zm11.655%200l-.817%2013.719A2%202%200%200115.616%2022H8.384a2%202%200%2001-1.996-1.881L5.571%206.4H3.5v-.7a.5.5%200%2001.5-.5h16a.5.5%200%2001.5.5v.7h-2.071zM14%203a.5.5%200%2001.5.5v.7h-5v-.7A.5.5%200%200110%203h4zM9.5%209h1.2l.5%209H10l-.5-9zm3.8%200h1.2l-.5%209h-1.2l.5-9z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.774%206.4l.812%2013.648a.8.8%200%2000.798.752h7.232a.8.8%200%2000.798-.752L17.226%206.4H6.774zm11.655%200l-.817%2013.719A2%202%200%200115.616%2022H8.384a2%202%200%2001-1.996-1.881L5.571%206.4H3.5v-.7a.5.5%200%2001.5-.5h16a.5.5%200%2001.5.5v.7h-2.071zM14%203a.5.5%200%2001.5.5v.7h-5v-.7A.5.5%200%200110%203h4zM9.5%209h1.2l.5%209H10l-.5-9zm3.8%200h1.2l-.5%209h-1.2l.5-9z%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-success-no-circle-thin{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.864%2016.617l-5.303-5.303-1.061%201.06%205.657%205.657a1%201%200%20001.414%200L21.238%206.364l-1.06-1.06L8.864%2016.616z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.864%2016.617l-5.303-5.303-1.061%201.06%205.657%205.657a1%201%200%20001.414%200L21.238%206.364l-1.06-1.06L8.864%2016.616z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-arrow{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-arrow-bold{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2212%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.157%2012.711L4.5%2018.368l-1.414-1.414%204.95-4.95-4.95-4.95L4.5%205.64l5.657%205.657a1%201%200%20010%201.414z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2212%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.157%2012.711L4.5%2018.368l-1.414-1.414%204.95-4.95-4.95-4.95L4.5%205.64l5.657%205.657a1%201%200%20010%201.414z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-back-arrow{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.343%2012l7.071%207.071L9%2020.485l-7.778-7.778a1%201%200%20010-1.414L9%203.515l1.414%201.414L3.344%2012z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.343%2012l7.071%207.071L9%2020.485l-7.778-7.778a1%201%200%20010-1.414L9%203.515l1.414%201.414L3.344%2012z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-back-arrow-thin{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-close{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2010.586l5.657-5.657%201.414%201.414L13.414%2012l5.657%205.657-1.414%201.414L12%2013.414l-5.657%205.657-1.414-1.414L10.586%2012%204.929%206.343%206.343%204.93%2012%2010.586z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2010.586l5.657-5.657%201.414%201.414L13.414%2012l5.657%205.657-1.414%201.414L12%2013.414l-5.657%205.657-1.414-1.414L10.586%2012%204.929%206.343%206.343%204.93%2012%2010.586z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-close-thin{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-back-circle{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm1.999-5.363L12.953%2016.5%209.29%2012.723a1.045%201.045%200%20010-1.446L12.953%207.5%2014%208.563%2010.68%2012%2014%2015.438z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm1.999-5.363L12.953%2016.5%209.29%2012.723a1.045%201.045%200%20010-1.446L12.953%207.5%2014%208.563%2010.68%2012%2014%2015.438z%22%2F%3E%3C%2Fsvg%3E)}.weui-icon-success{color:var(--weui-BRAND)}.weui-icon-waiting{color:var(--weui-BLUE)}.weui-icon-warn{color:var(--weui-RED)}.weui-icon-info{color:var(--weui-BLUE)}.weui-icon-success-circle,.weui-icon-success-no-circle,.weui-icon-success-no-circle-thin{color:var(--weui-BRAND)}.weui-icon-waiting-circle{color:var(--weui-BLUE)}.weui-icon-circle{color:var(--weui-FG-2)}.weui-icon-download{color:var(--weui-BRAND)}.weui-icon-info-circle{color:var(--weui-FG-2)}.weui-icon-safe-success{color:var(--weui-BRAND)}.weui-icon-safe-warn{color:var(--weui-YELLOW)}.weui-icon-cancel{color:var(--weui-RED)}.weui-icon-search{color:var(--weui-FG-1)}.weui-icon-clear{color:var(--weui-FG-2)}.weui-icon-clear:active{color:var(--weui-FG-1)}.weui-icon-delete.weui-icon_gallery-delete{color:var(--weui-WHITE)}.weui-icon-arrow,.weui-icon-arrow-bold,.weui-icon-back-arrow,.weui-icon-back-arrow-thin{width:12px}.weui-icon-arrow,.weui-icon-arrow-bold{color:var(--weui-FG-2)}.weui-icon-back,.weui-icon-back-arrow,.weui-icon-back-arrow-thin,.weui-icon-back-circle{color:var(--weui-FG-0)}.weui-icon_msg{width:64px;height:64px}.weui-icon_msg.weui-icon-warn{color:var(--weui-RED)}.weui-icon_msg-primary{width:64px;height:64px}.weui-icon_msg-primary.weui-icon-warn{color:var(--weui-YELLOW)}.weui-link{-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-link,.weui-link:visited{color:var(--weui-LINK)}.weui-btn{position:relative;display:block;width:184px;margin-left:auto;margin-right:auto;padding:8px 24px;box-sizing:border-box;font-weight:700;font-size:17px;text-align:center;text-decoration:none;color:#fff;line-height:1.41176471;border-radius:4px;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-btn_block{width:auto}.weui-btn_inline{display:inline-block}.weui-btn_default{background-color:var(--weui-BTN-DEFAULT-BG)}.weui-btn_default,.weui-btn_default:not(.weui-btn_disabled):visited{color:var(--weui-BTN-DEFAULT-COLOR)}.weui-btn_default:not(.weui-btn_disabled):active{background-color:var(--weui-BTN-DEFAULT-ACTIVE-BG)}.weui-btn_primary{background-color:var(--weui-BRAND)}.weui-btn_primary:not(.weui-btn_disabled):visited{color:#fff}.weui-btn_primary:not(.weui-btn_disabled):active{background-color:var(--weui-TAG-TEXT-GREEN)}.weui-btn_warn{background-color:var(--weui-BTN-DEFAULT-BG)}.weui-btn_warn,.weui-btn_warn:not(.weui-btn_disabled):visited{color:var(--weui-RED)}.weui-btn_warn:not(.weui-btn_disabled):active{background-color:var(--weui-BTN-DEFAULT-ACTIVE-BG)}.weui-btn_disabled{color:var(--weui-BTN-DISABLED-FONT-COLOR);background-color:var(--weui-BTN-DEFAULT-BG)}.weui-btn_loading .weui-loading{margin:-.2em .34em 0 0}.weui-btn_loading.weui-btn_primary{background-color:var(--weui-TAG-TEXT-GREEN);color:var(--weui-WHITE)}.weui-btn_loading.weui-btn_default,.weui-btn_loading.weui-btn_warn{background-color:var(--weui-BTN-DEFAULT-ACTIVE-BG)}.weui-btn_cell{position:relative;display:block;margin-left:auto;margin-right:auto;box-sizing:border-box;font-size:17px;text-align:center;text-decoration:none;color:#fff;line-height:1.41176471;padding:16px;-webkit-tap-highlight-color:rgba(0,0,0,0);overflow:hidden;background-color:var(--weui-BG-5)}.weui-btn_cell+.weui-btn_cell{margin-top:16px}.weui-btn_cell:active{background-color:var(--weui-BG-COLOR-ACTIVE)}.weui-btn_cell__icon{display:inline-block;vertical-align:middle;width:24px;height:24px;margin:-.2em .34em 0 0}.weui-btn_cell-default{color:var(--weui-FG-0)}.weui-btn_cell-primary{color:var(--weui-LINK)}.weui-btn_cell-warn{color:var(--weui-RED)}button.weui-btn,input.weui-btn{border-width:0;outline:0;-webkit-appearance:none}button.weui-btn:focus,input.weui-btn:focus{outline:0}button.weui-btn_inline,button.weui-btn_mini,input.weui-btn_inline,input.weui-btn_mini{width:auto}.weui-btn_mini{display:inline-block;width:auto;padding:0 .75em;line-height:2;font-size:16px}.weui-btn:not(.weui-btn_mini)+.weui-btn:not(.weui-btn_mini){margin-top:16px}.weui-btn.weui-btn_inline+.weui-btn.weui-btn_inline{margin-top:auto;margin-left:16px}.weui-btn-area{margin:48px 16px 8px}.weui-btn-area_inline{display:-webkit-box;display:-webkit-flex;display:flex}.weui-btn-area_inline .weui-btn{margin-top:auto;margin-right:16px;width:100%;-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn-area_inline .weui-btn:last-child{margin-right:0}.weui-btn_reset{background:transparent;border:0;padding:0;outline:0}.weui-btn_icon{font-size:0}.weui-btn_icon:active [class*=weui-icon-]{color:var(--weui-FG-1)}.weui-cells{margin-top:8px;background-color:var(--weui-BG-2);line-height:1.41176471;font-size:17px;overflow:hidden;position:relative}.weui-cells:before{top:0;border-top:1px solid var(--weui-FG-3);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:var(--weui-FG-3);z-index:2}.weui-cells:after{bottom:0;border-bottom:1px solid var(--weui-FG-3);-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-cells__title{margin-top:16px;margin-bottom:3px;padding-left:16px;padding-right:16px;color:var(--weui-FG-1);font-size:14px;line-height:1.4}.weui-cells__title+.weui-cells{margin-top:0}.weui-cells__tips{margin-top:8px;color:var(--weui-FG-1);padding-left:16px;padding-right:16px;font-size:14px;line-height:1.4}.weui-cells__tips a,.weui-cells__tips navigator{color:var(--weui-LINK)}.weui-cells__tips navigator{display:inline}.weui-cell{padding:16px;position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5);left:16px;z-index:2}.weui-cell:first-child:before{display:none}.weui-cell_active:active{background-color:var(--weui-BG-COLOR-ACTIVE)}.weui-cell_primary{-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start}.weui-cell__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-cell__ft{text-align:right;color:var(--weui-FG-1)}.weui-cell_swiped{display:block;padding:0}.weui-cell_swiped>.weui-cell__bd{position:relative;z-index:1;background-color:var(--weui-BG-2)}.weui-cell_swiped>.weui-cell__ft{position:absolute;right:0;top:0;bottom:0;display:-webkit-box;display:-webkit-flex;display:flex;color:#fff}.weui-swiped-btn{display:block;padding:16px 1em;line-height:1.41176471;color:inherit}.weui-swiped-btn_default{background-color:var(--weui-BG-0)}.weui-swiped-btn_warn{background-color:var(--weui-RED)}.weui-cell_access{-webkit-tap-highlight-color:rgba(0,0,0,0);color:inherit}.weui-cell_access:active{background-color:var(--weui-BG-COLOR-ACTIVE)}.weui-cell_access .weui-cell__ft{padding-right:22px;position:relative}.weui-cell_access .weui-cell__ft:after{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:var(--weui-FG-2);-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);position:absolute;top:50%;right:0;margin-top:-12px}.weui-cell_link{color:var(--weui-LINK);font-size:17px}.weui-cell_link:first-child:before{display:block}.weui-check__label{-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-check__label:active{background-color:var(--weui-BG-COLOR-ACTIVE)}.weui-check{position:absolute;left:-9999px}.weui-cells_radio .weui-cell__ft{padding-left:16px;font-size:0}.weui-cells_radio .weui-check+.weui-icon-checked{min-width:16px;color:transparent}.weui-cells_radio .weui-check:checked+.weui-icon-checked,.weui-cells_radio .weui-check[aria-checked=true]+.weui-icon-checked{color:var(--weui-BRAND);-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}.weui-cells_checkbox .weui-check__label:before{left:55px}.weui-cells_checkbox .weui-cell__hd{padding-right:16px;font-size:0}.weui-cells_checkbox .weui-icon-checked{color:var(--weui-FG-2);-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E)}.weui-cells_checkbox .weui-check:checked+.weui-icon-checked,.weui-cells_checkbox .weui-check[aria-checked=true]+.weui-icon-checked{color:var(--weui-BRAND);-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E)}.weui-label{display:block;width:105px;word-wrap:break-word;word-break:break-all}.weui-input{width:100%;border:0;outline:0;-webkit-appearance:none;background-color:transparent;font-size:inherit;color:inherit;height:1.41176471em;line-height:1.41176471}.weui-input::-webkit-inner-spin-button,.weui-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.weui-input:focus:not(:placeholder-shown)+.weui-btn_input-clear{display:inline}.weui-input::-webkit-input-placeholder,.weui-input__placeholder{color:var(--weui-FG-2)}.weui-input::placeholder,.weui-input__placeholder{color:var(--weui-FG-2)}.weui-textarea{display:block;border:0;resize:none;background:transparent;width:100%;color:inherit;font-size:1em;line-height:inherit;outline:0}.weui-textarea-counter{color:var(--weui-FG-2);text-align:right;font-size:14px}.weui-cell_warn .weui-textarea-counter{color:var(--weui-RED)}.weui-cells_form .weui-cell_disabled:active,.weui-cells_form .weui-cell_readonly:active,.weui-cells_form .weui-cell_switch:active,.weui-cells_form .weui-cell_vcode:active{background-color:transparent}.weui-cells_form .weui-cell__ft{font-size:0}.weui-cells_form .weui-icon-warn{display:none}.weui-cells_form input,.weui-cells_form label[for],.weui-cells_form textarea{-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-cell_warn{color:var(--weui-RED)}.weui-cell_warn .weui-icon-warn{display:inline-block}.weui-cell_disabled .weui-input:disabled,.weui-cell_disabled .weui-textarea:disabled,.weui-cell_readonly .weui-input:disabled,.weui-cell_readonly .weui-textarea:disabled{opacity:1;-webkit-text-fill-color:var(--weui-FG-1)}.weui-cell_disabled .weui-input[disabled],.weui-cell_disabled .weui-input[readonly],.weui-cell_disabled .weui-textarea[disabled],.weui-cell_disabled .weui-textarea[readonly],.weui-cell_readonly .weui-input[disabled],.weui-cell_readonly .weui-input[readonly],.weui-cell_readonly .weui-textarea[disabled],.weui-cell_readonly .weui-textarea[readonly]{color:var(--weui-FG-1)}.weui-btn_input-clear{display:none;padding-left:8px}.weui-btn_input-clear [class*=weui-icon-]{width:18px}.weui-form-preview{position:relative;background-color:var(--weui-BG-2)}.weui-form-preview:before{top:0;border-top:1px solid var(--weui-FG-3);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:var(--weui-FG-3)}.weui-form-preview:after{bottom:0;border-bottom:1px solid var(--weui-FG-3);-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-form-preview__hd{position:relative;padding:16px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5);left:16px}.weui-form-preview__hd .weui-form-preview__value{font-style:normal;font-size:1.6em}.weui-form-preview__bd{padding:16px;font-size:.9em;text-align:right;color:var(--weui-FG-1);line-height:2}.weui-form-preview__ft{position:relative;line-height:50px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid var(--weui-DIALOG-LINE-COLOR);color:var(--weui-DIALOG-LINE-COLOR);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:var(--weui-FG-1);text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word;color:var(--weui-FG-0)}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:var(--weui-LINK);text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}button.weui-form-preview__btn{background-color:transparent;border:0;outline:0;line-height:inherit;font-size:inherit}.weui-form-preview__btn:active{background-color:var(--weui-BG-COLOR-ACTIVE)}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid var(--weui-DIALOG-LINE-COLOR);color:var(--weui-DIALOG-LINE-COLOR);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_default{color:var(--weui-FG-HALF)}.weui-form-preview__btn_primary{color:var(--weui-LINK)}.weui-cell_select{padding:0}.weui-cell_select .weui-select{padding-right:30px}.weui-cell_select .weui-cell__bd:after{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:var(--weui-FG-2);-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);position:absolute;top:50%;right:16px;margin-top:-12px}.weui-select{-webkit-appearance:none;border:0;outline:0;background-color:transparent;width:100%;font-size:inherit;height:56px;line-height:56px;position:relative;z-index:1;padding-left:16px;color:var(--weui-FG-0)}.weui-cell_select-before{padding-right:16px}.weui-cell_select-before .weui-select{width:105px;box-sizing:border-box}.weui-cell_select-before .weui-cell__hd{position:relative}.weui-cell_select-before .weui-cell__hd:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-cell_select-before .weui-cell__hd:before{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:var(--weui-FG-2);-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);position:absolute;top:50%;right:16px;margin-top:-12px}.weui-cell_select-before .weui-cell__bd{padding-left:16px}.weui-cell_select-before .weui-cell__bd:after{display:none}.weui-cell_select-before.weui-cell_access .weui-cell__hd{line-height:56px;padding-left:32px}.weui-cell_select-after{padding-left:16px}.weui-cell_select-after .weui-select{padding-left:0}.weui-cell_select-after.weui-cell_access .weui-cell__bd{line-height:56px}.weui-cell_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:56px;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;line-height:56px;font-size:17px;color:var(--weui-LINK);position:relative}.weui-vcode-btn:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}button.weui-vcode-btn{background-color:transparent;border:0;outline:0}.weui-vcode-btn:active{color:#767676}.weui-gallery{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;z-index:1000}.weui-gallery__img,.weui-gallery__opr{position:absolute;left:0;left:constant(safe-area-inset-left);left:env(safe-area-inset-left);right:0;right:constant(safe-area-inset-right);right:env(safe-area-inset-right)}.weui-gallery__img{top:0;top:constant(safe-area-inset-top);top:env(safe-area-inset-top);bottom:60px;bottom:calc(60px + constant(safe-area-inset-bottom));bottom:calc(60px + env(safe-area-inset-bottom));background:50% no-repeat;background-size:contain}.weui-gallery__opr{position:absolute;bottom:0;padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);background-color:#0d0d0d;color:var(--weui-WHITE);line-height:60px;text-align:center}.weui-gallery__del{display:block}.weui-cell_switch{padding-top:12px;padding-bottom:12px}.weui-switch{-webkit-appearance:none;appearance:none}.weui-switch,.weui-switch-cp__box{position:relative;width:52px;height:32px;border:2px solid var(--weui-FG-3);outline:0;border-radius:16px;box-sizing:border-box;-webkit-transition:background-color .1s,border .1s;transition:background-color .1s,border .1s}.weui-switch-cp__box:before,.weui-switch:before{content:" ";position:absolute;top:0;left:0;bottom:0;right:0;border-radius:15px;background-color:var(--weui-BG-3);-webkit-transition:-webkit-transform .35s cubic-bezier(.45,1,.4,1);transition:-webkit-transform .35s cubic-bezier(.45,1,.4,1);transition:transform .35s cubic-bezier(.45,1,.4,1);transition:transform .35s cubic-bezier(.45,1,.4,1),-webkit-transform .35s cubic-bezier(.45,1,.4,1)}.weui-switch-cp__box:after,.weui-switch:after{content:" ";position:absolute;top:0;left:0;width:28px;height:28px;border-radius:15px;background-color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.4);-webkit-transition:-webkit-transform .35s cubic-bezier(.4,.4,.25,1.35);transition:-webkit-transform .35s cubic-bezier(.4,.4,.25,1.35);transition:transform .35s cubic-bezier(.4,.4,.25,1.35);transition:transform .35s cubic-bezier(.4,.4,.25,1.35),-webkit-transform .35s cubic-bezier(.4,.4,.25,1.35)}.weui-switch-cp__input:checked+.weui-switch-cp__box,.weui-switch-cp__input[aria-checked=true]+.weui-switch-cp__box,.weui-switch:checked{border-color:var(--weui-BRAND);background-color:var(--weui-BRAND)}.weui-switch-cp__input:checked+.weui-switch-cp__box:before,.weui-switch-cp__input[aria-checked=true]+.weui-switch-cp__box:before,.weui-switch:checked:before{-webkit-transform:scale(0);transform:scale(0)}.weui-switch-cp__input:checked+.weui-switch-cp__box:after,.weui-switch-cp__input[aria-checked=true]+.weui-switch-cp__box:after,.weui-switch:checked:after{-webkit-transform:translateX(20px);transform:translateX(20px)}.weui-switch-cp__input{position:absolute;left:-9999px}.weui-switch-cp__box{display:block}.weui-uploader{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__hd{display:-webkit-box;display:-webkit-flex;display:flex;padding-bottom:16px;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-uploader__title{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__info{color:var(--weui-FG-2)}.weui-uploader__bd{margin-bottom:-8px;margin-right:-8px;overflow:hidden}.weui-uploader__files{list-style:none}.weui-uploader__file{float:left;margin-right:8px;margin-bottom:8px;width:96px;height:96px;background:no-repeat 50%;background-size:cover}.weui-uploader__file_status{position:relative}.weui-uploader__file_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.5)}.weui-uploader__file_status .weui-uploader__file-content{display:block}.weui-uploader__file-content{display:none;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:var(--weui-WHITE)}.weui-uploader__file-content .weui-icon-warn{display:inline-block}.weui-uploader__input-box{float:left;position:relative;margin-right:8px;margin-bottom:8px;width:96px;height:96px;box-sizing:border-box;background-color:#ededed}[data-weui-theme=dark] .weui-uploader__input-box{background-color:#2e2e2e}.weui-uploader__input-box:after,.weui-uploader__input-box:before{content:" ";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#a3a3a3}[data-weui-theme=dark] .weui-uploader__input-box:after,[data-weui-theme=dark] .weui-uploader__input-box:before{background-color:#6d6d6d}.weui-uploader__input-box:before{width:2px;height:32px}.weui-uploader__input-box:after{width:32px;height:2px}.weui-uploader__input-box:active:after,.weui-uploader__input-box:active:before{opacity:.7}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-msg{padding-top:48px;padding:calc(48px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(48px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);text-align:center;line-height:1.4;min-height:100%;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;background-color:var(--weui-BG-2)}.weui-msg a:not(.weui-btn){color:var(--weui-LINK);display:inline-block;vertical-align:baseline}.weui-msg__icon-area{margin-bottom:32px}.weui-msg__text-area{margin-bottom:32px;padding:0 32px;-webkit-box-flex:1;-webkit-flex:1;flex:1;line-height:1.6}.weui-msg__text-area:first-child{padding-top:96px}.weui-msg__title{font-weight:700;font-size:22px}.weui-msg__desc,.weui-msg__title{margin-bottom:16px;color:var(--weui-FG-0);word-wrap:break-word;word-break:break-all}.weui-msg__desc{font-size:17px}.weui-msg__desc-primary{font-size:14px;color:var(--weui-FG-1);word-wrap:break-word;word-break:break-all;margin-bottom:16px}.weui-msg__opr-area{margin-bottom:16px}.weui-msg__opr-area .weui-btn-area{margin:0}.weui-msg__opr-area .weui-btn+.weui-btn{margin-bottom:16px}.weui-msg__opr-area:last-child{margin-bottom:96px}.weui-msg__opr-area+.weui-msg__extra-area{margin-top:48px}.weui-msg__tips-area{margin-bottom:16px;padding:0 40px}.weui-msg__opr-area+.weui-msg__tips-area{margin-bottom:48px}.weui-msg__tips-area:last-child{margin-bottom:64px}.weui-msg__extra-area,.weui-msg__tips{font-size:12px;color:var(--weui-FG-1)}.weui-msg__extra-area{margin-bottom:24px}.weui-msg__extra-area a,.weui-msg__extra-area navigator{color:var(--weui-LINK)}.weui-msg__extra-area navigator{display:inline}.weui-cells__group_form:first-child .weui-cells__title{margin-top:0}.weui-cells__group_form .weui-cells__title{margin-top:24px;margin-bottom:8px;padding:0 32px}.weui-cells__group_form .weui-cell:before,.weui-cells__group_form .weui-cells:before{left:32px;right:32px}.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before{left:72px}.weui-cells__group_form .weui-cells:after{left:32px;right:32px}.weui-cells__group_form .weui-cell{padding:16px 32px}.weui-cells__group_form .weui-cell:not(.weui-cell_link){color:var(--weui-FG-0)}.weui-cells__group_form .weui-cell__hd{padding-right:16px}.weui-cells__group_form .weui-cell__ft{padding-left:16px}.weui-cells__group_form .weui-cell_warn input{color:var(--weui-RED)}.weui-cells__group_form .weui-label{max-width:5em;margin-right:8px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:rgba(0,0,0,.3)}.weui-cells__group_form .weui-cells__tips a{font-weight:700}.weui-cells__group_form .weui-cell_vcode{padding:12px 32px}.weui-cells__group_form .weui-vcode-btn{font-size:16px;padding:0 12px;margin-left:0;height:auto;width:auto;line-height:2em;color:var(--weui-BTN-DEFAULT-COLOR);background-color:var(--weui-BTN-DEFAULT-BG)}.weui-cells__group_form .weui-vcode-btn:before{display:none}.weui-cells__group_form .weui-cell_select{padding:0}.weui-cells__group_form .weui-cell_select .weui-select{padding:0 32px}.weui-cells__group_form .weui-cell_select .weui-cell__bd:after{right:32px}.weui-cells__group_form .weui-cell_select-before .weui-label{margin-right:24px}.weui-cells__group_form .weui-cell_select-before .weui-select{padding-right:24px;box-sizing:initial}.weui-cells__group_form .weui-cell_select-after{padding-left:32px}.weui-cells__group_form .weui-cell_select-after .weui-select{padding-left:0}.weui-cells__group_form .weui-cell_switch{padding:12px 32px}.weui-form{padding:56px 0 0;padding:calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;line-height:1.4;min-height:100%;box-sizing:border-box;background-color:var(--weui-BG-2)}.weui-form .weui-footer,.weui-form .weui-footer__link{font-size:14px}.weui-form .weui-agree{padding:0}.weui-form__text-area{padding:0 32px;color:var(--weui-FG-0);text-align:center}.weui-form__control-area{-webkit-box-flex:1;-webkit-flex:1;flex:1;margin:48px 0}.weui-form__tips-area{overflow:hidden}.weui-form__extra-area,.weui-form__tips-area{margin-bottom:24px;text-align:center}.weui-form__opr-area{margin-bottom:64px}.weui-form__opr-area:last-child{margin-bottom:96px}.weui-form__title{font-size:22px;font-weight:700;line-height:1.36}.weui-form__desc{font-size:17px;margin-top:16px}.weui-form__tips{color:var(--weui-FG-1);font-size:14px}.weui-form__tips a,.weui-form__tips navigator{color:var(--weui-LINK)}.weui-form__tips navigator{display:inline}.weui-article{padding:24px 16px;padding:24px calc(16px + constant(safe-area-inset-right)) calc(24px + constant(safe-area-inset-bottom)) calc(16px + constant(safe-area-inset-left));padding:24px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));font-size:17px;color:var(--weui-FG-0)}.weui-article__section{margin-bottom:1.5em}.weui-article__h1{font-size:22px;font-weight:700;margin-bottom:.9em;line-height:1.4}.weui-article__h2{font-size:17px}.weui-article__h2,.weui-article__h3{font-weight:700;margin-bottom:.34em;line-height:1.4}.weui-article__h3{font-size:15px}.weui-article__p{margin:0 0 .8em}.weui-tabbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:var(--weui-BG-1)}.weui-tabbar:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-tabbar__item{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:8px 0;padding-bottom:calc(8px + constant(safe-area-inset-bottom));padding-bottom:calc(8px + env(safe-area-inset-bottom));font-size:0;color:var(--weui-FG-1);text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-tabbar__item:first-child{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-tabbar__item:last-child{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:var(--weui-BRAND)}.weui-tabbar__icon{display:inline-block;width:28px;height:28px;margin-bottom:2px}.weui-tabbar__icon>i,i.weui-tabbar__icon{font-size:24px;color:var(--weui-FG-1)}.weui-tabbar__icon img{width:100%;height:100%}.weui-tabbar__label{color:var(--weui-FG-0);font-size:10px;line-height:1.4}.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:var(--weui-BG-2);padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.weui-navbar:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-navbar+.weui-tab__panel{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:16px 0;padding-top:calc(16px + constant(safe-area-inset-top));padding-top:calc(16px + env(safe-area-inset-top));text-align:center;font-size:17px;line-height:1.41176471;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-navbar__item.weui-bar__item_on,.weui-navbar__item:active{background-color:var(--weui-BG-COLOR-ACTIVE)}.weui-navbar__item:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-navbar__item:first-child{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-navbar__item:last-child{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-navbar__item:last-child:after{display:none}.weui-tab{display:-webkit-box;display:-webkit-flex;display:flex;height:100%;box-sizing:border-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.weui-tab__panel{box-sizing:border-box;-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}.weui-tab__content{display:none}.weui-progress{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-progress__bar{background-color:var(--weui-BG-0);height:3px;-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-progress__inner-bar{width:0;height:100%;background-color:var(--weui-BRAND)}.weui-progress__opr{display:block;margin-left:15px;font-size:0}.weui-panel{background-color:var(--weui-BG-2);margin-top:10px;position:relative;overflow:hidden}.weui-panel:first-child{margin-top:0}.weui-panel:before{top:0;border-top:1px solid var(--weui-FG-3);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-panel:after,.weui-panel:before{content:" ";position:absolute;left:0;right:0;height:1px;color:var(--weui-FG-3)}.weui-panel:after{bottom:0;border-bottom:1px solid var(--weui-FG-3);-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-panel__hd{padding:16px 16px 13px;color:var(--weui-FG-0);font-size:15px;font-weight:700;position:relative}.weui-panel__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5);left:15px}.weui-media-box{padding:16px;position:relative}.weui-media-box:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5);left:16px}.weui-media-box:first-child:before{display:none}a.weui-media-box{color:#000;-webkit-tap-highlight-color:rgba(0,0,0,0)}a.weui-media-box:active{background-color:var(--weui-BG-COLOR-ACTIVE)}.weui-media-box__title{font-weight:400;font-size:17px;color:var(--weui-FG-0);width:auto;white-space:nowrap;word-wrap:normal;word-wrap:break-word;word-break:break-all}.weui-media-box__desc,.weui-media-box__title{line-height:1.4;overflow:hidden;text-overflow:ellipsis}.weui-media-box__desc{color:var(--weui-FG-2);font-size:14px;padding-top:4px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-media-box__info{margin-top:16px;padding-bottom:4px;font-size:13px;color:var(--weui-FG-2);line-height:1em;list-style:none;overflow:hidden}.weui-media-box__info__meta{float:left;padding-right:1em}.weui-media-box__info__meta_extra{padding-left:1em;border-left:1px solid var(--weui-FG-2)}.weui-media-box_appmsg{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-media-box_appmsg .weui-media-box__hd{margin-right:16px;width:60px;height:60px;line-height:60px;text-align:center}.weui-media-box_appmsg .weui-media-box__thumb{width:100%;max-height:100%;vertical-align:top}.weui-media-box_appmsg .weui-media-box__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1;min-width:0}.weui-media-box_small-appmsg{padding:0}.weui-media-box_small-appmsg .weui-cells{margin-top:0}.weui-media-box_small-appmsg .weui-cells:before{display:none}.weui-grids{position:relative;overflow:hidden}.weui-grids:before{right:0;height:1px;border-top:1px solid var(--weui-FG-3);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-grids:after,.weui-grids:before{content:" ";position:absolute;left:0;top:0;color:var(--weui-FG-3)}.weui-grids:after{width:1px;bottom:0;border-left:1px solid var(--weui-FG-3);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-grid{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box}.weui-grid:before{top:0;width:1px;border-right:1px solid var(--weui-FG-3);-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-grid:after,.weui-grid:before{content:" ";position:absolute;right:0;bottom:0;color:var(--weui-FG-3)}.weui-grid:after{left:0;height:1px;border-bottom:1px solid var(--weui-FG-3);-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-grid:active{background-color:var(--weui-BG-COLOR-ACTIVE)}.weui-grid__icon{width:28px;height:28px;margin:0 auto}.weui-grid__icon img{display:block;width:100%;height:100%}.weui-grid__icon+.weui-grid__label{margin-top:4px}.weui-grid__label{display:block;color:var(--weui-FG-0);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.weui-footer,.weui-grid__label{text-align:center;font-size:14px}.weui-footer{color:var(--weui-FG-2);line-height:1.4}.weui-footer a,.weui-footer navigator{color:var(--weui-LINK)}.weui-footer navigator{display:inline}.weui-footer_fixed-bottom{position:fixed;bottom:0;left:0;right:0;padding-top:16px;padding-bottom:16px;padding-bottom:calc(16px + constant(safe-area-inset-bottom));padding-bottom:calc(16px + env(safe-area-inset-bottom));left:constant(safe-area-inset-left);left:env(safe-area-inset-left);right:constant(safe-area-inset-right);right:env(safe-area-inset-right)}.weui-footer__links{font-size:0}.weui-footer__link{display:inline-block;vertical-align:top;margin:0 8px;position:relative;font-size:14px}.weui-footer__link:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5);left:-8px;top:.36em;bottom:.36em}.weui-footer__link:first-child:before{display:none}.weui-footer__text{padding:0 16px;font-size:12px}.weui-flex{display:-webkit-box;display:-webkit-flex;display:flex}.weui-flex__item{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-dialog{position:fixed;z-index:5000;top:50%;left:16px;right:16px;-webkit-transform:translateY(-50%);transform:translateY(-50%);background-color:var(--weui-BG-2);text-align:center;border-radius:12px;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;max-height:90%}.weui-dialog__hd{padding:32px 24px 16px}.weui-dialog__title{font-weight:700;font-size:17px;line-height:1.4}.weui-dialog__bd{overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 24px;margin-bottom:32px;font-size:17px;line-height:1.4;word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;color:var(--weui-FG-1)}.weui-dialog__bd:first-child{min-height:40px;padding:32px 24px 0;font-weight:700;color:var(--weui-FG-0);-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__bd:first-child,.weui-dialog__ft{display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft{position:relative;line-height:56px;min-height:56px;font-size:17px}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid var(--weui-DIALOG-LINE-COLOR);color:var(--weui-DIALOG-LINE-COLOR);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:var(--weui-LINK);font-weight:700;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:relative}.weui-dialog__btn:active{background-color:var(--weui-BG-COLOR-ACTIVE)}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid var(--weui-DIALOG-LINE-COLOR);color:var(--weui-DIALOG-LINE-COLOR);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:var(--weui-FG-HALF)}.weui-skin_android .weui-dialog{text-align:left;box-shadow:0 6px 30px 0 rgba(0,0,0,.1)}.weui-skin_android .weui-dialog__title{font-size:22px;line-height:1.4}.weui-skin_android .weui-dialog__hd{text-align:left}.weui-skin_android .weui-dialog__bd{color:var(--weui-FG-1);text-align:left}.weui-skin_android .weui-dialog__bd:first-child{color:var(--weui-FG-0)}.weui-skin_android .weui-dialog__ft{display:block;text-align:right;line-height:40px;min-height:40px;padding:0 24px 16px}.weui-skin_android .weui-dialog__ft:after{display:none}.weui-skin_android .weui-dialog__btn{display:inline-block;vertical-align:top;padding:0 .8em}.weui-skin_android .weui-dialog__btn:after{display:none}.weui-skin_android .weui-dialog__btn:last-child{margin-right:-.8em}.weui-skin_android .weui-dialog__btn_default{color:var(--weui-FG-HALF)}@media screen and (min-width:352px){.weui-dialog{width:320px;margin:0 auto}}.weui-half-screen-dialog{position:fixed;left:0;right:0;bottom:0;max-height:75%;z-index:5000;line-height:1.4;background-color:var(--weui-BG-2);border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden;padding:0 24px;padding:0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));padding:0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))}@media only screen and (max-height:558px){.weui-half-screen-dialog{max-height:none}}.weui-half-screen-dialog__hd{font-size:8px;height:8em;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-half-screen-dialog__hd .weui-icon-btn{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.weui-half-screen-dialog__hd .weui-icon-btn:active{opacity:.5}.weui-half-screen-dialog__hd__side{position:relative;left:-8px}.weui-half-screen-dialog__hd__main{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main{text-align:center;padding:0 40px}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side{right:-8px;left:auto}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn{right:0}.weui-half-screen-dialog__title{display:block;color:var(--weui-FG-0);font-weight:700;font-size:15px}.weui-half-screen-dialog__subtitle{display:block;color:var(--weui-FG-1);font-size:10px}.weui-half-screen-dialog__bd{word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;overflow-y:auto;padding-top:4px;padding-bottom:40px;font-size:14px;color:var(--weui-FG-0)}.weui-half-screen-dialog__desc{font-size:17px;font-weight:700;color:var(--weui-FG-0);line-height:1.4}.weui-half-screen-dialog__tips{padding-top:16px;font-size:14px;color:var(--weui-FG-2);line-height:1.4}.weui-half-screen-dialog__ft{padding:0 24px 32px;text-align:center}.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn{display:inline-block;vertical-align:top;margin:0 8px;width:120px}.weui-icon-btn{outline:0;-webkit-appearance:none;-webkit-tap-highlight-color:rgba(0,0,0,0);border-width:0;background-color:transparent;color:var(--weui-FG-0);font-size:0}.weui-icon-more{width:24px;-webkit-mask:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M5 10.25a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E%3C/svg%3E") no-repeat 50% 50%;mask:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M5 10.25a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E%3C/svg%3E") no-repeat 50% 50%;-webkit-mask-size:cover;mask-size:cover}.weui-icon-btn_goback,.weui-icon-more{display:inline-block;vertical-align:middle;height:24px;background-color:currentColor;color:var(--weui-FG-0)}.weui-icon-btn_goback{width:12px;-webkit-mask:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%;mask:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%;-webkit-mask-size:cover;mask-size:cover}.weui-icon-btn_close{color:var(--weui-FG-0);display:inline-block;vertical-align:middle;width:14px;height:24px;-webkit-mask:url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%;mask:url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%;-webkit-mask-size:cover;mask-size:cover;background-color:currentColor}.weui-toast{position:fixed;z-index:5000;width:120px;height:120px;top:40%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-align:center;border-radius:5px;color:hsla(0,0%,100%,.9);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;background-color:#4c4c4c}[data-weui-theme=dark] .weui-toast{background-color:#606060}.weui-icon_toast{display:block}.weui-icon_toast.weui-icon-success-no-circle{color:hsla(0,0%,100%,.9);width:55px;height:55px}.weui-icon_toast.weui-loading{margin:8px 0;width:38px;height:38px;vertical-align:baseline}.weui-toast__content{font-size:14px}.weui-mask{background:rgba(0,0,0,.6)}.weui-mask,.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-actionsheet{position:fixed;left:0;bottom:0;-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:5000;width:100%;background-color:var(--weui-BG-1);-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden}.weui-actionsheet__title{position:relative;height:56px;padding:0 24px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;text-align:center;font-size:12px;color:var(--weui-FG-1);line-height:1.4;background:var(--weui-BG-2)}.weui-actionsheet__title:before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-actionsheet__title .weui-actionsheet__title-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-actionsheet__menu{color:var(--weui-FG-0);background-color:var(--weui-BG-2)}.weui-actionsheet__action{margin-top:8px;background-color:var(--weui-BG-2);padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-actionsheet__cell{position:relative;padding:16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-actionsheet__cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-actionsheet__cell:active{background-color:var(--weui-BG-COLOR-ACTIVE)}.weui-actionsheet__cell:first-child:before{display:none}.weui-actionsheet__cell_warn{color:var(--weui-RED)}.weui-skin_android .weui-actionsheet{position:fixed;left:50%;top:50%;bottom:auto;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:274px;box-sizing:border-box;-webkit-backface-visibility:hidden;backface-visibility:hidden;background:transparent;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-top-left-radius:0;border-top-right-radius:0}.weui-skin_android .weui-actionsheet__action{display:none}.weui-skin_android .weui-actionsheet__menu{border-radius:2px;box-shadow:0 6px 30px 0 rgba(0,0,0,.1)}.weui-skin_android .weui-actionsheet__cell{padding:16px;font-size:17px;line-height:1.41176471;color:var(--weui-FG-0);text-align:left}.weui-skin_android .weui-actionsheet__cell:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.weui-skin_android .weui-actionsheet__cell:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.weui-actionsheet_toggle{-webkit-transform:translate(0);transform:translate(0)}.weui-loadmore{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.weui-loadmore__tips{display:inline-block;vertical-align:middle;color:var(--weui-FG-0)}.weui-loadmore_line{border-top:1px solid var(--weui-FG-3);margin-top:2.4em}.weui-loadmore_line .weui-loadmore__tips{position:relative;top:-.9em;padding:0 .55em;background-color:var(--weui-BG-2);color:var(--weui-FG-1)}.weui-loadmore_dot .weui-loadmore__tips{padding:0 .16em}.weui-loadmore_dot .weui-loadmore__tips:before{content:" ";width:4px;height:4px;border-radius:50%;background-color:var(--weui-FG-3);display:inline-block;position:relative;vertical-align:0;top:-.16em}.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:var(--weui-RED);color:#fff;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}.weui-toptips{display:none;position:fixed;-webkit-transform:translateZ(0);transform:translateZ(0);top:8px;left:8px;right:8px;padding:10px;border-radius:8px;font-size:14px;text-align:center;color:#fff;z-index:5000;word-wrap:break-word;word-break:break-all}.weui-toptips_warn{background-color:var(--weui-RED)}.weui-search-bar{position:relative;padding:8px;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;background-color:var(--weui-BG-0);-webkit-text-size-adjust:100%;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-search-bar.weui-search-bar_focusing .weui-search-bar__cancel-btn{display:block}.weui-search-bar.weui-search-bar_focusing .weui-search-bar__label{display:none}.weui-search-bar .weui-icon-search{width:16px;height:16px}.weui-search-bar__form{position:relative;-webkit-box-flex:1;-webkit-flex:auto;flex:auto;background-color:var(--weui-BG-2);border-radius:4px}.weui-search-bar__box{position:relative;padding-left:28px;padding-right:32px;height:100%;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__box .weui-search-bar__input{padding:8px 0;width:100%;height:1.14285714em;border:0;font-size:14px;line-height:1.14285714em;box-sizing:content-box;background:transparent;caret-color:var(--weui-BRAND);color:var(--weui-FG-0)}.weui-search-bar__box .weui-search-bar__input:focus{outline:none}.weui-search-bar__box .weui-icon-search{position:absolute;top:50%;left:8px;margin-top:-8px}.weui-search-bar__box .weui-icon-clear{position:absolute;top:50%;right:0;margin-top:-16px;padding:8px;width:16px;height:16px;-webkit-mask-size:16px;mask-size:16px}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;font-size:0;border-radius:4px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;color:var(--weui-FG-1);background:var(--weui-BG-2)}.weui-search-bar__label span{display:inline-block;font-size:14px;vertical-align:middle}.weui-search-bar__label .weui-icon-search{margin-right:4px}.weui-search-bar__cancel-btn{display:none;margin-left:8px;line-height:28px;color:var(--weui-LINK);white-space:nowrap}.weui-search-bar__input:not(:valid)+.weui-icon-clear{display:none}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}.weui-picker{position:fixed;width:100%;box-sizing:border-box;left:0;bottom:0;z-index:5000;background-color:var(--weui-BG-2);padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.weui-picker__hd{display:-webkit-box;display:-webkit-flex;display:flex;padding:16px;padding:16px calc(16px + constant(safe-area-inset-right)) 16px calc(16px + constant(safe-area-inset-left));padding:16px calc(16px + env(safe-area-inset-right)) 16px calc(16px + env(safe-area-inset-left));position:relative;text-align:center;font-size:17px;line-height:1.4}.weui-picker__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1px solid var(--weui-FG-3);color:var(--weui-FG-3);-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-picker__bd{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;background-color:var(--weui-BG-2);height:240px;overflow:hidden}.weui-picker__group{-webkit-box-flex:1;-webkit-flex:1;flex:1;position:relative;height:100%}.weui-picker__group:first-child .weui-picker__item{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-picker__group:last-child .weui-picker__item{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-picker__mask{position:absolute;top:0;left:0;width:100%;height:100%;margin:0 auto;z-index:3;background-image:-webkit-linear-gradient(top,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6)),-webkit-linear-gradient(bottom,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6));background-image:linear-gradient(180deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6)),linear-gradient(0deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6));background-position:top,bottom;background-size:100% 92px;background-repeat:no-repeat;-webkit-transform:translateZ(0);transform:translateZ(0)}[data-weui-theme=dark] .weui-picker__mask{background-image:-webkit-linear-gradient(top,rgba(35,35,35,.95),rgba(35,35,35,.6)),-webkit-linear-gradient(bottom,rgba(35,35,35,.95),rgba(35,35,35,.6));background-image:linear-gradient(180deg,rgba(35,35,35,.95),rgba(35,35,35,.6)),linear-gradient(0deg,rgba(35,35,35,.95),rgba(35,35,35,.6))}.weui-picker__indicator{width:100%;height:56px;position:absolute;left:0;top:92px;z-index:3}.weui-picker__indicator:before{top:0;border-top:1px solid var(--weui-FG-3);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-picker__indicator:after,.weui-picker__indicator:before{content:" ";position:absolute;left:0;right:0;height:1px;color:var(--weui-FG-3)}.weui-picker__indicator:after{bottom:0;border-bottom:1px solid var(--weui-FG-3);-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-picker__content{position:absolute;top:0;left:0;width:100%}.weui-picker__item{height:48px;line-height:48px;text-align:center;color:var(--weui-FG-0);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.weui-picker__item_disabled{color:var(--weui-FG-1)}@-webkit-keyframes a{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes a{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.weui-animate-slide-up{-webkit-animation:a ease .3s forwards;animation:a ease .3s forwards}@-webkit-keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}.weui-animate-slide-down{-webkit-animation:b ease .3s forwards;animation:b ease .3s forwards}@-webkit-keyframes c{0%{opacity:0}to{opacity:1}}.weui-animate-fade-in{-webkit-animation:c ease .3s forwards;animation:c ease .3s forwards}@-webkit-keyframes d{0%{opacity:1}to{opacity:0}}.weui-animate-fade-out{-webkit-animation:d ease .3s forwards;animation:d ease .3s forwards}.weui-agree{display:block;padding:8px 15px 0;font-size:14px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-agree a,.weui-agree navigator{color:var(--weui-LINK)}.weui-agree navigator{display:inline}.weui-agree__text{color:var(--weui-FG-1);margin-left:2px}.weui-agree__checkbox{-webkit-appearance:none;appearance:none;display:inline-block;border:0;outline:0;vertical-align:middle;background-color:currentColor;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E);color:var(--weui-FG-2);width:1em;height:1em;font-size:17px;margin-top:-.2em}.weui-agree__checkbox-check{position:absolute;left:-9999px}.weui-agree__checkbox-check[aria-checked=true]+.weui-agree__checkbox,.weui-agree__checkbox:checked{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);color:var(--weui-BRAND)}.weui-agree_animate{-webkit-animation:e .3s 1;animation:e .3s 1}@-webkit-keyframes e{0%{-webkit-transform:translateX(0);transform:translateX(0)}16%{-webkit-transform:translateX(-8px);transform:translateX(-8px)}28%{-webkit-transform:translateX(-16px);transform:translateX(-16px)}44%{-webkit-transform:translateX(0);transform:translateX(0)}59%{-webkit-transform:translateX(-16px);transform:translateX(-16px)}73%{-webkit-transform:translateX(0);transform:translateX(0)}82%{-webkit-transform:translateX(16px);transform:translateX(16px)}94%{-webkit-transform:translateX(8px);transform:translateX(8px)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes e{0%{-webkit-transform:translateX(0);transform:translateX(0)}16%{-webkit-transform:translateX(-8px);transform:translateX(-8px)}28%{-webkit-transform:translateX(-16px);transform:translateX(-16px)}44%{-webkit-transform:translateX(0);transform:translateX(0)}59%{-webkit-transform:translateX(-16px);transform:translateX(-16px)}73%{-webkit-transform:translateX(0);transform:translateX(0)}82%{-webkit-transform:translateX(16px);transform:translateX(16px)}94%{-webkit-transform:translateX(8px);transform:translateX(8px)}to{-webkit-transform:translateX(0);transform:translateX(0)}}.weui-loading{width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:f 1s steps(12) infinite;animation:f 1s steps(12) infinite;background:transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;background-size:100%}.weui-btn_loading.weui-btn_primary .weui-loading,.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@-webkit-keyframes f{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes f{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.weui-slider{padding:15px 18px;-webkit-user-select:none;user-select:none}.weui-slider__inner{position:relative;height:2px;background-color:var(--weui-FG-3)}.weui-slider__track{height:2px;background-color:var(--weui-BRAND);width:0}.weui-slider__handler{position:absolute;left:0;top:50%;width:28px;height:28px;margin-left:-14px;margin-top:-14px;border-radius:50%;background-color:#fff;box-shadow:0 0 4px var(--weui-FG-3)}.weui-slider-box{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-slider-box .weui-slider{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-slider-box__value{margin-left:.5em;min-width:24px;color:var(--weui-FG-1);text-align:center;font-size:14px}.wx_dot_loading,.wx_dot_loading:after,.wx_dot_loading:before{display:inline-block;vertical-align:middle;width:6px;height:6px;border-radius:50%;background-color:rgba(0,0,0,.3);font-size:0;-webkit-animation:h 1.6s step-start infinite;animation:h 1.6s step-start infinite}.wx_dot_loading{position:relative}.wx_dot_loading:before{content:"";position:absolute;left:-12px;background-color:rgba(0,0,0,.1);-webkit-animation:g 1.6s step-start infinite;animation:g 1.6s step-start infinite}.wx_dot_loading:after{content:"";position:absolute;right:-12px;background-color:rgba(0,0,0,.5);-webkit-animation:i 1.6s step-start infinite;animation:i 1.6s step-start infinite}@-webkit-keyframes g{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@keyframes g{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@-webkit-keyframes h{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@keyframes h{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@-webkit-keyframes i{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}@keyframes i{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}.wx_dot_loading_white{background-color:hsla(0,0%,100%,.3);-webkit-animation:k 1.6s step-start infinite;animation:k 1.6s step-start infinite}.wx_dot_loading_white:before{background-color:hsla(0,0%,100%,.5);-webkit-animation:j 1.6s step-start infinite;animation:j 1.6s step-start infinite}.wx_dot_loading_white:after{background-color:hsla(0,0%,100%,.1);-webkit-animation:l 1.6s step-start infinite;animation:l 1.6s step-start infinite}@-webkit-keyframes j{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@keyframes j{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@-webkit-keyframes k{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@keyframes k{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@-webkit-keyframes l{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}@keyframes l{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}:host{width:100%}.weui-slideview{position:relative;overflow:hidden}.weui-slideview__left{position:relative;z-index:10}.weui-slideview__right{position:absolute;z-index:1;left:100%;top:0;height:100%}.weui-slideview__btn__wrp{position:absolute;left:0;bottom:0;text-align:center;min-width:69px;height:100%;white-space:nowrap}.weui-slideview__btn{color:#fff;padding:0 17px}.weui-slideview__btn-group_default .weui-slideview__btn{background:#c7c7cc}[data-weui-theme=dark] .weui-slideview__btn-group_default .weui-slideview__btn{background:var(--weui-BG-4)}.weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid #fff;color:#fff;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}[data-weui-theme=dark] .weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before{border-left-color:var(--weui-FG-3)}.weui-slideview__btn-group_default:first-child:before{display:none}.weui-slideview__btn-group_warn .weui-slideview__btn{background:#fe3b30}.weui-slideview__btn-group_warn~.weui-slideview__btn-group_warn:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid #fff;color:#fff;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-slideview__btn-group_warn:first-child:before{display:none}.weui-slideview_icon .weui-slideview__btn__wrp{background:transparent;font-size:0}.weui-slideview_icon .weui-slideview__btn__wrp:first-child{padding-left:16px}.weui-slideview_icon .weui-slideview__btn__wrp:last-child{padding-right:8px}.weui-slideview_icon .weui-slideview__btn{width:48px;height:48px;line-height:48px;padding:0;display:inline-block;vertical-align:middle;border-radius:50%;background-color:#fff}[data-weui-theme=dark] .weui-slideview_icon .weui-slideview__btn{background-color:var(--weui-BG-4)}.weui-slideview_icon .weui-slideview__btn__icon{display:inline-block;vertical-align:middle;width:22px;height:22px}page{--height:44px;--right:190rpx}.weui-navigation-bar{overflow:hidden;color:var(--weui-FG-0)}.weui-navigation-bar .android{--height:48px;--right:222rpx}.weui-navigation-bar__inner{position:fixed;top:0;left:0;z-index:5001;height:var(--height);padding-right:var(--right);width:calc(100% - var(--right))}.weui-navigation-bar__inner,.weui-navigation-bar__inner .weui-navigation-bar__left{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-navigation-bar__inner .weui-navigation-bar__left{position:relative;width:var(--right);padding-left:16px}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn{display:inline-block;vertical-align:middle;background-repeat:no-repeat}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback{font-size:12px;width:1em;height:2em;-webkit-mask:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%;mask:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%;-webkit-mask-size:cover;mask-size:cover;background-color:currentColor}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback:active{opacity:.5}.weui-navigation-bar__inner .weui-navigation-bar__center{font-size:17px;text-align:center;position:relative;-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-navigation-bar__inner .weui-navigation-bar__loading{margin-right:4px;font-size:0}.weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading{margin-left:0}.weui-navigation-bar__inner .weui-navigation-bar__right{margin-right:16px}.weui-navigation-bar__placeholder{height:var(--height);background:var(--weui-BG-1);position:relative;z-index:50}.weui-uploader__hd{display:block}.weui-uploader__overview{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-uploader__tips{color:var(--weui-FG-2);font-size:14px;line-height:1.4;padding-top:4px}.weui-uploader__img{display:block;width:100%;height:100%}.weui-gallery{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap}.weui-gallery__info{color:#fff;font-size:17px;line-height:60px;min-height:60px;text-align:center}.weui-gallery__img__wrp{-webkit-box-flex:1;-webkit-flex:1;flex:1;position:relative;font-size:0}.weui-gallery__img{position:absolute;width:100%;height:100%}.weui-gallery__opr{position:static}.weui-search-bar .weui-search-bar__box .weui-search-bar__input{height:inherit;line-height:inherit}.weui-search-bar .weui-search-bar__box .weui-icon-clear{display:block}.weui-loadmore .weui-loading{margin-right:.3em}.weui-btn_input-clear{display:block}page{height:100%}.page{min-height:100%;background-color:var(--weui-BG-0);color:var(--weui-FG-0);font-size:16px;font-family:-apple-system-font,Helvetica Neue,Helvetica,sans-serif}image{max-width:100%;max-height:100%}.link{display:inline;color:var(--weui-LINK)}.fadeIn{-webkit-animation:c .3s forwards;animation:c .3s forwards}.fadeOut{-webkit-animation:d .3s forwards;animation:d .3s forwards}@keyframes c{0%{opacity:0}to{opacity:1}}@keyframes d{0%{opacity:1}to{opacity:0}}.weui-msg__extra-area{position:static}.page__hd{padding:40px}.page__bd{padding-bottom:40px}.page__bd_spacing{padding-left:15px;padding-right:15px}.page__ft{padding-top:40px;padding-bottom:10px;padding-bottom:calc(10px + constant(safe-area-inset-bottom));padding-bottom:calc(10px + env(safe-area-inset-bottom));text-align:center}[data-weui-theme=dark] .page__ft image{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}.page__title{text-align:left;font-size:20px;font-weight:400}.page__desc{margin-top:5px;color:var(--weui-FG-1);text-align:left;font-size:14px}.weui-cell_example:before{left:52px}
\ No newline at end of file
diff --git a/components/dynamicForm/components/timePicker/timePicker.js b/components/dynamicForm/components/timePicker/timePicker.js
new file mode 100644
index 0000000..0eb7587
--- /dev/null
+++ b/components/dynamicForm/components/timePicker/timePicker.js
@@ -0,0 +1,566 @@
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ pickerShow: {
+ type: Boolean,
+ observer:function(val){ //弹出动画
+ // console.log(this.data);
+ if(val){
+ let animation = wx.createAnimation({
+ duration: 500,
+ timingFunction: "ease"
+ });
+ let animationOpacity = wx.createAnimation({
+ duration: 500,
+ timingFunction: "ease"
+ });
+ setTimeout(() => {
+ animation.bottom(0).step();
+ animationOpacity.opacity(0.7).step();
+ this.setData({
+ animationOpacity: animationOpacity.export(),
+ animationData: animation.export()
+ })
+ }, 0);
+ }else{
+ let animation = wx.createAnimation({
+ duration: 100,
+ timingFunction: "ease"
+ });
+ let animationOpacity = wx.createAnimation({
+ duration: 500,
+ timingFunction: "ease"
+ });
+ animation.bottom(-320).step();
+ animationOpacity.opacity(0).step();
+ this.setData({
+ animationOpacity: animationOpacity.export(),
+ animationData: animation.export()
+ });
+ }
+
+ // 在picker滚动未停止前点确定,会使startValue数组各项归零,发生错误,这里判断并重新初始化
+ // 微信新增了picker滚动的回调函数,已进行兼容
+ if(this.data.startValue&&this.data.endValue){
+ let s = 0, e = 0;
+ let conf = this.data.config;
+
+ this.data.startValue.map(val => {
+ if (val == 0) {
+ s++
+ }
+ })
+ this.data.endValue.map(val => {
+ if (val == 0) {
+ e++;
+ }
+ });
+ let tmp={
+ hour:4,
+ minute:5,
+ second:6
+ }
+ let n = tmp[conf.column];
+ if (s>=n || e>=n) {
+ this.initPick(this.data.config);
+ this.setData({
+ startValue: this.data.startValue,
+ endValue: this.data.endValue,
+ });
+ }
+ }
+
+
+ }
+ },
+ config: Object
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ // pickerShow:true
+ // limitStartTime: new Date().getTime()-1000*60*60*24*30,
+ // limitEndTime: new Date().getTime(),
+ // yearStart:2000,
+ // yearEnd:2100
+ },
+ detached: function() {
+ console.log("dele");
+ },
+ attached: function() {},
+ ready: function() {
+ this.readConfig();
+ this.initPick(this.data.config || null);
+ this.setData({
+ startValue: this.data.startValue,
+ endValue: this.data.endValue,
+ });
+
+
+
+
+ },
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ //阻止滑动事件
+ onCatchTouchMove(e) {
+
+ },
+ //读取配置项
+ readConfig() {
+ let limitEndTime = new Date().getTime();
+ let limitStartTime = new Date().getTime() - 1000 * 60 * 60 * 24 * 30;
+ if (this.data.config) {
+ let conf = this.data.config;
+
+ if (typeof conf.dateLimit == "number") {
+ limitStartTime =
+ new Date().getTime() - 1000 * 60 * 60 * 24 * conf.dateLimit;
+ }
+ if(conf.limitStartTime){
+
+ limitStartTime = new Date(conf.limitStartTime.replace(/-/g,'/')).getTime();
+ }
+
+ if (conf.limitEndTime) {
+ limitEndTime = new Date(conf.limitEndTime.replace(/-/g, '/')).getTime();
+ }
+
+ this.setData({
+ yearStart: conf.yearStart || 2000,
+ yearEnd: conf.yearEnd || 2100,
+ endDate: conf.endDate || false,
+ dateLimit: conf.dateLimit || false,
+ hourColumn:
+ conf.column == "hour" ||
+ conf.column == "minute" ||
+ conf.column == "second",
+ minColumn: conf.column == "minute" || conf.column == "second",
+ secColumn: conf.column == "second"
+ });
+ }
+
+ let limitStartTimeArr = formatTime(limitStartTime);
+ let limitEndTimeArr = formatTime(limitEndTime);
+
+ this.setData({
+ limitStartTime,
+ limitStartTimeArr,
+ limitEndTime,
+ limitEndTimeArr
+ });
+ },
+ //滚动开始
+ handlePickStart:function(e){
+ this.setData({
+ isPicking:true
+ })
+ },
+ //滚动结束
+ handlePickEnd:function(e){
+ this.setData({
+ isPicking:false
+ })
+ },
+ onConfirm: function() {
+ //滚动未结束时不能确认
+ if(this.data.isPicking){return}
+ let startTime = new Date(this.data.startPickTime.replace(/-/g, "/"));
+ let endTime = new Date(this.data.endPickTime.replace(/-/g, "/"));
+ if (startTime <= endTime || !this.data.endDate) {
+ this.setData({
+ startTime,
+ endTime
+ });
+ let startArr = formatTime(startTime).arr;
+ let endArr = formatTime(endTime).arr;
+ let format0 = function(num){
+ return num<10?'0'+num:num
+ }
+
+ let startTimeBack =
+ startArr[0] +
+ "-" +
+ format0(startArr[1]) +
+ "-" +
+ format0(startArr[2]) +
+ " " +
+ (this.data.hourColumn ? format0(startArr[3]) : "00") +
+ ":" +
+ (this.data.minColumn ? format0(startArr[4]) : "00") +
+ ":" +
+ (this.data.secColumn ? format0(startArr[5]) : "00");
+
+ let endTimeBack =
+ endArr[0] +
+ "-" +
+ format0(endArr[1]) +
+ "-" +
+ format0(endArr[2]) +
+ " " +
+ (this.data.hourColumn ? format0(endArr[3]) : "00") +
+ ":" +
+ (this.data.minColumn ? format0(endArr[4]) : "00") +
+ ":" +
+ (this.data.secColumn ? format0(endArr[5]) : "00");
+
+ let time = {
+ startTime: startTimeBack,
+ endTime: endTimeBack
+ };
+
+ //触发自定义事件
+ this.triggerEvent("setPickerTime", time);
+ this.triggerEvent("hidePicker", {});
+ } else {
+ wx.showToast({
+ icon: "none",
+ title: "时间不合理"
+ });
+ }
+ },
+ hideModal: function() {
+
+ this.triggerEvent("hidePicker", {});
+ },
+ changeStartDateTime: function(e) {
+ let val = e.detail.value;
+
+ this.compareTime(val, "start");
+ },
+
+ changeEndDateTime: function(e) {
+ let val = e.detail.value;
+ this.compareTime(val, "end");
+ },
+ //比较时间是否在范围内
+ compareTime(val, type) {
+ let h = val[3] ? this.data.HourList[val[3]] : "00";
+ let m = val[4] ? this.data.MinuteList[val[4]] : "00";
+ let s = val[5] ? this.data.SecondList[val[5]] : "00";
+ let time =
+ this.data.YearList[val[0]] +
+ "-" +
+ this.data.MonthList[val[1]] +
+ "-" +
+ this.data.DayList[val[2]] +
+ " " +
+ h +
+ ":" +
+ m +
+ ":" +
+ s;
+
+ let start = this.data.limitStartTime;
+ let end = this.data.limitEndTime;
+ let timeNum = new Date(time.replace(/-/g, '/')).getTime();
+ let year, month, day, hour, min, sec, limitDate;
+ let tempArr = []
+
+ if (!this.data.dateLimit){
+ limitDate = [
+ this.data.YearList[val[0]],
+ this.data.MonthList[val[1]],
+ this.data.DayList[val[2]],
+ this.data.HourList[val[3]],
+ this.data.MinuteList[val[4]],
+ this.data.SecondList[val[5]]]
+ } else if (type == "start" && timeNum > new Date(this.data.endPickTime.replace(/-/g, '/')) && this.data.config.endDate) {
+ limitDate = formatTime(this.data.endPickTime).arr;
+
+ } else if (type == "end" && timeNum < new Date(this.data.startPickTime.replace(/-/g, '/'))) {
+ limitDate = formatTime(this.data.startPickTime).arr;
+
+ } else if (timeNum < start) {
+ limitDate = this.data.limitStartTimeArr.arr;
+
+ } else if (timeNum > end) {
+ limitDate = this.data.limitEndTimeArr.arr;
+
+ } else {
+ limitDate = [
+ this.data.YearList[val[0]],
+ this.data.MonthList[val[1]],
+ this.data.DayList[val[2]],
+ this.data.HourList[val[3]],
+ this.data.MinuteList[val[4]],
+ this.data.SecondList[val[5]]
+ ]
+
+ }
+
+ year = limitDate[0];
+ month = limitDate[1];
+ day = limitDate[2];
+ hour = limitDate[3];
+ min = limitDate[4];
+ sec = limitDate[5];
+
+ if (type == "start") {
+ this.setStartDate(year, month, day, hour, min, sec);
+ } else if (type == "end") {
+ this.setEndDate(year, month, day, hour, min, sec);
+ }
+ },
+ getDays: function(year, month) {
+ let daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+ if (month === 2) {
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0
+ ? 29
+ : 28;
+ } else {
+ return daysInMonth[month - 1];
+ }
+ },
+ initPick: function(initData) {
+ const date = initData.initStartTime ? new Date(initData.initStartTime.replace(/-/g, '/')): new Date();
+ const endDate = initData.initEndTime ? new Date(initData.initEndTime.replace(/-/g, '/')) : new Date();
+ // const startDate = new Date(date.getTime() - 1000 * 60 * 60 * 24);
+ const startDate = date;
+ const startYear = date.getFullYear();
+ const startMonth = date.getMonth() + 1;
+ const startDay = date.getDate();
+ const startHour = date.getHours();
+ const startMinute = date.getMinutes();
+ const startSecond = date.getSeconds();
+
+ const endYear = endDate.getFullYear();
+ const endMonth = endDate.getMonth() + 1;
+ const endDay = endDate.getDate();
+ const endHour = endDate.getHours();
+ const endMinute = endDate.getMinutes();
+ const endSecond = endDate.getSeconds();
+
+ let YearList = [];
+ let MonthList = [];
+ let DayList = [];
+ let HourList = [];
+ let MinuteList = [];
+ let SecondList = [];
+
+ //设置年份列表
+ for (let i = this.data.yearStart; i <= this.data.yearEnd; i++) {
+ YearList.push(i);
+ }
+
+ // 设置月份列表
+ for (let i = 1; i <= 12; i++) {
+ MonthList.push(i);
+ }
+ // 设置日期列表
+ for (let i = 1; i <= 31; i++) {
+ DayList.push(i);
+ }
+ // 设置时列表
+ for (let i = 0; i <= 23; i++) {
+ if (0 <= i && i < 10) {
+ i = "0" + i;
+ }
+ HourList.push(i);
+ }
+ // 分|秒
+ for (let i = 0; i <= 59; i++) {
+ if (0 <= i && i < 10) {
+ i = "0" + i;
+ }
+ MinuteList.push(i);
+ SecondList.push(i);
+ }
+
+ this.setData({
+ YearList,
+ MonthList,
+ DayList,
+ HourList,
+ MinuteList,
+ SecondList
+ });
+
+ this.setStartDate(startYear, startMonth, startDay, startHour, startMinute, startSecond);
+ this.setEndDate(endYear, endMonth, endDay, endHour, endMinute, endSecond);
+
+ //!!!
+ // setTimeout(() => {
+ // this.setStartDate(nowYear, nowMonth, nowDay, nowHour, nowMinute)
+ // this.setEndDate(nowYear, nowMonth, nowDay, nowHour, nowMinute)
+ // }, 0);
+ },
+ setPickerDateArr(type, year, month, day, hour, minute, second) {
+ let yearIdx = 0;
+ let monthIdx = 0;
+ let dayIdx = 0;
+ let hourIdx = 0;
+ let minuteIdx = 0;
+ let secondIdx = 0;
+
+ this.data.YearList.map((v, idx) => {
+ if (parseInt(v) === year) {
+ yearIdx = idx;
+ }
+ });
+
+ this.data.MonthList.map((v, idx) => {
+ if (parseInt(v) === month) {
+ monthIdx = idx;
+ }
+ });
+
+ // 重新设置日期列表
+ let DayList = [];
+ for (let i = 1; i <= this.getDays(year, month); i++) {
+ DayList.push(i);
+ }
+
+ DayList.map((v, idx) => {
+ if (parseInt(v) === day) {
+ dayIdx = idx;
+ }
+ });
+ if (type == "start") {
+ this.setData({ startDayList: DayList });
+ } else if (type == "end") {
+ this.setData({ endDayList: DayList });
+ }
+
+ this.data.HourList.map((v, idx) => {
+ if (parseInt(v) === parseInt(hour)) {
+ hourIdx = idx;
+ }
+ });
+
+ this.data.MinuteList.map((v, idx) => {
+ if (parseInt(v) === parseInt(minute)) {
+ minuteIdx = idx;
+ }
+ });
+ this.data.SecondList.map((v, idx) => {
+ if (parseInt(v) === parseInt(second)) {
+ secondIdx = idx;
+ }
+ });
+
+ return {
+ yearIdx,
+ monthIdx,
+ dayIdx,
+ hourIdx,
+ minuteIdx,
+ secondIdx
+ };
+ },
+ setStartDate: function(year, month, day, hour, minute, second) {
+ let pickerDateArr = this.setPickerDateArr(
+ "start",
+ year,
+ month,
+ day,
+ hour,
+ minute,
+ second
+ );
+ this.setData({
+ startYearList: this.data.YearList,
+ startMonthList: this.data.MonthList,
+ // startDayList: this.data.DayList,
+ startHourList: this.data.HourList,
+ startMinuteList: this.data.MinuteList,
+ startSecondList: this.data.SecondList,
+ startValue: [
+ pickerDateArr.yearIdx,
+ pickerDateArr.monthIdx,
+ pickerDateArr.dayIdx,
+ pickerDateArr.hourIdx,
+ pickerDateArr.minuteIdx,
+ pickerDateArr.secondIdx
+ ],
+ startPickTime:
+ this.data.YearList[pickerDateArr.yearIdx] +
+ "-" +
+ this.data.MonthList[pickerDateArr.monthIdx] +
+ "-" +
+ this.data.DayList[pickerDateArr.dayIdx] +
+ " " +
+ this.data.HourList[pickerDateArr.hourIdx] +
+ ":" +
+ this.data.MinuteList[pickerDateArr.minuteIdx] +
+ ":" +
+ this.data.SecondList[pickerDateArr.secondIdx]
+ });
+ },
+ setEndDate: function(year, month, day, hour, minute, second) {
+ let pickerDateArr = this.setPickerDateArr(
+ "end",
+ year,
+ month,
+ day,
+ hour,
+ minute,
+ second
+ );
+
+ this.setData({
+ endYearList: this.data.YearList,
+ endMonthList: this.data.MonthList,
+ // endDayList: this.data.DayList,
+ endHourList: this.data.HourList,
+ endMinuteList: this.data.MinuteList,
+ endSecondList: this.data.SecondList,
+ endValue: [
+ pickerDateArr.yearIdx,
+ pickerDateArr.monthIdx,
+ pickerDateArr.dayIdx,
+ pickerDateArr.hourIdx,
+ pickerDateArr.minuteIdx,
+ pickerDateArr.secondIdx
+ ],
+ endPickTime:
+ this.data.YearList[pickerDateArr.yearIdx] +
+ "-" +
+ this.data.MonthList[pickerDateArr.monthIdx] +
+ "-" +
+ this.data.DayList[pickerDateArr.dayIdx] +
+ " " +
+ this.data.HourList[pickerDateArr.hourIdx] +
+ ":" +
+ this.data.MinuteList[pickerDateArr.minuteIdx] +
+ ":" +
+ this.data.SecondList[pickerDateArr.secondIdx]
+ });
+ },
+ }
+});
+
+
+function formatTime(date) {
+
+ if (typeof date == 'string' || 'number') {
+ try {
+ date = date.replace(/-/g, '/')//兼容ios
+ } catch (error) {
+ }
+ date = new Date(date)
+ }
+
+ const year = date.getFullYear()
+ const month = date.getMonth() + 1
+ const day = date.getDate()
+ const hour = date.getHours()
+ const minute = date.getMinutes()
+ const second = date.getSeconds()
+
+ return {
+ str: [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':'),
+ arr: [year, month, day, hour, minute, second]
+ }
+}
+function formatNumber(n) {
+ n = n.toString()
+ return n[1] ? n : '0' + n
+}
diff --git a/components/dynamicForm/components/timePicker/timePicker.json b/components/dynamicForm/components/timePicker/timePicker.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/components/dynamicForm/components/timePicker/timePicker.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/components/dynamicForm/components/timePicker/timePicker.wxml b/components/dynamicForm/components/timePicker/timePicker.wxml
new file mode 100644
index 0000000..963e0dd
--- /dev/null
+++ b/components/dynamicForm/components/timePicker/timePicker.wxml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+ 取消
+ 确定
+
+
+
+
+
+ {{item}}年
+
+
+ {{item}}月
+
+
+ {{item}}日
+
+
+ {{item}}时
+
+
+ {{item}}分
+
+
+ {{item}}秒
+
+
+
+
+
+ 至
+
+
+ {{item}}年
+
+
+ {{item}}月
+
+
+ {{item}}日
+
+
+ {{item}}时
+
+
+ {{item}}分
+
+
+ {{item}}秒
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/dynamicForm/components/timePicker/timePicker.wxss b/components/dynamicForm/components/timePicker/timePicker.wxss
new file mode 100644
index 0000000..ec2c302
--- /dev/null
+++ b/components/dynamicForm/components/timePicker/timePicker.wxss
@@ -0,0 +1,96 @@
+/* components/timePicker/timePicker.wxss */
+
+.picker-item{
+ line-height: 100rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+/* 自定义时间 */
+.picker-container {
+ display: flex;
+ flex-direction: column;
+ /* justify-content: center; */
+ align-items: center;
+
+ width: 100%;
+ overflow: hidden;
+ position: fixed;
+ bottom: -640rpx;
+ left: 0;
+ /* height: 0; */
+ transition: height 0.5s;
+ z-index: 2000;
+ background: white;
+ border-top: 1px solid #EFEFF4;
+}
+.sensorType-screen{
+ width: 100vw;
+ /* height:400rpx; */
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ background: #000;
+ opacity: 0;
+ overflow: hidden;
+ z-index: 1999;
+ color: #fff;
+}
+.sensorTypePicker{
+ width: 690rpx;
+ height: 240rpx;
+ /* padding: 45px 0; */
+}
+.picker-item{
+ line-height: 100rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 32rpx;
+ /* overflow: hidden; */
+}
+.box{
+ padding: 0 20rpx;
+}
+
+/* 至 */
+.to{
+ width:100%;
+ display: flex;
+ justify-content: center;align-items: center;
+ color:rgb(138,138,138);
+ /* font-size:30rpx; */
+}
+
+/* 确定 */
+.sure{
+ width:100%;
+ height:90rpx;
+ border-top: 2rpx solid #EFEFF4;
+ display: flex;justify-content: center;align-items: center;
+ color: rgb(36,123,255);
+ font-size:16px;
+}
+
+.btn-box{
+ width: 100%;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ border-bottom: 2rpx solid #eee;
+}
+.pick_btn{
+ padding: 14rpx 30rpx;
+ color: #ccc;
+ /* background-color: #159; */
+}
+
+.show_picker{
+ /* height: 320px; */
+}
+.hide_picker{
+ /* height: 0; */
+}
diff --git a/components/dynamicForm/index.js b/components/dynamicForm/index.js
new file mode 100644
index 0000000..35cafe6
--- /dev/null
+++ b/components/dynamicForm/index.js
@@ -0,0 +1,291 @@
+// components/dynamicForm/index.js
+import formatTime from './utils/formatTime';
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ formData: Array,
+ showSubmitBtn: {
+ type: Boolean,
+ value: true
+ },
+ toSubmit: Number
+ },
+ //监听数据变化, 当toSubmit 值变化时, 代表父组件点击提交案例事件
+ observers: {
+ 'toSubmit': function (e) {
+ if (e) {
+ this.formSubmit();
+ }
+ },
+ 'formData': function () {
+ this.formInit();
+ }
+ },
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ pickerMap: {},
+ fileMap: {},
+ inputMap: {}
+ },
+ lifetimes: {
+ attached: function () {
+ this.formInit();
+ },
+ moved: function () { },
+ detached: function () { },
+ },
+ pageLifetimes: {
+ // 组件所在页面的生命周期函数
+ show: function () { },
+ hide: function () { },
+ resize: function () { },
+ },
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ //表单初始化
+ formInit() {
+
+ const pickerMap = {}, fileMap = {}, inputMap = {}, dateMap = {};//存储各表单变化后的值,表单id为索引
+ const pickers = [], files = [], inputs = [], datePickers = [];
+ this.data.formData.forEach(val => {
+ switch (val.type) {
+ case 'picker':
+ pickers.push(val);
+ break;
+ case 'file':
+ files.push(val);
+ break;
+ case 'input':
+ case 'textarea':
+ inputs.push(val);
+ break;
+ case 'date':
+ datePickers.push(val);
+ break;
+ default:
+ break;
+ }
+ });
+ pickers.forEach(val => {
+ pickerMap[val.id] = {
+ original: val,
+ hasChoose: val.defaultIdx != 'undefined',
+ error:null,
+ idx: val.defaultIdx || 0
+ };
+ });
+ files.forEach(val => {
+ fileMap[val.id] = {
+ original: val,
+ error: null,
+ list: val.fileList
+ };
+ });
+ inputs.forEach(val => {
+ inputMap[val.id] = {
+ original: val,
+ value: val.defaultValue || '',
+ placeholder: val.placeholder,
+ error: null,
+ rules: val.rules ? val.rules.map(val => {
+ val.regular = new RegExp(val.regular);
+ return val;
+ }) : []
+ };
+ });
+ datePickers.forEach(val => {
+ dateMap[val.id] = {
+ original: val,
+ config: val.config,
+ completeTime: val.completeTime,
+ show: false,
+ hasChoose: !!val.config.initStartTime,
+ error: null,
+ startDate: val.config.initStartTime || formatTime(),
+ endDate: val.config.initEndTime || formatTime()
+ };
+ if (!val.completeTime){
+ dateMap[val.id].startDate = dateMap[val.id].startDate.split(' ')[0];
+ dateMap[val.id].endDate = dateMap[val.id].endDate.split(' ')[0];
+ }
+ });
+ this.setData({
+ pickers,
+ inputs,
+ datePickers,
+ files,
+ pickerMap,
+ inputMap,
+ fileMap,
+ dateMap
+ });
+ },
+ //提交表单
+ formSubmit() {
+ let formData = {};
+ const { pickerMap, inputMap, dateMap, fileMap } = this.data;
+ for (let i in this.data) { //获取表单数据后缀为Map
+ if (i.match(/Map$/)) {
+ formData = Object.assign({}, formData, this.data[i]);
+ }
+ }
+ let hasError = false;
+ for (let i in formData) {//循环验证所有表单数据规则
+ let info = formData[i];
+ if (info.original.type === 'input' || info.original.type === 'textarea') {
+ if (!info.value){
+ if (info.original.isRequired){
+ info.error = info.original.lable + '不可为空';
+ hasError = true;
+ }
+ } else if (info.rules){
+ for (let val of info.rules) {
+ if (!info.value.match(val.regular)) {
+ info.error = val.tips || '格式有误';
+ hasError = true;
+ break;
+ }
+ }
+ }
+ this.setData({
+ [`inputMap.${i}`]: info
+ });
+ } else if (info.original.type === 'file') {
+ if (info.list.length === 0 && info.original.isRequired) {
+ let error = '请选择文件';
+ if (info.original.accept === 'video') {
+ error = '请选择视频';
+ } else if (info.original.accept === 'image') {
+ error = '请选择图片';
+ }
+ info.error = error;
+ hasError = true;
+ this.setData({
+ [`fileMap.${i}`]: info
+ });
+ }
+ } else if (info.original.type === 'picker' || info.original.type === 'date'){
+ if (!info.hasChoose && info.original.isRequired){
+ info.error = '请选择' + info.original.lable;
+ hasError = true;
+ this.setData({
+ [`${info.original.type}Map.${i}`]: info
+ });
+ }
+ }
+ }
+ if (hasError) {
+ wx.showToast({
+ title: '表单填写有误',
+ icon: 'none'
+ });
+ return;
+ }
+ this.triggerEvent('dynamicFormSubmit', formData);
+ console.log(formData);
+
+ },
+ //更新数据劫持
+ updateData(key,val){
+ this.setData({
+ [key]: val
+ });
+ this.triggerEvent('dynamicFormChange', { key, val});
+ },
+ //显示选择器
+ datePickerShow(e) {
+ if (e.target.dataset.disabled) {
+ return;
+ }
+ this.setData({
+ [`dateMap.${e.target.dataset.id}.show`]: true
+ });
+ },
+ //隐藏时间选择器
+ datePickerHide(id) {
+ if (typeof id === 'object') {
+ id = id.target.id;
+ }
+ this.setData({
+ [`dateMap.${id}.show`]: false
+ });
+ },
+ //设置选择器时间
+ setPickerTime(e) {
+ const {dateMap} = this.data;
+ const { startTime, endTime } = e.detail;
+ const date = dateMap[e.target.id];
+ if (!date.hasChoose){
+ date.hasChoose = true;
+ date.error = null;
+ }
+ date.show = false;
+ date.startDate = date.completeTime ? startTime :startTime.split(' ')[0];
+ date.endDate = date.completeTime ?endTime :endTime.split(' ')[0];
+ this.updateData(`dateMap.${e.target.id}`,date);
+ },
+ //输入框
+ onInput(e) {
+ const { value } = e.detail;
+ const info = this.data.inputMap[e.target.id] || {};
+ if (!info) {
+ return;
+ }
+ info.value = e.detail.value;
+ info.error = null;
+ if (info.rules && info.value) {
+ for (let val of info.rules) {
+ if (!info.value.match(val.regular)) {
+ info.error = val.tips || '格式有误';
+ break;
+ }
+ }
+ }
+ this.updateData(`inputMap.${e.target.id}`, info);
+ },
+ //picker选择
+ onPickerChange(e) {
+ const { id } = e.target;
+ const picker = this.data.pickerMap[id];
+ if(!picker.hasChoose){
+ picker.hasChoose = true;
+ picker.error = null;
+ }
+ picker.idx = e.detail.value;
+ picker.data = this.data.pickers.filter(val => val.id === id)[0].range[e.detail.value];
+ this.updateData(`pickerMap.${e.target.id}`, picker);
+ },
+ // 选择文件
+ onFileRead(e) {
+ console.log(e);
+ for (let val of e.detail.file) {
+ const size = this.data.fileMap[e.target.id].original.maxSize;
+ if (val.size > size * 1024 * 1024) {
+ wx.showToast({
+ title: `请选择${size}MB以内的文件`,
+ icon: 'none'
+ });
+ return;
+ }
+ }
+ const files = this.data.fileMap[e.target.id];
+ files.error = null;
+ files.list = files.list.concat(e.detail.file);
+ this.updateData(`fileMap.${e.target.id}`, files);
+ },
+ //删除文件
+ onFileDelete(e) {
+ console.log(e);
+ const files = this.data.fileMap[e.target.id].list;
+ files.splice(e.detail.index, 1);
+ this.updateData(`fileMap.${e.target.id}.list`, files);
+ }
+ }
+});
diff --git a/components/dynamicForm/index.json b/components/dynamicForm/index.json
new file mode 100644
index 0000000..9fe4286
--- /dev/null
+++ b/components/dynamicForm/index.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "van-icon": "./vant/icon/index",
+ "van-uploader": "./vant/uploader/index",
+ "time-picker": "./components/timePicker/timePicker"
+ }
+}
\ No newline at end of file
diff --git a/components/dynamicForm/index.wxml b/components/dynamicForm/index.wxml
new file mode 100644
index 0000000..931dec9
--- /dev/null
+++ b/components/dynamicForm/index.wxml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+ {{item.lable}}
+
+
+ {{item.defaultValue || ''}}
+ {{inputMap[item.id].error}}
+
+
+
+
+ {{item.lable}}
+
+
+
+ {{pickerMap[item.id].hasChoose?item.range[pickerMap[item.id].idx].name:'请选择'}}
+
+
+
+ {{pickerMap[item.id].hasChoose?item.range[pickerMap[item.id].idx].name:''}}
+ {{pickerMap[item.id].error}}
+
+
+
+
+ {{item.lable}}
+
+
+ {{dateMap[item.id].hasChoose?(dateMap[item.id].config.endDate?dateMap[item.id].startDate+' ~ ' + dateMap[item.id].endDate: dateMap[item.id].startDate):'请选择'}}
+
+
+
+ {{dateMap[item.id].error}}
+
+
+
+
+
+ {{item.lable}}
+ {{inputMap[item.id].error}}
+
+
+
+ {{inputMap[item.id].value.length||0}}/{{item.maxLength}}
+
+
+
+
+
+
+
+ {{item.lable}}
+ {{fileMap[item.id].error}}
+
+
+
+
+
+
diff --git a/components/dynamicForm/index.wxss b/components/dynamicForm/index.wxss
new file mode 100644
index 0000000..f1b7e23
--- /dev/null
+++ b/components/dynamicForm/index.wxss
@@ -0,0 +1,119 @@
+/* components/dynamicForm/index.wxss */
+.page{
+ background-color: #eeeeef;
+ padding-top: 1px;
+ padding-bottom: 1px;
+}
+.flex{
+ display: flex;
+ align-items: center;
+}
+.form-box{
+ padding: 0 30rpx 0px;
+ padding-right: 0;
+ margin: 30rpx;
+ box-sizing: border-box;
+ border-top: 1px solid #eee;
+ border-radius: 10rpx;
+ background-color: #fff;
+}
+.form-row{
+ position: relative;
+ display: flex;
+ align-items: center;
+ padding: 25rpx 0;
+ font-size: 30rpx;
+ border-bottom: 1px solid #eee;
+}
+.ipt-row{
+ align-items: flex-start;
+}
+.flex-start{
+ align-items: flex-start;
+}
+.picker-row{
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+.form-row:last-child{
+ border-bottom: none;
+}
+.form-lable{
+ position: relative;
+ min-width: 120rpx;
+ max-width: 200rpx;
+ word-break: break-all;
+ padding-right: 30rpx;
+ flex-shrink: 0;
+ flex-grow: 0;
+ font-weight: 700;
+}
+.field{
+ width: 100%;
+ flex-grow: 1;
+ min-height: 45rpx;
+ padding-right: 30rpx;
+ box-sizing: border-box;
+ line-height: 45rpx;
+}
+.error-info{
+ font-size: 24rpx;
+ color: #f00;
+}
+.required::before{
+ position: absolute;
+ top: 50%;
+ left: -18rpx;
+ transform: translateY(-35%);
+ content: '*';
+ color: #f00;
+ font-size: 36rpx;
+}
+.form-btn{
+ margin: 60rpx auto;
+ width: 400rpx;
+ background-color: #17e;
+ color: #fff;
+}
+.row-icon{
+ padding-right: 20rpx;
+}
+.img-box{
+ padding-top: 25rpx;
+ /* padding-bottom: 25rpx; */
+}
+.mb-24{
+ margin-bottom: 24rpx;
+}
+.area-lable{
+ position: relative;
+ font-size: 30rpx;
+ margin-right: 20rpx;
+ font-weight: 700;
+}
+.textarea-box{
+ padding-top: 20rpx;
+}
+.text-area{
+ position: relative;
+ width: 630rpx;
+ padding: 20rpx;
+ padding-bottom: 60rpx;
+ font-size: 30rpx;
+ min-height: 200rpx;
+ box-sizing: border-box;
+ border-radius: 8rpx;
+ border: 1px solid #eee;
+}
+.text-num{
+ position: absolute;
+ right: 20rpx;
+ bottom: 10px;
+ text-align: right;
+ color: #999;
+}
+
+.disabled{
+ opacity: 0.3;
+}
\ No newline at end of file
diff --git a/components/dynamicForm/utils/formatTime.js b/components/dynamicForm/utils/formatTime.js
new file mode 100644
index 0000000..50df5f2
--- /dev/null
+++ b/components/dynamicForm/utils/formatTime.js
@@ -0,0 +1,29 @@
+const formatTime = date => {
+ if (!date) {
+ date = new Date();
+ }
+ if(typeof date === 'string'){
+ date = new Date(date);
+ if(!date){
+ date = new Date(date.replace(/-/g, '/'));//兼容IOS new Date()
+ }
+ }
+ if(typeof date === 'number'){
+ date = new Date(date);
+ }
+ const year = date.getFullYear();
+ const month = date.getMonth() + 1;
+ const day = date.getDate();
+ const hour = date.getHours();
+ const minute = date.getMinutes();
+ const second = date.getSeconds();
+
+ return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':');
+};
+
+const formatNumber = n => {
+ n = n.toString();
+ return n[1] ? n : '0' + n;
+};
+
+export default formatTime;
diff --git a/components/dynamicForm/vant/common/color.d.ts b/components/dynamicForm/vant/common/color.d.ts
new file mode 100644
index 0000000..386f307
--- /dev/null
+++ b/components/dynamicForm/vant/common/color.d.ts
@@ -0,0 +1,7 @@
+export declare const RED = "#ee0a24";
+export declare const BLUE = "#1989fa";
+export declare const WHITE = "#fff";
+export declare const GREEN = "#07c160";
+export declare const ORANGE = "#ff976a";
+export declare const GRAY = "#323233";
+export declare const GRAY_DARK = "#969799";
diff --git a/components/dynamicForm/vant/common/color.js b/components/dynamicForm/vant/common/color.js
new file mode 100644
index 0000000..6b285bd
--- /dev/null
+++ b/components/dynamicForm/vant/common/color.js
@@ -0,0 +1,7 @@
+export const RED = '#ee0a24';
+export const BLUE = '#1989fa';
+export const WHITE = '#fff';
+export const GREEN = '#07c160';
+export const ORANGE = '#ff976a';
+export const GRAY = '#323233';
+export const GRAY_DARK = '#969799';
diff --git a/components/dynamicForm/vant/common/component.d.ts b/components/dynamicForm/vant/common/component.d.ts
new file mode 100644
index 0000000..307a96c
--- /dev/null
+++ b/components/dynamicForm/vant/common/component.d.ts
@@ -0,0 +1,3 @@
+import { VantComponentOptions, CombinedComponentInstance } from '../definitions/index';
+declare function VantComponent(vantOptions?: VantComponentOptions>): void;
+export { VantComponent };
diff --git a/components/dynamicForm/vant/common/component.js b/components/dynamicForm/vant/common/component.js
new file mode 100644
index 0000000..63ef1a9
--- /dev/null
+++ b/components/dynamicForm/vant/common/component.js
@@ -0,0 +1,48 @@
+import { basic } from '../mixins/basic';
+import { observe } from '../mixins/observer/index';
+function mapKeys(source, target, map) {
+ Object.keys(map).forEach(key => {
+ if (source[key]) {
+ target[map[key]] = source[key];
+ }
+ });
+}
+function VantComponent(vantOptions = {}) {
+ const options = {};
+ mapKeys(vantOptions, options, {
+ data: 'data',
+ props: 'properties',
+ mixins: 'behaviors',
+ methods: 'methods',
+ beforeCreate: 'created',
+ created: 'attached',
+ mounted: 'ready',
+ relations: 'relations',
+ destroyed: 'detached',
+ classes: 'externalClasses'
+ });
+ const { relation } = vantOptions;
+ if (relation) {
+ options.relations = Object.assign(options.relations || {}, {
+ [`../${relation.name}/index`]: relation
+ });
+ }
+ // add default externalClasses
+ options.externalClasses = options.externalClasses || [];
+ options.externalClasses.push('custom-class');
+ // add default behaviors
+ options.behaviors = options.behaviors || [];
+ options.behaviors.push(basic);
+ // map field to form-field behavior
+ if (vantOptions.field) {
+ options.behaviors.push('wx://form-field');
+ }
+ // add default options
+ options.options = {
+ multipleSlots: true,
+ addGlobalClass: true
+ };
+ observe(vantOptions, options);
+ Component(options);
+}
+export { VantComponent };
diff --git a/components/dynamicForm/vant/common/index.wxss b/components/dynamicForm/vant/common/index.wxss
new file mode 100644
index 0000000..6e6891f
--- /dev/null
+++ b/components/dynamicForm/vant/common/index.wxss
@@ -0,0 +1 @@
+.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
\ No newline at end of file
diff --git a/components/dynamicForm/vant/common/style/clearfix.wxss b/components/dynamicForm/vant/common/style/clearfix.wxss
new file mode 100644
index 0000000..a0ca838
--- /dev/null
+++ b/components/dynamicForm/vant/common/style/clearfix.wxss
@@ -0,0 +1 @@
+.van-clearfix:after{display:table;clear:both;content:""}
\ No newline at end of file
diff --git a/components/dynamicForm/vant/common/style/ellipsis.wxss b/components/dynamicForm/vant/common/style/ellipsis.wxss
new file mode 100644
index 0000000..1e9dbc9
--- /dev/null
+++ b/components/dynamicForm/vant/common/style/ellipsis.wxss
@@ -0,0 +1 @@
+.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}
\ No newline at end of file
diff --git a/components/dynamicForm/vant/common/style/hairline.wxss b/components/dynamicForm/vant/common/style/hairline.wxss
new file mode 100644
index 0000000..f64e2f8
--- /dev/null
+++ b/components/dynamicForm/vant/common/style/hairline.wxss
@@ -0,0 +1 @@
+.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
\ No newline at end of file
diff --git a/components/dynamicForm/vant/common/style/mixins/clearfix.wxss b/components/dynamicForm/vant/common/style/mixins/clearfix.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/components/dynamicForm/vant/common/style/mixins/ellipsis.wxss b/components/dynamicForm/vant/common/style/mixins/ellipsis.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/components/dynamicForm/vant/common/style/mixins/hairline.wxss b/components/dynamicForm/vant/common/style/mixins/hairline.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/components/dynamicForm/vant/common/style/theme.wxss b/components/dynamicForm/vant/common/style/theme.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/components/dynamicForm/vant/common/style/var.wxss b/components/dynamicForm/vant/common/style/var.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/components/dynamicForm/vant/common/utils.d.ts b/components/dynamicForm/vant/common/utils.d.ts
new file mode 100644
index 0000000..9fad27d
--- /dev/null
+++ b/components/dynamicForm/vant/common/utils.d.ts
@@ -0,0 +1,8 @@
+///
+export declare function isDef(value: any): boolean;
+export declare function isObj(x: any): boolean;
+export declare function isNumber(value: any): boolean;
+export declare function range(num: number, min: number, max: number): number;
+export declare function nextTick(fn: Function): void;
+export declare function getSystemInfoSync(): WechatMiniprogram.GetSystemInfoSuccessCallbackResult;
+export declare function addUnit(value?: string | number): string | undefined;
diff --git a/components/dynamicForm/vant/common/utils.js b/components/dynamicForm/vant/common/utils.js
new file mode 100644
index 0000000..cc0f8f1
--- /dev/null
+++ b/components/dynamicForm/vant/common/utils.js
@@ -0,0 +1,32 @@
+export function isDef(value) {
+ return value !== undefined && value !== null;
+}
+export function isObj(x) {
+ const type = typeof x;
+ return x !== null && (type === 'object' || type === 'function');
+}
+export function isNumber(value) {
+ return /^\d+(\.\d+)?$/.test(value);
+}
+export function range(num, min, max) {
+ return Math.min(Math.max(num, min), max);
+}
+export function nextTick(fn) {
+ setTimeout(() => {
+ fn();
+ }, 1000 / 30);
+}
+let systemInfo = null;
+export function getSystemInfoSync() {
+ if (systemInfo == null) {
+ systemInfo = wx.getSystemInfoSync();
+ }
+ return systemInfo;
+}
+export function addUnit(value) {
+ if (!isDef(value)) {
+ return undefined;
+ }
+ value = String(value);
+ return isNumber(value) ? `${value}px` : value;
+}
diff --git a/components/dynamicForm/vant/icon/index.d.ts b/components/dynamicForm/vant/icon/index.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/components/dynamicForm/vant/icon/index.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/components/dynamicForm/vant/icon/index.js b/components/dynamicForm/vant/icon/index.js
new file mode 100644
index 0000000..2cfe253
--- /dev/null
+++ b/components/dynamicForm/vant/icon/index.js
@@ -0,0 +1,27 @@
+import { VantComponent } from '../common/component';
+VantComponent({
+ props: {
+ dot: Boolean,
+ info: null,
+ size: null,
+ color: String,
+ customStyle: String,
+ classPrefix: {
+ type: String,
+ value: 'van-icon'
+ },
+ name: {
+ type: String,
+ observer(val) {
+ this.setData({
+ isImageName: val.indexOf('/') !== -1
+ });
+ }
+ }
+ },
+ methods: {
+ onClick() {
+ this.$emit('click');
+ }
+ }
+});
diff --git a/components/dynamicForm/vant/icon/index.json b/components/dynamicForm/vant/icon/index.json
new file mode 100644
index 0000000..bf0ebe0
--- /dev/null
+++ b/components/dynamicForm/vant/icon/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "van-info": "../info/index"
+ }
+}
diff --git a/components/dynamicForm/vant/icon/index.wxml b/components/dynamicForm/vant/icon/index.wxml
new file mode 100644
index 0000000..b536511
--- /dev/null
+++ b/components/dynamicForm/vant/icon/index.wxml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
diff --git a/components/dynamicForm/vant/icon/index.wxss b/components/dynamicForm/vant/icon/index.wxss
new file mode 100644
index 0000000..cf2c506
--- /dev/null
+++ b/components/dynamicForm/vant/icon/index.wxss
@@ -0,0 +1 @@
+@import '../common/index.wxss';@font-face{font-weight:400;font-family:vant-icon;font-style:normal;font-display:auto;src:url(https://img.yzcdn.cn/vant/vant-icon-d3825a.woff2) format("woff2"),url(https://img.yzcdn.cn/vant/vant-icon-d3825a.woff) format("woff"),url(https://img.yzcdn.cn/vant/vant-icon-d3825a.ttf) format("truetype")}.van-icon{position:relative;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}.van-icon,.van-icon:before{display:inline-block}.van-icon-add-o:before{content:"\F000"}.van-icon-add-square:before{content:"\F001"}.van-icon-add:before{content:"\F002"}.van-icon-after-sale:before{content:"\F003"}.van-icon-aim:before{content:"\F004"}.van-icon-alipay:before{content:"\F005"}.van-icon-apps-o:before{content:"\F006"}.van-icon-arrow-down:before{content:"\F007"}.van-icon-arrow-left:before{content:"\F008"}.van-icon-arrow-up:before{content:"\F009"}.van-icon-arrow:before{content:"\F00A"}.van-icon-ascending:before{content:"\F00B"}.van-icon-audio:before{content:"\F00C"}.van-icon-award-o:before{content:"\F00D"}.van-icon-award:before{content:"\F00E"}.van-icon-bag-o:before{content:"\F00F"}.van-icon-bag:before{content:"\F010"}.van-icon-balance-list-o:before{content:"\F011"}.van-icon-balance-list:before{content:"\F012"}.van-icon-balance-o:before{content:"\F013"}.van-icon-balance-pay:before{content:"\F014"}.van-icon-bar-chart-o:before{content:"\F015"}.van-icon-bars:before{content:"\F016"}.van-icon-bell:before{content:"\F017"}.van-icon-bill-o:before{content:"\F018"}.van-icon-bill:before{content:"\F019"}.van-icon-birthday-cake-o:before{content:"\F01A"}.van-icon-bookmark-o:before{content:"\F01B"}.van-icon-bookmark:before{content:"\F01C"}.van-icon-browsing-history-o:before{content:"\F01D"}.van-icon-browsing-history:before{content:"\F01E"}.van-icon-brush-o:before{content:"\F01F"}.van-icon-bulb-o:before{content:"\F020"}.van-icon-bullhorn-o:before{content:"\F021"}.van-icon-calender-o:before{content:"\F022"}.van-icon-card:before{content:"\F023"}.van-icon-cart-circle-o:before{content:"\F024"}.van-icon-cart-circle:before{content:"\F025"}.van-icon-cart-o:before{content:"\F026"}.van-icon-cart:before{content:"\F027"}.van-icon-cash-back-record:before{content:"\F028"}.van-icon-cash-on-deliver:before{content:"\F029"}.van-icon-cashier-o:before{content:"\F02A"}.van-icon-certificate:before{content:"\F02B"}.van-icon-chart-trending-o:before{content:"\F02C"}.van-icon-chat-o:before{content:"\F02D"}.van-icon-chat:before{content:"\F02E"}.van-icon-checked:before{content:"\F02F"}.van-icon-circle:before{content:"\F030"}.van-icon-clear:before{content:"\F031"}.van-icon-clock-o:before{content:"\F032"}.van-icon-clock:before{content:"\F033"}.van-icon-close:before{content:"\F034"}.van-icon-closed-eye:before{content:"\F035"}.van-icon-cluster-o:before{content:"\F036"}.van-icon-cluster:before{content:"\F037"}.van-icon-column:before{content:"\F038"}.van-icon-comment-circle-o:before{content:"\F039"}.van-icon-comment-circle:before{content:"\F03A"}.van-icon-comment-o:before{content:"\F03B"}.van-icon-comment:before{content:"\F03C"}.van-icon-completed:before{content:"\F03D"}.van-icon-contact:before{content:"\F03E"}.van-icon-coupon-o:before{content:"\F03F"}.van-icon-coupon:before{content:"\F040"}.van-icon-credit-pay:before{content:"\F041"}.van-icon-cross:before{content:"\F042"}.van-icon-debit-pay:before{content:"\F043"}.van-icon-delete:before{content:"\F044"}.van-icon-descending:before{content:"\F045"}.van-icon-description:before{content:"\F046"}.van-icon-desktop-o:before{content:"\F047"}.van-icon-diamond-o:before{content:"\F048"}.van-icon-diamond:before{content:"\F049"}.van-icon-discount:before{content:"\F04A"}.van-icon-down:before{content:"\F04B"}.van-icon-ecard-pay:before{content:"\F04C"}.van-icon-edit:before{content:"\F04D"}.van-icon-ellipsis:before{content:"\F04E"}.van-icon-empty:before{content:"\F04F"}.van-icon-envelop-o:before{content:"\F050"}.van-icon-exchange:before{content:"\F051"}.van-icon-expand-o:before{content:"\F052"}.van-icon-expand:before{content:"\F053"}.van-icon-eye-o:before{content:"\F054"}.van-icon-eye:before{content:"\F055"}.van-icon-fail:before{content:"\F056"}.van-icon-failure:before{content:"\F057"}.van-icon-filter-o:before{content:"\F058"}.van-icon-fire-o:before{content:"\F059"}.van-icon-fire:before{content:"\F05A"}.van-icon-flag-o:before{content:"\F05B"}.van-icon-flower-o:before{content:"\F05C"}.van-icon-free-postage:before{content:"\F05D"}.van-icon-friends-o:before{content:"\F05E"}.van-icon-friends:before{content:"\F05F"}.van-icon-gem-o:before{content:"\F060"}.van-icon-gem:before{content:"\F061"}.van-icon-gift-card-o:before{content:"\F062"}.van-icon-gift-card:before{content:"\F063"}.van-icon-gift-o:before{content:"\F064"}.van-icon-gift:before{content:"\F065"}.van-icon-gold-coin-o:before{content:"\F066"}.van-icon-gold-coin:before{content:"\F067"}.van-icon-good-job-o:before{content:"\F068"}.van-icon-good-job:before{content:"\F069"}.van-icon-goods-collect-o:before{content:"\F06A"}.van-icon-goods-collect:before{content:"\F06B"}.van-icon-graphic:before{content:"\F06C"}.van-icon-home-o:before{content:"\F06D"}.van-icon-hot-o:before{content:"\F06E"}.van-icon-hot-sale-o:before{content:"\F06F"}.van-icon-hot-sale:before{content:"\F070"}.van-icon-hot:before{content:"\F071"}.van-icon-hotel-o:before{content:"\F072"}.van-icon-idcard:before{content:"\F073"}.van-icon-info-o:before{content:"\F074"}.van-icon-info:before{content:"\F075"}.van-icon-invition:before{content:"\F076"}.van-icon-label-o:before{content:"\F077"}.van-icon-label:before{content:"\F078"}.van-icon-like-o:before{content:"\F079"}.van-icon-like:before{content:"\F07A"}.van-icon-live:before{content:"\F07B"}.van-icon-location-o:before{content:"\F07C"}.van-icon-location:before{content:"\F07D"}.van-icon-lock:before{content:"\F07E"}.van-icon-logistics:before{content:"\F07F"}.van-icon-manager-o:before{content:"\F080"}.van-icon-manager:before{content:"\F081"}.van-icon-map-marked:before{content:"\F082"}.van-icon-medal-o:before{content:"\F083"}.van-icon-medal:before{content:"\F084"}.van-icon-more-o:before{content:"\F085"}.van-icon-more:before{content:"\F086"}.van-icon-music-o:before{content:"\F087"}.van-icon-music:before{content:"\F088"}.van-icon-new-arrival-o:before{content:"\F089"}.van-icon-new-arrival:before{content:"\F08A"}.van-icon-new-o:before{content:"\F08B"}.van-icon-new:before{content:"\F08C"}.van-icon-newspaper-o:before{content:"\F08D"}.van-icon-notes-o:before{content:"\F08E"}.van-icon-orders-o:before{content:"\F08F"}.van-icon-other-pay:before{content:"\F090"}.van-icon-paid:before{content:"\F091"}.van-icon-passed:before{content:"\F092"}.van-icon-pause-circle-o:before{content:"\F093"}.van-icon-pause-circle:before{content:"\F094"}.van-icon-pause:before{content:"\F095"}.van-icon-peer-pay:before{content:"\F096"}.van-icon-pending-payment:before{content:"\F097"}.van-icon-phone-circle-o:before{content:"\F098"}.van-icon-phone-circle:before{content:"\F099"}.van-icon-phone-o:before{content:"\F09A"}.van-icon-phone:before{content:"\F09B"}.van-icon-photo-o:before{content:"\F09C"}.van-icon-photo:before{content:"\F09D"}.van-icon-photograph:before{content:"\F09E"}.van-icon-play-circle-o:before{content:"\F09F"}.van-icon-play-circle:before{content:"\F0A0"}.van-icon-play:before{content:"\F0A1"}.van-icon-plus:before{content:"\F0A2"}.van-icon-point-gift-o:before{content:"\F0A3"}.van-icon-point-gift:before{content:"\F0A4"}.van-icon-points:before{content:"\F0A5"}.van-icon-printer:before{content:"\F0A6"}.van-icon-qr-invalid:before{content:"\F0A7"}.van-icon-qr:before{content:"\F0A8"}.van-icon-question-o:before{content:"\F0A9"}.van-icon-question:before{content:"\F0AA"}.van-icon-records:before{content:"\F0AB"}.van-icon-refund-o:before{content:"\F0AC"}.van-icon-replay:before{content:"\F0AD"}.van-icon-scan:before{content:"\F0AE"}.van-icon-search:before{content:"\F0AF"}.van-icon-send-gift-o:before{content:"\F0B0"}.van-icon-send-gift:before{content:"\F0B1"}.van-icon-service-o:before{content:"\F0B2"}.van-icon-service:before{content:"\F0B3"}.van-icon-setting-o:before{content:"\F0B4"}.van-icon-setting:before{content:"\F0B5"}.van-icon-share:before{content:"\F0B6"}.van-icon-shop-collect-o:before{content:"\F0B7"}.van-icon-shop-collect:before{content:"\F0B8"}.van-icon-shop-o:before{content:"\F0B9"}.van-icon-shop:before{content:"\F0BA"}.van-icon-shopping-cart-o:before{content:"\F0BB"}.van-icon-shopping-cart:before{content:"\F0BC"}.van-icon-shrink:before{content:"\F0BD"}.van-icon-sign:before{content:"\F0BE"}.van-icon-smile-comment-o:before{content:"\F0BF"}.van-icon-smile-comment:before{content:"\F0C0"}.van-icon-smile-o:before{content:"\F0C1"}.van-icon-smile:before{content:"\F0C2"}.van-icon-star-o:before{content:"\F0C3"}.van-icon-star:before{content:"\F0C4"}.van-icon-stop-circle-o:before{content:"\F0C5"}.van-icon-stop-circle:before{content:"\F0C6"}.van-icon-stop:before{content:"\F0C7"}.van-icon-success:before{content:"\F0C8"}.van-icon-thumb-circle-o:before{content:"\F0C9"}.van-icon-thumb-circle:before{content:"\F0CA"}.van-icon-todo-list-o:before{content:"\F0CB"}.van-icon-todo-list:before{content:"\F0CC"}.van-icon-tosend:before{content:"\F0CD"}.van-icon-tv-o:before{content:"\F0CE"}.van-icon-umbrella-circle:before{content:"\F0CF"}.van-icon-underway-o:before{content:"\F0D0"}.van-icon-underway:before{content:"\F0D1"}.van-icon-upgrade:before{content:"\F0D2"}.van-icon-user-circle-o:before{content:"\F0D3"}.van-icon-user-o:before{content:"\F0D4"}.van-icon-video-o:before{content:"\F0D5"}.van-icon-video:before{content:"\F0D6"}.van-icon-vip-card-o:before{content:"\F0D7"}.van-icon-vip-card:before{content:"\F0D8"}.van-icon-volume-o:before{content:"\F0D9"}.van-icon-volume:before{content:"\F0DA"}.van-icon-wap-home-o:before{content:"\F0DB"}.van-icon-wap-home:before{content:"\F0DC"}.van-icon-wap-nav:before{content:"\F0DD"}.van-icon-warn-o:before{content:"\F0DE"}.van-icon-warning-o:before{content:"\F0DF"}.van-icon-warning:before{content:"\F0E0"}.van-icon-weapp-nav:before{content:"\F0E1"}.van-icon-wechat:before{content:"\F0E2"}.van-icon-youzan-shield:before{content:"\F0E3"}:host{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-icon--image{width:1em;height:1em}.van-icon__image{width:100%;height:100%}.van-icon__info{z-index:1}
\ No newline at end of file
diff --git a/components/dynamicForm/vant/info/index.d.ts b/components/dynamicForm/vant/info/index.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/components/dynamicForm/vant/info/index.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/components/dynamicForm/vant/info/index.js b/components/dynamicForm/vant/info/index.js
new file mode 100644
index 0000000..a7ce835
--- /dev/null
+++ b/components/dynamicForm/vant/info/index.js
@@ -0,0 +1,12 @@
+import { VantComponent } from '../common/component';
+
+VantComponent({
+ props: {
+ dot: Boolean,
+ info: null,
+ customStyle: String
+ },
+ data: {
+ // classBem: utils.bem('info', { dot })
+ }
+});
diff --git a/components/dynamicForm/vant/info/index.json b/components/dynamicForm/vant/info/index.json
new file mode 100644
index 0000000..467ce29
--- /dev/null
+++ b/components/dynamicForm/vant/info/index.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
diff --git a/components/dynamicForm/vant/info/index.wxml b/components/dynamicForm/vant/info/index.wxml
new file mode 100644
index 0000000..7ad29be
--- /dev/null
+++ b/components/dynamicForm/vant/info/index.wxml
@@ -0,0 +1,8 @@
+
+
+{{ dot ? '' : info }}
+
\ No newline at end of file
diff --git a/components/dynamicForm/vant/info/index.wxss b/components/dynamicForm/vant/info/index.wxss
new file mode 100644
index 0000000..16e3f32
--- /dev/null
+++ b/components/dynamicForm/vant/info/index.wxss
@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-info{position:absolute;top:0;right:0;box-sizing:border-box;white-space:nowrap;text-align:center;-webkit-transform:translate(50%,-50%);transform:translate(50%,-50%);-webkit-transform-origin:100%;transform-origin:100%;min-width:16px;min-width:var(--info-size,16px);padding:0 3px;padding:var(--info-padding,0 3px);color:#fff;color:var(--info-color,#fff);font-weight:500;font-weight:var(--info-font-weight,500);font-size:12px;font-size:var(--info-font-size,12px);font-family:PingFang SC,Helvetica Neue,Arial,sans-serif;font-family:var(--info-font-family,PingFang SC,Helvetica Neue,Arial,sans-serif);line-height:14px;line-height:calc(var(--info-size, 16px) - var(--info-border-width, 1px)*2);background-color:#ee0a24;background-color:var(--info-background-color,#ee0a24);border:1px solid #fff;border:var(--info-border-width,1px) solid var(--white,#fff);border-radius:16px;border-radius:var(--info-size,16px)}.van-info--dot{min-width:0;border-radius:100%;width:8px;width:var(--info-dot-size,8px);height:8px;height:var(--info-dot-size,8px);background-color:#ee0a24;background-color:var(--info-dot-color,#ee0a24)}
\ No newline at end of file
diff --git a/components/dynamicForm/vant/mixins/basic.js b/components/dynamicForm/vant/mixins/basic.js
new file mode 100644
index 0000000..db7087e
--- /dev/null
+++ b/components/dynamicForm/vant/mixins/basic.js
@@ -0,0 +1,22 @@
+export var basic = Behavior({
+ methods: {
+ $emit: function $emit() {
+ this.triggerEvent.apply(this, arguments);
+ },
+ getRect: function getRect(selector, all) {
+ var _this = this;
+
+ return new Promise(function (resolve) {
+ wx.createSelectorQuery().in(_this)[all ? 'selectAll' : 'select'](selector).boundingClientRect(function (rect) {
+ if (all && Array.isArray(rect) && rect.length) {
+ resolve(rect);
+ }
+
+ if (!all && rect) {
+ resolve(rect);
+ }
+ }).exec();
+ });
+ }
+ }
+});
\ No newline at end of file
diff --git a/components/dynamicForm/vant/mixins/button.js b/components/dynamicForm/vant/mixins/button.js
new file mode 100644
index 0000000..676f4d9
--- /dev/null
+++ b/components/dynamicForm/vant/mixins/button.js
@@ -0,0 +1,15 @@
+export var button = Behavior({
+ properties: {
+ id: String,
+ sessionFrom: String,
+ appParameter: String,
+ sendMessageImg: String,
+ sendMessagePath: String,
+ showMessageCard: String,
+ sendMessageTitle: String,
+ lang: {
+ type: String,
+ value: 'en'
+ }
+ }
+});
\ No newline at end of file
diff --git a/components/dynamicForm/vant/mixins/iphonex.js b/components/dynamicForm/vant/mixins/iphonex.js
new file mode 100644
index 0000000..e33fb52
--- /dev/null
+++ b/components/dynamicForm/vant/mixins/iphonex.js
@@ -0,0 +1,39 @@
+var isIPhoneX = null;
+
+function getIsIPhoneX() {
+ return new Promise(function (resolve, reject) {
+ if (isIPhoneX !== null) {
+ resolve(isIPhoneX);
+ } else {
+ wx.getSystemInfo({
+ success: function success(_ref) {
+ var model = _ref.model,
+ screenHeight = _ref.screenHeight;
+ var iphoneX = /iphone x/i.test(model);
+ var iphoneNew = /iPhone11/i.test(model) && screenHeight === 812;
+ isIPhoneX = iphoneX || iphoneNew;
+ resolve(isIPhoneX);
+ },
+ fail: reject
+ });
+ }
+ });
+}
+
+export var iphonex = Behavior({
+ properties: {
+ safeAreaInsetBottom: {
+ type: Boolean,
+ value: true
+ }
+ },
+ created: function created() {
+ var _this = this;
+
+ getIsIPhoneX().then(function (isIPhoneX) {
+ _this.set({
+ isIPhoneX: isIPhoneX
+ });
+ });
+ }
+});
\ No newline at end of file
diff --git a/components/dynamicForm/vant/mixins/link.js b/components/dynamicForm/vant/mixins/link.js
new file mode 100644
index 0000000..63a120a
--- /dev/null
+++ b/components/dynamicForm/vant/mixins/link.js
@@ -0,0 +1,24 @@
+export var link = Behavior({
+ properties: {
+ url: String,
+ linkType: {
+ type: String,
+ value: 'navigateTo'
+ }
+ },
+ methods: {
+ jumpLink: function jumpLink(urlKey) {
+ if (urlKey === void 0) {
+ urlKey = 'url';
+ }
+
+ var url = this.data[urlKey];
+
+ if (url) {
+ wx[this.data.linkType]({
+ url: url
+ });
+ }
+ }
+ }
+});
\ No newline at end of file
diff --git a/components/dynamicForm/vant/mixins/observer/behavior.js b/components/dynamicForm/vant/mixins/observer/behavior.js
new file mode 100644
index 0000000..1df073f
--- /dev/null
+++ b/components/dynamicForm/vant/mixins/observer/behavior.js
@@ -0,0 +1,43 @@
+export var behavior = Behavior({
+ created: function created() {
+ var _this = this;
+
+ if (!this.$options) {
+ return;
+ }
+
+ var cache = {};
+
+ var _this$$options = this.$options(),
+ computed = _this$$options.computed;
+
+ var keys = Object.keys(computed);
+
+ this.calcComputed = function () {
+ var needUpdate = {};
+ keys.forEach(function (key) {
+ var value = computed[key].call(_this);
+
+ if (cache[key] !== value) {
+ cache[key] = needUpdate[key] = value;
+ }
+ });
+ return needUpdate;
+ };
+ },
+ attached: function attached() {
+ this.set();
+ },
+ methods: {
+ // set data and set computed data
+ set: function set(data, callback) {
+ if (data) {
+ this.setData(data, callback);
+ }
+
+ if (this.calcComputed) {
+ this.setData(this.calcComputed());
+ }
+ }
+ }
+});
\ No newline at end of file
diff --git a/components/dynamicForm/vant/mixins/observer/index.js b/components/dynamicForm/vant/mixins/observer/index.js
new file mode 100644
index 0000000..c878fd0
--- /dev/null
+++ b/components/dynamicForm/vant/mixins/observer/index.js
@@ -0,0 +1,38 @@
+import { behavior } from './behavior';
+import { observeProps } from './props';
+export function observe(vantOptions, options) {
+ var watch = vantOptions.watch,
+ computed = vantOptions.computed;
+ options.behaviors.push(behavior);
+
+ if (watch) {
+ var props = options.properties || {};
+ Object.keys(watch).forEach(function (key) {
+ if (key in props) {
+ var prop = props[key];
+
+ if (prop === null || !('type' in prop)) {
+ prop = {
+ type: prop
+ };
+ }
+
+ prop.observer = watch[key];
+ props[key] = prop;
+ }
+ });
+ options.properties = props;
+ }
+
+ if (computed) {
+ options.methods = options.methods || {};
+
+ options.methods.$options = function () {
+ return vantOptions;
+ };
+
+ if (options.properties) {
+ observeProps(options.properties);
+ }
+ }
+}
\ No newline at end of file
diff --git a/components/dynamicForm/vant/mixins/observer/props.js b/components/dynamicForm/vant/mixins/observer/props.js
new file mode 100644
index 0000000..57706da
--- /dev/null
+++ b/components/dynamicForm/vant/mixins/observer/props.js
@@ -0,0 +1,32 @@
+export function observeProps(props) {
+ if (!props) {
+ return;
+ }
+
+ Object.keys(props).forEach(function (key) {
+ var prop = props[key];
+
+ if (prop === null || !('type' in prop)) {
+ prop = {
+ type: prop
+ };
+ }
+
+ var _prop = prop,
+ observer = _prop.observer;
+
+ prop.observer = function () {
+ if (observer) {
+ if (typeof observer === 'string') {
+ observer = this[observer];
+ }
+
+ observer.apply(this, arguments);
+ }
+
+ this.set();
+ };
+
+ props[key] = prop;
+ });
+}
\ No newline at end of file
diff --git a/components/dynamicForm/vant/mixins/open-type.js b/components/dynamicForm/vant/mixins/open-type.js
new file mode 100644
index 0000000..98f09bb
--- /dev/null
+++ b/components/dynamicForm/vant/mixins/open-type.js
@@ -0,0 +1,22 @@
+export var openType = Behavior({
+ properties: {
+ openType: String
+ },
+ methods: {
+ bindGetUserInfo: function bindGetUserInfo(event) {
+ this.$emit('getuserinfo', event.detail);
+ },
+ bindContact: function bindContact(event) {
+ this.$emit('contact', event.detail);
+ },
+ bindGetPhoneNumber: function bindGetPhoneNumber(event) {
+ this.$emit('getphonenumber', event.detail);
+ },
+ bindOpenSetting: function bindOpenSetting(event) {
+ this.$emit('opensetting', event.detail);
+ },
+ bindError: function bindError(event) {
+ this.$emit('error', event.detail);
+ }
+ }
+});
\ No newline at end of file
diff --git a/components/dynamicForm/vant/mixins/touch.js b/components/dynamicForm/vant/mixins/touch.js
new file mode 100644
index 0000000..c31559b
--- /dev/null
+++ b/components/dynamicForm/vant/mixins/touch.js
@@ -0,0 +1,21 @@
+export var touch = Behavior({
+ methods: {
+ touchStart: function touchStart(event) {
+ this.direction = '';
+ this.deltaX = 0;
+ this.deltaY = 0;
+ this.offsetX = 0;
+ this.offsetY = 0;
+ this.startX = event.touches[0].clientX;
+ this.startY = event.touches[0].clientY;
+ },
+ touchMove: function touchMove(event) {
+ var touch = event.touches[0];
+ this.deltaX = touch.clientX - this.startX;
+ this.deltaY = touch.clientY - this.startY;
+ this.offsetX = Math.abs(this.deltaX);
+ this.offsetY = Math.abs(this.deltaY);
+ this.direction = this.offsetX > this.offsetY ? 'horizontal' : this.offsetX < this.offsetY ? 'vertical' : '';
+ }
+ }
+});
\ No newline at end of file
diff --git a/components/dynamicForm/vant/mixins/transition.js b/components/dynamicForm/vant/mixins/transition.js
new file mode 100644
index 0000000..3723eb1
--- /dev/null
+++ b/components/dynamicForm/vant/mixins/transition.js
@@ -0,0 +1,73 @@
+export var transition = function transition(showDefaultValue) {
+ return Behavior({
+ properties: {
+ customStyle: String,
+ show: {
+ type: Boolean,
+ value: showDefaultValue,
+ observer: 'observeShow'
+ },
+ duration: {
+ type: Number,
+ value: 300
+ }
+ },
+ data: {
+ type: '',
+ inited: false,
+ display: false,
+ supportAnimation: true
+ },
+ attached: function attached() {
+ if (this.data.show) {
+ this.show();
+ }
+
+ this.detectSupport();
+ },
+ methods: {
+ detectSupport: function detectSupport() {
+ var _this = this;
+
+ wx.getSystemInfo({
+ success: function success(info) {
+ if (info && info.system && info.system.indexOf('iOS 8') === 0) {
+ _this.set({
+ supportAnimation: false
+ });
+ }
+ }
+ });
+ },
+ observeShow: function observeShow(value) {
+ if (value) {
+ this.show();
+ } else {
+ if (this.data.supportAnimation) {
+ this.set({
+ type: 'leave'
+ });
+ } else {
+ this.set({
+ display: false
+ });
+ }
+ }
+ },
+ show: function show() {
+ this.set({
+ inited: true,
+ display: true,
+ type: 'enter'
+ });
+ },
+ onAnimationEnd: function onAnimationEnd() {
+ if (!this.data.show) {
+ this.set({
+ display: false
+ });
+ }
+ }
+ }
+ });
+};
\ No newline at end of file
diff --git a/components/dynamicForm/vant/uploader/index.d.ts b/components/dynamicForm/vant/uploader/index.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/components/dynamicForm/vant/uploader/index.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/components/dynamicForm/vant/uploader/index.js b/components/dynamicForm/vant/uploader/index.js
new file mode 100644
index 0000000..ccfd01f
--- /dev/null
+++ b/components/dynamicForm/vant/uploader/index.js
@@ -0,0 +1,180 @@
+import { VantComponent } from '../common/component';
+import { isImageFile } from './utils';
+
+VantComponent({
+ props: {
+ disabled: Boolean,
+ multiple: Boolean,
+ uploadText: String,
+ useBeforeRead: Boolean,
+ previewSize: {
+ type: null,
+ value: 90
+ },
+ name: {
+ type: [Number, String],
+ value: ''
+ },
+ accept: {
+ type: String,
+ value: 'image'
+ },
+ sizeType: {
+ type: Array,
+ value: ['original', 'compressed']
+ },
+ capture: {
+ type: Array,
+ value: ['album', 'camera']
+ },
+ fileList: {
+ type: Array,
+ value: [],
+ observer: 'formatFileList'
+ },
+ maxSize: {
+ type: Number,
+ value: Number.MAX_VALUE
+ },
+ maxCount: {
+ type: Number,
+ value: 100
+ },
+ deletable: {
+ type: Boolean,
+ value: true
+ },
+ previewImage: {
+ type: Boolean,
+ value: true
+ },
+ previewFullImage: {
+ type: Boolean,
+ value: true
+ },
+ imageFit: {
+ type: String,
+ value: 'scaleToFill'
+ }
+ },
+ data: {
+ lists: [],
+ computedPreviewSize: '',
+ isInCount: true
+ },
+ methods: {
+ formatFileList() {
+ const { fileList = [], maxCount } = this.data;
+ const lists = fileList.map(item => (Object.assign(Object.assign({}, item), { isImage: typeof item.isImage === 'undefined' ? isImageFile(item) : item.isImage })));
+ this.setData({ lists, isInCount: lists.length < maxCount });
+ },
+ startUpload() {
+ if (this.data.disabled)
+ return;
+ const { name = '', capture, maxCount, multiple, maxSize, accept, sizeType,videoCfg={}, lists, useBeforeRead = false // 是否定义了 beforeRead
+ } = this.data;
+ let chooseFile = null;
+ const newMaxCount = maxCount - lists.length;
+ // 设置为只选择图片的时候使用 chooseImage 来实现
+ if (accept === 'image') {
+ chooseFile = new Promise((resolve, reject) => {
+ wx.chooseImage({
+ count: multiple ? (newMaxCount > 9 ? 9 : newMaxCount) : 1,
+ sourceType: capture,
+ sizeType,
+ success: resolve,
+ fail: reject
+ });
+ });
+ }
+ else if (accept === 'video'){
+ chooseFile = new Promise((resolve, reject) => {
+ wx.chooseMedia({
+ count: videoCfg.count || 9,
+ mediaType: ['video'],
+ sourceType: videoCfg.sourceType || ['album', 'camera'],
+ maxDuration: videoCfg.maxDuration || 10,
+ camera: videoCfg.camera || 'back',
+ success: (res)=>{
+ res.isVideo = true;
+ resolve(res);
+ },
+ fail: reject
+ });
+ });
+ }
+ else {
+ chooseFile = new Promise((resolve, reject) => {
+ wx.chooseMessageFile({
+ count: multiple ? newMaxCount : 1,
+ type: 'file',
+ success: resolve,
+ fail: reject
+ });
+ });
+ }
+ chooseFile
+ .then((res) => {
+ const file = multiple ? res.tempFiles : res.tempFiles[0];
+ // 检查文件大小
+ if (file instanceof Array) {
+ const sizeEnable = file.every(item => item.size <= maxSize);
+ if (!sizeEnable) {
+ this.$emit('oversize', { name });
+ return;
+ }
+ }
+ else if (file.size > maxSize) {
+ this.$emit('oversize', { name });
+ return;
+ }
+ let upData = { file, name };
+ if(res.isVideo){
+ file.map(val=>{
+ val.isVideo = true;
+ return val;
+ });
+ }
+ // 触发上传之前的钩子函数
+ if (useBeforeRead) {
+ this.$emit('before-read', {
+ file,
+ name,
+ callback: (result) => {
+ if (result) {
+ // 开始上传
+ this.$emit('after-read', upData);
+ }
+ }
+ });
+ }
+ else {
+ this.$emit('after-read', upData);
+ }
+ })
+ .catch(error => {
+ this.$emit('error', error);
+ });
+ },
+ deleteItem(event) {
+ const { index } = event.currentTarget.dataset;
+ this.$emit('delete', { index, name: this.data.name });
+ },
+ doPreviewImage(event) {
+ if (!this.data.previewFullImage)
+ return;
+ const curUrl = event.currentTarget.dataset.url;
+ const images = this.data.lists
+ .filter(item => item.isImage)
+ .map(item => item.url || item.path);
+ this.$emit('click-preview', { url: curUrl, name: this.data.name });
+ wx.previewImage({
+ urls: images,
+ current: curUrl,
+ fail() {
+ wx.showToast({ title: '预览图片失败', icon: 'none' });
+ }
+ });
+ }
+ }
+});
diff --git a/components/dynamicForm/vant/uploader/index.json b/components/dynamicForm/vant/uploader/index.json
new file mode 100644
index 0000000..0a336c0
--- /dev/null
+++ b/components/dynamicForm/vant/uploader/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "van-icon": "../icon/index"
+ }
+}
diff --git a/components/dynamicForm/vant/uploader/index.wxml b/components/dynamicForm/vant/uploader/index.wxml
new file mode 100644
index 0000000..bbc7bfa
--- /dev/null
+++ b/components/dynamicForm/vant/uploader/index.wxml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.name || item.url || item.path }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ uploadText }}
+
+
+
+
diff --git a/components/dynamicForm/vant/uploader/index.wxss b/components/dynamicForm/vant/uploader/index.wxss
new file mode 100644
index 0000000..1a22368
--- /dev/null
+++ b/components/dynamicForm/vant/uploader/index.wxss
@@ -0,0 +1,3 @@
+@import '../common/index.wxss';.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}.van-uploader__slot:empty{display:none}.van-uploader__slot:not(:empty)+.van-uploader__upload{display:none!important}.van-uploader__upload{position:relative;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:80px;height:80px;margin:0 20rpx 20rpx 0;background-color:#fff;border:2px dashed #e0e0f0;border-radius:8px}.van-uploader__upload-icon{display:inline-block;width:48rpx;height:48rpx;color:#969799;font-size:24px}.van-uploader__upload-text{margin-top:8px;color:#969799;font-size:12px}.van-uploader__preview{position:relative;margin:0 20rpx 20rpx 0}.van-uploader__preview-image{display:block;width:80px;height:80px;border-radius:8px}
+.van-uploader__preview-video{display:block;width:80px;height:80px;border-radius:8px;overflow: hidden}
+.van-uploader__preview-delete{position:absolute;top:-8px;right:-8px;color:#969799;font-size:18px;background-color:#fff;border-radius:100%}.van-uploader__file{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;width:80px;height:80px;background-color:#f7f8fa;border-radius:8px}.van-uploader__file-icon{display:inline-block;width:20px;height:20px;color:#646566;font-size:20px}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:8px;padding:0 5px;color:#646566;font-size:12px;text-align:center}
\ No newline at end of file
diff --git a/components/dynamicForm/vant/uploader/utils.d.ts b/components/dynamicForm/vant/uploader/utils.d.ts
new file mode 100644
index 0000000..d3bb3b5
--- /dev/null
+++ b/components/dynamicForm/vant/uploader/utils.d.ts
@@ -0,0 +1,12 @@
+interface File {
+ path: string;
+ url: string;
+ size: number;
+ name: string;
+ type: string;
+ time: number;
+ image: boolean;
+}
+export declare function isImageUrl(url: string): boolean;
+export declare function isImageFile(item: File): boolean;
+export {};
diff --git a/components/dynamicForm/vant/uploader/utils.js b/components/dynamicForm/vant/uploader/utils.js
new file mode 100644
index 0000000..aa59dc1
--- /dev/null
+++ b/components/dynamicForm/vant/uploader/utils.js
@@ -0,0 +1,16 @@
+const IMAGE_EXT = ['jpeg', 'jpg', 'gif', 'png', 'svg'];
+export function isImageUrl(url) {
+ return IMAGE_EXT.some(ext => url.indexOf(`.${ext}`) !== -1);
+}
+export function isImageFile(item) {
+ if (item.type) {
+ return item.type.indexOf('image') === 0;
+ }
+ if (item.path) {
+ return isImageUrl(item.path);
+ }
+ if (item.url) {
+ return isImageUrl(item.url);
+ }
+ return false;
+}
diff --git a/components/dynamicForm/vant/wxs/add-unit.wxs b/components/dynamicForm/vant/wxs/add-unit.wxs
new file mode 100644
index 0000000..27a22d8
--- /dev/null
+++ b/components/dynamicForm/vant/wxs/add-unit.wxs
@@ -0,0 +1,14 @@
+/* eslint-disable */
+var REGEXP = getRegExp('^\d+(\.\d+)?$');
+
+function addUnit(value) {
+ if (value == null) {
+ return undefined;
+ }
+
+ return REGEXP.test('' + value) ? value + 'px' : value;
+}
+
+module.exports = {
+ addUnit: addUnit
+};
diff --git a/components/dynamicForm/vant/wxs/array.wxs b/components/dynamicForm/vant/wxs/array.wxs
new file mode 100644
index 0000000..610089c
--- /dev/null
+++ b/components/dynamicForm/vant/wxs/array.wxs
@@ -0,0 +1,5 @@
+function isArray(array) {
+ return array && array.constructor === 'Array';
+}
+
+module.exports.isArray = isArray;
diff --git a/components/dynamicForm/vant/wxs/bem.wxs b/components/dynamicForm/vant/wxs/bem.wxs
new file mode 100644
index 0000000..93b2777
--- /dev/null
+++ b/components/dynamicForm/vant/wxs/bem.wxs
@@ -0,0 +1,38 @@
+var array = require('./array.wxs');
+var object = require('./object.wxs');
+var PREFIX = 'van-';
+
+function join(name, mods) {
+ name = PREFIX + name;
+ mods = mods.map(function(mod) {
+ return name + '--' + mod;
+ });
+ mods.unshift(name);
+ return mods.join(' ');
+}
+
+function traversing(mods, conf) {
+ if (!conf) {
+ return;
+ }
+
+ if (typeof conf === 'string' || typeof conf === 'number') {
+ mods.push(conf);
+ } else if (array.isArray(conf)) {
+ conf.forEach(function(item) {
+ traversing(mods, item);
+ });
+ } else if (typeof conf === 'object') {
+ object.keys(conf).forEach(function(key) {
+ conf[key] && mods.push(key);
+ });
+ }
+}
+
+function bem(name, conf) {
+ var mods = [];
+ traversing(mods, conf);
+ return join(name, mods);
+}
+
+module.exports.bem = bem;
diff --git a/components/dynamicForm/vant/wxs/memoize.wxs b/components/dynamicForm/vant/wxs/memoize.wxs
new file mode 100644
index 0000000..261ae67
--- /dev/null
+++ b/components/dynamicForm/vant/wxs/memoize.wxs
@@ -0,0 +1,54 @@
+/**
+ * Simple memoize
+ * wxs doesn't support fn.apply, so this memoize only support up to 2 args
+ */
+
+function isPrimitive(value) {
+ var type = typeof value;
+ return (
+ type === 'boolean' ||
+ type === 'number' ||
+ type === 'string' ||
+ type === 'undefined' ||
+ value === null
+ );
+}
+
+// mock simple fn.call in wxs
+function call(fn, args) {
+ if (args.length === 2) {
+ return fn(args[0], args[1]);
+ }
+
+ if (args.length === 1) {
+ return fn(args[0]);
+ }
+
+ return fn();
+}
+
+function serializer(args) {
+ if (args.length === 1 && isPrimitive(args[0])) {
+ return args[0];
+ }
+ var obj = {};
+ for (var i = 0; i < args.length; i++) {
+ obj['key' + i] = args[i];
+ }
+ return JSON.stringify(obj);
+}
+
+function memoize(fn) {
+ var cache = {};
+
+ return function() {
+ var key = serializer(arguments);
+ if (cache[key] === undefined) {
+ cache[key] = call(fn, arguments);
+ }
+
+ return cache[key];
+ };
+}
+
+module.exports.memoize = memoize;
diff --git a/components/dynamicForm/vant/wxs/object.wxs b/components/dynamicForm/vant/wxs/object.wxs
new file mode 100644
index 0000000..e077107
--- /dev/null
+++ b/components/dynamicForm/vant/wxs/object.wxs
@@ -0,0 +1,13 @@
+/* eslint-disable */
+var REGEXP = getRegExp('{|}|"', 'g');
+
+function keys(obj) {
+ return JSON.stringify(obj)
+ .replace(REGEXP, '')
+ .split(',')
+ .map(function(item) {
+ return item.split(':')[0];
+ });
+}
+
+module.exports.keys = keys;
diff --git a/components/dynamicForm/vant/wxs/utils.wxs b/components/dynamicForm/vant/wxs/utils.wxs
new file mode 100644
index 0000000..d5c9d8c
--- /dev/null
+++ b/components/dynamicForm/vant/wxs/utils.wxs
@@ -0,0 +1,10 @@
+/* eslint-disable */
+var bem = require('./bem.wxs').bem;
+var memoize = require('./memoize.wxs').memoize;
+var addUnit = require('./add-unit.wxs').addUnit;
+
+module.exports = {
+ bem: memoize(bem),
+ memoize: memoize,
+ addUnit: addUnit
+};
diff --git a/components/mp-html/index.js b/components/mp-html/index.js
new file mode 100644
index 0000000..e48f0a8
--- /dev/null
+++ b/components/mp-html/index.js
@@ -0,0 +1,8 @@
+"use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}/*!
+ * mp-html v2.0.5
+ * https://github.com/jin-yufeng/mp-html
+ *
+ * Released under the MIT license
+ * Author: Jin Yufeng
+ */
+var t=require("./parser"),n=[];Component({data:{nodes:[]},properties:{content:{type:String,value:"",observer:function(e){this.setContent(e)}},copyLink:{type:Boolean,value:!0},domain:String,errorImg:String,lazyLoad:Boolean,loadingImg:String,pauseVideo:{type:Boolean,value:!0},previewImg:{type:Boolean,value:!0},scrollTable:Boolean,selectable:null,setTitle:{type:Boolean,value:!0},showImgMenu:{type:Boolean,value:!0},tagStyle:Object,useAnchor:null},created:function(){this.plugins=[];for(var e=n.length;e--;)this.plugins.push(new n[e](this))},detached:function(){clearInterval(this._timer),this._hook("onDetached")},methods:{in:function(e,t,n){e&&t&&n&&(this._in={page:e,selector:t,scrollTop:n})},navigateTo:function(t,n){var o=this;return new Promise(function(i,r){if(!o.data.useAnchor)return r("Anchor is disabled");var a=wx.createSelectorQuery().in(o._in?o._in.page:o).select((o._in?o._in.selector:"._root")+(t?"".concat(">>>","#").concat(t):"")).boundingClientRect();o._in?a.select(o._in.selector).scrollOffset().select(o._in.selector).boundingClientRect():a.selectViewport().scrollOffset(),a.exec(function(t){if(!t[0])return r("Label not found");var a=t[1].scrollTop+t[0].top-(t[2]?t[2].top:0)+(n||parseInt(o.data.useAnchor)||0);o._in?o._in.page.setData(e({},o._in.scrollTop,a)):wx.pageScrollTo({scrollTop:a,duration:300}),i()})})},getText:function(e){var t="";return function e(n){for(var o=0;o"0"&&i.name[1]<"7";r&&t&&"\n"!=t[t.length-1]&&(t+="\n"),i.children&&e(i.children),r&&"\n"!=t[t.length-1]?t+="\n":"td"!=i.name&&"th"!=i.name||(t+="\t")}}}(e||this.data.nodes),t},getRect:function(){var e=this;return new Promise(function(t,n){wx.createSelectorQuery().in(e).select("._root").boundingClientRect().exec(function(e){return e[0]?t(e[0]):n("Root label not found")})})},setContent:function(e,n){var o=this;this.imgList&&n||(this.imgList=[]),this._videos=[];var i={},r=new t(this).parse(e);if(n)for(var a=this.data.nodes.length,l=r.length;l--;)i["nodes[".concat(a+l,"]")]=r[l];else i.nodes=r;this.setData(i,function(){o._hook("onLoad"),o.triggerEvent("load")});var s;clearInterval(this._timer),this._timer=setInterval(function(){o.getRect().then(function(e){e.height==s&&(o.triggerEvent("ready",e),clearInterval(o._timer)),s=e.height}).catch(function(){})},350)},_hook:function(e){for(var t=n.length;t--;)this.plugins[t][e]&&this.plugins[t][e]()},_add:function(e){e.detail.root=this}}});
\ No newline at end of file
diff --git a/components/mp-html/index.json b/components/mp-html/index.json
new file mode 100644
index 0000000..36b626e
--- /dev/null
+++ b/components/mp-html/index.json
@@ -0,0 +1 @@
+{"component":true,"usingComponents":{"node":"./node/node"}}
\ No newline at end of file
diff --git a/components/mp-html/index.wxml b/components/mp-html/index.wxml
new file mode 100644
index 0000000..6069e2d
--- /dev/null
+++ b/components/mp-html/index.wxml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/components/mp-html/index.wxss b/components/mp-html/index.wxss
new file mode 100644
index 0000000..5f74d06
--- /dev/null
+++ b/components/mp-html/index.wxss
@@ -0,0 +1 @@
+._root{padding:1px 0;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}._select{-webkit-user-select:text;user-select:text}
\ No newline at end of file
diff --git a/components/mp-html/node/node.js b/components/mp-html/node/node.js
new file mode 100644
index 0000000..ef15f8a
--- /dev/null
+++ b/components/mp-html/node/node.js
@@ -0,0 +1 @@
+"use strict";function t(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Component({data:{ctrl:{}},properties:{childs:Array,opts:Array},attached:function(){this.triggerEvent("add",this,{bubbles:!0,composed:!0})},methods:{noop:function(){},getNode:function(t){for(var e=t.split("_"),i=this.data.childs[e[0]],r=1;rr.src.length&&(s=0),svar e={abbr:!0,b:!0,big:!0,code:!0,del:!0,em:!0,i:!0,ins:!0,label:!0,q:!0,small:!0,span:!0,strong:!0,sub:!0,sup:!0};module.exports=function(n){return!(e[n.name]||n.children&&-1!=(n.attrs.style||"").indexOf("inline"))&&!n.c};{{n.text}}\n
\ No newline at end of file
diff --git a/components/mp-html/node/node.wxss b/components/mp-html/node/node.wxss
new file mode 100644
index 0000000..43a2fab
--- /dev/null
+++ b/components/mp-html/node/node.wxss
@@ -0,0 +1 @@
+._a{padding:1.5px 0 1.5px 0;color:#366092;word-break:break-all}._hover{text-decoration:underline;opacity:.7}._img{max-width:100%;-webkit-touch-callout:none}._b,._strong{font-weight:700}._code{font-family:monospace}._del{text-decoration:line-through}._em,._i{font-style:italic}._h1{font-size:2em}._h2{font-size:1.5em}._h3{font-size:1.17em}._h5{font-size:.83em}._h6{font-size:.67em}._h1,._h2,._h3,._h4,._h5,._h6{display:block;font-weight:700}._ins{text-decoration:underline}._li{display:list-item}._ol{list-style-type:decimal}._ol,._ul{display:block;padding-left:40px;margin:1em 0}._q::before{content:'"'}._q::after{content:'"'}._sub{font-size:smaller;vertical-align:sub}._sup{font-size:smaller;vertical-align:super}._tbody,._tfoot,._thead{display:table-row-group}._tr{display:table-row}._td,._th{display:table-cell;vertical-align:middle}._th{font-weight:700;text-align:center}._ul{list-style-type:disc}._ul ._ul{margin:0;list-style-type:circle}._ul ._ul ._ul{list-style-type:square}._abbr,._b,._code,._del,._em,._i,._ins,._label,._q,._span,._strong,._sub,._sup{display:inline}._blockquote,._div,._p{display:block}
\ No newline at end of file
diff --git a/components/mp-html/parser.js b/components/mp-html/parser.js
new file mode 100644
index 0000000..ea5ec63
--- /dev/null
+++ b/components/mp-html/parser.js
@@ -0,0 +1 @@
+"use strict";function t(t){for(var i=Object.create(null),s=t.split(","),e=s.length;e--;)i[s[e]]=!0;return i}function i(t,i){for(var s=t.indexOf("&");-1!=s;){var e=t.indexOf(";",s+3),n=void 0;if(-1==e)break;"#"==t[s+1]?(n=parseInt(("x"==t[s+2]?"0":"")+t.substring(s+2,e)),isNaN(n)||(t=t.substr(0,s)+String.fromCharCode(n)+t.substr(e+1))):(n=t.substring(s+1,e),(a.entities[n]||"amp"==n&&i)&&(t=t.substr(0,s)+(a.entities[n]||"&")+t.substr(e+1))),s=t.indexOf("&",s+1)}return t}function s(t){this.options=t.data||{},this.tagStyle=Object.assign(a.tagStyle,this.options.tagStyle),this.imgList=t.imgList||[],this.plugins=t.plugins||[],this.attrs=Object.create(null),this.stack=[],this.nodes=[]}function e(t){this.handler=t}var a={trustTags:t("a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,ruby,rt,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video"),blockTags:t("address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section"),ignoreTags:t("area,base,canvas,embed,frame,head,iframe,input,link,map,meta,param,rp,script,source,style,textarea,title,track,wbr"),voidTags:t("area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr"),entities:{lt:"<",gt:">",quot:'"',apos:"'",ensp:" ",emsp:" ",nbsp:" ",semi:";",ndash:"–",mdash:"—",middot:"·",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",hellip:"…"},tagStyle:{address:"font-style:italic",big:"display:inline;font-size:1.2em",caption:"display:table-caption;text-align:center",center:"text-align:center",cite:"font-style:italic",dd:"margin-left:40px",mark:"background-color:yellow",pre:"font-family:monospace;white-space:pre",s:"text-decoration:line-through",small:"display:inline;font-size:0.8em",u:"text-decoration:underline"}},n=wx.getSystemInfoSync(),r=n.windowWidth,h=n.system,o=t(" ,\r,\n,\t,\f"),l=0;s.prototype.parse=function(t){for(var i=this.plugins.length;i--;)this.plugins[i].onUpdate&&(t=this.plugins[i].onUpdate(t,a)||t);for(new e(this).parse(t);this.stack.length;)this.popNode();return this.nodes},s.prototype.expose=function(){for(var t=this.stack.length;t--;){var i=this.stack[t];if("a"==i.name||i.c)return;i.c=1}},s.prototype.hook=function(t){for(var i=this.plugins.length;i--;)if(this.plugins[i].onParse&&0==this.plugins[i].onParse(t,this))return!1;return!0},s.prototype.getUrl=function(t){var i=this.options.domain;return"/"==t[0]?"/"==t[1]?t=(i?i.split("://")[0]:"http")+":"+t:i&&(t=i+t):!i||t.includes("data:")||t.includes("://")||(t=i+"/"+t),t},s.prototype.parseStyle=function(t){var i=t.attrs,s=(this.tagStyle[t.name]||"").split(";").concat((i.style||"").split(";")),e={},a="";i.id&&(this.options.useAnchor?this.expose():"img"!=t.name&&"a"!=t.name&&"video"!=t.name&&"audio"!=t.name&&(i.id=void 0)),i.width&&(e.width=parseFloat(i.width)+(i.width.includes("%")?"%":"px"),i.width=void 0),i.height&&(e.height=parseFloat(i.height)+(i.height.includes("%")?"%":"px"),i.height=void 0);for(var n=0,h=s.length;n0||d.includes("safe"))a+=";".concat(c,":").concat(d);else if(!e[c]||d.includes("import")||!e[c].includes("import")){if(d.includes("url")){var p=d.indexOf("(")+1;if(p){for(;'"'==d[p]||"'"==d[p]||o[d[p]];)p++;d=d.substr(0,p)+this.getUrl(d.substr(p))}}else d.includes("rpx")&&(d=d.replace(/[0-9.]+\s*rpx/g,function(t){return parseFloat(t)*r/750+"px"}));e[c]=d}}}return t.attrs.style=a,e},s.prototype.onTagName=function(t){this.tagName=this.xml?t:t.toLowerCase(),"svg"==this.tagName&&(this.xml=!0)},s.prototype.onAttrName=function(t){t=this.xml?t:t.toLowerCase(),"data-"==t.substr(0,5)?"data-src"!=t||this.attrs.src?"img"==this.tagName||"a"==this.tagName?this.attrName=t:this.attrName=void 0:this.attrName="src":(this.attrName=t,this.attrs[t]="T")},s.prototype.onAttrVal=function(t){var s=this.attrName||"";"style"==s||"href"==s?this.attrs[s]=i(t,!0):s.includes("src")?this.attrs[s]=this.getUrl(i(t,!0)):s&&(this.attrs[s]=t)},s.prototype.onOpenTag=function(t){var i=Object.create(null);i.name=this.tagName,i.attrs=this.attrs,this.attrs=Object.create(null);var s=i.attrs,e=this.stack[this.stack.length-1],n=e?e.children:this.nodes,h=this.xml?t:a.voidTags[i.name];if("embed"==i.name){var o=s.src||"";o.includes(".mp4")||o.includes(".3gp")||o.includes(".m3u8")||(s.type||"").includes("video")?i.name="video":(o.includes(".mp3")||o.includes(".wav")||o.includes(".aac")||o.includes(".m4a")||(s.type||"").includes("audio"))&&(i.name="audio"),s.autostart&&(s.autoplay="T"),s.controls="T"}if("video"!=i.name&&"audio"!=i.name||("video"!=i.name||s.id||(s.id="v"+l++),s.controls||s.autoplay||(s.controls="T"),i.src=[],s.src&&(i.src.push(s.src),s.src=void 0),this.expose()),h){if(!this.hook(i)||a.ignoreTags[i.name])return void("base"!=i.name||this.options.domain?"source"==i.name&&e&&("video"==e.name||"audio"==e.name)&&s.src&&e.src.push(s.src):this.options.domain=s.href);var c=this.parseStyle(i);if("img"==i.name){if(s.src&&(s.src.includes("webp")&&(i.webp="T"),s.src.includes("data:")&&!s["original-src"]&&(s.ignore="T"),!s.ignore||i.webp||s.src.includes("cloud://"))){for(var d=this.stack.length;d--;){var p=this.stack[d];if("a"==p.name){i.a=p.attrs;break}var u=p.attrs.style||"";if(!u.includes("flex:")||u.includes("flex:0")||u.includes("flex: 0")||c.width&&c.width.includes("%"))if(u.includes("flex")&&"100%"==c.width)for(var g=d+1;g.5?v[y].toUpperCase():v[y];x+=v.substr(y),v=x}}this.imgList.push(v)}"inline"==c.display&&(c.display=""),s.ignore&&(c["max-width"]=c["max-width"]||"100%",s.style+=";-webkit-touch-callout:none"),parseInt(c.width)>r&&(c.height=void 0),c.width&&(c.width.includes("auto")?c.width="":(i.w="T",c.height&&!c.height.includes("auto")&&(i.h="T")))}else if("svg"==i.name)return n.push(i),this.stack.push(i),void this.popNode();for(var b in c)c[b]&&(s.style+=";".concat(b,":").concat(c[b].replace(" !important","")));s.style=s.style.substr(1)||void 0}else("pre"==i.name||(s.style||"").includes("white-space")&&s.style.includes("pre"))&&(this.pre=i.pre=!0),i.children=[],this.stack.push(i);n.push(i)},s.prototype.onCloseTag=function(t){t=this.xml?t:t.toLowerCase();var i;for(i=this.stack.length;i--&&this.stack[i].name!=t;);if(-1!=i)for(;this.stack.length>i;)this.popNode();else if("p"==t||"br"==t){var s=this.stack.length?this.stack[this.stack.length-1].children:this.nodes;s.push({name:t,attrs:{}})}},s.prototype.popNode=function(){var t=this.stack.pop(),i=t.attrs,s=t.children,e=this.stack[this.stack.length-1],n=e?e.children:this.nodes;if(!this.hook(t)||a.ignoreTags[t.name])return"title"==t.name&&s.length&&"text"==s[0].type&&this.options.setTitle&&wx.setNavigationBarTitle({title:s[0].text}),void n.pop();if(t.pre){t.pre=this.pre=void 0;for(var h=this.stack.length;h--;)this.stack[h].pre&&(this.pre=!0)}if("svg"==t.name){var o="",l=i.style;return i.style="",i.viewbox&&(i.viewBox=i.viewbox),i.xmlns="http://www.w3.org/2000/svg",function t(i){o+="<"+i.name;for(var s in i.attrs){var e=i.attrs[s];e&&(o+=" ".concat(s,'="').concat(e,'"'))}if(i.children){o+=">";for(var a=0;a"}else o+="/>"}(t),t.name="img",t.attrs={src:"data:image/svg+xml;utf8,"+o.replace(/#/g,"%23"),style:l,ignore:"T"},t.children=void 0,void(this.xml=!1)}var c={};if(i.align&&("table"==t.name?"center"==i.align?c["margin-inline-start"]=c["margin-inline-end"]="auto":c.float=i.align:c["text-align"]=i.align,i.align=void 0),"font"==t.name&&(i.color&&(c.color=i.color,i.color=void 0),i.face&&(c["font-family"]=i.face,i.face=void 0),i.size)){var d=parseInt(i.size);isNaN(d)||(d<1?d=1:d>7&&(d=7),c["font-size"]=["xx-small","x-small","small","medium","large","x-large","xx-large"][d-1]),i.size=void 0}if((i.class||"").includes("align-center")&&(c["text-align"]="center"),Object.assign(c,this.parseStyle(t)),parseInt(c.width)>r&&(c["max-width"]="100%",c["box-sizing"]="border-box"),a.blockTags[t.name])t.name="div";else if(a.trustTags[t.name]||this.xml)if("a"==t.name||"ad"==t.name)this.expose();else if("video"==t.name||"audio"==t.name)t.children=void 0;else if("ul"!=t.name&&"ol"!=t.name||!t.c){if("table"==t.name){var p=parseFloat(i.cellpadding),u=parseFloat(i.cellspacing),g=parseFloat(i.border);if(t.c&&(isNaN(p)&&(p=2),isNaN(u)&&(u=2)),g&&(i.style+=";border:"+g+"px solid gray"),t.flag&&t.c){t.flag=void 0,c.display="grid",u?(c["grid-gap"]=u+"px",c.padding=u+"px"):g&&(i.style+=";border-left:0;border-top:0");var f=[],m=[],v=[],y={};!function t(i){for(var s=0;s"==this.content[this.i]||i&&">"==this.content[this.i+1])&&(t&&this.handler[t](this.content.substring(this.start,this.i)),this.i+=i?2:1,this.start=this.i,this.handler.onOpenTag(i),"script"==this.handler.tagName?(this.i=this.content.indexOf("",this.i),-1!=this.i&&(this.i+=2,this.start=this.i),this.state=this.endTag):this.state=this.text,!0)},e.prototype.text=function(){if(this.i=this.content.indexOf("<",this.i),-1==this.i)return void(this.start="a"&&t<="z"||t>="A"&&t<="Z")this.start!=this.i&&this.handler.onText(this.content.substring(this.start,this.i)),this.start=++this.i,this.state=this.tagName;else if("/"==t||"!"==t||"?"==t){this.start!=this.i&&this.handler.onText(this.content.substring(this.start,this.i));var i=this.content[this.i+2];if("/"==t&&(i>="a"&&i<="z"||i>="A"&&i<="Z"))return this.i+=2,this.start=this.i,this.state=this.endTag;var s="--\x3e";"!"==t&&"-"==this.content[this.i+2]&&"-"==this.content[this.i+3]||(s=">"),this.i=this.content.indexOf(s,this.i),-1!=this.i&&(this.i+=s.length,this.start=this.i)}else this.i++},e.prototype.tagName=function(){if(o[this.content[this.i]]){for(this.handler.onTagName(this.content.substring(this.start,this.i));o[this.content[++this.i]];);this.i"==t||"/"==t){if(this.handler.onCloseTag(this.content.substring(this.start,this.i)),">"!=t&&(this.i=this.content.indexOf(">",this.i),-1==this.i))return;this.start=++this.i,this.state=this.text}else this.i++},module.exports=s;
\ No newline at end of file
diff --git a/components/parser/audio/audio.js b/components/parser/audio/audio.js
new file mode 100644
index 0000000..e50640d
--- /dev/null
+++ b/components/parser/audio/audio.js
@@ -0,0 +1,100 @@
+/*
+ audio 扩展包
+ github:https://github.com/jin-yufeng/Parser
+ docs:https://jin-yufeng.github.io/Parser
+ author:JinYufeng
+*/
+Component({
+ data: {
+ time: '00:00'
+ },
+ properties: {
+ author: String,
+ autoplay: Boolean,
+ controls: Boolean,
+ loop: Boolean,
+ name: String,
+ poster: String,
+ src: {
+ type: String,
+ observer(src) {
+ this.setSrc(src);
+ }
+ }
+ },
+ created() {
+ this._ctx = wx.createInnerAudioContext();
+ this._ctx.onError((err) => {
+ this.setData({
+ error: true
+ })
+ this.triggerEvent('error', err);
+ })
+ this._ctx.onTimeUpdate(() => {
+ var time = this._ctx.currentTime,
+ min = parseInt(time / 60),
+ sec = Math.ceil(time % 60),
+ data = {};
+ data.time = (min > 9 ? min : '0' + min) + ':' + (sec > 9 ? sec : '0' + sec);
+ if (!this.lastTime) data.value = time / this._ctx.duration * 100; // 不在拖动状态下
+ this.setData(data);
+ })
+ this._ctx.onEnded(() => {
+ this.setData({
+ playing: false
+ })
+ })
+ },
+ detached() {
+ this._ctx.destroy();
+ },
+ pageLifetimes: {
+ show() {
+ if (this.data.playing && this._ctx.paused)
+ this._ctx.play();
+ }
+ },
+ methods: {
+ // 设置源
+ setSrc(src) {
+ this._ctx.autoplay = this.data.autoplay;
+ this._ctx.loop = this.data.loop;
+ this._ctx.src = src;
+ },
+ // 播放
+ play() {
+ this._ctx.play();
+ this.setData({
+ playing: true
+ })
+ this.triggerEvent('play');
+ },
+ // 暂停
+ pause() {
+ this._ctx.pause();
+ this.setData({
+ playing: false
+ })
+ this.triggerEvent('pause');
+ },
+ // 移动进度条
+ seek(sec) {
+ this._ctx.seek(sec);
+ },
+ // 内部方法
+ _seeking(e) {
+ if (e.timeStamp - this.lastTime < 200) return;
+ var time = Math.round(e.detail.value / 100 * this._ctx.duration),
+ min = parseInt(time / 60),
+ sec = time % 60;
+ this.setData({
+ time: (min > 9 ? min : '0' + min) + ':' + (sec > 9 ? sec : '0' + sec)
+ })
+ this.lastTime = e.timeStamp;
+ },
+ _seeked(e) {
+ this.seek(e.detail.value / 100 * this._ctx.duration);
+ this.lastTime = void 0;
+ }
+ }
+})
\ No newline at end of file
diff --git a/components/parser/audio/audio.json b/components/parser/audio/audio.json
new file mode 100644
index 0000000..32640e0
--- /dev/null
+++ b/components/parser/audio/audio.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
\ No newline at end of file
diff --git a/components/parser/audio/audio.wxml b/components/parser/audio/audio.wxml
new file mode 100644
index 0000000..bd30fbd
--- /dev/null
+++ b/components/parser/audio/audio.wxml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+ {{name||'未知音频'}}
+ {{author||'未知作者'}}
+
+ {{time}}
+
\ No newline at end of file
diff --git a/components/parser/audio/audio.wxss b/components/parser/audio/audio.wxss
new file mode 100644
index 0000000..d193004
--- /dev/null
+++ b/components/parser/audio/audio.wxss
@@ -0,0 +1,75 @@
+:host {
+ display: inline-block;
+}
+.author {
+ color: #888;
+ font-size: 28rpx;
+ width: 140rpx;
+}
+.author, .name {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.button {
+ align-items: center;
+ background-color: rgb(0, 0, 0, 0.2);
+ border: 3.5rpx solid white;
+ border-radius: 50%;
+ display: flex;
+ height: 47rpx;
+ justify-content: center;
+ opacity: 0.9;
+ overflow: hidden;
+ width: 47rpx;
+}
+.contain {
+ background-color: #fcfcfc;
+ border: 1px solid #e0e0e0;
+ border-radius: 2px;
+ display: flex;
+ position: relative;
+ width: 650rpx;
+}
+.name {
+ font-size: 33rpx;
+ line-height: 80rpx;
+ width: 320rpx;
+}
+.pause {
+ width: 16.5rpx;
+ height: 16.5rpx;
+ background-color: white;
+}
+.play {
+ border-bottom: 10rpx solid transparent;
+ border-left: 18rpx solid white;
+ border-top: 10rpx solid transparent;
+ margin-left: 5rpx;
+}
+.poster {
+ align-items: center;
+ background-color: #e6e6e6;
+ background-size: contain;
+ display: flex;
+ height: 152.35rpx;
+ justify-content: center;
+ width: 152.35rpx;
+}
+.slider {
+ position: absolute;
+ bottom: 18.75rpx;
+ margin: 0;
+ right: 35.15rpx;
+ width: 316.4rpx;
+}
+.title {
+ flex: 1;
+ margin: 10rpx 0 0 35.15rpx;
+ text-align: left;
+}
+.time {
+ color: #888;
+ font-size: 28rpx;
+ margin: 16.4rpx 35.15rpx 0 0;
+}
\ No newline at end of file
diff --git a/components/parser/libs/CssHandler.js b/components/parser/libs/CssHandler.js
new file mode 100644
index 0000000..fd9c486
--- /dev/null
+++ b/components/parser/libs/CssHandler.js
@@ -0,0 +1,102 @@
+/*
+ 解析和匹配 Css 的选择器
+ github:https://github.com/jin-yufeng/Parser
+ docs:https://jin-yufeng.github.io/Parser
+ author:JinYufeng
+ update:2020/03/15
+*/
+var cfg = require('./config.js');
+class CssHandler {
+ constructor(tagStyle) {
+ var styles = Object.assign({}, cfg.userAgentStyles);
+ for (var item in tagStyle)
+ styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];
+ this.styles = styles;
+ }
+ getStyle = data => this.styles = new CssParser(data, this.styles).parse();
+ match(name, attrs) {
+ var tmp, matched = (tmp = this.styles[name]) ? tmp + ';' : '';
+ if (attrs.class) {
+ var items = attrs.class.split(' ');
+ for (var i = 0, item; item = items[i]; i++)
+ if (tmp = this.styles['.' + item])
+ matched += tmp + ';';
+ }
+ if (tmp = this.styles['#' + attrs.id])
+ matched += tmp + ';';
+ return matched;
+ }
+}
+module.exports = CssHandler;
+class CssParser {
+ constructor(data, init) {
+ this.data = data;
+ this.floor = 0;
+ this.i = 0;
+ this.list = [];
+ this.res = init;
+ this.state = this.Space;
+ }
+ parse() {
+ for (var c; c = this.data[this.i]; this.i++)
+ this.state(c);
+ return this.res;
+ }
+ section = () => this.data.substring(this.start, this.i);
+ isLetter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
+ // 状态机
+ Space(c) {
+ if (c == '.' || c == '#' || this.isLetter(c)) {
+ this.start = this.i;
+ this.state = this.Name;
+ } else if (c == '/' && this.data[this.i + 1] == '*')
+ this.Comment();
+ else if (!cfg.blankChar[c] && c != ';')
+ this.state = this.Ignore;
+ }
+ Comment() {
+ this.i = this.data.indexOf('*/', this.i) + 1;
+ if (!this.i) this.i = this.data.length;
+ this.state = this.Space;
+ }
+ Ignore(c) {
+ if (c == '{') this.floor++;
+ else if (c == '}' && !--this.floor) this.state = this.Space;
+ }
+ Name(c) {
+ if (cfg.blankChar[c]) {
+ this.list.push(this.section());
+ this.state = this.NameSpace;
+ } else if (c == '{') {
+ this.list.push(this.section());
+ this.Content();
+ } else if (c == ',') {
+ this.list.push(this.section());
+ this.Comma();
+ } else if (!this.isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
+ this.state = this.Ignore;
+ }
+ NameSpace(c) {
+ if (c == '{') this.Content();
+ else if (c == ',') this.Comma();
+ else if (!cfg.blankChar[c]) this.state = this.Ignore;
+ }
+ Comma() {
+ while (cfg.blankChar[this.data[++this.i]]);
+ if (this.data[this.i] == '{') this.Content();
+ else {
+ this.start = this.i--;
+ this.state = this.Name;
+ }
+ }
+ Content() {
+ this.start = ++this.i;
+ if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
+ var content = this.section();
+ for (var i = 0, item; item = this.list[i++];)
+ if (this.res[item]) this.res[item] += ';' + content;
+ else this.res[item] = content;
+ this.list = [];
+ this.state = this.Space;
+ }
+}
\ No newline at end of file
diff --git a/components/parser/libs/MpHtmlParser.js b/components/parser/libs/MpHtmlParser.js
new file mode 100644
index 0000000..6368a4f
--- /dev/null
+++ b/components/parser/libs/MpHtmlParser.js
@@ -0,0 +1,528 @@
+/*
+ 将 html 解析为适用于小程序 rich-text 的 DOM 结构
+ github:https://github.com/jin-yufeng/Parser
+ docs:https://jin-yufeng.github.io/Parser
+ author:JinYufeng
+ update:2020/04/26
+*/
+var cfg = require('./config.js'),
+ blankChar = cfg.blankChar,
+ CssHandler = require('./CssHandler.js'),
+ screenWidth = wx.getSystemInfoSync().screenWidth;
+try {
+ var emoji = require('./emoji.js');
+} catch (e) {}
+class MpHtmlParser {
+ constructor(data, options = {}) {
+ this.attrs = {};
+ this.compress = options.compress;
+ this.CssHandler = new CssHandler(options.tagStyle, screenWidth);
+ this.data = data;
+ this.domain = options.domain;
+ this.DOM = [];
+ this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
+ this.protocol = this.domain && this.domain.includes('://') ? this.domain.split('://')[0] : 'http';
+ this.state = this.Text;
+ this.STACK = [];
+ this.useAnchor = options.useAnchor;
+ this.xml = options.xml;
+ }
+ parse() {
+ if (emoji) this.data = emoji.parseEmoji(this.data);
+ for (var c; c = this.data[this.i]; this.i++)
+ this.state(c);
+ if (this.state == this.Text) this.setText();
+ while (this.STACK.length) this.popNode(this.STACK.pop());
+ if (this.DOM.length) {
+ this.DOM[0].PoweredBy = 'Parser';
+ if (this.title) this.DOM[0].title = this.title;
+ }
+ return this.DOM;
+ }
+ // 设置属性
+ setAttr() {
+ var name = this.getName(this.attrName);
+ if (cfg.trustAttrs[name]) {
+ var val = this.attrVal;
+ if (val) {
+ if (name == 'src') this.attrs[name] = this.getUrl(this.decode(val, 'amp'));
+ else if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');
+ else this.attrs[name] = val;
+ } else if (cfg.boolAttrs[name]) this.attrs[name] = 'T';
+ }
+ this.attrVal = '';
+ while (blankChar[this.data[this.i]]) this.i++;
+ if (this.isClose()) this.setNode();
+ else {
+ this.start = this.i;
+ this.state = this.AttrName;
+ }
+ }
+ // 设置文本节点
+ setText() {
+ var back, text = this.section();
+ if (!text) return;
+ text = (cfg.onText && cfg.onText(text, () => back = true)) || text;
+ if (back) {
+ this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
+ let j = this.start + text.length;
+ for (this.i = this.start; this.i < j; this.i++) this.state(this.data[this.i]);
+ return;
+ }
+ if (!this.pre) {
+ // 合并空白符
+ var tmp = [];
+ for (let i = text.length, c; c = text[--i];)
+ if (!blankChar[c] || (!blankChar[tmp[0]] && (c = ' '))) tmp.unshift(c);
+ text = tmp.join('');
+ if (text == ' ') return;
+ }
+ this.siblings().push({
+ type: 'text',
+ text: this.decode(text)
+ });
+ }
+ // 设置元素节点
+ setNode() {
+ var node = {
+ name: this.getName(this.tagName),
+ attrs: this.attrs
+ },
+ close = cfg.selfClosingTags[node.name] || (this.xml && this.data[this.i] == '/');
+ this.attrs = {};
+ if (!cfg.ignoreTags[node.name]) {
+ this.matchAttr(node);
+ if (!close) {
+ node.children = [];
+ if (node.name == 'pre' && cfg.highlight) {
+ this.remove(node);
+ this.pre = node.pre = true;
+ }
+ this.siblings().push(node);
+ this.STACK.push(node);
+ } else if (!cfg.filter || cfg.filter(node, this) != false)
+ this.siblings().push(node);
+ } else {
+ if (!close) this.remove(node);
+ else if (node.name == 'source') {
+ var parent = this.parent(),
+ attrs = node.attrs;
+ if (parent && attrs.src)
+ if (parent.name == 'video' || parent.name == 'audio')
+ parent.attrs.source.push(attrs.src);
+ else {
+ var i, media = attrs.media;
+ if (parent.name == 'picture' && !parent.attrs.src && (!media || (media.includes('px') &&
+ (((i = media.indexOf('min-width')) != -1 && (i = media.indexOf(':', i + 8)) != -1 && screenWidth > parseInt(media.substr(i + 1))) ||
+ ((i = media.indexOf('max-width')) != -1 && (i = media.indexOf(':', i + 8)) != -1 && screenWidth < parseInt(media.substr(i + 1)))))))
+ parent.attrs.src = attrs.src;
+ }
+ } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
+ }
+ if (this.data[this.i] == '/') this.i++;
+ this.start = this.i + 1;
+ this.state = this.Text;
+ }
+ // 移除标签
+ remove(node) {
+ var name = node.name,
+ j = this.i;
+ while (1) {
+ if ((this.i = this.data.indexOf('', this.i + 1)) == -1) {
+ if (name == 'pre' || name == 'svg') this.i = j;
+ else this.i = this.data.length;
+ return;
+ }
+ this.start = (this.i += 2);
+ while (!blankChar[this.data[this.i]] && !this.isClose()) this.i++;
+ if (this.getName(this.section()) == name) {
+ // 代码块高亮
+ if (name == 'pre') {
+ this.data = this.data.substr(0, j + 1) + cfg.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data.substr(this.i - 5);
+ return this.i = j;
+ } else if (name == 'style')
+ this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));
+ else if (name == 'title')
+ this.title = this.data.substring(j + 1, this.i - 7);
+ if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
+ // 处理 svg
+ if (name == 'svg') {
+ var src = this.data.substring(j, this.i + 1);
+ if (!node.attrs.xmlns) src = ' xmlns="http://www.w3.org/2000/svg"' + src;
+ var i = j;
+ while (this.data[j] != '<') j--;
+ src = this.data.substring(j, i) + src;
+ var parent = this.parent();
+ if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline'))
+ parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
+ this.siblings().push({
+ name: 'img',
+ attrs: {
+ src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
+ ignore: 'T'
+ }
+ })
+ }
+ return;
+ }
+ }
+ }
+ // 处理属性
+ matchAttr(node) {
+ var attrs = node.attrs,
+ style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
+ styleObj = {};
+ if (attrs.id) {
+ if (this.compress & 1) attrs.id = void 0;
+ else if (this.useAnchor) this.bubble();
+ }
+ if ((this.compress & 2) && attrs.class) attrs.class = void 0;
+ switch (node.name) {
+ case 'a':
+ case 'ad':
+ this.bubble();
+ break;
+ case 'font':
+ if (attrs.color) {
+ styleObj['color'] = attrs.color;
+ attrs.color = void 0;
+ }
+ if (attrs.face) {
+ styleObj['font-family'] = attrs.face;
+ attrs.face = void 0;
+ }
+ if (attrs.size) {
+ var size = parseInt(attrs.size);
+ if (size < 1) size = 1;
+ else if (size > 7) size = 7;
+ var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
+ styleObj['font-size'] = map[size - 1];
+ attrs.size = void 0;
+ }
+ break;
+ case 'video':
+ case 'audio':
+ if (!attrs.id) attrs.id = node.name + (++this[`${node.name}Num`]);
+ else this[`${node.name}Num`]++;
+ if (node.name == 'video') {
+ if (this.videoNum > 3)
+ node.lazyLoad = 1;
+ if (attrs.width) {
+ styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
+ attrs.width = void 0;
+ }
+ if (attrs.height) {
+ styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
+ attrs.height = void 0;
+ }
+ }
+ attrs.source = [];
+ if (attrs.src) attrs.source.push(attrs.src);
+ if (!attrs.controls && !attrs.autoplay)
+ console.warn(`存在没有 controls 属性的 ${node.name} 标签,可能导致无法播放`, node);
+ this.bubble();
+ break;
+ case 'td':
+ case 'th':
+ if (attrs.colspan || attrs.rowspan)
+ for (var k = this.STACK.length, item; item = this.STACK[--k];)
+ if (item.name == 'table') {
+ item.c = void 0;
+ break;
+ }
+ }
+ if (attrs.align) {
+ styleObj['text-align'] = attrs.align;
+ attrs.align = void 0;
+ }
+ // 压缩 style
+ var styles = style.split(';');
+ style = '';
+ for (var i = 0, len = styles.length; i < len; i++) {
+ var info = styles[i].split(':');
+ if (info.length < 2) continue;
+ let key = info[0].trim().toLowerCase(),
+ value = info.slice(1).join(':').trim();
+ if (value.includes('-webkit') || value.includes('-moz') || value.includes('-ms') || value.includes('-o') || value.includes('safe'))
+ style += `;${key}:${value}`;
+ else if (!styleObj[key] || value.includes('import') || !styleObj[key].includes('import'))
+ styleObj[key] = value;
+ }
+ if (node.name == 'img' || node.name == 'picture') {
+ if (attrs['data-src']) {
+ attrs.src = attrs.src || attrs['data-src'];
+ attrs['data-src'] = void 0;
+ }
+ if ((attrs.src || node.name == 'picture') && !attrs.ignore) {
+ if (this.bubble())
+ attrs.i = (this.imgNum++).toString();
+ else attrs.ignore = 'T';
+ }
+ if (attrs.ignore) styleObj['max-width'] = '100%';
+ var width;
+ if(styleObj.width) width = styleObj.width;
+ else if(attrs.width) width = attrs.width.includes('%') ? attrs.width : attrs.width + 'px';
+ if (width) {
+ styleObj.width = width;
+ attrs.width = '100%';
+ if (parseInt(width) > screenWidth) {
+ styleObj.height = '';
+ if (attrs.height) attrs.height = void 0;
+ }
+ }
+ if (styleObj.height) {
+ attrs.height = styleObj.height;
+ styleObj.height = '';
+ } else if (attrs.height && !attrs.height.includes('%'))
+ attrs.height += 'px';
+ }
+ for (var key in styleObj) {
+ var value = styleObj[key];
+ if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
+ // 填充链接
+ if (value.includes('url')) {
+ var j = value.indexOf('(');
+ if (j++ != -1) {
+ while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) j++;
+ value = value.substr(0, j) + this.getUrl(value.substr(j));
+ }
+ }
+ // 转换 rpx
+ else if (value.includes('rpx'))
+ value = value.replace(/[0-9.]+\s*rpx/g, $ => parseFloat($) * screenWidth / 750 + 'px');
+ else if (key == 'white-space' && value.includes('pre'))
+ this.pre = node.pre = true;
+ style += `;${key}:${value}`;
+ }
+ style = style.substr(1);
+ if (style) attrs.style = style;
+ }
+ // 节点出栈处理
+ popNode(node) {
+ // 空白符处理
+ if (node.pre) {
+ node.pre = this.pre = void 0;
+ for (let i = this.STACK.length; i--;)
+ if (this.STACK[i].pre)
+ this.pre = true;
+ }
+ if (node.name == 'head' || (cfg.filter && cfg.filter(node, this) == false))
+ return this.siblings().pop();
+ var attrs = node.attrs;
+ // 替换一些标签名
+ if (node.name == 'picture') {
+ node.name = 'img';
+ if (!attrs.src && (node.children[0] || '').name == 'img')
+ attrs.src = node.children[0].attrs.src;
+ return node.children = void 0;
+ }
+ if (cfg.blockTags[node.name]) node.name = 'div';
+ else if (!cfg.trustTags[node.name]) node.name = 'span';
+ // 处理列表
+ if (node.c && (node.name == 'ul' || node.name == 'ol')) {
+ if ((node.attrs.style || '').includes('list-style:none')) {
+ for (let i = 0, child; child = node.children[i++];)
+ if (child.name == 'li')
+ child.name = 'div';
+ } else if (node.name == 'ul') {
+ var floor = 1;
+ for (let i = this.STACK.length; i--;)
+ if (this.STACK[i].name == 'ul') floor++;
+ if (floor != 1)
+ for (let i = node.children.length; i--;)
+ node.children[i].floor = floor;
+ } else {
+ for (let i = 0, num = 1, child; child = node.children[i++];)
+ if (child.name == 'li') {
+ child.type = 'ol';
+ child.num = ((num, type) => {
+ if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
+ if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
+ if (type == 'i' || type == 'I') {
+ num = (num - 1) % 99 + 1;
+ var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
+ ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
+ res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
+ if (type == 'i') return res.toLowerCase();
+ return res;
+ }
+ return num;
+ })(num++, attrs.type) + '.';
+ }
+ }
+ }
+ // 处理表格的边框
+ if (node.name == 'table') {
+ var padding = attrs.cellpadding,
+ spacing = attrs.cellspacing,
+ border = attrs.border;
+ if (node.c) {
+ this.bubble();
+ attrs.style = (attrs.style || '') + ';display:table';
+ if (!padding) padding = 2;
+ if (!spacing) spacing = 2;
+ }
+ if (border) attrs.style = `border:${border}px solid gray;${attrs.style || ''}`;
+ if (spacing) attrs.style = `border-spacing:${spacing}px;${attrs.style || ''}`;
+ if (border || padding || node.c)
+ (function f(ns) {
+ for (var i = 0, n; n = ns[i]; i++) {
+ if(n.type == 'text') continue;
+ var style = n.attrs.style || '';
+ if (node.c && n.name[0] == 't') {
+ n.c = 1;
+ style += ';display:table-' + (n.name == 'th' || n.name == 'td' ? 'cell' : (n.name == 'tr' ? 'row' : 'row-group'));
+ }
+ if (n.name == 'th' || n.name == 'td') {
+ if (border) style = `border:${border}px solid gray;${style}`;
+ if (padding) style = `padding:${padding}px;${style}`;
+ } else f(n.children || []);
+ if (style) n.attrs.style = style;
+ }
+ })(node.children)
+ }
+ this.CssHandler.pop && this.CssHandler.pop(node);
+ // 自动压缩
+ if (node.name == 'div' && !Object.keys(attrs).length) {
+ var siblings = this.siblings();
+ if (node.children.length == 1 && node.children[0].name == 'div')
+ siblings[siblings.length - 1] = node.children[0];
+ }
+ }
+ // 工具函数
+ bubble() {
+ for (var i = this.STACK.length, item; item = this.STACK[--i];) {
+ if (cfg.richOnlyTags[item.name]) {
+ if (item.name == 'table' && !Object.hasOwnProperty.call(item, 'c')) item.c = 1;
+ return false;
+ }
+ item.c = 1;
+ }
+ return true;
+ }
+ decode(val, amp) {
+ var i = -1,
+ j, en;
+ while (1) {
+ if ((i = val.indexOf('&', i + 1)) == -1) break;
+ if ((j = val.indexOf(';', i + 2)) == -1) break;
+ if (val[i + 1] == '#') {
+ en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
+ if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
+ } else {
+ en = val.substring(i + 1, j);
+ if (cfg.entities[en] || en == amp)
+ val = val.substr(0, i) + (cfg.entities[en] || '&') + val.substr(j + 1);
+ }
+ }
+ return val;
+ }
+ getUrl(url) {
+ if (url[0] == '/') {
+ if (url[1] == '/') url = this.protocol + ':' + url;
+ else if (this.domain) url = this.domain + url;
+ } else if (this.domain && url.indexOf('data:') != 0 && !url.includes('://'))
+ url = this.domain + '/' + url;
+ return url;
+ }
+ getName = val => this.xml ? val : val.toLowerCase();
+ isClose = () => this.data[this.i] == '>' || (this.data[this.i] == '/' && this.data[this.i + 1] == '>');
+ section = () => this.data.substring(this.start, this.i);
+ parent = () => this.STACK[this.STACK.length - 1];
+ siblings = () => this.STACK.length ? this.parent().children : this.DOM;
+ // 状态机
+ Text(c) {
+ if (c == '<') {
+ var next = this.data[this.i + 1],
+ isLetter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
+ if (isLetter(next)) {
+ this.setText();
+ this.start = this.i + 1;
+ this.state = this.TagName;
+ } else if (next == '/') {
+ this.setText();
+ if (isLetter(this.data[++this.i + 1])) {
+ this.start = this.i + 1;
+ this.state = this.EndTag;
+ } else this.Comment();
+ } else if (next == '!') {
+ this.setText();
+ this.Comment();
+ }
+ }
+ }
+ Comment() {
+ var key;
+ if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';
+ else if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';
+ else key = '>';
+ if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;
+ else this.i += key.length - 1;
+ this.start = this.i + 1;
+ this.state = this.Text;
+ }
+ TagName(c) {
+ if (blankChar[c]) {
+ this.tagName = this.section();
+ while (blankChar[this.data[this.i]]) this.i++;
+ if (this.isClose()) this.setNode();
+ else {
+ this.start = this.i;
+ this.state = this.AttrName;
+ }
+ } else if (this.isClose()) {
+ this.tagName = this.section();
+ this.setNode();
+ }
+ }
+ AttrName(c) {
+ var blank = blankChar[c];
+ if (blank) {
+ this.attrName = this.section();
+ c = this.data[this.i];
+ }
+ if (c == '=') {
+ if (!blank) this.attrName = this.section();
+ while (blankChar[this.data[++this.i]]);
+ this.start = this.i--;
+ this.state = this.AttrValue;
+ } else if (blank) this.setAttr();
+ else if (this.isClose()) {
+ this.attrName = this.section();
+ this.setAttr();
+ }
+ }
+ AttrValue(c) {
+ if (c == '"' || c == "'") {
+ this.start++;
+ if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
+ this.attrVal = this.section();
+ this.i++;
+ } else {
+ for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++);
+ this.attrVal = this.section();
+ }
+ this.setAttr();
+ }
+ EndTag(c) {
+ if (blankChar[c] || c == '>' || c == '/') {
+ var name = this.getName(this.section());
+ for (var i = this.STACK.length; i--;)
+ if (this.STACK[i].name == name) break;
+ if (i != -1) {
+ var node;
+ while ((node = this.STACK.pop()).name != name);
+ this.popNode(node);
+ } else if (name == 'p' || name == 'br')
+ this.siblings().push({
+ name,
+ attrs: {}
+ });
+ this.i = this.data.indexOf('>', this.i);
+ this.start = this.i + 1;
+ if (this.i == -1) this.i = this.data.length;
+ else this.state = this.Text;
+ }
+ }
+}
+module.exports = MpHtmlParser;
\ No newline at end of file
diff --git a/components/parser/libs/config.js b/components/parser/libs/config.js
new file mode 100644
index 0000000..795f439
--- /dev/null
+++ b/components/parser/libs/config.js
@@ -0,0 +1,102 @@
+/* 配置文件 */
+const canIUse = wx.canIUse('editor'); // 高基础库标识,用于兼容
+const Prism = require('./prism.js');
+module.exports = {
+ // 过滤器函数
+ filter(node, cxt) {
+ if (node.name == 'pre')
+ cxt.bubble(); // 使得 pre 不被 rich-text 包含(为实现长按复制)
+ },
+ // 代码高亮函数
+ highlight(content, attrs) {
+ var info = content.match(/([\s\S]+)<\/code.*?>/m);
+ if (!info) return content;
+ var lan = info[1];
+ content = info[2].replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
+ attrs['data-content'] = content; // 记录原始内容,长按复制时使用
+ switch (lan) {
+ case 'js':
+ case 'javascript':
+ content = Prism.highlight(content, Prism.languages.javascript, 'javascript');
+ break;
+ case 'html':
+ case 'html-editor':
+ case 'wxml':
+ case 'vue':
+ content = Prism.highlight(content, Prism.languages.html, 'html');
+ break;
+ case 'json':
+ content = Prism.highlight(content, Prism.languages.json, 'json');
+ break;
+ case 'md':
+ case 'md-editor':
+ case 'markdown':
+ content = Prism.highlight(content, Prism.languages.markdown, 'markdown');
+ break;
+ case 'c':
+ case 'cpp':
+ content = Prism.highlight(content, Prism.languages.clike, 'clike');
+ }
+ // 增加语言显示
+ if (!lan.includes('editor'))
+ content = `${lan}${content}
`;
+ return content;
+ },
+ // 文本处理函数
+ onText: null,
+ // 实体编码列表
+ entities: {
+ quot: '"',
+ apos: "'",
+ semi: ';',
+ nbsp: '\xA0',
+ ndash: '–',
+ mdash: '—',
+ middot: '·',
+ lsquo: '‘',
+ rsquo: '’',
+ ldquo: '“',
+ rdquo: '”',
+ bull: '•',
+ hellip: '…'
+ },
+ blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
+ inlineTags: makeMap('abbr,b,big,code,del,em,i,ins,label,q,small,span,strong'),
+ // 块级标签,将被转为 div
+ blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,section' + (canIUse ? '' : ',pre')),
+ // 将被移除的标签
+ ignoreTags: makeMap('area,base,basefont,canvas,command,embed,frame,iframe,input,isindex,keygen,link,map,meta,param,script,source,style,svg,textarea,title,track,use,wbr' + (canIUse ? ',rp' : '')),
+ // 只能被 rich-text 显示的标签
+ richOnlyTags: makeMap('a,colgroup,fieldset,legend,picture,table' + (canIUse ? ',bdi,bdo,rt,ruby' : '')),
+ // 自闭合的标签
+ selfClosingTags: makeMap('area,base,basefont,br,col,circle,ellipse,embed,frame,hr,img,input,isindex,keygen,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
+ // 信任的属性
+ trustAttrs: makeMap('align,alt,app-id,author,autoplay,border,cellpadding,cellspacing,class,color,colspan,controls,data-src,dir,face,height,href,id,ignore,loop,media,muted,name,path,poster,rowspan,size,span,src,start,style,type,unit-id,width,xmlns'),
+ // bool 型的属性
+ boolAttrs: makeMap('autoplay,controls,ignore,loop,muted'),
+ // 信任的标签
+ trustTags: makeMap('a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video' + (canIUse ? ',bdi,bdo,caption,pre,rt,ruby' : '')),
+ // 默认的标签样式
+ userAgentStyles: {
+ address: 'font-style:italic',
+ big: 'display:inline;font-size:1.2em',
+ blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
+ caption: 'display:table-caption;text-align:center',
+ center: 'text-align:center',
+ cite: 'font-style:italic',
+ dd: 'margin-left:40px',
+ mark: 'background-color:yellow',
+ pre: 'font-family:monospace;white-space:pre;overflow:scroll',
+ s: 'text-decoration:line-through',
+ small: 'display:inline;font-size:0.8em',
+ u: 'text-decoration:underline'
+ }
+}
+
+function makeMap(str) {
+ var map = {},
+ list = str.split(',');
+ for (var i = list.length; i--;)
+ map[list[i]] = true;
+ return map;
+}
\ No newline at end of file
diff --git a/components/parser/libs/emoji.js b/components/parser/libs/emoji.js
new file mode 100644
index 0000000..d6dadee
--- /dev/null
+++ b/components/parser/libs/emoji.js
@@ -0,0 +1,198 @@
+/*
+ emoji 扩展包
+ github:https://github.com/jin-yufeng/Parser
+ docs:https://jin-yufeng.github.io/Parser
+ author:JinYufeng
+*/
+const reg = /\[(\S+?)\]/g;
+const data = {
+ '笑脸': '😄',
+ '生病': '😷',
+ '破涕为笑': '😂',
+ '吐舌': '😝',
+ '脸红': '😳',
+ '恐惧': '😱',
+ '失望': '😔',
+ '无语': '😒',
+ '眨眼': '😉',
+ '酷': '😎',
+ '哭': '😭',
+ '痴迷': '😍',
+ '吻': '😘',
+ '思考': '🤔',
+ '困惑': '😕',
+ '颠倒': '🙃',
+ '钱': '🤑',
+ '惊讶': '😲',
+ '白眼': '🙄',
+ '叹气': '😤',
+ '睡觉': '😴',
+ '书呆子': '🤓',
+ '愤怒': '😡',
+ '面无表情': '😑',
+ '张嘴': '😮',
+ '量体温': '🤒',
+ '呕吐': '🤮',
+ '光环': '😇',
+ '幽灵': '👻',
+ '外星人': '👽',
+ '机器人': '🤖',
+ '捂眼镜': '🙈',
+ '捂耳朵': '🙉',
+ '捂嘴': '🙊',
+ '婴儿': '👶',
+ '男孩': '👦',
+ '女孩': '👧',
+ '男人': '👨',
+ '女人': '👩',
+ '老人': '👴',
+ '老妇人': '👵',
+ '警察': '👮',
+ '王子': '🤴',
+ '公主': '🤴',
+ '举手': '🙋',
+ '跑步': '🏃',
+ '家庭': '👪',
+ '眼睛': '👀',
+ '鼻子': '👃',
+ '耳朵': '👂',
+ '舌头': '👅',
+ '嘴': '👄',
+ '心': '❤️',
+ '心碎': '💔',
+ '雪人': '☃️',
+ '情书': '💌',
+ '大便': '💩',
+ '闹钟': '⏰',
+ '眼镜': '👓',
+ '雨伞': '☂️',
+ '音乐': '🎵',
+ '话筒': '🎤',
+ '游戏机': '🎮',
+ '喇叭': '📢',
+ '耳机': '🎧',
+ '礼物': '🎁',
+ '电话': '📞',
+ '电脑': '💻',
+ '打印机': '🖨️',
+ '手电筒': '🔦',
+ '灯泡': '💡',
+ '书本': '📖',
+ '信封': '✉️',
+ '药丸': '💊',
+ '口红': '💄',
+ '手机': '📱',
+ '相机': '📷',
+ '电视': '📺',
+ '中': '🀄',
+ '垃圾桶': '🚮',
+ '厕所': '🚾',
+ '感叹号': '❗',
+ '禁': '🈲',
+ '可': '🉑',
+ '彩虹': '🌈',
+ '旋风': '🌀',
+ '雷电': '⚡',
+ '雪花': '❄️',
+ '星星': '⭐',
+ '水滴': '💧',
+ '玫瑰': '🌹',
+ '加油': '💪',
+ '左': '👈',
+ '右': '👉',
+ '上': '👆',
+ '下': '👇',
+ '手掌': '🖐️',
+ '好的': '👌',
+ '好': '👍',
+ '差': '👎',
+ '胜利': '✌',
+ '拳头': '👊',
+ '挥手': '👋',
+ '鼓掌': '👏',
+ '猴子': '🐒',
+ '狗': '🐶',
+ '狼': '🐺',
+ '猫': '🐱',
+ '老虎': '🐯',
+ '马': '🐎',
+ '独角兽': '🦄',
+ '斑马': '🦓',
+ '鹿': '🦌',
+ '牛': '🐮',
+ '猪': '🐷',
+ '羊': '🐏',
+ '长颈鹿': '🦒',
+ '大象': '🐘',
+ '老鼠': '🐭',
+ '蝙蝠': '🦇',
+ '刺猬': '🦔',
+ '熊猫': '🐼',
+ '鸽子': '🕊️',
+ '鸭子': '🦆',
+ '兔子': '🐇',
+ '老鹰': '🦅',
+ '青蛙': '🐸',
+ '蛇': '🐍',
+ '龙': '🐉',
+ '鲸鱼': '🐳',
+ '海豚': '🐬',
+ '足球': '⚽',
+ '棒球': '⚾',
+ '篮球': '🏀',
+ '排球': '🏐',
+ '橄榄球': '🏉',
+ '网球': '🎾',
+ '骰子': '🎲',
+ '鸡腿': '🍗',
+ '蛋糕': '🎂',
+ '啤酒': '🍺',
+ '饺子': '🥟',
+ '汉堡': '🍔',
+ '薯条': '🍟',
+ '意大利面': '🍝',
+ '干杯': '🥂',
+ '筷子': '🥢',
+ '糖果': '🍬',
+ '奶瓶': '🍼',
+ '爆米花': '🍿',
+ '邮局': '🏤',
+ '医院': '🏥',
+ '银行': '🏦',
+ '酒店': '🏨',
+ '学校': '🏫',
+ '城堡': '🏰',
+ '火车': '🚂',
+ '高铁': '🚄',
+ '地铁': '🚇',
+ '公交': '🚌',
+ '救护车': '🚑',
+ '消防车': '🚒',
+ '警车': '🚓',
+ '出租车': '🚕',
+ '汽车': '🚗',
+ '货车': '🚛',
+ '自行车': '🚲',
+ '摩托': '🛵',
+ '红绿灯': '🚥',
+ '帆船': '⛵',
+ '游轮': '🛳️',
+ '轮船': '⛴️',
+ '飞机': '✈️',
+ '直升机': '🚁',
+ '缆车': '🚠',
+ '警告': '⚠️',
+ '禁止': '⛔'
+}
+module.exports = {
+ parseEmoji: (text) => text.replace(reg, ($, $1) => {
+ if (data[$1]) {
+ if (data[$1].includes('http'))
+ return `
`;
+ else return data[$1];
+ } else return $;
+ }),
+ getEmoji: (key) => data[key],
+ setEmoji: (key, emoji) => data[key] = emoji,
+ removeEmoji: (key) => data[key] = void 0
+}
\ No newline at end of file
diff --git a/components/parser/libs/prism.js b/components/parser/libs/prism.js
new file mode 100644
index 0000000..9a95229
--- /dev/null
+++ b/components/parser/libs/prism.js
@@ -0,0 +1,9 @@
+/* PrismJS 1.19.0
+https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript+json+markdown */
+var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,r=0,C={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function e(r){return r instanceof _?new _(r.type,e(r.content),r.alias):Array.isArray(r)?r.map(e):r.replace(/&/g,"&").replace(/e.length)return;if(!(k instanceof _)){if(h&&y!=r.length-1){if(c.lastIndex=v,!(S=c.exec(e)))break;for(var b=S.index+(f&&S[1]?S[1].length:0),w=S.index+S[0].length,A=y,P=v,x=r.length;A"+a.content+""+a.tag+">"},!u.document)return u.addEventListener&&(C.disableWorkerMessageHandler||u.addEventListener("message",function(e){var r=JSON.parse(e.data),n=r.language,t=r.code,a=r.immediateClose;u.postMessage(C.highlight(t,C.languages[n],n)),a&&u.close()},!1)),C;var e=C.util.currentScript();function n(){C.manual||C.highlightAll()}if(e&&(C.filename=e.src,e.hasAttribute("data-manual")&&(C.manual=!0)),!C.manual){var t=document.readyState;"loading"===t||"interactive"===t&&e&&e.defer?document.addEventListener("DOMContentLoaded",n):window.requestAnimationFrame?window.requestAnimationFrame(n):window.setTimeout(n,16)}return C}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
+Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:(?!)*\]\s*)?>/i,greedy:!0},cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var n={"included-cdata":{pattern://i,inside:s}};n["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var t={};t[a]={pattern:RegExp("(<__[\\s\\S]*?>)(?:\\s*|[\\s\\S])*?(?=<\\/__>)".replace(/__/g,a),"i"),lookbehind:!0,greedy:!0,inside:n},Prism.languages.insertBefore("markup","cdata",t)}}),Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
+!function(s){var e=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\((?!\s*\))\s*)(?:[^()]|\((?:[^()]|\([^()]*\))*\))+?(?=\s*\))/,lookbehind:!0,alias:"selector"}}},url:{pattern:RegExp("url\\((?:"+e.source+"|[^\n\r()]*)\\)","i"),inside:{function:/^url/i,punctuation:/^\(|\)$/}},selector:RegExp("[^{}\\s](?:[^{};\"']|"+e.source+")*?(?=\\s*\\{)"),string:{pattern:e,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var t=s.languages.markup;t&&(t.tag.addInlined("style","css"),s.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:t.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:s.languages.css}},alias:"language-css"}},t.tag))}(Prism);
+Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};
+Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/--|\+\+|\*\*=?|=>|&&|\|\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?[.?]?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*[\s\S]*?\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript;
+Prism.languages.json={property:{pattern:/"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,greedy:!0},comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,number:/-?\d+\.?\d*(?:e[+-]?\d+)?/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}};
+!function(d){function n(n,e){return n=n.replace(//g,"(?:\\\\.|[^\\\\\\n\r]|(?:\r?\n|\r)(?!\r?\n|\r))"),e&&(n=n+"|"+n.replace(/_/g,"\\*")),RegExp("((?:^|[^\\\\])(?:\\\\{2})*)(?:"+n+")")}var e="(?:\\\\.|``.+?``|`[^`\r\\n]+`|[^\\\\|\r\\n`])+",t="\\|?__(?:\\|__)+\\|?(?:(?:\r?\n|\r)|$)".replace(/__/g,e),a="\\|?[ \t]*:?-{3,}:?[ \t]*(?:\\|[ \t]*:?-{3,}:?[ \t]*)+\\|?(?:\r?\n|\r)";d.languages.markdown=d.languages.extend("markup",{}),d.languages.insertBefore("markdown","prolog",{blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+t+a+"(?:"+t+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+t+a+")(?:"+t+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(e),inside:d.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+t+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+t+"$"),inside:{"table-header":{pattern:RegExp(e),alias:"important",inside:d.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/(^[ \t]*(?:\r?\n|\r))(?: {4}|\t).+(?:(?:\r?\n|\r)(?: {4}|\t).+)*/m,lookbehind:!0,alias:"keyword"},{pattern:/``.+?``|`[^`\r\n]+`/,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\r?\n|\r))[\s\S]+?(?=(?:\r?\n|\r)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\r?\n|\r)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#+.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n("__(?:(?!_)|_(?:(?!_))+_)+__",!0),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n("_(?:(?!_)|__(?:(?!_))+__)+_",!0),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n("(~~?)(?:(?!~))+?\\2",!1),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},url:{pattern:n('!?\\[(?:(?!\\]))+\\](?:\\([^\\s)]+(?:[\t ]+"(?:\\\\.|[^"\\\\])*")?\\)| ?\\[(?:(?!\\]))+\\])',!1),lookbehind:!0,greedy:!0,inside:{variable:{pattern:/(\[)[^\]]+(?=\]$)/,lookbehind:!0},content:{pattern:/(^!?\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},string:{pattern:/"(?:\\.|[^"\\])*"(?=\)$)/}}}}),["url","bold","italic","strike"].forEach(function(e){["url","bold","italic","strike"].forEach(function(n){e!==n&&(d.languages.markdown[e].inside.content.inside[n]=d.languages.markdown[n])})}),d.hooks.add("after-tokenize",function(n){"markdown"!==n.language&&"md"!==n.language||!function n(e){if(e&&"string"!=typeof e)for(var t=0,a=e.length;t 0.5 ? c.toUpperCase() : c;
+ }
+ newSrc += src.substr(j);
+ return this[i] = newSrc;
+ }
+ this[i] = src;
+ // 暂存 data src
+ if (src.includes('data:image')) {
+ var info = src.match(/data:image\/(\S+?);(\S+?),(.+)/);
+ if (!info) return;
+ var filePath = `${wx.env.USER_DATA_PATH}/${Date.now()}.${info[1]}`;
+ fs && fs.writeFile({
+ filePath,
+ data: info[3],
+ encoding: info[2],
+ success: () => this[i] = filePath
+ })
+ }
+ }
+ this.imgList.each = function (f) {
+ for (var i = 0, len = this.length; i < len; i++)
+ this.setItem(i, f(this[i], i, this));
+ }
+ if (dom) this.document = new dom(this);
+ },
+ detached() {
+ // 删除暂存
+ this.imgList.each(src => {
+ if (src && src.includes(wx.env.USER_DATA_PATH) && fs)
+ fs.unlink({
+ filePath: src
+ })
+ })
+ clearInterval(this._timer);
+ },
+ methods: {
+ // 锚点跳转
+ navigateTo(obj) {
+ if (!this.data.useAnchor)
+ return obj.fail && obj.fail({
+ errMsg: 'Anchor is disabled'
+ })
+ this.createSelectorQuery()
+ .select('.top' + (obj.id ? '>>>#' + obj.id : '')).boundingClientRect()
+ .selectViewport().scrollOffset().exec(res => {
+ if (!res[0])
+ return this.group ? this.group.navigateTo(this.i, obj) :
+ obj.fail && obj.fail({
+ errMsg: 'Label not found'
+ });
+ obj.scrollTop = res[1].scrollTop + res[0].top + (obj.offset || 0);
+ wx.pageScrollTo(obj);
+ })
+ },
+ // 获取文本
+ getText(ns = this.data.html) {
+ var txt = '';
+ for (var i = 0, n; n = ns[i++];) {
+ if (n.type == 'text') txt += n.text.replace(/ /g, '\u00A0').replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
+ else if (n.type == 'br') txt += '\n';
+ else {
+ // 块级标签前后加换行
+ var br = n.name == 'p' || n.name == 'div' || n.name == 'tr' || n.name == 'li' || (n.name[0] == 'h' && n.name[1] > '0' && n.name[1] < '7');
+ if (br && txt && txt[txt.length - 1] != '\n') txt += '\n';
+ if (n.children) txt += this.getText(n.children);
+ if (br && txt[txt.length - 1] != '\n') txt += '\n';
+ else if (n.name == 'td' || n.name == 'th') txt += '\t';
+ }
+ }
+ return txt;
+ },
+ // 获取视频 context
+ getVideoContext(id) {
+ if (!id) return this.videoContexts;
+ for (var i = this.videoContexts.length; i--;)
+ if (this.videoContexts[i].id == id) return this.videoContexts[i];
+ },
+ // 渲染富文本
+ setContent(html, append, _watch) {
+ var data = {};
+ if (!html) {
+ if (_watch || append) return;
+ data.html = '';
+ } else if (typeof html == 'string') {
+ let parser = new Parser(html, this.data);
+ // 缓存读取
+ if (this.data.useCache) {
+ var hashVal = hash(html);
+ if (cache[hashVal]) data.html = cache[hashVal];
+ else {
+ data.html = parser.parse();
+ cache[hashVal] = data.html;
+ }
+ } else data.html = parser.parse();
+ this._refresh = true;
+ this.triggerEvent('parse', data.html);
+ } else if (html.constructor == Array) {
+ // 转换不符合格式的 array
+ if (html.length && html[0].PoweredBy != 'Parser') {
+ let parser = new Parser('', this.data);
+ (function f(ns) {
+ for (var i = 0, n; n = ns[i]; i++) {
+ if (n.type == 'text') continue;
+ n.attrs = n.attrs || {};
+ for (var key in n.attrs)
+ if (typeof n.attrs[key] != 'string') n.attrs[key] = n.attrs[key].toString();
+ parser.matchAttr(n);
+ if (n.children) {
+ parser.STACK.push(n);
+ f(n.children);
+ parser.popNode(parser.STACK.pop());
+ }
+ }
+ })(html);
+ data.html = html;
+ }
+ if (!_watch) data.html = html;
+ } else if (typeof html == 'object' && html.nodes) {
+ data.html = html.nodes;
+ console.warn('错误的 html 类型:object 类型已废弃');
+ } else
+ return console.warn('错误的 html 类型:' + typeof html);
+ if (append) {
+ this._refresh = true;
+ data.html = (this.data.html || []).concat(data.html);
+ } else if (this.data.showWithAnimation) data.showAm = 'animation: show .5s';
+ if (data.html || data.showAm) this.setData(data);
+ // 设置标题
+ if (this.data.html.length && this.data.html[0].title && this.data.autosetTitle)
+ wx.setNavigationBarTitle({
+ title: this.data.html[0].title
+ })
+ this.imgList.length = 0;
+ this.videoContexts = [];
+ var ns = this.selectAllComponents('.top,.top>>>._node');
+ for (let i = 0, n; n = ns[i++];) {
+ n.top = this;
+ for (var j = 0, item; item = n.data.nodes[j++];) {
+ if (item.c) continue;
+ // 获取图片列表
+ if (item.name == 'img')
+ this.imgList.setItem(item.attrs.i, item.attrs.src);
+ // 音视频控制
+ else if (item.name == 'video' || item.name == 'audio') {
+ var ctx;
+ if (item.name == 'video') ctx = wx.createVideoContext(item.attrs.id, n);
+ else ctx = n.selectComponent('#' + item.attrs.id);
+ if (ctx) {
+ ctx.id = item.attrs.id;
+ this.videoContexts.push(ctx);
+ }
+ }
+ }
+ }
+ (wx.nextTick || setTimeout)(() => this.triggerEvent('load'), 50);
+ var height;
+ clearInterval(this._timer);
+ this._timer = setInterval(() => {
+ this.createSelectorQuery().select('.top').boundingClientRect(res => {
+ this.rect = res;
+ if (res.height == height) {
+ this.triggerEvent('ready', res)
+ clearInterval(this._timer);
+ }
+ height = res.height;
+ }).exec();
+ }, 350)
+ },
+ // 预加载
+ preLoad(html, num) {
+ if (typeof html == 'string') {
+ var id = hash(html);
+ html = new Parser(html, this.data).parse();
+ cache[id] = html;
+ }
+ var imgs, wait = [];
+ (function f(ns) {
+ for (var i = 0, n; n = ns[i++];) {
+ if (n.name == 'img' && n.attrs.src && !wait.includes(n.attrs.src))
+ wait.push(n.attrs.src);
+ f(n.children || []);
+ }
+ })(html);
+ if (num) wait = wait.slice(0, num);
+ this._wait = (this._wait || []).concat(wait);
+ if (!this.data.imgs) imgs = this._wait.splice(0, 15);
+ else if (this.data.imgs.length < 15)
+ imgs = this.data.imgs.concat(this._wait.splice(0, 15 - this.data.imgs.length));
+ imgs && this.setData({
+ imgs
+ });
+ },
+ _load(e) {
+ if (this._wait.length)
+ this.setData({
+ [`imgs[${e.target.id}]`]: this._wait.shift()
+ })
+ },
+ // 事件处理
+ _tap(e) {
+ if (this.data.gestureZoom && e.timeStamp - this._lastT < 300) {
+ var initY = e.detail.y - e.currentTarget.offsetTop;
+ if (this._zoom) {
+ this._scaleAm.translateX(0).scale(1).step();
+ wx.pageScrollTo({
+ scrollTop: (initY + this._initY) / 2 - e.touches[0].clientY,
+ duration: 400
+ })
+ } else {
+ var initX = e.detail.x - e.currentTarget.offsetLeft;
+ this._initY = initY;
+ this._scaleAm = wx.createAnimation({
+ transformOrigin: `${initX}px ${this._initY}px 0`,
+ timingFunction: 'ease-in-out'
+ });
+ this._scaleAm.scale(2).step();
+ this._tMax = initX / 2;
+ this._tMin = (initX - this.rect.width) / 2;
+ this._tX = 0;
+ }
+ this._zoom = !this._zoom;
+ this.setData({
+ scaleAm: this._scaleAm.export()
+ })
+ }
+ this._lastT = e.timeStamp;
+ },
+ _touchstart(e) {
+ if (e.touches.length == 1)
+ this._initX = this._lastX = e.touches[0].pageX;
+ },
+ _touchmove(e) {
+ var diff = e.touches[0].pageX - this._lastX;
+ if (this._zoom && e.touches.length == 1 && Math.abs(diff) > 20) {
+ this._lastX = e.touches[0].pageX;
+ if ((this._tX <= this._tMin && diff < 0) || (this._tX >= this._tMax && diff > 0)) return;
+ this._tX += diff * Math.abs(this._lastX - this._initX) * 0.05;
+ if (this._tX < this._tMin) this._tX = this._tMin;
+ if (this._tX > this._tMax) this._tX = this._tMax;
+ this._scaleAm.translateX(this._tX).step();
+ this.setData({
+ scaleAm: this._scaleAm.export()
+ })
+ }
+ }
+ }
+})
\ No newline at end of file
diff --git a/components/parser/parser.json b/components/parser/parser.json
new file mode 100644
index 0000000..85e49c9
--- /dev/null
+++ b/components/parser/parser.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "trees": "./trees/trees"
+ }
+}
\ No newline at end of file
diff --git a/components/parser/parser.wxml b/components/parser/parser.wxml
new file mode 100644
index 0000000..d905cce
--- /dev/null
+++ b/components/parser/parser.wxml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/components/parser/parser.wxss b/components/parser/parser.wxss
new file mode 100644
index 0000000..7801832
--- /dev/null
+++ b/components/parser/parser.wxss
@@ -0,0 +1,16 @@
+:host {
+ display: block;
+ overflow: scroll;
+ -webkit-overflow-scrolling: touch;
+}
+.top {
+ display: inherit;
+}
+@keyframes show {
+ 0% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
\ No newline at end of file
diff --git a/components/parser/trees/trees.js b/components/parser/trees/trees.js
new file mode 100644
index 0000000..24bf445
--- /dev/null
+++ b/components/parser/trees/trees.js
@@ -0,0 +1,134 @@
+/*
+ trees 递归子组件
+ github:https://github.com/jin-yufeng/Parser
+ docs:https://jin-yufeng.github.io/Parser
+ author:JinYufeng
+ update:2020/04/25
+*/
+Component({
+ data: {
+ canIUse: !!wx.chooseMessageFile,
+ placeholder: "data:image/svg+xml;utf8,",
+ inlineTags: require('../libs/config.js').inlineTags
+ },
+ properties: {
+ nodes: Array,
+ lazyLoad: Boolean
+ },
+ methods: {
+ // 自定义事件
+ copyCode(e) {
+ wx.showActionSheet({
+ itemList: ['复制代码'],
+ success: () =>
+ wx.setClipboardData({
+ data: e.target.dataset.content
+ })
+ })
+ },
+ // 视频播放事件
+ play(e) {
+ this.top.group && this.top.group.pause(this.top.i);
+ if (this.top.videoContexts.length > 1 && this.top.data.autopause)
+ for (var i = this.top.videoContexts.length; i--;)
+ if (this.top.videoContexts[i].id != e.currentTarget.id)
+ this.top.videoContexts[i].pause();
+ },
+ // 图片事件
+ imgtap(e) {
+ var attrs = e.currentTarget.dataset.attrs;
+ if (!attrs.ignore) {
+ var preview = true;
+ this.top.triggerEvent('imgtap', {
+ id: e.currentTarget.id,
+ src: attrs.src,
+ ignore: () => preview = false
+ })
+ if (preview) {
+ if (this.top.group) return this.top.group.preview(this.top.i, attrs.i);
+ var urls = this.top.imgList,
+ current = urls[attrs.i] ? urls[attrs.i] : (urls = [attrs.src], attrs.src);
+ wx.previewImage({
+ current,
+ urls
+ })
+ }
+ }
+ },
+ loadImg(e) {
+ var i = e.target.dataset.i;
+ if (this.data.lazyLoad && !this.data.nodes[i].load)
+ this.setData({
+ [`nodes[${i}].load`]: true
+ })
+ },
+ // 链接点击事件
+ linkpress(e) {
+ var jump = true,
+ attrs = e.currentTarget.dataset.attrs;
+ attrs.ignore = () => jump = false;
+ this.top.triggerEvent('linkpress', attrs);
+ if (jump) {
+ if (attrs['app-id'])
+ wx.navigateToMiniProgram({
+ appId: attrs['app-id'],
+ path: attrs.path
+ })
+ else if (attrs.href) {
+ if (attrs.href[0] == '#')
+ this.top.navigateTo({
+ id: attrs.href.substring(1)
+ })
+ else if (attrs.href.indexOf('http') == 0 || attrs.href.indexOf('//') == 0)
+ wx.setClipboardData({
+ data: attrs.href,
+ success: () =>
+ wx.showToast({
+ title: '链接已复制'
+ })
+ })
+ else
+ wx.navigateTo({
+ url: attrs.href,
+ })
+ }
+ }
+ },
+ // 错误事件
+ error(e) {
+ var context, source = e.target.dataset.source,
+ i = e.target.dataset.i,
+ node = this.data.nodes[i];
+ if (source == 'video' || source == 'audio') {
+ // 加载其他 source
+ var index = (node.i || 0) + 1;
+ if (index < node.attrs.source.length)
+ return this.setData({
+ [`nodes[${i}].i`]: index
+ })
+ if (this.top) context = this.top.getVideoContext(e.target.id);
+ } else if (source == 'img')
+ context = {
+ setSrc: src => {
+ this.setData({
+ [`nodes[${i}].attrs.src`]: src
+ })
+ }
+ }
+ this.top && this.top.triggerEvent('error', {
+ source,
+ target: e.target,
+ context,
+ ...e.detail
+ })
+ },
+ // 加载视频
+ loadVideo(e) {
+ var i = e.target.dataset.i;
+ this.setData({
+ [`nodes[${i}].lazyLoad`]: false,
+ [`nodes[${i}].attrs.autoplay`]: true
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/components/parser/trees/trees.json b/components/parser/trees/trees.json
new file mode 100644
index 0000000..125a52b
--- /dev/null
+++ b/components/parser/trees/trees.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "trees": "./trees",
+ "myAudio": "../audio/audio"
+ }
+}
\ No newline at end of file
diff --git a/components/parser/trees/trees.wxml b/components/parser/trees/trees.wxml
new file mode 100644
index 0000000..61dea53
--- /dev/null
+++ b/components/parser/trees/trees.wxml
@@ -0,0 +1,52 @@
+
+
+module.exports = {
+ visited: function (e, owner) {
+ if (!e.instance.hasClass('_visited'))
+ e.instance.addClass('_visited')
+ owner.callMethod('linkpress', e);
+ },
+ useRichText: function (item, inlineTags) {
+ return !item.c && !inlineTags[item.name] && (item.attrs.style || '').indexOf('display:inline') == -1
+ }
+}
+
+
+
+
+
+
+
+
+ {{n.text}}
+ \n
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{n.num}}
+
+ █
+
+ █
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/parser/trees/trees.wxss b/components/parser/trees/trees.wxss
new file mode 100644
index 0000000..520b6df
--- /dev/null
+++ b/components/parser/trees/trees.wxss
@@ -0,0 +1,136 @@
+/* 在这里引入自定义样式 */
+@import "../libs/prism.wxss";
+
+/* 链接和图片效果 */
+._a {
+ color: #366092;
+ display: inline;
+ padding: 1.5px 0 1.5px 0;
+ word-break: break-all;
+}
+._hover {
+ opacity: 0.7;
+ text-decoration: underline;
+}
+._visited {
+ color: #551a8b;
+}
+._img {
+ display: inline-block;
+ max-width: 100%;
+ position: relative;
+}
+/* 内部样式 */
+:host {
+ display: inline;
+}
+._blockquote, ._div, ._p, ._ul, ._ol, ._li {
+ display: block;
+}
+._b, ._strong {
+ font-weight: bold;
+}
+._code {
+ font-family: monospace;
+}
+._del {
+ text-decoration: line-through;
+}
+._em, ._i {
+ font-style: italic;
+}
+._h1 {
+ font-size: 2em;
+}
+._h2 {
+ font-size: 1.5em;
+}
+._h3 {
+ font-size: 1.17em;
+}
+._h5 {
+ font-size: 0.83em;
+}
+._h6 {
+ font-size: 0.67em;
+}
+._h1, ._h2, ._h3, ._h4, ._h5, ._h6 {
+ display: block;
+ font-weight: bold;
+}
+._image {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0;
+}
+._ins {
+ text-decoration: underline;
+}
+._li {
+ flex: 1;
+ width: 0;
+}
+._ol-bef {
+ margin-right: 5px;
+ text-align: right;
+ width: 36px;
+}
+._ul-bef {
+ line-height: normal;
+ margin: 0 12px 0 23px;
+}
+._ol-bef, ._ul_bef {
+ flex: none;
+ user-select: none;
+}
+._ul-p1 {
+ display: inline-block;
+ height: 0.3em;
+ line-height: 0.3em;
+ overflow: hidden;
+ width: 0.3em;
+}
+._ul-p2 {
+ border: 0.05em solid black;
+ border-radius: 50%;
+ display: inline-block;
+ height: 0.23em;
+ width: 0.23em;
+}
+._q::before {
+ content: '"';
+}
+._q::after {
+ content: '"';
+}
+._sub {
+ font-size: smaller;
+ vertical-align: sub;
+}
+._sup {
+ font-size: smaller;
+ vertical-align: super;
+}
+.__bdi, .__bdo, .__ruby, .__rt {
+ display: inline-block;
+}
+._video {
+ background-color: black;
+ display: inline-block;
+ height: 225px;
+ position: relative;
+ width: 300px;
+}
+._video::after {
+ border-color: transparent transparent transparent white;
+ border-style: solid;
+ border-width: 15px 0 15px 30px;
+ content: '';
+ left: 50%;
+ margin: -15px 0 0 -15px;
+ position: absolute;
+ top: 50%;
+}
\ No newline at end of file
diff --git a/images/avg.svg b/images/avg.svg
new file mode 100644
index 0000000..11b1e56
--- /dev/null
+++ b/images/avg.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/bg.png b/images/bg.png
new file mode 100644
index 0000000..1a5342e
Binary files /dev/null and b/images/bg.png differ
diff --git a/images/candidate.svg b/images/candidate.svg
new file mode 100644
index 0000000..f6f032d
--- /dev/null
+++ b/images/candidate.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/class.svg b/images/class.svg
new file mode 100644
index 0000000..2c83ee2
--- /dev/null
+++ b/images/class.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/count.svg b/images/count.svg
new file mode 100644
index 0000000..d46b11e
--- /dev/null
+++ b/images/count.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/cuoti.svg b/images/cuoti.svg
new file mode 100644
index 0000000..1608556
--- /dev/null
+++ b/images/cuoti.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/cuoti_.svg b/images/cuoti_.svg
new file mode 100644
index 0000000..5c3277d
--- /dev/null
+++ b/images/cuoti_.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/data.png b/images/data.png
new file mode 100644
index 0000000..7fffab5
Binary files /dev/null and b/images/data.png differ
diff --git a/images/datac.png b/images/datac.png
new file mode 100644
index 0000000..849d826
Binary files /dev/null and b/images/datac.png differ
diff --git a/images/exam.svg b/images/exam.svg
new file mode 100644
index 0000000..4f489b8
--- /dev/null
+++ b/images/exam.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/examtest.svg b/images/examtest.svg
new file mode 100644
index 0000000..cf8b452
--- /dev/null
+++ b/images/examtest.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/excel.svg b/images/excel.svg
new file mode 100644
index 0000000..5d76766
--- /dev/null
+++ b/images/excel.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/file.svg b/images/file.svg
new file mode 100644
index 0000000..478dc37
--- /dev/null
+++ b/images/file.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/fushe.svg b/images/fushe.svg
new file mode 100644
index 0000000..5e78530
--- /dev/null
+++ b/images/fushe.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/home.png b/images/home.png
new file mode 100644
index 0000000..ca92acd
Binary files /dev/null and b/images/home.png differ
diff --git a/images/homec.png b/images/homec.png
new file mode 100644
index 0000000..0d7baca
Binary files /dev/null and b/images/homec.png differ
diff --git a/images/ksjl.svg b/images/ksjl.svg
new file mode 100644
index 0000000..b1ebe56
--- /dev/null
+++ b/images/ksjl.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/me.png b/images/me.png
new file mode 100644
index 0000000..549b7f4
Binary files /dev/null and b/images/me.png differ
diff --git a/images/mec.png b/images/mec.png
new file mode 100644
index 0000000..07e8078
Binary files /dev/null and b/images/mec.png differ
diff --git a/images/moni.svg b/images/moni.svg
new file mode 100644
index 0000000..353dd74
--- /dev/null
+++ b/images/moni.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/moni_.svg b/images/moni_.svg
new file mode 100644
index 0000000..9e881ba
--- /dev/null
+++ b/images/moni_.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/mp4.svg b/images/mp4.svg
new file mode 100644
index 0000000..a989e54
--- /dev/null
+++ b/images/mp4.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/news.png b/images/news.png
new file mode 100644
index 0000000..197a5f8
Binary files /dev/null and b/images/news.png differ
diff --git a/images/newsc.png b/images/newsc.png
new file mode 100644
index 0000000..975bb28
Binary files /dev/null and b/images/newsc.png differ
diff --git a/images/pdf.svg b/images/pdf.svg
new file mode 100644
index 0000000..3afe69f
--- /dev/null
+++ b/images/pdf.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/play.png b/images/play.png
new file mode 100644
index 0000000..c7b993f
Binary files /dev/null and b/images/play.png differ
diff --git a/images/playc.png b/images/playc.png
new file mode 100644
index 0000000..8d9b701
Binary files /dev/null and b/images/playc.png differ
diff --git a/images/ppt.svg b/images/ppt.svg
new file mode 100644
index 0000000..ea6c816
--- /dev/null
+++ b/images/ppt.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/qtest.svg b/images/qtest.svg
new file mode 100644
index 0000000..91cb923
--- /dev/null
+++ b/images/qtest.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/quota.svg b/images/quota.svg
new file mode 100644
index 0000000..44b74be
--- /dev/null
+++ b/images/quota.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/rate.svg b/images/rate.svg
new file mode 100644
index 0000000..78dbd71
--- /dev/null
+++ b/images/rate.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/shoucang.svg b/images/shoucang.svg
new file mode 100644
index 0000000..a4afcd6
--- /dev/null
+++ b/images/shoucang.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/shoucang_.svg b/images/shoucang_.svg
new file mode 100644
index 0000000..d7b3d46
--- /dev/null
+++ b/images/shoucang_.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/shunxu.svg b/images/shunxu.svg
new file mode 100644
index 0000000..a12c05a
--- /dev/null
+++ b/images/shunxu.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/sologan.png b/images/sologan.png
new file mode 100644
index 0000000..ba0482c
Binary files /dev/null and b/images/sologan.png differ
diff --git a/images/suiji.svg b/images/suiji.svg
new file mode 100644
index 0000000..77ef1cd
--- /dev/null
+++ b/images/suiji.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/suiji_.svg b/images/suiji_.svg
new file mode 100644
index 0000000..bdfe567
--- /dev/null
+++ b/images/suiji_.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/test.svg b/images/test.svg
new file mode 100644
index 0000000..d297546
--- /dev/null
+++ b/images/test.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/video.svg b/images/video.svg
new file mode 100644
index 0000000..012e663
--- /dev/null
+++ b/images/video.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/wave.png b/images/wave.png
new file mode 100644
index 0000000..f3d1ce7
Binary files /dev/null and b/images/wave.png differ
diff --git a/images/weishoucang.svg b/images/weishoucang.svg
new file mode 100644
index 0000000..bd36880
--- /dev/null
+++ b/images/weishoucang.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/word.svg b/images/word.svg
new file mode 100644
index 0000000..64fbba3
--- /dev/null
+++ b/images/word.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/yati.svg b/images/yati.svg
new file mode 100644
index 0000000..a3682e5
--- /dev/null
+++ b/images/yati.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/yati_.svg b/images/yati_.svg
new file mode 100644
index 0000000..ddb3c8e
--- /dev/null
+++ b/images/yati_.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/yishoucang.svg b/images/yishoucang.svg
new file mode 100644
index 0000000..5ca69de
--- /dev/null
+++ b/images/yishoucang.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/zip.svg b/images/zip.svg
new file mode 100644
index 0000000..5325174
--- /dev/null
+++ b/images/zip.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..623896a
--- /dev/null
+++ b/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "test_mini",
+ "version": "1.0.0",
+ "description": "",
+ "main": "app.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "lin-ui": "^0.8.4"
+ }
+}
diff --git a/pages/about/about.js b/pages/about/about.js
new file mode 100644
index 0000000..33d4897
--- /dev/null
+++ b/pages/about/about.js
@@ -0,0 +1,66 @@
+// pages/about/about.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/about/about.json b/pages/about/about.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/about/about.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/about/about.wxml b/pages/about/about.wxml
new file mode 100644
index 0000000..b71e85c
--- /dev/null
+++ b/pages/about/about.wxml
@@ -0,0 +1,2 @@
+
+pages/about/about.wxml
diff --git a/pages/about/about.wxss b/pages/about/about.wxss
new file mode 100644
index 0000000..0d61e08
--- /dev/null
+++ b/pages/about/about.wxss
@@ -0,0 +1 @@
+/* pages/about/about.wxss */
\ No newline at end of file
diff --git a/pages/admin/candidate/index.js b/pages/admin/candidate/index.js
new file mode 100644
index 0000000..5e8e427
--- /dev/null
+++ b/pages/admin/candidate/index.js
@@ -0,0 +1,98 @@
+// pages/admin/exam/index.js
+const api = require("../../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ page:1,
+ isLoadedAll:false,
+ count:0,
+ results:[]
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getList(1)
+ },
+ getList: function(page) {
+ wx.showLoading({
+ title: '正在加载...',
+ })
+ api.requesta('/crm/candidate/', 'GET', {page:page}).then(res=>{
+ wx.hideLoading()
+ let results = this.data.results
+ let isLoadedAll = false
+ if(res.data.results){
+ if(page==1){results=res.data.results}else{
+ results = results.concat(res.data.results)
+ }
+ }
+ if(!res.data.next){
+ isLoadedAll = true
+ }
+ this.setData({
+ count:res.data.count,
+ results:results,
+ page:page,
+ isLoadedAll: isLoadedAll
+ })
+ }).catch(
+ wx.hideLoading()
+ )
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ this.getList(1)
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if(!this.data.isLoadedAll){
+ this.data.page=this.data.page+1
+ this.getList(this.data.page)
+ }
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/admin/candidate/index.json b/pages/admin/candidate/index.json
new file mode 100644
index 0000000..4e57ba6
--- /dev/null
+++ b/pages/admin/candidate/index.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "出证记录",
+ "enablePullDownRefresh":true
+}
\ No newline at end of file
diff --git a/pages/admin/candidate/index.wxml b/pages/admin/candidate/index.wxml
new file mode 100644
index 0000000..727eb16
--- /dev/null
+++ b/pages/admin/candidate/index.wxml
@@ -0,0 +1,31 @@
+
+
+ 已颁发的证书,共{{count}}张
+
+
+
+
+ 身份证号:{{item.ID_number}}
+
+
+ 工作类别:{{item.workscope_name}}
+
+
+ 期限:{{item.start_date}}至{{item.end_date}}
+
+
+
+
+
+
+ 到底了
+
+
\ No newline at end of file
diff --git a/pages/admin/candidate/index.wxss b/pages/admin/candidate/index.wxss
new file mode 100644
index 0000000..6837f53
--- /dev/null
+++ b/pages/admin/candidate/index.wxss
@@ -0,0 +1 @@
+/* pages/admin/candidate/index.wxss */
\ No newline at end of file
diff --git a/pages/admin/exam/add.js b/pages/admin/exam/add.js
new file mode 100644
index 0000000..dfa7683
--- /dev/null
+++ b/pages/admin/exam/add.js
@@ -0,0 +1,68 @@
+// pages/admin/exam/add.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ form:{
+
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/admin/exam/add.json b/pages/admin/exam/add.json
new file mode 100644
index 0000000..bc12026
--- /dev/null
+++ b/pages/admin/exam/add.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {
+
+ }
+}
\ No newline at end of file
diff --git a/pages/admin/exam/add.wxml b/pages/admin/exam/add.wxml
new file mode 100644
index 0000000..f1cacf4
--- /dev/null
+++ b/pages/admin/exam/add.wxml
@@ -0,0 +1,80 @@
+
+新建考试
+基本信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{formdata.opentime}}
+
+
+
+
+
+
+
+
+
+
+
+监考人信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+确定
+
\ No newline at end of file
diff --git a/pages/admin/exam/add.wxss b/pages/admin/exam/add.wxss
new file mode 100644
index 0000000..45f7d1b
--- /dev/null
+++ b/pages/admin/exam/add.wxss
@@ -0,0 +1 @@
+/* pages/admin/exam/add.wxss */
\ No newline at end of file
diff --git a/pages/admin/exam/add2.js b/pages/admin/exam/add2.js
new file mode 100644
index 0000000..bdd5970
--- /dev/null
+++ b/pages/admin/exam/add2.js
@@ -0,0 +1,207 @@
+const app = getApp()
+const api = require("../../../utils/request.js");
+Page({
+ data: {
+ formData: [
+ {
+ type: 'input',
+ id:'name',
+ lable:'考试名称',
+ isRequired: true,//是否必填
+ maxLength: 20,//最大长度
+ defaultValue:'',//初始值
+ rules:[//规则验证数组
+ {
+ regular: '^\\S*$',//正则字符串
+ tips: '不能有空格'//错误提示
+ },
+ ]
+ },
+ {
+ type: 'input',
+ id:'place',
+ lable:'考试地点',
+ isRequired: true,//是否必填
+ maxLength: 50,//最大长度
+ defaultValue:'',//初始值
+ rules:[//规则验证数组
+ {
+ regular: '^\\S*$',//正则字符串
+ tips: '不能有空格'//错误提示
+ },
+ ]
+ },
+ {
+ type: 'input',
+ id: 'chance',
+ lable: '考试机会',
+ defaultValue: 3,
+ inputType: 'digit', //对应input组件type值(text,number)
+ placeholder: '请填写数字',
+ isRequired: true,//是否必填
+ //disabled:true,
+ rules: [
+
+ ]
+ },
+ {
+ type: 'picker',
+ id: 'workscope',
+ lable: '工作类别',
+ defaultIdx:0,//默认选择索引
+ // disabled:true,
+ isRequired:true,
+ range:[
+ {
+ id: 0,
+ name: '正常'
+ },
+ {
+ id: 1,
+ name: '异常'
+ },
+
+ ]
+ },
+ {
+ type: 'date',
+ id: 'daterange',
+ lable: '开关时间',
+ isRequired: true,
+ /* 显示完整时间包含时分秒;当使用endDate的时候关闭,不要同时打开, 否则日期将会换行;
+ 与config中的colum属性共同设置
+ */
+ completeTime:true, //显示完整时间, 包含时分秒
+ config: {
+ endDate: true,
+ dateLimit: true,
+ // initStartTime: "2020-01-01 12:32:44",
+ // initEndTime: "2020-12-01 12:32:44",
+ column: "minute",//day、hour、minute、secend
+ limitStartTime: "2000-01-01 00:00:59",
+ limitEndTime: "2100-01-01 00:00:59"
+ }
+ },
+ {
+ type: 'input',
+ id:'proctor_name',
+ lable:'监考人姓名',
+ isRequired: true,//是否必填
+ maxLength: 50,//最大长度
+ defaultValue:'',//初始值
+ rules:[//规则验证数组
+ {
+ regular: '^\\S*$',//正则字符串
+ tips: '不能有空格'//错误提示
+ },
+ ]
+ },
+ {
+ type: 'input',
+ id:'proctor_phone',
+ lable:'监考人联系方式',
+ isRequired: true,//是否必填
+ maxLength: 50,//最大长度
+ defaultValue:'',//初始值
+ rules:[//规则验证数组
+ {
+ regular: '^\\S*$',//正则字符串
+ tips: '不能有空格'//错误提示
+ },
+ ]
+ },
+ {
+ type: 'input',
+ id:'train_name',
+ lable:'培训名称',
+ isRequired: false,//是否必填
+ maxLength: 50,//最大长度
+ defaultValue:null,//初始值
+ rules:[//规则验证数组
+ {
+ regular: '^\\S*$',//正则字符串
+ tips: '不能有空格'//错误提示
+ },
+ ]
+ },
+ {
+ type: 'date',
+ id: 'daterange2',
+ lable: '培训时间',
+ isRequired: false,
+ /* 显示完整时间包含时分秒;当使用endDate的时候关闭,不要同时打开, 否则日期将会换行;
+ 与config中的colum属性共同设置
+ */
+ completeTime:false, //显示完整时间, 包含时分秒
+ config: {
+ endDate: true,
+ dateLimit: true,
+ // initStartTime: "2020-01-01 12:32:44",
+ // initEndTime: "2020-12-01 12:32:44",
+ column: "day",//day、hour、minute、secend
+ limitStartTime: "2000-01-01 00:00:59",
+ limitEndTime: "2100-01-01 00:00:59"
+ }
+ },
+ ],
+ toSubmit: Math.random()
+ },
+ onFormSubmit(e){
+ console.log('表单提交: ', e);
+ let x = {};
+ x.opentime = e.detail.daterange.startDate;
+ x.closetime = e.detail.daterange.endDate;
+ x.train_name = e.detail.train_name.value;
+ if (e.detail.daterange2.startDate){
+ x.train_start_date = e.detail.daterange2.startDate
+ }
+ if (e.detail.daterange2.endDate){
+ x.train_end_date = e.detail.daterange2.endDate
+ }
+ x.name = e.detail.name.value
+ x.place = e.detail.place.value
+ x.chance = e.detail.chance.value
+ x.workscope = e.detail.workscope.original.range[e.detail.workscope.idx].id
+ x.proctor_name = e.detail.proctor_name.value
+ x.proctor_phone = e.detail.proctor_phone.value
+ wx.showModal({
+ content: '确认发布考试吗',
+ success (res) {
+ if (res.confirm) {
+ api.requesta('/examtest/exam/', 'POST', x).then(res=>{
+ let rdata = res.data
+ wx.showModal({
+ title: '发布成功',
+ content: '考试号为' + rdata.code,
+ showCancel: false,
+ success (res) {
+ if (res.confirm) {
+ wx.redirectTo({
+ url: '/pages/admin/exam/detail?id='+rdata.id,
+ })
+ }
+ }
+ })
+ })
+ }
+ }
+ })
+ },
+ onFormChange(e){
+ //console.log('表单变化: ',e);
+ },
+ //变更数值, 触发表单提交事件
+ toSubmitChange(){
+ this.setData({
+ toSubmit: Math.random()
+ })
+ },
+ onLoad: function () {
+ api.requesta('/examtest/workscope/?can_exam=true', 'GET').then(res=>{
+ this.data.formData[3].range=res.data
+ this.setData({
+ formData: this.data.formData
+ })
+ })
+ },
+})
diff --git a/pages/admin/exam/add2.json b/pages/admin/exam/add2.json
new file mode 100644
index 0000000..9d2ea85
--- /dev/null
+++ b/pages/admin/exam/add2.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {
+ "d-form": "/components/dynamicForm/index"
+ }
+}
\ No newline at end of file
diff --git a/pages/admin/exam/add2.wxml b/pages/admin/exam/add2.wxml
new file mode 100644
index 0000000..c760dee
--- /dev/null
+++ b/pages/admin/exam/add2.wxml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/pages/admin/exam/add2.wxss b/pages/admin/exam/add2.wxss
new file mode 100644
index 0000000..7d56591
--- /dev/null
+++ b/pages/admin/exam/add2.wxss
@@ -0,0 +1 @@
+/* pages/admin/exam/add2.wxss */
\ No newline at end of file
diff --git a/pages/admin/exam/detail.js b/pages/admin/exam/detail.js
new file mode 100644
index 0000000..3fee37e
--- /dev/null
+++ b/pages/admin/exam/detail.js
@@ -0,0 +1,144 @@
+// pages/admin/exam/detail.js
+const api = require("../../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ exam:{
+ qdimgs:[],
+ xcimgs:[]
+ },
+ tests:[]
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ if(options.id){
+ let id = options.id
+ this.data.exam.id = id
+ api.requesta('/examtest/examtest/', 'GET', {exam:id, pageoff:true}).then(res=>{
+ this.setData({
+ tests:res.data
+ })
+ })
+ }
+ },
+ getExam: function(){
+ let id = this.data.exam.id
+ api.requesta(`/examtest/exam/${id}/`, 'GET').then(res=>{
+ let exam = res.data
+ for(var i=0;i{
+ wx.hideLoading()
+ let index = e.currentTarget.dataset.index;
+ this.setData({
+ ['tests[' + index + '].candidate_']:res.data
+ })
+ wx.showToast({
+ title: '证书颁发成功',
+ })
+ })
+ },
+ godetail: function(e){
+ wx.navigateTo({
+ url: '/pages/test/detail?id='+e.currentTarget.dataset.id,
+ })
+ },
+ goCandidate:function(e){
+ let candidate_ = e.currentTarget.dataset.candidate_;
+ wx.navigateTo({
+ url: '/pages/candidate/show?id='+candidate_.id,
+ })
+ },
+ upImg: function(){
+ wx.navigateTo({
+ url: '/pages/admin/exam/upimg?id='+this.data.exam.id,
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/admin/exam/detail.json b/pages/admin/exam/detail.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/admin/exam/detail.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/admin/exam/detail.wxml b/pages/admin/exam/detail.wxml
new file mode 100644
index 0000000..e0e92df
--- /dev/null
+++ b/pages/admin/exam/detail.wxml
@@ -0,0 +1,117 @@
+
+
+
+
+ {{exam.name}}
+
+
+
+
+ 工作类别:{{exam.workscope_name}}
+
+
+ 考试地点:{{exam.place}}
+
+
+ 开关时间:{{exam.opentime}}-{{exam.closetime}}
+
+
+ 监考人:{{exam.proctor_name}}-{{exam.proctor_phone}}
+
+
+
+
+
+
+
+
+
+
+ 签到表图片
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 现场照片
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 共{{tests.length}}次考试记录
+
+
+
+
+ {{item.consumer_detail.company_name}} {{item.consumer_detail.deptname}}
+
+
+ 身份证号:{{item.consumer_detail.ID_number}}
+
+
+ 开始答题:{{item.start_time}}-耗时:{{item.took_format}}
+
+
+ 得分:{{item.score}}
+
+
+ 证书编号:
+ {{item.candidate_.number}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 到底了
+
+
+
\ No newline at end of file
diff --git a/pages/admin/exam/detail.wxss b/pages/admin/exam/detail.wxss
new file mode 100644
index 0000000..8d4b5d6
--- /dev/null
+++ b/pages/admin/exam/detail.wxss
@@ -0,0 +1,4 @@
+/* pages/admin/exam/detail.wxss */
+.weui-media-box {
+ padding: 12px;
+}
\ No newline at end of file
diff --git a/pages/admin/exam/index.js b/pages/admin/exam/index.js
new file mode 100644
index 0000000..779b458
--- /dev/null
+++ b/pages/admin/exam/index.js
@@ -0,0 +1,98 @@
+// pages/admin/exam/index.js
+const api = require("../../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ page:1,
+ isLoadedAll:false,
+ count:0,
+ results:[]
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getList(1)
+ },
+ getList: function(page) {
+ wx.showLoading({
+ title: '正在加载...',
+ })
+ api.requesta('/examtest/exam/', 'GET', {page:page}).then(res=>{
+ wx.hideLoading()
+ let results = this.data.results
+ let isLoadedAll = false
+ if(res.data.results){
+ if(page==1){results=res.data.results}else{
+ results = results.concat(res.data.results)
+ }
+ }
+ if(!res.data.next){
+ isLoadedAll = true
+ }
+ this.setData({
+ count:res.data.count,
+ results:results,
+ page:page,
+ isLoadedAll: isLoadedAll
+ })
+ }).catch(
+ wx.hideLoading()
+ )
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ this.getList(1)
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if(!this.data.isLoadedAll){
+ this.data.page=this.data.page+1
+ this.getList(this.data.page)
+ }
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/admin/exam/index.json b/pages/admin/exam/index.json
new file mode 100644
index 0000000..eb97555
--- /dev/null
+++ b/pages/admin/exam/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "enablePullDownRefresh":true
+}
\ No newline at end of file
diff --git a/pages/admin/exam/index.wxml b/pages/admin/exam/index.wxml
new file mode 100644
index 0000000..22c75d7
--- /dev/null
+++ b/pages/admin/exam/index.wxml
@@ -0,0 +1,31 @@
+
+
+ 已发布的考试,共{{count}}场
+
+
+
+ {{item.workscope_name}}
+ {{item.name}}
+
+
+ 考试地点:{{item.place}}
+
+
+ 开关时间:{{item.opentime}}-{{item.closetime}}
+
+
+ 监考人:{{item.proctor_name}}-{{item.proctor_phone}}
+
+
+
+
+ 到底了
+
+
+
+
\ No newline at end of file
diff --git a/pages/admin/exam/index.wxss b/pages/admin/exam/index.wxss
new file mode 100644
index 0000000..15a1dc2
--- /dev/null
+++ b/pages/admin/exam/index.wxss
@@ -0,0 +1 @@
+/* pages/admin/exam/index.wxss */
\ No newline at end of file
diff --git a/pages/admin/exam/upimg.js b/pages/admin/exam/upimg.js
new file mode 100644
index 0000000..60a7592
--- /dev/null
+++ b/pages/admin/exam/upimg.js
@@ -0,0 +1,207 @@
+// pages/admin/exam/u'p.js
+const api = require("../../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ exam:0,
+ qdimgs: [],
+ xcimgs: [],
+ upqdimgs:[],
+ upxcimgs:[]
+ },
+ chooseImage: function (e) {
+ var that = this;
+ wx.chooseImage({
+ sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
+ sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
+ success: function (res) {
+ // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
+ console.log(e.currentTarget.dataset.type)
+ if(e.currentTarget.dataset.type == 'qdimgs'){
+ that.setData({
+ qdimgs: that.data.qdimgs.concat(res.tempFilePaths)
+ });
+ }else{
+ that.setData({
+ xcimgs: that.data.xcimgs.concat(res.tempFilePaths)
+ });
+ }
+
+ }
+ })
+ },
+ previewImage: function (e) {
+ if(e.currentTarget.dataset.type=='qdimgs'){
+ wx.previewImage({
+ current: e.currentTarget.id, // 当前显示图片的http链接
+ urls: this.data.qdimgs // 需要预览的图片http链接列表
+ })
+ }else{
+ wx.previewImage({
+ current: e.currentTarget.id, // 当前显示图片的http链接
+ urls: this.data.xcimgs // 需要预览的图片http链接列表
+ })
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.data.exam = options.id
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ deleteImg: function(e){
+ var that = this
+ wx.showModal({
+ content: '确认删除该图片?',
+ success (res) {
+ if (res.confirm) {
+ if(e.currentTarget.dataset.type=='qdimgs'){
+ var qdimgs = that.data.qdimgs
+ qdimgs.splice(e.currentTarget.dataset.index, 1);
+ that.setData({
+ qdimgs:qdimgs
+ })
+ }else{
+ var xcimgs = that.data.xcimgs
+ xcimgs.splice(e.currentTarget.dataset.index, 1);
+ that.setData({
+ xcimgs:xcimgs
+ })
+ }
+ }
+ }
+ })
+ },
+ confirm: function(){
+ if(this.data.upqdimgs.length>0 && this.data.upxcimgs.length>0){
+ let formdata={
+ qdimgs:this.data.upqdimgs,
+ xcimgs:this.data.upxcimgs
+ }
+ let id = this.data.exam
+ wx.showLoading({
+ title: '正在提交...',
+ })
+ api.requesta(`/examtest/exam/${id}/upimgs/`,'POST', formdata).then(res=>{
+ wx.hideLoading({
+ success: (res) => {},
+ })
+ wx.navigateBack({
+ delta: 0,
+ })
+ })
+ }
+ else if(this.data.qdimgs.length>0 && this.data.xcimgs.length>0){
+ this.upImgx(0, 'qdimgs')
+ }
+ else{
+ wx.showToast({
+ title: '图片信息不全',
+ })
+ }
+ },
+ upImgx: function(index, type){
+ var that = this
+ if(type=='qdimgs'){
+ let x = index+1
+ wx.showLoading({
+ title: '正在上传签到图片',
+ })
+ wx.uploadFile({
+ filePath: that.data.qdimgs[index],
+ name: 'file',
+ url: getApp().globalData.host+'/uploadfile/',
+ header:{
+ 'Authorization': 'JWT ' + getApp().globalData.admintoken
+ },
+ success (res){
+ wx.hideLoading()
+ let data = JSON.parse(res.data);
+ that.data.upqdimgs.push(data.data.path)
+ if(x == that.data.qdimgs.length){
+ that.upImgx(0, 'xcimgs')
+ }else{
+ that.upImgx(index+1, 'qdimgs')
+ }
+ }
+ })
+ }else{
+ let x = index+1
+ wx.showLoading({
+ title: '正在上传现场图片',
+ })
+ wx.uploadFile({
+ filePath: that.data.xcimgs[index],
+ name: 'file',
+ url: getApp().globalData.host+'/uploadfile/',
+ header:{
+ 'Authorization': 'JWT ' + getApp().globalData.admintoken
+ },
+ success (res){
+ wx.hideLoading()
+ let data = JSON.parse(res.data);
+ that.data.upxcimgs.push(data.data.path)
+ if(x == that.data.xcimgs.length){
+ that.confirm()
+ }else{
+ that.upImgx(index+1, 'xcimgs')
+ }
+ }
+ })
+ }
+
+ }
+})
\ No newline at end of file
diff --git a/pages/admin/exam/upimg.json b/pages/admin/exam/upimg.json
new file mode 100644
index 0000000..b55b5a2
--- /dev/null
+++ b/pages/admin/exam/upimg.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {
+ }
+}
\ No newline at end of file
diff --git a/pages/admin/exam/upimg.wxml b/pages/admin/exam/upimg.wxml
new file mode 100644
index 0000000..d05ce30
--- /dev/null
+++ b/pages/admin/exam/upimg.wxml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+ 签到表图片
+
+
+
+ 长按删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 现场照片
+
+
+
+ 长按删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/admin/exam/upimg.wxss b/pages/admin/exam/upimg.wxss
new file mode 100644
index 0000000..227da4c
--- /dev/null
+++ b/pages/admin/exam/upimg.wxss
@@ -0,0 +1 @@
+/* pages/admin/exam/u'p.wxss */
\ No newline at end of file
diff --git a/pages/admin/index.js b/pages/admin/index.js
new file mode 100644
index 0000000..6857d98
--- /dev/null
+++ b/pages/admin/index.js
@@ -0,0 +1,94 @@
+// pages/admin/index.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.setData({
+ admininfo:getApp().globalData.admininfo
+ })
+ },
+ logout: function(){
+ wx.redirectTo({
+ url: '/pages/admin/login?type=nologin',
+ })
+ },
+ bindmp: function(){
+ wx.login({
+ success: res => {
+ // 发送 res.code 到后台换取 openId, sessionKey, unionId
+ api.requesta('/rbac/user/bindmp/','POST', {code:res.code}).then(res=>{
+ getApp().globalData.admininfo.mpopenid = res.data.mpopenid
+ this.setData({
+ 'admininfo.mpopenid':res.data.mpopenid
+ })
+ })
+ }
+ })
+ },
+ unbindmp: function(){
+ api.requesta('/rbac/user/unbindmp/','POST').then(res=>{
+ getApp().globalData.admininfo.mpopenid = null
+ this.setData({
+ 'admininfo.mpopenid':null
+ })
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/admin/index.json b/pages/admin/index.json
new file mode 100644
index 0000000..63f2663
--- /dev/null
+++ b/pages/admin/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "管理员控制台"
+}
\ No newline at end of file
diff --git a/pages/admin/index.wxml b/pages/admin/index.wxml
new file mode 100644
index 0000000..c41a3d2
--- /dev/null
+++ b/pages/admin/index.wxml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+ 账号:
+ {{admininfo.username}}
+
+ 昵称:
+ {{ admininfo.name }}
+
+ 角色:
+ {{ admininfo.roles }}
+
+
+ 已绑定微信
+
+
+
+
+
+
+
+
+
+
+ 功能列表
+
+
+
+
+
+
+ 发布考试
+
+
+
+
+
+ 考试记录
+
+
+
+
+
+ 出证记录
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/admin/index.wxss b/pages/admin/index.wxss
new file mode 100644
index 0000000..38d2c4b
--- /dev/null
+++ b/pages/admin/index.wxss
@@ -0,0 +1,9 @@
+/* pages/admin/index.wxss */
+.weui-grids {
+ border-top:none;
+}
+.weui-grid {
+ width: 25%;
+ border-right:none;
+ border-bottom:none;
+}
\ No newline at end of file
diff --git a/pages/admin/login.js b/pages/admin/login.js
new file mode 100644
index 0000000..c8ffbb4
--- /dev/null
+++ b/pages/admin/login.js
@@ -0,0 +1,125 @@
+// pages/admin/login.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ form:{
+ username:'',
+ password:''
+ }
+ },
+ usernameChange: function (e) {
+ this.data.form.username = e.detail.value
+ },
+ passwordChange: function (e) {
+ this.data.form.password = e.detail.value
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ if(options.type=='nologin'){
+
+ }else{
+ if(getApp().globalData.admintoken){
+ wx.redirectTo({
+ url: '/pages/admin/index',
+ })
+ }else{
+ this.mplogin()
+ }
+
+ }
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ denglu: function ( ) {
+ var form = this.data.form
+ api.requesta('/token/', 'POST', form).then(res => {
+ getApp().globalData.admintoken = res.data.token;
+ api.requesta('/rbac/user/info/', 'GET').then(res=>{
+ getApp().globalData.admininfo = res.data
+ wx.showToast({
+ title: '登录成功',
+ icon: 'none'
+ })
+ wx.redirectTo({
+ url: '/pages/admin/index',
+ })
+ })
+ })
+ },
+ mplogin: function(){
+ wx.showLoading({
+ title: '自动登陆中',
+ mask:true
+ })
+ wx.login({
+ success: res => {
+ // 发送 res.code 到后台换取 openId, sessionKey, unionId
+ api.requesta('/rbac/user/mplogin/','POST', {code:res.code}).then(res=>{
+ getApp().globalData.admintoken = res.data.token;
+ api.requesta('/rbac/user/info/', 'GET').then(res=>{
+ wx.hideLoading()
+ getApp().globalData.admininfo = res.data
+ wx.redirectTo({
+ url: '/pages/admin/index',
+ })
+ })
+ })
+ }
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/admin/login.json b/pages/admin/login.json
new file mode 100644
index 0000000..7035483
--- /dev/null
+++ b/pages/admin/login.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "管理员登录"
+}
\ No newline at end of file
diff --git a/pages/admin/login.wxml b/pages/admin/login.wxml
new file mode 100644
index 0000000..ee39079
--- /dev/null
+++ b/pages/admin/login.wxml
@@ -0,0 +1,33 @@
+
+
+
+ 中科辐射学堂
+ 管理员登录
+
+
+
+
+
+ 账号
+
+
+
+
+
+
+
+ 密码
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/admin/login.wxss b/pages/admin/login.wxss
new file mode 100644
index 0000000..6c0a800
--- /dev/null
+++ b/pages/admin/login.wxss
@@ -0,0 +1 @@
+/* pages/admin/login.wxss */
\ No newline at end of file
diff --git a/pages/article/detail.js b/pages/article/detail.js
new file mode 100644
index 0000000..ad83dd9
--- /dev/null
+++ b/pages/article/detail.js
@@ -0,0 +1,88 @@
+// pages/article/detail.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ elink_f:'',
+ domain:getApp().globalData.mediahost
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getDetail(options.id)
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+ getDetail: function (id) {
+ var that = this
+ wx.showLoading({
+ title: '加载中',
+ mask:true
+ })
+ api.request(`/cms/article/${id}/`,'GET').then(res => {
+ // res.data.content = res.data.content.replace(/"media/g, '"'+getApp().globalData.mediahost + '/media').replace(/\
{},
+ })
+ }).catch(res=>{
+ wx.hideLoading({
+ complete: (res) => {},
+ })
+ })
+ },
+
+})
\ No newline at end of file
diff --git a/pages/article/detail.json b/pages/article/detail.json
new file mode 100644
index 0000000..c77cd44
--- /dev/null
+++ b/pages/article/detail.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {
+ "mp-html": "/components/mp-html/index"
+ }
+}
\ No newline at end of file
diff --git a/pages/article/detail.wxml b/pages/article/detail.wxml
new file mode 100644
index 0000000..7027727
--- /dev/null
+++ b/pages/article/detail.wxml
@@ -0,0 +1,15 @@
+
+
+
+
+ {{title}}
+
+ 置顶
+ {{ifrom}}
+
+
+
+
+
+
+
diff --git a/pages/article/detail.wxss b/pages/article/detail.wxss
new file mode 100644
index 0000000..08d786a
--- /dev/null
+++ b/pages/article/detail.wxss
@@ -0,0 +1,7 @@
+/* pages/article/detail.wxss */
+.page__title {
+ font-size: 18px;
+}
+.page {
+ background-color: var(--weui-BG-2);
+}
\ No newline at end of file
diff --git a/pages/article/index.js b/pages/article/index.js
new file mode 100644
index 0000000..9ebb31a
--- /dev/null
+++ b/pages/article/index.js
@@ -0,0 +1,102 @@
+// pages/lianxi/index.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ results: [],
+ query: {
+ page: 1,
+ limit: 10
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function () {
+ var that = this
+ that.getList(that.data.query)
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ },
+ getList: function () {
+ var that = this
+ api.request('/cms/article/', 'GET', that.data.query).then(res => {
+ if (that.data.query.page == 1) {
+ that.data.results = res.data.results
+ } else {
+ that.data.results = that.data.results.concat(res.data.results)
+ }
+ for(var i = 0;i
+
+ {{count}}条资讯
+
+
+
+
+
+ {{item.title}}
+
+ 置顶
+ {{item.ifrom}} {{item.update_time}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/article/index.wxss b/pages/article/index.wxss
new file mode 100644
index 0000000..a458506
--- /dev/null
+++ b/pages/article/index.wxss
@@ -0,0 +1,5 @@
+.head{
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: center;
+}
\ No newline at end of file
diff --git a/pages/candidate/detail.js b/pages/candidate/detail.js
new file mode 100644
index 0000000..27268b9
--- /dev/null
+++ b/pages/candidate/detail.js
@@ -0,0 +1,121 @@
+// pages/candidate/detail.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let id = options.id
+ this.getDetail(id)
+ },
+ getDetail: function (id) {
+ api.request(`/crm/candidate/${id}/`, 'GET').then(res => {
+ this.setData({
+ candidate: res.data
+ })
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ godetail: function (e) {
+ wx.navigateTo({
+ url: '/pages/test/detail?id=' + this.data.candidate.examtest,
+ })
+ },
+ goCandidate: function (e) {
+ wx.navigateTo({
+ url: '/pages/candidate/show?id=' + this.data.candidate.id,
+ })
+ },
+ copyUrl: function(e){
+ wx.setClipboardData({
+ data: getApp().globalData.host+'/crm/candidate/img/?id='+this.data.candidate.id,
+ success: function (res) {
+ wx.showToast({
+ title: '复制成功,可前往自带浏览器粘贴访问',
+ icon: 'none'
+ })
+ }
+ })
+ },
+ downDoc: function (e) {
+ let id = this.data.candidate.id
+ wx.showLoading({
+ title: '正在生成...',
+ })
+ api.request(`/crm/candidate/${id}/down/`, 'GET').then(res => {
+ wx.showLoading({
+ title: '正在下载...',
+ })
+ wx.downloadFile({
+ url: getApp().globalData.host + res.data.path,
+ success(res) {
+ const filePath = res.tempFilePath
+ wx.openDocument({
+ filePath,
+ fileType: 'docx',
+ success: function (res) {
+ wx.hideLoading({
+ success: (res) => {},
+ })
+ }
+ })
+ }
+ })
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/candidate/detail.json b/pages/candidate/detail.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/candidate/detail.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/candidate/detail.wxml b/pages/candidate/detail.wxml
new file mode 100644
index 0000000..2ebf774
--- /dev/null
+++ b/pages/candidate/detail.wxml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+ {{candidate.ID_number}}
+
+
+ {{candidate.workscope_name}}
+
+
+ {{candidate.start_date}}至{{candidate.end_date}}
+
+
+
+查看证书
+复制证书链接
+答题信息
+下载完整文档
diff --git a/pages/candidate/detail.wxss b/pages/candidate/detail.wxss
new file mode 100644
index 0000000..629c061
--- /dev/null
+++ b/pages/candidate/detail.wxss
@@ -0,0 +1 @@
+/* pages/candidate/detail.wxss */
\ No newline at end of file
diff --git a/pages/candidate/index.js b/pages/candidate/index.js
new file mode 100644
index 0000000..e39961b
--- /dev/null
+++ b/pages/candidate/index.js
@@ -0,0 +1,134 @@
+// pages/candidate/index.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ ID_number:null,
+ realname:null,
+ candidates:[]
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ if(getApp().globalData.userinfo.ID_number && getApp().globalData.userinfo.realname){
+ this.setData({
+ ID_number:getApp().globalData.userinfo.ID_number,
+ realname:getApp().globalData.userinfo.realname,
+ })
+ this.search()
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ bindinput1: function(e){
+ this.data.realname = e.detail.value
+ },
+ bindinput2: function(e){
+ this.data.ID_number = e.detail.value
+ },
+ copyUrl: function(e){
+ wx.setClipboardData({
+ data: e.currentTarget.dataset.url,
+ success: function (res) {
+ wx.showToast({
+ title: '复制成功,可前往自带浏览器粘贴访问',
+ icon: 'none'
+ })
+ }
+ })
+ },
+ search: function() {
+ if(this.data.realname && this.data.ID_number){
+ var data = {
+ realname:this.data.realname,
+ ID_number:this.data.ID_number
+ }
+ wx.showLoading({
+ title: '查询中..',
+ mask:true
+ })
+ api.request('/crm/consumer/candidate/', 'GET', data).then(res => {
+ wx.hideLoading({
+ success: (res) => {},
+ })
+ // console.log(res.data.candidates)
+ this.setData({
+ candidates:res.data.candidates
+ })
+ }).catch(e=>{
+ wx.hideLoading({
+ success: (res) => {},
+ })
+ })
+ api.request('/crm/consumer/realinfo/', 'POST', data).then(res=>{
+ })
+ }else{
+ wx.showToast({
+ title: '请填写姓名和身份证号',
+ icon: 'none',
+ duration: 1500
+ })
+ }
+
+ },
+ toDetail: function(e){
+ var url = e.currentTarget.dataset.url
+ getApp().globalData.candidate_url = url
+ wx.navigateTo({
+ url: 'detail',
+ })
+ }
+
+})
\ No newline at end of file
diff --git a/pages/candidate/index.json b/pages/candidate/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/candidate/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/candidate/index.wxml b/pages/candidate/index.wxml
new file mode 100644
index 0000000..041b118
--- /dev/null
+++ b/pages/candidate/index.wxml
@@ -0,0 +1,39 @@
+查询信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+查询结果
+
+
+
+
+
+ 单号:{{item.report_number}}
+
+ 发证日期:{{item.issue_date}}
+
+
+
+ 通过考核
+ 长按复制地址去浏览器打开
+
+
+
+
+暂无证书信息
\ No newline at end of file
diff --git a/pages/candidate/index.wxss b/pages/candidate/index.wxss
new file mode 100644
index 0000000..a7ac3f3
--- /dev/null
+++ b/pages/candidate/index.wxss
@@ -0,0 +1 @@
+/* pages/candidate/index.wxss */
\ No newline at end of file
diff --git a/pages/candidate/my.js b/pages/candidate/my.js
new file mode 100644
index 0000000..4d9ddba
--- /dev/null
+++ b/pages/candidate/my.js
@@ -0,0 +1,88 @@
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ results:[]
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getList()
+ },
+ getList: function() {
+ wx.showLoading({
+ title: '正在加载...',
+ })
+ api.request('/crm/candidate/my/', 'GET').then(res=>{
+ wx.hideLoading()
+ this.setData({
+ results:res.data,
+ })
+ }).catch(
+ wx.hideLoading()
+ )
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ scanC: function() {
+ wx.scanCode({
+ onlyFromCamera: true,
+ success(res) {
+ console.log(res)
+ let id = res.result.split('=')[1]
+ wx.navigateTo({
+ url: 'detail?id=' + id,
+ })
+ }
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/candidate/my.json b/pages/candidate/my.json
new file mode 100644
index 0000000..449b05c
--- /dev/null
+++ b/pages/candidate/my.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "我的证书"
+}
\ No newline at end of file
diff --git a/pages/candidate/my.wxml b/pages/candidate/my.wxml
new file mode 100644
index 0000000..810e261
--- /dev/null
+++ b/pages/candidate/my.wxml
@@ -0,0 +1,29 @@
+
+ 扫一扫证书二维码
+
+
+
+
+
+ 身份证号:{{item.ID_number}}
+
+
+ 工作类别:{{item.workscope_name}}
+
+
+ 期限:{{item.start_date}}至{{item.end_date}}
+
+
+
+ 暂无证书信息
+
+
+
\ No newline at end of file
diff --git a/pages/candidate/my.wxss b/pages/candidate/my.wxss
new file mode 100644
index 0000000..313142f
--- /dev/null
+++ b/pages/candidate/my.wxss
@@ -0,0 +1 @@
+/* pages/candidate/my.wxss */
\ No newline at end of file
diff --git a/pages/candidate/show.js b/pages/candidate/show.js
new file mode 100644
index 0000000..12cedd5
--- /dev/null
+++ b/pages/candidate/show.js
@@ -0,0 +1,69 @@
+// pages/candidate/show.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ let id = options.id;
+ this.setData({
+ url:getApp().globalData.host+'/crm/candidate/img/?id='+id
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/candidate/show.json b/pages/candidate/show.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/candidate/show.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/candidate/show.wxml b/pages/candidate/show.wxml
new file mode 100644
index 0000000..029c6e5
--- /dev/null
+++ b/pages/candidate/show.wxml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/pages/candidate/show.wxss b/pages/candidate/show.wxss
new file mode 100644
index 0000000..0c1e445
--- /dev/null
+++ b/pages/candidate/show.wxss
@@ -0,0 +1 @@
+/* pages/candidate/show.wxss */
\ No newline at end of file
diff --git a/pages/collect/main.js b/pages/collect/main.js
new file mode 100644
index 0000000..d5869bc
--- /dev/null
+++ b/pages/collect/main.js
@@ -0,0 +1,212 @@
+// pages/lianxi/main.js
+const api = require("../../utils/request.js");
+var util = require('../../utils/util.js')
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ sctms: [],
+ tm_index: 0,
+ is_right: false,
+ answerP: false,
+ tmtotal: 0,
+ domain:getApp().globalData.mediahost,
+ },
+ radioChange: function (e) {
+ var that = this
+ that.data.tm_current['user_answer'] = e.detail.value
+ that.data.sctms[that.data.tm_index] = that.data.tm_current
+ that.showAnswer()
+ },
+ checkboxChange: function (e) {
+ var that = this
+ that.data.tm_current['user_answer'] = e.detail.value
+ that.data.sctms[that.data.tm_index] = that.data.tm_current
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function () {
+ var that = this
+ api.request('/crm/consumer/collects/', 'GET').then(res => {
+
+ for(var i=0;i {
+ that.data.sctms.splice(index, 1)
+ if (that.data.sctms.length > index) {
+ that.showTm(index)
+ } else if (that.data.sctms.length > 0 && index > 1) {
+ that.showTm(index - 1)
+ }
+ else {
+ wx.navigateBack({
+ })
+ }
+ })
+
+ }
+})
\ No newline at end of file
diff --git a/pages/collect/main.json b/pages/collect/main.json
new file mode 100644
index 0000000..2ca97bd
--- /dev/null
+++ b/pages/collect/main.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "mp-html": "/components/mp-html/index"
+ },
+ "navigationBarTitleText": "收藏集"
+}
\ No newline at end of file
diff --git a/pages/collect/main.wxml b/pages/collect/main.wxml
new file mode 100644
index 0000000..e7742e1
--- /dev/null
+++ b/pages/collect/main.wxml
@@ -0,0 +1,72 @@
+
+ 题量: {{tm_index+1}}/{{tmtotal}}
+
+
+
+ {{tm_index+1}}.
+ {{tm_current.type}}
+ {{tm_current.questioncat_name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 回答正确!
+ 回答有误!
+ 正确答案是{{tm_current.right}},你的答案是{{tm_current.user_answer}}
+
+ 解析:
+ {{tm_current.resolution}}
+ 无
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/collect/main.wxss b/pages/collect/main.wxss
new file mode 100644
index 0000000..bf7322d
--- /dev/null
+++ b/pages/collect/main.wxss
@@ -0,0 +1,21 @@
+.head{
+ width:100%;
+ height:30px;
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: center;
+}
+.btns{
+ height:40px;
+ display:flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ text-align:center;
+}
+.txlabel{
+ color:#fff;
+ background-color: rgb(216, 140, 0);
+ border-radius: 2px;
+ padding: 1px 4px;
+}
+
diff --git a/pages/cuoti/index.js b/pages/cuoti/index.js
new file mode 100644
index 0000000..b06b646
--- /dev/null
+++ b/pages/cuoti/index.js
@@ -0,0 +1,233 @@
+// pages/lianxi/main.js
+const api = require("../../utils/request.js");
+var util = require('../../utils/util.js')
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ ctms: [],
+ tm_index: 0,
+ isright:false,
+ answerP:false,
+ tmtotal:0,
+ moShi:'看题模式',
+ domain:getApp().globalData.mediahost,
+ },
+ radioChange: function (e) {
+ var that = this
+ that.data.currentTm['user_answer'] = e.detail.value
+ that.data.ctms[that.data.tm_index] = that.data.currentTm
+ that.showAnswer()
+ },
+ checkboxChange: function (e) {
+ var that = this
+ that.data.currentTm['user_answer'] = e.detail.value
+ that.data.ctms[that.data.tm_index] = that.data.currentTm
+
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function () {
+ var that = this
+ try {
+ var value = wx.getStorageSync('ctms')
+ if (value) {
+ that.data.ctms = value
+ that.setData({
+ tmtotal: value.length
+ })
+ }
+ } catch (e) { }
+ try {
+ const res = wx.getSystemInfoSync()
+ that.setData({
+ scrollHeight: res.windowHeight - 70
+ })
+ } catch (e) {
+ }
+ if (that.data.tmtotal== 0) {
+ wx.showModal({
+ title: '提示',
+ content: '无错题记录!',
+ confirmText:'返回',
+ cancelText:'前去练习',
+ success: function (res) {
+ if (res.confirm) {
+ wx.navigateBack({
+ })
+ }else{
+ wx.redirectTo({
+ url: '/pages/lianxi/index',
+ })
+ }
+ }
+ })
+ }else{
+ that.showTm(that.data.tm_index)
+ }
+
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+ try {
+ wx.setStorageSync('ctms', this.data.ctms)
+ } catch (e) { }
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+ showTm: function (index) {
+ var that = this
+ var currentTm = that.data.ctms[index]
+ that.setData({
+ 'tm_index': index,
+ 'tmtotal':that.data.ctms.length,
+ 'currentTm': currentTm
+ })
+ that.showOptions()
+ if (currentTm.user_answer && that.data.moShi=='看题模式') {
+ that.showAnswer()
+ }
+ },
+ panTi: function () {
+ var that = this
+ let currentTm = that.data.currentTm
+ let isright = false
+ if (currentTm.type == '多选') {
+ if (currentTm.user_answer) {
+ if (currentTm.user_answer.sort().toString() == currentTm.right.sort().toString()) {
+ isright = true
+ }
+ }
+
+ } else {
+ isright = currentTm.right == currentTm.user_answer
+ }
+ return isright
+ },
+ showAnswer: function () {
+ let isright = this.panTi()
+ this.setData({
+ isright: isright,
+ answerP: true,
+ currentTm: this.data.currentTm
+ })
+ },
+ next: function () {
+ var that = this
+ var tm_index = that.data.tm_index + 1
+ that.showTm(tm_index)
+ that.showAnswerP()
+ },
+ previous: function () {
+ var that = this
+ var tm_index = that.data.tm_index - 1
+ that.showTm(tm_index)
+ that.showAnswerP()
+ },
+ showOptions: function () {
+ let currentTm = this.data.currentTm
+ let options = []
+ for (let key in currentTm.options) {
+ let option = {}
+ option.key = key
+ option.value = '' + currentTm.options[key].toString() + '
'
+ if (currentTm.user_answer && this.data.moShi == '看题模式') {
+ if (key == currentTm.user_answer || currentTm.user_answer.indexOf(key) != -1) {
+ option.checked = true
+ }
+ } else {
+ option.checked = false
+ }
+ options.push(option)
+ }
+ this.setData({
+ options: options
+ })
+ },
+ remove: function () {
+ var that = this
+ var index = that.data.tm_index
+ that.data.ctms.splice(index,1)
+ if(that.data.ctms.length>index){
+ that.showTm(index)
+ } else if (that.data.ctms.length > 0 && index > 1){
+ that.showTm(index-1)
+ }
+ else{
+ wx.navigateBack({
+ })
+ }
+ },
+ changeM: function () {
+ var that = this
+ if(that.data.moShi=='看题模式'){
+ that.setData({
+ moShi:'背题模式',
+ answerP:false
+ })
+ that.showOptions()
+ }else{
+ that.setData({
+ moShi: '看题模式'
+ })
+ }
+ },
+ showAnswerP:function(){
+ var that = this
+ if (that.data.moShi == '背题模式') {
+ that.setData({
+ answerP:false
+ })
+ }else{
+ that.setData({
+ answerP: true
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/cuoti/index.json b/pages/cuoti/index.json
new file mode 100644
index 0000000..d1927c4
--- /dev/null
+++ b/pages/cuoti/index.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "mp-html": "/components/mp-html/index"
+ },
+ "navigationBarTitleText": "错题集"
+}
\ No newline at end of file
diff --git a/pages/cuoti/index.wxml b/pages/cuoti/index.wxml
new file mode 100644
index 0000000..bb97470
--- /dev/null
+++ b/pages/cuoti/index.wxml
@@ -0,0 +1,74 @@
+
+
+ 题量: {{tm_index+1}}/{{tmtotal}}
+
+
+ {{moShi}}
+ (点击切换)
+
+
+
+
+ {{tm_index+1}}.
+ {{currentTm.type}}
+ {{currentTm.questioncat_name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 回答正确!
+ 回答有误!
+ 正确答案是{{currentTm.right}},你的答案是{{currentTm.user_answer}}
+
+ 解析:
+ {{currentTm.resolution}}
+ 无
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/cuoti/index.wxss b/pages/cuoti/index.wxss
new file mode 100644
index 0000000..bf5f8fa
--- /dev/null
+++ b/pages/cuoti/index.wxss
@@ -0,0 +1,23 @@
+.head{
+ width:100%;
+ height:30px;
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: left;
+ display:flex;
+ flex-direction: row;
+}
+.btns{
+ height:40px;
+ display:flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ text-align:center;
+}
+.txlabel{
+ color:#fff;
+ background-color: rgb(216, 140, 0);
+ border-radius: 2px;
+ padding: 1px 4px;
+}
+
diff --git a/pages/exam/index.js b/pages/exam/index.js
new file mode 100644
index 0000000..da45676
--- /dev/null
+++ b/pages/exam/index.js
@@ -0,0 +1,155 @@
+// pages/qtest/form.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ userInfo:{},
+ form:{
+ deptname:null,
+ code:null
+ }
+ },
+
+ idinput: function(e){
+ this.data.form.ID_number = e.detail.value
+ },
+
+ nameinput: function(e){
+ this.data.form.name = e.detail.value
+ },
+
+ companyinput: function(e){
+ this.data.form.company_name = e.detail.value
+ },
+ deptinput: function(e){
+ this.data.form.deptname = e.detail.value
+ },
+ codeinput: function(e){
+ this.data.form.code = e.detail.value
+ },
+ submit: function(){
+ var that = this
+ var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
+ if(!reg.test(this.data.form.ID_number))
+ {
+ wx.showToast({
+ title: '身份证号有误',
+ icon:'none'
+ })
+ return false;
+ }
+ if(this.data.form.deptname&&this.data.form.code&&this.data.form.name&&this.data.form.company_name&&this.data.form.ID_number){
+ wx.showLoading({
+ title: '加入考试...',
+ mask:true
+ })
+ let data = this.data.form
+ api.request('/examtest/exam/attend/','POST', data).then(res=>{
+ wx.showToast({
+ title: '加入考试成功',
+ icon:'none'
+ })
+ wx.showLoading({
+ title: '正在组卷...',
+ mask:true
+ })
+ let exam = res.data.exam
+ api.request(`/examtest/exam/${exam}/init/`,'POST', data).then(res=>{
+ wx.hideLoading()
+ try {
+ wx.setStorageSync('examtest', res.data)
+ } catch (e) { }
+ wx.navigateTo({
+ url: '/pages/exam/note',
+ })
+
+ }).catch(e=>{
+ wx.hideLoading({
+ success: (res) => {},
+ })
+ })
+ })
+ }else{
+ wx.showToast({
+ title: '信息不完整',
+ icon:'none'
+ })
+ }
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ wx.showLoading({
+ title: '获取基本信息中..',
+ })
+ api.request('/crm/consumer/info/','GET').then(res=>{
+ wx.hideLoading()
+ let userinfo = res.data.userinfo
+ getApp().globalData.userinfo = userinfo
+ this.setData(
+ {
+ userinfo: res.data.userinfo,
+ form:{
+ deptname:res.data.userinfo.deptname,
+ company_name:res.data.userinfo.company_name,
+ ID_number: res.data.userinfo.ID_number1,
+ name: res.data.userinfo.name
+ },
+ }
+ )
+ }).catch(e=>{wx.hideLoading()})
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/exam/index.json b/pages/exam/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/exam/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/exam/index.wxml b/pages/exam/index.wxml
new file mode 100644
index 0000000..9b49676
--- /dev/null
+++ b/pages/exam/index.wxml
@@ -0,0 +1,72 @@
+
+
+
+ 请确认和完善个人信息,并输入考试号加入考试,如有问题请及时联系老师
+
+
+
+ 基本信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 补充信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 确认
+
+
\ No newline at end of file
diff --git a/pages/exam/index.wxss b/pages/exam/index.wxss
new file mode 100644
index 0000000..a6a15b8
--- /dev/null
+++ b/pages/exam/index.wxss
@@ -0,0 +1 @@
+/* pages/exam/index.wxss */
\ No newline at end of file
diff --git a/pages/exam/note.js b/pages/exam/note.js
new file mode 100644
index 0000000..af5bb1f
--- /dev/null
+++ b/pages/exam/note.js
@@ -0,0 +1,78 @@
+// pages/exam/note.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ try {
+ var value = wx.getStorageSync('examtest')
+ if (value) {
+ let examtest = value
+ delete examtest['questions']
+ this.setData(examtest)
+ }
+ } catch (e) { }
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ startTest: function () {
+ wx.reLaunch({
+ url: '/pages/test/test',
+ })
+ },
+})
\ No newline at end of file
diff --git a/pages/exam/note.json b/pages/exam/note.json
new file mode 100644
index 0000000..28a2a8e
--- /dev/null
+++ b/pages/exam/note.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "考试须知"
+}
\ No newline at end of file
diff --git a/pages/exam/note.wxml b/pages/exam/note.wxml
new file mode 100644
index 0000000..2628071
--- /dev/null
+++ b/pages/exam/note.wxml
@@ -0,0 +1,24 @@
+
+
+
+ 正式考试须知
+ 1.考试信息
+ 名称:{{exam_.name}}
+ 监考人:{{exam_.proctor_name}}/{{exam_.proctor_phone}}
+ 2.试卷信息
+ 答卷时长:{{limit}}分钟
+ {{danxuan_count}}道单选题,每题{{danxuan_score}}分
+ {{duoxuan_count}}道多选题,每题{{duoxuan_score}}分
+ {{panduan_count}}道判断题,每题{{panduan_score}}分
+ 多选题漏选每个正确选项得1分,错选0分
+ 满分{{total_score}};{{pass_score}}以上通过
+ 3.答题须知
+ 进入答题后请不要后退或返回桌面
+ 用户可点击上一题/下一题进行切换答题
+ 可点击答题卡复查
+ 请合理安排时间答题,可提前交卷,超时会自动提交
+
+ 开始考试
+
+
+
\ No newline at end of file
diff --git a/pages/exam/note.wxss b/pages/exam/note.wxss
new file mode 100644
index 0000000..3592ee0
--- /dev/null
+++ b/pages/exam/note.wxss
@@ -0,0 +1 @@
+/* pages/exam/note.wxss */
\ No newline at end of file
diff --git a/pages/index/index.js b/pages/index/index.js
new file mode 100644
index 0000000..177d47e
--- /dev/null
+++ b/pages/index/index.js
@@ -0,0 +1,54 @@
+//index.js
+//获取应用实例
+const app = getApp()
+
+Page({
+ data: {
+ userInfo: {},
+ hasUserInfo: false,
+ canIUse: wx.canIUse('button.open-type.getUserInfo')
+ },
+ //事件处理函数
+ bindViewTap: function() {
+ wx.navigateTo({
+ url: '../logs/logs'
+ })
+ },
+ onLoad: function () {
+ if (app.globalData.userInfo) {
+ this.setData({
+ userInfo: app.globalData.userInfo,
+ hasUserInfo: true
+ })
+ } else if (this.data.canIUse){
+ // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
+ // 所以此处加入 callback 以防止这种情况
+ app.userInfoReadyCallback = res => {
+ this.setData({
+ userInfo: res.userInfo,
+ hasUserInfo: true
+ })
+ }
+ } else {
+ // 在没有 open-type=getUserInfo 版本的兼容处理
+ wx.getUserInfo({
+ success: res => {
+ app.globalData.userInfo = res.userInfo
+ this.setData({
+ userInfo: res.userInfo,
+ hasUserInfo: true
+ })
+ }
+ })
+ }
+ },
+ getUserInfo: function(e) {
+ app.globalData.userInfo = e.detail.userInfo
+ console.log(e.detail.userInfo)
+ this.setData({
+ userInfo: e.detail.userInfo,
+ hasUserInfo: true
+ })
+ },
+
+})
diff --git a/pages/index/index.json b/pages/index/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/index/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
new file mode 100644
index 0000000..d79c207
--- /dev/null
+++ b/pages/index/index.wxml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+ {{userInfo.nickName}}
+
+
+
diff --git a/pages/index/index.wxss b/pages/index/index.wxss
new file mode 100644
index 0000000..fab9dee
--- /dev/null
+++ b/pages/index/index.wxss
@@ -0,0 +1,17 @@
+/**index.wxss**/
+.userinfo {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.userinfo-avatar {
+ width: 128rpx;
+ height: 128rpx;
+ margin: 20rpx;
+ border-radius: 50%;
+}
+
+.userinfo-nickname {
+ color: #aaa;
+}
diff --git a/pages/lianxi/index.js b/pages/lianxi/index.js
new file mode 100644
index 0000000..db18e03
--- /dev/null
+++ b/pages/lianxi/index.js
@@ -0,0 +1,145 @@
+// pages/lianxi/index.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ questioncatData: [],
+ isLoad: true,
+ workscopeName:''
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function () {
+ if (getApp().globalData.userinfo.workscope) {
+ this.setData({
+ workscopeId: getApp().globalData.userinfo.workscope,
+ workscopeName:getApp().globalData.userinfo.workscope_name
+ })
+ } else {
+ wx.switchTab({
+ url: '/pages/main/main',
+ })
+ }
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ this.getList()
+ },
+ getList: function () {
+ var that = this
+ if (that.data.workscopeId) {
+ api.request('/question/questioncat/workscope/', 'GET', { 'id': that.data.workscopeId }).then(res => {
+ let questioncatData = []
+ if (res.data.length > 0) {
+ for (var i = 0; i < res.data.length; i++) {
+ let questioncat = {}
+ questioncat['id'] = res.data[i].id
+ questioncat['name'] = res.data[i].name
+ questioncat['tmtotal'] = res.data[i].tmtotal
+ questioncat['type'] = res.data[i].type
+ questioncat['ydtmtotal'] = 0
+ questioncatData.push(questioncat)
+ }
+ that.setData({
+ questioncatData: that.showYd(questioncatData)
+ })
+ }
+ })
+ }
+
+ },
+ showYd: function (cat) {
+ for (var i = 0; i < cat.length; i++) {
+ try {
+ var value = wx.getStorageSync('cat' + cat[i].id.toString())
+ if (value) {
+ cat[i]['ydtmtotal'] = value.length
+ }
+ } catch (e) {
+ }
+ }
+ return cat
+ },
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+ var process = {}
+ try {
+ const res = wx.getStorageInfoSync()
+ const keys = res.keys
+ for(var i=0;i {
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+ startLianxi: function (e) {
+ wx.navigateTo({
+ url: 'main?questioncat=' + e.currentTarget.id,
+ })
+ },
+ restartLianxi: function (e) {
+ try {
+ wx.setStorageSync('cat' + e.currentTarget.id, [])
+ } catch (e) { }
+ wx.navigateTo({
+ url: 'main?questioncat=' + e.currentTarget.id,
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/lianxi/index.json b/pages/lianxi/index.json
new file mode 100644
index 0000000..4d20457
--- /dev/null
+++ b/pages/lianxi/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "题库分类"
+}
\ No newline at end of file
diff --git a/pages/lianxi/index.wxml b/pages/lianxi/index.wxml
new file mode 100644
index 0000000..fe30a10
--- /dev/null
+++ b/pages/lianxi/index.wxml
@@ -0,0 +1,34 @@
+
+
+
+ {{workscopeName}}
+
+
+
+
+
+
+
+
+
+
+ 已答
+ {{item.ydtmtotal}}
+ 道,
+ 共
+ {{item.tmtotal}}
+ 道
+
+
+ 开始练习
+ 继续练习
+ 重新开始
+
+
+
+
+
+
+
+
+
diff --git a/pages/lianxi/index.wxss b/pages/lianxi/index.wxss
new file mode 100644
index 0000000..5dbdb87
--- /dev/null
+++ b/pages/lianxi/index.wxss
@@ -0,0 +1,14 @@
+/* pages/lianxi/index.wxss */
+.weui-panel {
+ margin-left:8px;
+ margin-right:8px;
+ border-radius: 8px;
+ /* background: linear-gradient(to right, #fad8be 0%, #fe6673 100%); */
+ /* background:#00a7d0; */
+ background: rgba(255, 255, 255, 1);
+ box-shadow: 0px 4rpx 16rpx 0px rgba(140, 160, 181, 0.2);
+ /* background: linear-gradient(to right, #3399CC 0%, #0066CC 100%); */
+}
+/* .weui-media-box__title {
+ color:ghostwhite
+} */
\ No newline at end of file
diff --git a/pages/lianxi/main.js b/pages/lianxi/main.js
new file mode 100644
index 0000000..8ad0e7d
--- /dev/null
+++ b/pages/lianxi/main.js
@@ -0,0 +1,301 @@
+// pages/lianxi/main.js
+const api = require("../../utils/request.js");
+var util = require('../../utils/util.js')
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ questioncat: null,
+ tm_current:null,
+ tms: [],
+ ydtms: [],
+ ctms: [],
+ tm_index: 0,
+ answerP: false,
+ page:1,
+ domain:getApp().globalData.mediahost,
+ moShi:'背题模式',
+ },
+ changeM: function () {
+ var that = this
+ if(that.data.moShi=='看题模式'){
+ that.setData({
+ moShi:'背题模式',
+ })
+ that.showOptions()
+ }else{
+ that.setData({
+ moShi: '看题模式',
+ })
+ }
+ },
+ radioChange: function(e) {
+ var that = this
+ that.data.tm_current['user_answer'] = e.detail.value
+ that.data.tms[that.data.tm_index] = that.data.tm_current
+ that.showAnswer()
+ if (that.data.moShi=='背题模式' && that.data.ydtms.indexOf(that.data.tm_current.id) == -1) {
+ that.data.ydtms.push(that.data.tm_current.id)
+ }
+ },
+ checkboxChange: function(e) {
+ var that = this
+ that.data.tm_current['user_answer'] = e.detail.value
+ that.data.tms[that.data.tm_index] = that.data.tm_current
+ if (that.data.moShi=='背题模式' && that.data.ydtms.indexOf(that.data.tm_current.id) == -1) {
+ that.data.ydtms.push(that.data.tm_current.id)
+ }
+ },
+ changeProcess: function(e){
+ let data = {'questioncat':this.questioncat, 'ydtms':this.ydtms}
+
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ wx.hideShareMenu()
+ var that = this
+ that.data.questioncat = options.questioncat
+ try {
+ var value = wx.getStorageSync('cat' + that.data.questioncat.toString())
+ if (value) {
+ that.data.ydtms = value
+ }
+ } catch (e) {
+
+ }
+ try {
+ var value = wx.getStorageSync('ctms')
+ if (value) {
+ that.data.ctms = value
+ }
+ } catch (e) {}
+ that.getTms()
+ try {
+ const res = wx.getSystemInfoSync()
+ that.setData({
+ scrollHeight: res.windowHeight - 78
+ })
+ } catch (e) {}
+ },
+ getTms: function() {
+ var that = this
+ var query = {
+ questioncat: that.data.questioncat,
+ ydtms: wx.getStorageSync('cat' + that.data.questioncat.toString()),
+ ydtms_:that.data.ydtms
+ }
+ api.request('/question/question/exercise/?limit=10&page='+that.data.page, 'POST', query).then(res => {
+ if(res.code>=200){
+ for (var i = 0; i < res.data.results.length; i++) {
+ if(res.data.results[i].img){
+ res.data.results[i].img = getApp().globalData.mediahost + res.data.results[i].img
+ }
+ }
+
+ that.data.tms = that.data.tms.concat(res.data.results)
+ that.showTm(that.data.tm_index) //展示题目和答案
+ that.setData({
+ tmtotal: res.data.count,
+ })
+ }
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function() {
+ try {
+ wx.setStorageSync('cat' + this.data.questioncat.toString(), this.data.ydtms)
+ } catch (e) {}
+ try {
+ wx.setStorageSync('ctms', this.data.ctms)
+ } catch (e) {}
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function() {
+
+ },
+
+ showTm: function(index) {
+ var that = this
+ if(index 100) {
+ that.data.ctms.length = 100
+ }
+ }
+ return isright
+ },
+ showAnswer: function() {
+ let isright = this.panTi()
+ this.setData({
+ isright: isright,
+ answerP: true,
+ tm_current: this.data.tm_current
+ })
+ },
+ next: function() {
+ var that = this
+ var tm_index = that.data.tm_index
+ if (tm_index+1==that.data.tmtotal){
+ wx.showToast({
+ title: '没有更多',
+ icon:'none'
+ })
+ }else{
+ tm_index = tm_index + 1
+ that.setData({
+ tm_index: tm_index,
+ answerP: false
+ })
+ if (tm_index + 1 > that.data.tms.length) {
+ that.data.page = that.data.page + 1
+ that.getTms()
+ } else {
+ that.showTm(tm_index)
+ }
+ }
+
+
+
+ },
+ previous: function() {
+ var that = this
+ var tm_index = that.data.tm_index - 1
+ that.setData({
+ answerP: false
+ })
+ that.showTm(tm_index)
+ },
+ showOptions: function() {
+ let tm_current = this.data.tm_current
+ let options = []
+ for (let key in tm_current.options) {
+ let option = {}
+ option.key = key
+ // option.value = '' + tm_current.options[key].toString() + '
'
+ option.value = tm_current.options[key]
+ option.checked = false
+ option.right = false
+ if(option.key == tm_current.right||tm_current.right.indexOf(option.key)!=-1){
+ option.right = true
+ }
+ if (tm_current.user_answer) {
+ if (key == tm_current.user_answer || tm_current.user_answer.indexOf(key) != -1) {
+ option.checked = true
+ }
+ }
+ options.push(option)
+ }
+ this.setData({
+ options: options
+ })
+ },
+ shoucang: function() {
+ var that = this
+ var tm_current = that.data.tm_current
+ if (tm_current.is_collect) {
+ api.request('/crm/consumer/collects/', 'DELETE', { question: tm_current.id }).then(res => {
+ wx.showToast({
+ title: '已取消!',
+ icon: 'none'
+ })
+ tm_current.is_collect = false
+ that.setData({
+ tm_current: tm_current
+ })
+ })
+
+ } else {
+ api.request('/crm/consumer/collects/', 'POST', { question: tm_current.id }).then(res => {
+ wx.showToast({
+ title: '收藏成功!',
+ icon: 'none'
+ })
+ tm_current.is_collect = true
+ that.setData({
+ tm_current: tm_current
+ })
+ })
+
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/lianxi/main.json b/pages/lianxi/main.json
new file mode 100644
index 0000000..ad8534d
--- /dev/null
+++ b/pages/lianxi/main.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "mp-html": "/components/mp-html/index"
+ },
+ "navigationBarTitleText": "练习"
+}
\ No newline at end of file
diff --git a/pages/lianxi/main.wxml b/pages/lianxi/main.wxml
new file mode 100644
index 0000000..0375f07
--- /dev/null
+++ b/pages/lianxi/main.wxml
@@ -0,0 +1,97 @@
+
+
+
+ 题量: {{tm_index+1}}/{{tmtotal}}
+
+
+ {{moShi}}
+ (点击切换)
+
+
+
+
+ {{tm_index+1}}.
+ {{tm_current.type}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 回答正确!
+ 回答有误!
+ 正确答案是 {{tm_current.right}},你的答案是 {{tm_current.user_answer}}
+
+ 解析:
+ {{tm_current.resolution}}
+ 无
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/lianxi/main.wxss b/pages/lianxi/main.wxss
new file mode 100644
index 0000000..8b8bea7
--- /dev/null
+++ b/pages/lianxi/main.wxss
@@ -0,0 +1,28 @@
+.head{
+ width:100%;
+ height:30px;
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: left;
+ display:flex;
+ flex-direction: row;
+}
+.btns{
+ height:40px;
+ display:flex;
+ padding:4px;
+ background-color: white;
+ flex-direction: row;
+ flex-wrap: wrap;
+ text-align:center;
+}
+.txlabel{
+ color:#fff;
+ background-color: rgb(216, 140, 0);
+ border-radius: 2px;
+ padding: 1px 4px;
+}
+.weui-article{
+ background-color: white;
+ padding: 24px 16px;
+}
diff --git a/pages/login/login.js b/pages/login/login.js
new file mode 100644
index 0000000..a02b457
--- /dev/null
+++ b/pages/login/login.js
@@ -0,0 +1,145 @@
+//index.js
+//获取应用实例
+const app = getApp()
+const api = require("../../utils/request.js");
+Page({
+ data: {
+ userInfo: {},
+ hasUserInfo: false,
+ canIUse: wx.canIUse('button.open-type.getUserInfo'),
+ countDown:40,
+ form:{
+ phone:0,
+ code:0,
+ nickname:0,
+ avatar:0
+ }
+ },
+ //事件处理函数
+ bindViewTap: function () {
+ wx.navigateTo({
+ url: '../logs/logs'
+ })
+ },
+ phoneChange: function (e) {
+ this.data.form.phone = e.detail.value
+ },
+ codeChange: function (e) {
+ this.data.form.code = e.detail.value
+ },
+ onLoad: function () {
+ wx.hideHomeButton()
+ if (app.globalData.userInfo) {
+ this.setData({
+ userInfo: app.globalData.userInfo,
+ hasUserInfo: true
+ })
+ } else if (this.data.canIUse) {
+ // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
+ // 所以此处加入 callback 以防止这种情况
+ app.userInfoReadyCallback = res => {
+ this.setData({
+ userInfo: res.userInfo,
+ hasUserInfo: true
+ })
+ }
+ } else {
+ // 在没有 open-type=getUserInfo 版本的兼容处理
+ wx.getUserInfo({
+ success: res => {
+ app.globalData.userInfo = res.userInfo
+ this.setData({
+ userInfo: res.userInfo,
+ hasUserInfo: true
+ })
+ }
+ })
+ }
+ },
+ getUserInfo: function (e) {
+ app.globalData.userInfo = e.detail.userInfo
+ this.setData({
+ userInfo: e.detail.userInfo,
+ hasUserInfo: true
+ })
+ },
+ sendMsg : function (){
+ var that = this
+ if(that.isPhone(that.data.form.phone)){
+ api.request('/crm/consumer/sendcode', 'GET', { phone: that.data.form.phone }).then(res => {
+ wx.showToast({
+ title: '验证码发送成功!注意查收',
+ icon: 'none'
+ })
+ getApp().globalData.timer = setInterval(function () {
+ that.startPass()
+ }, 1000)
+ })
+ }else{
+ wx.showToast({
+ title: '请输入正确的手机号!',
+ icon: 'none'
+ })
+ }
+
+ },
+ onGetInfo : function (e){
+ var that = this
+ if(e.detail.userInfo){
+ this.setData({
+ userInfo: e.detail.userInfo
+ })
+ that.data.form.nickname = e.detail.userInfo.nickName
+ that.data.form.avatar = e.detail.userInfo.avatarUrl
+ }
+
+ if(that.isPhone(that.data.form.phone)){
+ that.denglu(that.data.form)
+ }else{
+ wx.showToast({
+ title: '请输入正确的手机号!',
+ icon: 'none'
+ })
+ }
+ },
+ goMain: function (){
+ wx.reLaunch({
+ url: '/pages/main/main',
+ })
+ },
+ goadmin: function(){
+ wx.redirectTo({
+ url: '/pages/admin/login',
+ })
+ },
+ denglu: function (data) {
+ api.request('/crm/consumer/register/', 'POST', data).then(res => {
+ getApp().onLaunch()
+ wx.switchTab({
+ url: '/pages/main/main',
+ })
+ })
+ },
+ startPass: function(){
+ var that = this
+ var mil = that.data.countDown
+ if (mil < 2) {
+ that.setData({
+ countDown:40
+ })
+ clearInterval(getApp().globalData.timer)
+ }else{
+ this.setData({
+ countDown: mil-1,
+ });
+ }
+ },
+ isPhone: function(phone){
+ var phoneReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
+ if (phoneReg.test(phone)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+})
diff --git a/pages/login/login.json b/pages/login/login.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/login/login.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/login/login.wxml b/pages/login/login.wxml
new file mode 100644
index 0000000..6d7eb8e
--- /dev/null
+++ b/pages/login/login.wxml
@@ -0,0 +1,39 @@
+
+
+ 开启学习之旅
+ 为了更好的为您服务,请注册!
+
+
+ 注册
+
+
+
+ 手机号
+
+
+
+
+
+ 获取验证码
+ {{countDown}}s
+
+
+
+
+ 验证码
+
+
+
+
+
+
+
+
+ 浏览进入
+
+
\ No newline at end of file
diff --git a/pages/login/login.wxss b/pages/login/login.wxss
new file mode 100644
index 0000000..8435be5
--- /dev/null
+++ b/pages/login/login.wxss
@@ -0,0 +1,21 @@
+/**index.wxss**/
+.userinfo {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.userinfo-avatar {
+ width: 128rpx;
+ height: 128rpx;
+ margin: 20rpx;
+ border-radius: 50%;
+}
+
+.userinfo-nickname {
+ color: #aaa;
+}
+
+.usermotto {
+ margin-top: 20px;
+}
\ No newline at end of file
diff --git a/pages/login/login2.js b/pages/login/login2.js
new file mode 100644
index 0000000..d357aa5
--- /dev/null
+++ b/pages/login/login2.js
@@ -0,0 +1,155 @@
+//index.js
+//获取应用实例
+const app = getApp()
+const api = require("../../utils/request.js");
+Page({
+ data: {
+ userInfo: {},
+ hasUserInfo: false,
+ canIUse: wx.canIUse('button.open-type.getUserInfo'),
+ countDown:40,
+ form:{
+ phone:0,
+ code:0,
+ nickname:0,
+ avatar:0
+ }
+ },
+ //事件处理函数
+ bindViewTap: function () {
+ wx.navigateTo({
+ url: '../logs/logs'
+ })
+ },
+ phoneChange: function (e) {
+ this.data.form.phone = e.detail.value
+ },
+ codeChange: function (e) {
+ this.data.form.code = e.detail.value
+ },
+ onLoad: function () {
+ wx.hideHomeButton()
+ if (app.globalData.userInfo) {
+ this.setData({
+ userInfo: app.globalData.userInfo,
+ hasUserInfo: true
+ })
+ } else if (this.data.canIUse) {
+ // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
+ // 所以此处加入 callback 以防止这种情况
+ app.userInfoReadyCallback = res => {
+ this.setData({
+ userInfo: res.userInfo,
+ hasUserInfo: true
+ })
+ }
+ } else {
+ // 在没有 open-type=getUserInfo 版本的兼容处理
+ wx.getUserInfo({
+ success: res => {
+ app.globalData.userInfo = res.userInfo
+ this.setData({
+ userInfo: res.userInfo,
+ hasUserInfo: true
+ })
+ }
+ })
+ }
+ },
+ getUserInfo: function (e) {
+ app.globalData.userInfo = e.detail.userInfo
+ this.setData({
+ userInfo: e.detail.userInfo,
+ hasUserInfo: true
+ })
+ },
+ sendMsg : function (){
+ var that = this
+ if(that.isPhone(that.data.form.phone)){
+ api.request('/crm/consumer/sendcode', 'GET', { phone: that.data.form.phone }).then(res => {
+ wx.showToast({
+ title: '验证码发送成功!注意查收',
+ icon: 'none'
+ })
+ getApp().globalData.timer = setInterval(function () {
+ that.startPass()
+ }, 1000)
+ })
+ }else{
+ wx.showToast({
+ title: '请输入正确的手机号!',
+ icon: 'none'
+ })
+ }
+
+ },
+ onGetInfo : function (e){
+ var that = this
+ if(e.detail.userInfo){
+ this.setData({
+ userInfo: e.detail.userInfo
+ })
+ that.data.form.nickname = e.detail.userInfo.nickName
+ that.data.form.avatar = e.detail.userInfo.avatarUrl
+ }
+
+ if(that.isPhone(that.data.form.phone)){
+ that.denglu(that.data.form)
+ }else{
+ wx.showToast({
+ title: '请输入正确的手机号!',
+ icon: 'none'
+ })
+ }
+ },
+ goMain: function (){
+ wx.reLaunch({
+ url: '/pages/main/main',
+ })
+ },
+ denglu: function (data) {
+ api.request('/crm/consumer/register/', 'POST', data).then(res => {
+ getApp().onLaunch()
+ wx.switchTab({
+ url: '/pages/main/main',
+ })
+ })
+ },
+ getPhoneNumber: function(e){
+ if(e.detail.encryptedData){
+ let form = {
+ encryptedData: e.detail.encryptedData,
+ iv: e.detail.iv,
+ sessionKey:getApp().globalData.session_key
+ }
+ api.request('/crm/consumer/wxphoneregister/', 'POST', form).then(res => {
+ getApp().onLaunch()
+ wx.switchTab({
+ url: '/pages/main/main',
+ })
+ })
+ }
+ },
+ startPass: function(){
+ var that = this
+ var mil = that.data.countDown
+ if (mil < 2) {
+ that.setData({
+ countDown:40
+ })
+ clearInterval(getApp().globalData.timer)
+ }else{
+ this.setData({
+ countDown: mil-1,
+ });
+ }
+ },
+ isPhone: function(phone){
+ var phoneReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
+ if (phoneReg.test(phone)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+})
diff --git a/pages/login/login2.json b/pages/login/login2.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/login/login2.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/login/login2.wxml b/pages/login/login2.wxml
new file mode 100644
index 0000000..9b3cf7c
--- /dev/null
+++ b/pages/login/login2.wxml
@@ -0,0 +1,38 @@
+
+
+ 开启学习之旅
+ 为了更好的为您服务,请注册!
+
+
+
+ 浏览进入
+
+
\ No newline at end of file
diff --git a/pages/login/login2.wxss b/pages/login/login2.wxss
new file mode 100644
index 0000000..8435be5
--- /dev/null
+++ b/pages/login/login2.wxss
@@ -0,0 +1,21 @@
+/**index.wxss**/
+.userinfo {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.userinfo-avatar {
+ width: 128rpx;
+ height: 128rpx;
+ margin: 20rpx;
+ border-radius: 50%;
+}
+
+.userinfo-nickname {
+ color: #aaa;
+}
+
+.usermotto {
+ margin-top: 20px;
+}
\ No newline at end of file
diff --git a/pages/logs/logs.js b/pages/logs/logs.js
new file mode 100644
index 0000000..b2b967d
--- /dev/null
+++ b/pages/logs/logs.js
@@ -0,0 +1,15 @@
+//logs.js
+const util = require('../../utils/util.js')
+
+Page({
+ data: {
+ logs: []
+ },
+ onLoad: function () {
+ this.setData({
+ logs: (wx.getStorageSync('logs') || []).map(log => {
+ return util.formatTime(new Date(log))
+ })
+ })
+ }
+})
diff --git a/pages/logs/logs.json b/pages/logs/logs.json
new file mode 100644
index 0000000..3ee76c1
--- /dev/null
+++ b/pages/logs/logs.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "查看启动日志",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/logs/logs.wxml b/pages/logs/logs.wxml
new file mode 100644
index 0000000..b5a85ac
--- /dev/null
+++ b/pages/logs/logs.wxml
@@ -0,0 +1,6 @@
+
+
+
+ {{index + 1}}. {{log}}
+
+
diff --git a/pages/logs/logs.wxss b/pages/logs/logs.wxss
new file mode 100644
index 0000000..94d4b88
--- /dev/null
+++ b/pages/logs/logs.wxss
@@ -0,0 +1,8 @@
+.log-list {
+ display: flex;
+ flex-direction: column;
+ padding: 40rpx;
+}
+.log-item {
+ margin: 10rpx;
+}
diff --git a/pages/main/main.js b/pages/main/main.js
new file mode 100644
index 0000000..ace042f
--- /dev/null
+++ b/pages/main/main.js
@@ -0,0 +1,303 @@
+// pages/main/main.js
+const app = getApp()
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ Hei:0,
+ wrongnum: 0,
+ collectnum: 0,
+ dg1:false,
+ background: [app.globalData.mediahost + '/media/banner/1.jpg'],
+ indicatorDots: true,
+ vertical: false,
+ autoplay: true,
+ interval: 7000,
+ duration: 1500,
+ nowWork:null,
+ msgList: [
+ { title: "欢迎使用辐射学堂!" },
+ { title: "QQ交流群:1072443859" },
+ { title: "首次访问用户有3次自助模考机会" },
+ { title: "如有疑问,请致电课程顾问" },
+ ]
+ },
+ imgH: function (e) {
+ let winWid = wx.getSystemInfoSync().windowWidth; //获取当前屏幕的宽度
+ let imgh = e.detail.height; //图片高度
+ let imgw = e.detail.width;
+ let swiperH = winWid * imgh / imgw + "px";
+ this.setData({
+ Hei: swiperH //设置高度
+ })
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var that = this
+ api.request('/examtest/banner/', 'GET').then(res => {
+ let images = []
+ for(var i=0;i0){
+ wx.showModal({
+ title: '暂未开通权限!',
+ content: '您有' + remain_count + '次体验次数.',
+ confirmText: '体验一下',
+ success(res) {
+ if (res.confirm) {
+ that.genPaper2()
+ }
+ }
+ })
+ }else{
+ wx.showModal({
+ title: '未开通权限!',
+ content: '体验次数已用完',
+ showCancel: false,
+ })
+ }
+ }
+ },
+ goYati: function () {
+ if (getApp().globalData.userinfo.workscope) {
+ wx.navigateTo({
+ url: '/pages/yati/index',
+ })
+ } else {
+ wx.showModal({
+ title: '暂未开通权限!',
+ content: '查看各地区课程顾问联系方式。',
+ confirmText: '查看',
+ success(res) {
+ if (res.confirm) {
+ wx.navigateTo({
+ url: '/pages/article/detail?id=6',
+ })
+ }
+ }
+ })
+ }
+ },
+ testList: function (){
+ wx.navigateTo({
+ url: '/pages/test/list',
+ })
+ },
+ genPaper: function (workId) {
+ wx.showLoading({
+ title: '正在生成试卷',
+ mask:true
+ })
+ api.request('/examtest/workscope/' + workId + '/monitest/', 'GET').then(res => {
+ wx.hideLoading()
+ try {
+ wx.setStorageSync('examtest', res.data)
+ } catch (e) { }
+ wx.navigateTo({
+ url: '/pages/moni/note',
+ })
+ })
+
+ },
+ genPaper2: function () {
+ wx.showLoading({
+ title: '正在生成试卷',
+ mask: true
+ })
+ api.request('/examtest/workscope/monitest2/', 'GET').then(res => {
+ wx.hideLoading()
+ try {
+ wx.setStorageSync('examtest', res.data)
+ getApp().globalData.userinfo.remain_count = res.data.remain_count
+ } catch (e) { }
+ wx.navigateTo({
+ url: '/pages/moni/note',
+ })
+ })
+
+ },
+ showDg: function(){
+ this.setData({
+ dg1:true
+ })
+ },
+ Baoming: function (){
+ wx.navigateToMiniProgram({
+ appId: 'wxdcf5bbfb50dbbac8',
+ path: '',
+ success(res) {
+ // 打开其他小程序成功同步触发
+ // wx.showToast({
+ // title: '跳转成功'
+ // })
+ }
+ })
+ },
+ search: function (value) {
+
+ return new Promise((resolve, reject) => {
+ api.request('/question/question/', 'GET', {search:value,page:1,limit:20}).then(res => {
+ if(res.data && res.data.results){
+ for(var i=0; i','').replace('
','').substring(0,18)+'...'
+ res.data.results[i].value = res.data.results[i].id
+ }
+ resolve(res.data.results)
+ }else{
+ resolve([{text: '无搜索结果', value: 0}])
+ }
+ })
+ })
+ },
+ selectResult: function (e) {
+ console.log(e.detail)
+ wx.navigateTo({
+ url: `/pages/question/detail?id=${e.detail.item.id}`,
+ })
+ },
+ getNum: function(){
+ try{
+ const ctms = wx.getStorageSync('ctms')
+ this.setData({
+ wrongnum:ctms.length
+ })
+ }catch(e){}
+ },
+ goTest: function(){
+ var that = this
+ const workscope = getApp().globalData.userinfo.workscope
+ wx.showLoading({
+ title: '正在生成试卷',
+ mask:true
+ })
+ api.request('/examtest/workscope/' + workscope + '/examtest/', 'GET').then(res => {
+ wx.hideLoading()
+ try {
+ wx.setStorageSync('examtest', res.data)
+ } catch (e) { }
+ wx.navigateTo({
+ url: '/pages/exam/note',
+ })
+ })
+
+ }
+})
\ No newline at end of file
diff --git a/pages/main/main.json b/pages/main/main.json
new file mode 100644
index 0000000..f71f8cc
--- /dev/null
+++ b/pages/main/main.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "mp-searchbar": "weui-miniprogram/searchbar/searchbar",
+ "mp-halfScreenDialog": "weui-miniprogram/half-screen-dialog/half-screen-dialog"
+ }
+}
\ No newline at end of file
diff --git a/pages/main/main.wxml b/pages/main/main.wxml
new file mode 100644
index 0000000..7d9ef5c
--- /dev/null
+++ b/pages/main/main.wxml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+
+
+
+
+
+
+
+ 练习
+
+
+
+
+
+ 自助模考
+
+
+
+
+
+ 押卷模考
+
+
+
+
+
+ 错题集
+ {{wrongnum}}
+
+
+
+
+
+ 收藏集
+ {{collectnum}}
+
+
+
+
+
+
+
+ 考试记录
+
+
+
+
+
+
+
+ Ⅲ类自测入口
+
+
+
+
+ Ⅲ类报告单
+
+
+
+
+
+
+
+ 放射工作/管理人员
+
+
+
+
+
+
+
+
+ 成绩报告单查询
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 视频课程
+
+
+
+
+ 自主考核
+
+
+
+
+ 我的证书
+
+
+
\ No newline at end of file
diff --git a/pages/main/main.wxss b/pages/main/main.wxss
new file mode 100644
index 0000000..047bbe9
--- /dev/null
+++ b/pages/main/main.wxss
@@ -0,0 +1,33 @@
+.swiper_container1 {
+margin-top:12rpx;
+height: 50rpx;
+width: 100%;
+text-align: center
+}
+.swiper_item1 {
+font-size: 30rpx;
+font-weight: bold;
+color:darkblue;
+overflow: hidden;
+text-overflow: ellipsis;
+white-space: nowrap;
+}
+
+.weui-grids{
+ border-top: 0px;
+ border-bottom: 0px;
+}
+.weui-grid {
+ border-bottom: 0px;
+ width: 33.3%
+}
+.bigCard {
+ background-color: white;
+ height: 100%;
+ width:100%;
+ display: flex;
+ box-shadow: 0px 4rpx 16rpx 0px rgba(140, 160, 181, 0.2);
+ border-radius: 4rpx;
+ justify-content: center;
+ align-items: center;
+}
\ No newline at end of file
diff --git a/pages/main/start.js b/pages/main/start.js
new file mode 100644
index 0000000..b7fbd25
--- /dev/null
+++ b/pages/main/start.js
@@ -0,0 +1,66 @@
+// pages/main/start.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/main/start.json b/pages/main/start.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/main/start.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/main/start.wxml b/pages/main/start.wxml
new file mode 100644
index 0000000..e14d1c8
--- /dev/null
+++ b/pages/main/start.wxml
@@ -0,0 +1,2 @@
+
+pages/main/start.wxml
diff --git a/pages/main/start.wxss b/pages/main/start.wxss
new file mode 100644
index 0000000..eb99c2d
--- /dev/null
+++ b/pages/main/start.wxss
@@ -0,0 +1 @@
+/* pages/main/start.wxss */
\ No newline at end of file
diff --git a/pages/material/index.js b/pages/material/index.js
new file mode 100644
index 0000000..7ae5e24
--- /dev/null
+++ b/pages/material/index.js
@@ -0,0 +1,159 @@
+// pages/lianxi/index.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ results: [],
+ query: {
+ page: 1,
+ limit: 10,
+ type:'文档'
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function () {
+ var that = this
+ that.getList(that.data.query)
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ },
+ getList: function () {
+ var that = this
+ api.request('/cms/material/', 'GET', that.data.query).then(res => {
+ if (that.data.query.page == 1) {
+ that.data.results = res.data.results
+ } else {
+ that.data.results = that.data.results.concat(res.data.results)
+ }
+
+ that.setData({
+ results: that.data.results,
+ count: res.data.count
+ })
+
+ })
+ },
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ var that = this
+ that.data.query.page = 1;
+ that.getList();
+ wx.stopPullDownRefresh();
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ var that = this
+ if (that.data.count <= that.data.query.page * that.data.query.limit) {
+ wx.showToast({
+ title: '没有更多了',
+ icon: 'none'
+ })
+ } else {
+ that.data.query.page = that.data.query.page + 1
+ that.getList()
+ }
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ downFile:function(e){
+ var that = this
+ wx.showLoading({
+ title: '正在下载...',
+ })
+ api.request('/cms/material/'+e.currentTarget.dataset.id+'/down/', 'GET').then(res => {
+ that.data.results[e.currentTarget.dataset.index].down_count = res.data.down_count
+ var fileurl = getApp().globalData.host + res.data.path
+ wx.downloadFile({
+ url: fileurl,
+ success(res) {
+ wx.showLoading({
+ title: '成功,正在打开...',
+ })
+ const filePath = res.tempFilePath
+ var filetype
+ if (fileurl.indexOf(".docx") != -1) {
+ filetype = 'docx'
+ }
+ else if (fileurl.indexOf(".doc") != -1) {
+ filetype = 'doc'
+ }
+ else if (fileurl.indexOf(".xlsx") != -1) {
+ filetype = 'xlsx'
+ }
+ else if (fileurl.indexOf(".xls") != -1) {
+ filetype = 'xls'
+ }
+ else if (fileurl.indexOf(".pptx") != -1) {
+ filetype = 'pptx'
+ }
+ else if (fileurl.indexOf(".ppt") != -1) {
+ filetype = 'ppt'
+ }
+ else if (fileurl.indexOf(".pdf") != -1) {
+ filetype = 'pdf'
+ } else {
+ wx.hideLoading()
+ return
+ }
+ wx.openDocument({
+ filePath,
+ fileType: filetype,
+ showMenu: true,
+ success(res) {
+ wx.hideLoading()
+ console.log('打开文档成功')
+ }, fail: function (e) {
+ wx.hideLoading()
+ }
+ })
+ }
+ })
+ that.setData({
+ results:that.data.results
+ })
+ })
+ }
+
+})
\ No newline at end of file
diff --git a/pages/material/index.json b/pages/material/index.json
new file mode 100644
index 0000000..77aa06a
--- /dev/null
+++ b/pages/material/index.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ },
+ "enablePullDownRefresh": true,
+ "onReachBottomDistance": 50
+}
\ No newline at end of file
diff --git a/pages/material/index.wxml b/pages/material/index.wxml
new file mode 100644
index 0000000..d205a65
--- /dev/null
+++ b/pages/material/index.wxml
@@ -0,0 +1,30 @@
+
+
+ {{count}}份资料
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+ {{item.description}}
+
+
+
+
+ 下载
+
+
+ 下载量:{{item.down_count}}
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/material/index.wxss b/pages/material/index.wxss
new file mode 100644
index 0000000..a458506
--- /dev/null
+++ b/pages/material/index.wxss
@@ -0,0 +1,5 @@
+.head{
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: center;
+}
\ No newline at end of file
diff --git a/pages/material/video.js b/pages/material/video.js
new file mode 100644
index 0000000..20dd5d4
--- /dev/null
+++ b/pages/material/video.js
@@ -0,0 +1,120 @@
+// pages/lianxi/index.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ results: [],
+ query: {
+ page: 1,
+ limit: 10,
+ type:'视频'
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function () {
+ var that = this
+ that.getList(that.data.query)
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ },
+ getList: function () {
+ var that = this
+ api.request('/cms/material/', 'GET', that.data.query).then(res => {
+ for(var i=0;i{
+
+ }).catch(e=>{})
+ },
+ pause:function(e){
+ let index = e.currentTarget.dataset.index
+ this.data.results[index].showTitle=true
+ this.setData({
+ results:this.data.results
+ })
+ },
+})
\ No newline at end of file
diff --git a/pages/material/video.json b/pages/material/video.json
new file mode 100644
index 0000000..9fc3298
--- /dev/null
+++ b/pages/material/video.json
@@ -0,0 +1,7 @@
+{
+ "usingComponents": {
+ "txv-video": "plugin://tencentvideo/video"
+ },
+ "enablePullDownRefresh": true,
+ "onReachBottomDistance": 50
+}
\ No newline at end of file
diff --git a/pages/material/video.wxml b/pages/material/video.wxml
new file mode 100644
index 0000000..e6699bd
--- /dev/null
+++ b/pages/material/video.wxml
@@ -0,0 +1,21 @@
+暂无视频资源
+
+
+
+
+ {{item.name}}
+
+
+
+{{item.name}}
+
+
+
\ No newline at end of file
diff --git a/pages/material/video.wxss b/pages/material/video.wxss
new file mode 100644
index 0000000..f4aae0e
--- /dev/null
+++ b/pages/material/video.wxss
@@ -0,0 +1,14 @@
+.head{
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: center;
+}
+.txv-video-slot{
+ width: 100%;
+ height: 40px;
+ line-height: 40px;
+ font-size: 16px;
+ color:white;
+ background-color: black;
+ opacity:0.3;
+}
\ No newline at end of file
diff --git a/pages/moni/index.js b/pages/moni/index.js
new file mode 100644
index 0000000..5304a21
--- /dev/null
+++ b/pages/moni/index.js
@@ -0,0 +1,86 @@
+// pages/lianxi/index.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ ruleData: [],
+ isLoad: true
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function () {
+ if (getApp().globalData.userinfo.workscope) {
+ this.setData({
+ workId: getApp().globalData.userinfo.workscope
+ })
+ this.genPaper()
+ } else {
+ wx.switchTab({
+ url: '/pages/main/main',
+ })
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ },
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+ genPaper: function () {
+ api.request('/examtest/workscope/' + this.data.workId + '/monitest/', 'GET').then(res => {
+ try {
+ wx.setStorageSync('examtest', res.data)
+ } catch (e) { }
+ wx.redirectTo({
+ url: 'note',
+ })
+ })
+ },
+})
\ No newline at end of file
diff --git a/pages/moni/index.json b/pages/moni/index.json
new file mode 100644
index 0000000..2317f37
--- /dev/null
+++ b/pages/moni/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "出题规则"
+}
\ No newline at end of file
diff --git a/pages/moni/index.wxml b/pages/moni/index.wxml
new file mode 100644
index 0000000..f8355ca
--- /dev/null
+++ b/pages/moni/index.wxml
@@ -0,0 +1,19 @@
+
+
diff --git a/pages/moni/index.wxss b/pages/moni/index.wxss
new file mode 100644
index 0000000..1214bd9
--- /dev/null
+++ b/pages/moni/index.wxss
@@ -0,0 +1 @@
+/* pages/moni/index.wxss */
\ No newline at end of file
diff --git a/pages/moni/note.js b/pages/moni/note.js
new file mode 100644
index 0000000..aa421da
--- /dev/null
+++ b/pages/moni/note.js
@@ -0,0 +1,77 @@
+// pages/examtest/note.js
+var util = require('../../utils/util.js')
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function () {
+ try {
+ var value = wx.getStorageSync('examtest')
+ if (value) {
+ let examtest = value
+ delete examtest['questions']
+ this.setData(examtest)
+ }
+ } catch (e) { }
+
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ startTest: function () {
+ wx.reLaunch({
+ url: '/pages/test/test',
+ })
+ },
+})
\ No newline at end of file
diff --git a/pages/moni/note.json b/pages/moni/note.json
new file mode 100644
index 0000000..28a2a8e
--- /dev/null
+++ b/pages/moni/note.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "考试须知"
+}
\ No newline at end of file
diff --git a/pages/moni/note.wxml b/pages/moni/note.wxml
new file mode 100644
index 0000000..29121dd
--- /dev/null
+++ b/pages/moni/note.wxml
@@ -0,0 +1,22 @@
+
+
+
+ 考试须知
+ 1.考试详情
+ 名称:{{name}}
+ 答卷时长:{{limit}}分钟
+ {{danxuan_count}}道单选题,每题{{danxuan_score}}分
+ {{duoxuan_count}}道多选题,每题{{duoxuan_score}}分
+ {{panduan_count}}道判断题,每题{{panduan_score}}分
+ 多选题漏选每个正确选项得1分,错选0分
+ 满分{{total_score}};{{pass_score}}以上通过
+ 2.答题须知
+ 进入答题后请不要后退或返回桌面
+ 用户可点击上一题/下一题进行切换答题
+ 可点击答题卡复查
+ 请合理安排时间答题,可提前交卷,超时会自动提交
+
+ 开始考试
+
+
+
\ No newline at end of file
diff --git a/pages/moni/note.wxss b/pages/moni/note.wxss
new file mode 100644
index 0000000..cc6af1e
--- /dev/null
+++ b/pages/moni/note.wxss
@@ -0,0 +1 @@
+/* pages/moni/note.wxss */
\ No newline at end of file
diff --git a/pages/my/index.js b/pages/my/index.js
new file mode 100644
index 0000000..d31039f
--- /dev/null
+++ b/pages/my/index.js
@@ -0,0 +1,87 @@
+// pages/my/index.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ total:0,
+ avg_score:0,
+ pass_rate:0,
+ nowWork:'点击选择'
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ let userinfo = getApp().globalData.userinfo
+ if(userinfo.username){
+ userinfo.username = userinfo.username.replace(/(\d{3})(\d{4})(\d{4})/,"$1****$3")
+ }
+ this.setData({
+ userinfo: userinfo
+ })
+ api.request('/examtest/examtest/fx/', 'GET').then(res => {
+ this.setData(res.data)
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ register: function() {
+ var that = this
+ if (that.data.userinfo.role_name=='游客'){
+ wx.reLaunch({
+ url: '/pages/login/login2',
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/my/index.json b/pages/my/index.json
new file mode 100644
index 0000000..b55b5a2
--- /dev/null
+++ b/pages/my/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {
+ }
+}
\ No newline at end of file
diff --git a/pages/my/index.wxml b/pages/my/index.wxml
new file mode 100644
index 0000000..9837a27
--- /dev/null
+++ b/pages/my/index.wxml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+ {{userinfo.role_name}}:
+ {{userinfo.username}}
+
+ 账号:
+ 未登陆
+
+ 昵称:
+
+
+ 单位:
+ {{ userinfo.company_name }}
+
+ 如需解绑账号请联系课程顾问
+
+
+
+
+
+ 统计分析
+
+
+
+
+
+
+ 工作类别
+
+ {{userinfo.workscope_name}}
+ 无
+
+
+
+
+
+
+
+ 考试次数
+ {{total}}
+
+
+
+
+
+
+ 通过率
+ {{pass_rate}}%
+
+
+
+
+
+
+ 平均分
+ {{avg_score}}
+
+
+
+
+
+
+ 个人防护用品检测(铅当量)
+
+
+
+
+
+
+ 考核名额监控
+
+
+
+
+
+ 管理员操作台
+
+
+ 管理员入口
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/my/index.wxss b/pages/my/index.wxss
new file mode 100644
index 0000000..beb7c9e
--- /dev/null
+++ b/pages/my/index.wxss
@@ -0,0 +1 @@
+/* pages/my/index.wxss */
\ No newline at end of file
diff --git a/pages/qtest/form.js b/pages/qtest/form.js
new file mode 100644
index 0000000..d923914
--- /dev/null
+++ b/pages/qtest/form.js
@@ -0,0 +1,230 @@
+// pages/qtest/form.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ items: [
+ { name: '铅衣', value: '铅衣' },
+ { name: '铅帽', value: '铅帽' },
+ { name: '铅围裙', value: '铅围裙' },
+ { name: '铅围脖', value: '铅围脖' },
+ { name: '一整套防护用品', value: '一整套防护用品' },
+ ]
+ },
+ checkboxChange: function (e) {
+ this.data.tests = e.detail.value
+ },
+ addressInput: function(e){
+ this.data.address = e.detail.value
+ },
+ nameInput: function(e){
+ this.data.name = e.detail.value
+ },
+ phoneInput: function(e){
+ this.data.phone = e.detail.value
+ },
+ kdInput: function(e){
+ this.data.kdd = e.detail.value
+ },
+ tap1:function(){
+ api.request('/cms/material/','get', {name:'个人防护用品检测介绍和案例'}).then(res=>{
+ var res1 = res.data
+ if(res1.count){
+ var fileurl = getApp().globalData.host + res1.results[0].path
+ wx.showLoading({
+ title: '正在下载...',
+ })
+ wx.downloadFile({
+ url: fileurl,
+ success(res) {
+ wx.showLoading({
+ title: '成功,正在打开...',
+ })
+ const filePath = res.tempFilePath
+ var filetype
+ if (fileurl.indexOf(".docx") != -1) {
+ filetype = 'docx'
+ }
+ else if (fileurl.indexOf(".doc") != -1) {
+ filetype = 'doc'
+ }
+ else if (fileurl.indexOf(".xlsx") != -1) {
+ filetype = 'xlsx'
+ }
+ else if (fileurl.indexOf(".xls") != -1) {
+ filetype = 'xls'
+ }
+ else if (fileurl.indexOf(".pptx") != -1) {
+ filetype = 'pptx'
+ }
+ else if (fileurl.indexOf(".ppt") != -1) {
+ filetype = 'ppt'
+ }
+ else if (fileurl.indexOf(".pdf") != -1) {
+ filetype = 'pdf'
+ } else {
+ wx.hideLoading()
+ return
+ }
+ wx.openDocument({
+ filePath,
+ fileType: filetype,
+ showMenu: true,
+ success(res) {
+ wx.hideLoading()
+ console.log('打开文档成功')
+ }, fail: function (e) {
+ wx.hideLoading()
+ }
+ })
+ }
+ })
+ }
+ })
+ },
+ tap2:function(){
+ api.request('/cms/material/','get', {name:'个人防护用品检测申请单'}).then(res=>{
+ var res1 = res.data
+ if(res1.count){
+ var fileurl = getApp().globalData.host + res1.results[0].path
+ wx.showLoading({
+ title: '正在下载...',
+ })
+ wx.downloadFile({
+ url: fileurl,
+ success(res) {
+ wx.showLoading({
+ title: '成功,正在打开...',
+ })
+ const filePath = res.tempFilePath
+ var filetype
+ if (fileurl.indexOf(".docx") != -1) {
+ filetype = 'docx'
+ }
+ else if (fileurl.indexOf(".doc") != -1) {
+ filetype = 'doc'
+ }
+ else if (fileurl.indexOf(".xlsx") != -1) {
+ filetype = 'xlsx'
+ }
+ else if (fileurl.indexOf(".xls") != -1) {
+ filetype = 'xls'
+ }
+ else if (fileurl.indexOf(".pptx") != -1) {
+ filetype = 'pptx'
+ }
+ else if (fileurl.indexOf(".ppt") != -1) {
+ filetype = 'ppt'
+ }
+ else if (fileurl.indexOf(".pdf") != -1) {
+ filetype = 'pdf'
+ } else {
+ wx.hideLoading()
+ return
+ }
+ wx.openDocument({
+ filePath,
+ fileType: filetype,
+ showMenu: true,
+ success(res) {
+ wx.hideLoading()
+ console.log('打开文档成功')
+ }, fail: function (e) {
+ wx.hideLoading()
+ }
+ })
+ }
+ })
+ }
+ })
+ },
+ submit: function(){
+ if(this.data.name&&this.data.phone&&this.data.address){
+ let data = {
+ name:this.data.name,
+ phone:this.data.phone,
+ address:this.data.address,
+ tests:this.data.tests,
+ kdd:this.data.kdd
+ }
+ api.request('/qtest/consult/','POST', data).then(res=>{
+ wx.showModal({
+ title: '提示!',
+ content: '已提交信息.',
+ confirmText: '好的',
+ showCancel:false,
+ success(res) {
+ if (res.confirm) {
+ wx.navigateBack({
+ delta: 0,
+ })
+ }
+ }
+ })
+ })
+ }else{
+ wx.showToast({
+ title: '填写不完整',
+ icon:'none'
+ })
+ }
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/qtest/form.json b/pages/qtest/form.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/qtest/form.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/qtest/form.wxml b/pages/qtest/form.wxml
new file mode 100644
index 0000000..319ae58
--- /dev/null
+++ b/pages/qtest/form.wxml
@@ -0,0 +1,81 @@
+
+
+
+ 中科辐射学堂和国家建材工业安防工程产品质量监督检验中心推出个人防护用品合格检测, 如有需要可提交您的申请。
+
+
+
+
+
+
+ 基本信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 检测内容
+
+
+
+
+
+
+
+
+
+
+ 提交
+
+
+
+
\ No newline at end of file
diff --git a/pages/qtest/form.wxss b/pages/qtest/form.wxss
new file mode 100644
index 0000000..52e4904
--- /dev/null
+++ b/pages/qtest/form.wxss
@@ -0,0 +1,2 @@
+/* pages/qtest/form.wxss */
+.page{height:100%}.weui-label{width:4.1em}
\ No newline at end of file
diff --git a/pages/question/detail.js b/pages/question/detail.js
new file mode 100644
index 0000000..cbd3ecf
--- /dev/null
+++ b/pages/question/detail.js
@@ -0,0 +1,156 @@
+
+const api = require("../../utils/request.js");
+var util = require('../../utils/util.js')
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ is_right: false,
+ answerP: false,
+ domain:getApp().globalData.mediahost,
+ },
+ radioChange: function (e) {
+ var that = this
+ that.data.tm_current['user_answer'] = e.detail.value
+ that.showAnswer()
+ },
+ checkboxChange: function (e) {
+ var that = this
+ that.data.tm_current['user_answer'] = e.detail.value
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var that = this
+ wx.showLoading({
+ title: '加载中',
+ mask:true
+ })
+ api.request(`/question/question/${options.id}/`, 'GET').then(res => {
+ if(res.data.img){
+ res.data.img = getApp().globalData.mediahost + res.data.img
+ }
+ that.data.tm_current = res.data
+ that.showTm()
+ wx.hideLoading({
+ complete: (res) => {},
+ })
+ })
+ try {
+ const res = wx.getSystemInfoSync()
+ that.setData({
+ scrollHeight: res.windowHeight - 90
+ })
+ } catch (e) {
+ }
+
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+ showTm: function (index) {
+ var that = this
+ var tm_current = that.data.tm_current
+ that.setData({
+ tm_current: tm_current,
+ answerP: false
+ })
+ that.showOptions()
+ if (tm_current.user_answer) {
+ that.showAnswer()
+ }
+ },
+ panTi: function () {
+ var that = this
+ let tm_current = that.data.tm_current
+ let is_right = false
+ if (tm_current.type == '多选') {
+ if (tm_current.user_answer) {
+ if (tm_current.user_answer.sort().toString() == tm_current.right.sort().toString()) {
+ is_right = true
+ }
+ }
+
+ } else {
+ is_right = tm_current.right == tm_current.user_answer
+ }
+ return is_right
+ },
+ showAnswer: function () {
+ let is_right = this.panTi()
+ this.setData({
+ is_right: is_right,
+ answerP: true,
+ tm_current: this.data.tm_current
+ })
+ },
+
+ showOptions: function () {
+ let tm_current = this.data.tm_current
+ let options = []
+ for (let key in tm_current.options) {
+ let option = {}
+ option.key = key
+ option.value = tm_current.options[key].toString()
+ if (tm_current.user_answer) {
+ if (key == tm_current.user_answer || tm_current.user_answer.indexOf(key) != -1) {
+ option.checked = true
+ }
+ } else {
+ option.checked = false
+ }
+ options.push(option)
+ }
+ this.setData({
+ options: options
+ })
+ },
+})
\ No newline at end of file
diff --git a/pages/question/detail.json b/pages/question/detail.json
new file mode 100644
index 0000000..c77cd44
--- /dev/null
+++ b/pages/question/detail.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {
+ "mp-html": "/components/mp-html/index"
+ }
+}
\ No newline at end of file
diff --git a/pages/question/detail.wxml b/pages/question/detail.wxml
new file mode 100644
index 0000000..e19385d
--- /dev/null
+++ b/pages/question/detail.wxml
@@ -0,0 +1,59 @@
+
+ 题目详情
+
+
+
+
+ {{tm_current.type}}
+ {{tm_current.questioncat_name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 回答正确!
+ 回答有误!
+ 正确答案是{{tm_current.right}},你的答案是{{tm_current.user_answer}}
+
+ 解析:
+ {{tm_current.resolution}}
+ 无
+
+
+
+
+ 查看答案
+
\ No newline at end of file
diff --git a/pages/question/detail.wxss b/pages/question/detail.wxss
new file mode 100644
index 0000000..0a74c69
--- /dev/null
+++ b/pages/question/detail.wxss
@@ -0,0 +1,17 @@
+.head{
+ width:100%;
+ height:30px;
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: center;
+}
+.btns{
+ height:60px;
+}
+.txlabel{
+ color:#fff;
+ background-color: rgb(216, 140, 0);
+ border-radius: 2px;
+ padding: 1px 4px;
+}
+
diff --git a/pages/quota/quota.js b/pages/quota/quota.js
new file mode 100644
index 0000000..f39e227
--- /dev/null
+++ b/pages/quota/quota.js
@@ -0,0 +1,85 @@
+// pages/quota/quota.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getList()
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ this.getList()
+ wx.stopPullDownRefresh()
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ Baoming: function () {
+ wx.navigateToMiniProgram({
+ appId: 'wxdcf5bbfb50dbbac8',
+ path: '',
+ success(res) {
+ // 打开其他小程序成功同步触发
+ // wx.showToast({
+ // title: '跳转成功'
+ // })
+ }
+ })
+ },
+ getList:function(){
+ api.request('/analyse/quota/', 'GET').then(res => {
+ this.setData(res.data)
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/quota/quota.json b/pages/quota/quota.json
new file mode 100644
index 0000000..2a7b263
--- /dev/null
+++ b/pages/quota/quota.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {},
+ "enablePullDownRefresh": true,
+ "onReachBottomDistance": 50
+}
\ No newline at end of file
diff --git a/pages/quota/quota.wxml b/pages/quota/quota.wxml
new file mode 100644
index 0000000..84634f3
--- /dev/null
+++ b/pages/quota/quota.wxml
@@ -0,0 +1,38 @@
+
+
+
+ 更新时间:{{update_time}}
+
+
+
+
+
+
+
+
+ {{item.cityName}} {{item.examDate}}
+
+ 考试时间:
+ {{item.examTime}}
+ -
+ 截止报名:
+ {{item.endSignDate}}
+
+
+ 联系电话:{{item.linkContact}}
+
+
+ {{item.planName}}
+
+
+
+
+ 余{{item.validNum}}名
+
+
+ 共{{item.pNum}}名
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/quota/quota.wxss b/pages/quota/quota.wxss
new file mode 100644
index 0000000..59891b9
--- /dev/null
+++ b/pages/quota/quota.wxss
@@ -0,0 +1,6 @@
+/* pages/quota/quota.wxss */
+.head{
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: center;
+}
\ No newline at end of file
diff --git a/pages/subject/index.js b/pages/subject/index.js
new file mode 100644
index 0000000..eccd6e6
--- /dev/null
+++ b/pages/subject/index.js
@@ -0,0 +1,104 @@
+// pages/subject/index.js
+const api = require("../../utils/request.js");
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ api.request('/question/subject/', 'GET').then(res => {
+ var subjectData = res.data
+ api.request('/crm/consumer/subjectpaid', 'GET').then(res => {
+ for(var i=0;i
+
+
+所有学科
+
+
+
+
+
+
+
+
+
+ 已购买
+ 购买
+
+
+
+
+
+
+
diff --git a/pages/subject/index.wxss b/pages/subject/index.wxss
new file mode 100644
index 0000000..16efc05
--- /dev/null
+++ b/pages/subject/index.wxss
@@ -0,0 +1 @@
+/* pages/subject/index.wxss */
\ No newline at end of file
diff --git a/pages/test/detail.js b/pages/test/detail.js
new file mode 100644
index 0000000..21c1c64
--- /dev/null
+++ b/pages/test/detail.js
@@ -0,0 +1,140 @@
+// pages/test/detail.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ tm_index:0,
+ results:[],
+ tm_current:null,
+ domain:getApp().globalData.mediahost,
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var that = this
+ var query = {'examtest':options.id}
+ wx.showLoading({
+ title: '加载中...',
+ mask:true
+ })
+ api.request('/examtest/answerdetail/', 'GET', query).then(res => {
+ wx.hideLoading()
+ for (var i = 0; i < res.data.length; i++) {
+ if(res.data[i].img){
+ res.data[i].img = getApp().globalData.mediahost + res.data[i].img
+ }
+ }
+ that.data.results= res.data
+ that.showTm(0)
+ that.setData({
+ tmtotal:res.data.length
+ })
+ }).catch(e=>{wx.hideLoading()})
+ try {
+ const res = wx.getSystemInfoSync()
+ that.setData({
+ scrollHeight: res.windowHeight - 78
+ })
+ } catch (e) {
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ showTm: function (index) {
+ var that = this
+ if(index
+
+ 题量: {{tm_index+1}}/{{tmtotal}}
+
+
+
+ {{tm_index+1}}.
+ {{tm_current.question.type}}
+ ({{tm_current.question.questioncat_name}})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 回答正确!得{{tm_current.score}}分
+ 回答有误!得{{tm_current.score}}分
+ 正确答案是{{tm_current.question.right}},
+ 你的答案是{{tm_current.user_answer}}
+ 你未作答
+
+
+ 解析:
+ {{tm_current.question.resolution}}
+ 无
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/test/detail.wxss b/pages/test/detail.wxss
new file mode 100644
index 0000000..c892a15
--- /dev/null
+++ b/pages/test/detail.wxss
@@ -0,0 +1,27 @@
+.head{
+ width:100%;
+ height:30px;
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: center;
+}
+.btns{
+ height:40px;
+ display:flex;
+ padding:4px;
+ background-color: white;
+ flex-direction: row;
+ flex-wrap: wrap;
+ text-align:center;
+}
+.txlabel{
+ color:#fff;
+ background-color: rgb(216, 140, 0);
+ border-radius: 2px;
+ padding: 1px 4px;
+}
+.weui-article{
+ background-color: white;
+ padding: 24px 16px;
+}
+
diff --git a/pages/test/list.js b/pages/test/list.js
new file mode 100644
index 0000000..28e1431
--- /dev/null
+++ b/pages/test/list.js
@@ -0,0 +1,113 @@
+// pages/lianxi/index.js
+const api = require("../../utils/request.js");
+var util = require('../../utils/util.js')
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ results: [],
+ query:{
+ page:1,
+ limit:10
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var that = this
+ if(options.type=1){
+ that.data.query.type='正式考试'
+ that.data.query.workscope=getApp().globalData.userinfo.workscope
+ }
+ that.getList(that.data.query)
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ },
+ getList: function () {
+ var that = this
+ api.request('/examtest/examtest/self/', 'GET', that.data.query).then(res => {
+ for(var i=0;i
+
+ 共{{count}}条考试记录
+
+
+
+
+ {{item.name}}
+
+ {{item.type}}
+ {{item.type}}
+ -
+ 通过
+ 未通过
+ (得分
+ {{item.score}}
+ {{item.score}}
+ -满分
+ {{item.total_score}})
+
+
+ 耗时:{{item.took}}
+ 开始答题:{{item.start_time}}
+
+
+
+ 答卷详情
+
+
+
+
\ No newline at end of file
diff --git a/pages/test/list.wxss b/pages/test/list.wxss
new file mode 100644
index 0000000..a458506
--- /dev/null
+++ b/pages/test/list.wxss
@@ -0,0 +1,5 @@
+.head{
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: center;
+}
\ No newline at end of file
diff --git a/pages/test/result.js b/pages/test/result.js
new file mode 100644
index 0000000..5b1af2f
--- /dev/null
+++ b/pages/test/result.js
@@ -0,0 +1,82 @@
+// pages/examtest/result.js
+var util = require('../../utils/util.js')
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function () {
+ const data = getApp().globalData.testData
+ try{
+ data.took = util.formatSecond(data.took)
+ }catch(e){}
+
+ this.setData(getApp().globalData.testData)
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ detail: function () {
+ wx.redirectTo({
+ url: 'detail?id=' + this.data.id,
+ })
+ },
+ back: function () {
+ wx.switchTab({
+ url: '/pages/main/main'
+ })
+ },
+})
\ No newline at end of file
diff --git a/pages/test/result.json b/pages/test/result.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/test/result.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/test/result.wxml b/pages/test/result.wxml
new file mode 100644
index 0000000..fb03615
--- /dev/null
+++ b/pages/test/result.wxml
@@ -0,0 +1,28 @@
+
+
+
+
+
+ 恭喜您,通过考试
+ 很遗憾,下次加油
+
+ 得分
+ {{score}}
+ {{score}}
+ ——满分
+ {{total_score}}
+
+
+ 用时:
+ {{took}}
+ {{took}}
+
+
+
+
+ 查看答卷详情
+ 返回首页
+
+
+
+
\ No newline at end of file
diff --git a/pages/test/result.wxss b/pages/test/result.wxss
new file mode 100644
index 0000000..e45ef0f
--- /dev/null
+++ b/pages/test/result.wxss
@@ -0,0 +1 @@
+/* pages/test/note.wxss */
\ No newline at end of file
diff --git a/pages/test/sheet.js b/pages/test/sheet.js
new file mode 100644
index 0000000..c444179
--- /dev/null
+++ b/pages/test/sheet.js
@@ -0,0 +1,86 @@
+// pages/examtest/sheet.js
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ back: function (e) {
+ console.log(e.currentTarget.dataset.index);
+ var tm_index = e.currentTarget.dataset.index
+ var pages = getCurrentPages();
+ var prevPage = pages[pages.length - 2]; //上一个页面
+ prevPage.setData({
+ tm_index: tm_index
+ })
+ prevPage.showTm(tm_index)
+ prevPage.showOptions()
+ wx.navigateBack({
+ })
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var pages = getCurrentPages();
+ var prevPage = pages[pages.length - 2]; //上一个页面
+ var tms = prevPage.data.tms //取上页data里的数据也可以修改
+ this.setData({
+ tms: tms
+ })
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/test/sheet.json b/pages/test/sheet.json
new file mode 100644
index 0000000..6cfdd8d
--- /dev/null
+++ b/pages/test/sheet.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "答题卡"
+}
\ No newline at end of file
diff --git a/pages/test/sheet.wxml b/pages/test/sheet.wxml
new file mode 100644
index 0000000..f79108e
--- /dev/null
+++ b/pages/test/sheet.wxml
@@ -0,0 +1,13 @@
+
+
+
+
+
+{{index+1}}
+
+
+{{index+1}}
+
+
+
+
diff --git a/pages/test/sheet.wxss b/pages/test/sheet.wxss
new file mode 100644
index 0000000..913bdd4
--- /dev/null
+++ b/pages/test/sheet.wxss
@@ -0,0 +1,21 @@
+/* pages/examtest/sheet.wxss */
+.ok{
+ display: flex;
+ color:#fff;
+ background-color: green;
+ border:4rpx solid green;
+ height:100rpx;
+ width:100rpx;
+ margin:20rpx;
+ justify-content: center;
+ align-items: center;
+}
+.no{
+ display: flex;
+ border:4rpx solid red;
+ height:100rpx;
+ width:100rpx;
+ margin:20rpx;
+ justify-content: center;
+ align-items: center;
+}
\ No newline at end of file
diff --git a/pages/test/test.js b/pages/test/test.js
new file mode 100644
index 0000000..9e773b4
--- /dev/null
+++ b/pages/test/test.js
@@ -0,0 +1,280 @@
+// pages/lianxi/main.js
+const api = require("../../utils/request.js");
+var util = require('../../utils/util.js')
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ tms:[],
+ tm_index: 0,
+ ctms:[],
+ domain:getApp().globalData.mediahost,
+ },
+ radioChange: function (e) {
+ var that = this
+ that.data.tm_current['user_answer'] = e.detail.value
+ that.data.tms[that.data.tm_index] = that.data.tm_current
+ },
+ checkboxChange: function (e) {
+ var that = this
+ that.data.tm_current['user_answer'] = e.detail.value
+ that.data.tms[that.data.tm_index] = that.data.tm_current
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function () {
+ var that = this
+ try {
+ var value = wx.getStorageSync('examtest')
+ console.log(value)
+ if (value) {
+ for(var i=0;i 40) {
+ that.data.ctms.length = 40
+ }
+ }
+ that.data.tms[i].score = tm_result.score
+ score = score + tm_result.score
+ }
+ that.data.examtest.score = score
+ if (score >= that.data.examtest.pass_score){
+ that.data.examtest.is_pass = true
+ }else{
+ that.data.examtest.is_pass = false
+ }
+ that.data.examtest.questions = that.data.tms
+ that.data.examtest.start_time = util.formatTime(new Date(that.data.starttimes))
+ that.data.examtest.end_time = util.formatTime(new Date())
+ that.data.examtest.took = Math.floor(((new Date()).getTime() - this.data.starttimes) / 1000)
+ api.request('/examtest/examtest/', 'POST', that.data.examtest).then(res => {
+ wx.hideLoading()
+ getApp().globalData.testData = res.data
+ try {
+ wx.removeStorageSync('examtest')
+ } catch (e) {
+ }
+ wx.redirectTo({
+ url: 'result',
+ })
+
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/test/test.json b/pages/test/test.json
new file mode 100644
index 0000000..1915ada
--- /dev/null
+++ b/pages/test/test.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "mp-html": "/components/mp-html/index"
+ },
+ "navigationBarTitleText": "答题中"
+}
\ No newline at end of file
diff --git a/pages/test/test.wxml b/pages/test/test.wxml
new file mode 100644
index 0000000..4d9fd9c
--- /dev/null
+++ b/pages/test/test.wxml
@@ -0,0 +1,73 @@
+
+
+
+ 倒计时
+ {{countdown}}
+
+
+ 题量:
+ {{tm_index+1}}/{{tm_total}}
+
+
+
+
+
+ {{tm_index+1}}.
+ {{tm_current.type}}
+ ({{tm_current.total_score}}分)
+ ({{tm_current.questioncat_name}})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 答题卡
+
+
+ 交卷
+
+
+
\ No newline at end of file
diff --git a/pages/test/test.wxss b/pages/test/test.wxss
new file mode 100644
index 0000000..3aa57b4
--- /dev/null
+++ b/pages/test/test.wxss
@@ -0,0 +1,30 @@
+
+.head{
+ width:100%;
+ height:30px;
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: left;
+ display:flex;
+ flex-direction: row;
+}
+.btns{
+ height:40px;
+ display:flex;
+ padding: 4px;
+ flex-direction: row;
+ flex-wrap: wrap;
+ text-align:center;
+ background-color: white;
+}
+.txlabel{
+ color:#fff;
+ background-color: rgb(216, 140, 0);
+ border-radius: 2px;
+ padding: 1px 4px;
+}
+.weui-article{
+ background-color: white;
+ padding: 24px 16px;
+}
+
diff --git a/pages/video/index.js b/pages/video/index.js
new file mode 100644
index 0000000..c71ec99
--- /dev/null
+++ b/pages/video/index.js
@@ -0,0 +1,73 @@
+// pages/video/index.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.getList()
+ },
+ getList: function(){
+ api.request('/vod/video/', 'GET', {pageoff:true}).then(res=>{
+ this.setData({
+ videos:res.data.results
+ })
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/video/index.json b/pages/video/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/video/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/video/index.wxml b/pages/video/index.wxml
new file mode 100644
index 0000000..fd8b69e
--- /dev/null
+++ b/pages/video/index.wxml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+ --0%
+
+
+
+
+
+
diff --git a/pages/video/index.wxss b/pages/video/index.wxss
new file mode 100644
index 0000000..2a3f104
--- /dev/null
+++ b/pages/video/index.wxss
@@ -0,0 +1 @@
+/* pages/video/index.wxss */
\ No newline at end of file
diff --git a/pages/video/play.js b/pages/video/play.js
new file mode 100644
index 0000000..5b1b004
--- /dev/null
+++ b/pages/video/play.js
@@ -0,0 +1,66 @@
+// pages/video/play.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/video/play.json b/pages/video/play.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/video/play.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/video/play.wxml b/pages/video/play.wxml
new file mode 100644
index 0000000..4a40ed6
--- /dev/null
+++ b/pages/video/play.wxml
@@ -0,0 +1,2 @@
+
+pages/video/play.wxml
diff --git a/pages/video/play.wxss b/pages/video/play.wxss
new file mode 100644
index 0000000..05b70ed
--- /dev/null
+++ b/pages/video/play.wxss
@@ -0,0 +1 @@
+/* pages/video/play.wxss */
\ No newline at end of file
diff --git a/pages/workscope/index.js b/pages/workscope/index.js
new file mode 100644
index 0000000..9bf0f5b
--- /dev/null
+++ b/pages/workscope/index.js
@@ -0,0 +1,123 @@
+// pages/subject/index.js
+const api = require("../../utils/request.js");
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var that = this
+ // try {
+ // var value = wx.getStorageSync('nowSubject')
+ // if (value.id) {
+ api.request('/examtest/workscope/', 'GET', {is_public:true}).then(res => {
+ that.setData({
+ workData:res.data
+ })
+ })
+ // }else{
+ // wx.showModal({
+ // content: '请先选择学科!',
+ // showCancel:false,
+ // success(res) {
+ // if (res.confirm) {
+ // wx.redirectTo({
+ // url: '/pages/subject/index',
+ // })
+ // }
+ // }
+ // })
+ // }
+ // } catch (e) {
+ // }
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+ chooseWork: function (e) {
+ let work = e.currentTarget.dataset
+ wx.showModal({
+ title: '提示',
+ content: '确定修改工作类别吗?',
+ confirmText: '确定',
+ cancelText: '取消',
+ success: function (res) {
+ if (res.confirm) {
+ api.request(`/examtest/workscope/${work.id}/chose/`, 'GET').then(res => {
+ //选择工作类别
+ // that.setData({
+ // workData:res.data
+ // })
+ wx.showToast({
+ title: '成功',
+ icon:'none'
+ })
+ getApp().globalData.userinfo.workscope = res.data.workscope
+ getApp().globalData.userinfo.workscope_name = res.data.workscope_name
+ wx.navigateBack({
+ })
+ })
+ }
+ }
+ })
+
+ //wx.setStorageSync('nowWork', work)
+
+ },
+})
\ No newline at end of file
diff --git a/pages/workscope/index.json b/pages/workscope/index.json
new file mode 100644
index 0000000..777efdc
--- /dev/null
+++ b/pages/workscope/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "选择工作类别"
+}
\ No newline at end of file
diff --git a/pages/workscope/index.wxml b/pages/workscope/index.wxml
new file mode 100644
index 0000000..aedee16
--- /dev/null
+++ b/pages/workscope/index.wxml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+ 公开可选
+ 该类别下包含{{item.questioncat.length}}个科目
+
+
+
+
+
+
diff --git a/pages/workscope/index.wxss b/pages/workscope/index.wxss
new file mode 100644
index 0000000..e19eaad
--- /dev/null
+++ b/pages/workscope/index.wxss
@@ -0,0 +1 @@
+/* pages/workscope/index.wxss */
\ No newline at end of file
diff --git a/pages/yati/index.js b/pages/yati/index.js
new file mode 100644
index 0000000..fd579b5
--- /dev/null
+++ b/pages/yati/index.js
@@ -0,0 +1,129 @@
+// pages/lianxi/index.js
+const api = require("../../utils/request.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ paperData: [],
+ query:{
+ page:1,
+ limit:10
+ },
+ workscopeName:''
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function () {
+
+ if (getApp().globalData.userinfo.workscope) {
+ this.setData({
+ workscopeId: getApp().globalData.userinfo.workscope,
+ workscopeName:getApp().globalData.userinfo.workscope_name
+ })
+ } else {
+ wx.switchTab({
+ url: '/pages/main/main',
+ })
+ }
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ this.getList()
+ },
+ getList: function () {
+ var that = this
+ if (that.data.workscopeId) {
+ that.data.query.workscope = that.data.workscopeId
+ api.request('/examtest/paper/', 'GET', that.data.query).then(res => {
+ if (that.data.query.page == 1) {
+ that.data.paperData = res.data.results
+ } else {
+ that.data.paperData = that.data.paperData.concat(res.data.results)
+ }
+ that.setData({
+ paperData: that.data.paperData,
+ count: res.data.count
+ })
+ })
+ }
+
+ },
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ var that = this
+ that.data.query.page = 1;
+ that.getList();
+ wx.stopPullDownRefresh();
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ var that = this
+ if (that.data.count <= that.data.query.page * that.data.query.limit) {
+ wx.showToast({
+ title: '没有更多了',
+ icon: 'none'
+ })
+ } else {
+ that.data.query.page = that.data.query.page + 1
+ that.getList()
+ }
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+ startYati: function (e) {
+ wx.showLoading({
+ title: '正在准备考试',
+ mask:true
+ })
+ api.request('/examtest/paper/' + e.currentTarget.id +'/monitest/', 'GET').then(res => {
+ wx.hideLoading()
+ try {
+ wx.setStorageSync('examtest', res.data)
+ } catch (e) { }
+ wx.navigateTo({
+ url: '/pages/moni/note',
+ })
+
+ })
+ },
+})
\ No newline at end of file
diff --git a/pages/yati/index.json b/pages/yati/index.json
new file mode 100644
index 0000000..16a27d9
--- /dev/null
+++ b/pages/yati/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "押题试卷"
+}
\ No newline at end of file
diff --git a/pages/yati/index.wxml b/pages/yati/index.wxml
new file mode 100644
index 0000000..5748d82
--- /dev/null
+++ b/pages/yati/index.wxml
@@ -0,0 +1,21 @@
+
+
+
+ {{workscopeName}}
+
+
+
+
+
+
+
+
+ 选择
+
+
+
+
+
+
+
+
diff --git a/pages/yati/index.wxss b/pages/yati/index.wxss
new file mode 100644
index 0000000..278a808
--- /dev/null
+++ b/pages/yati/index.wxss
@@ -0,0 +1,8 @@
+/* pages/yati/index.wxss */
+.weui-panel {
+ margin-left:8px;
+ margin-right:8px;
+ border-radius: 8px;
+ background: rgba(255, 255, 255, 1);
+ box-shadow: 0px 4rpx 16rpx 0px rgba(140, 160, 181, 0.2);
+}
\ No newline at end of file
diff --git a/project.config.json b/project.config.json
new file mode 100644
index 0000000..44aee58
--- /dev/null
+++ b/project.config.json
@@ -0,0 +1,56 @@
+{
+ "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+ "packOptions": {
+ "ignore": [],
+ "include": []
+ },
+ "setting": {
+ "urlCheck": false,
+ "es6": true,
+ "enhance": true,
+ "postcss": true,
+ "preloadBackgroundData": false,
+ "minified": true,
+ "newFeature": true,
+ "coverView": true,
+ "nodeModules": true,
+ "autoAudits": false,
+ "showShadowRootInWxmlPanel": true,
+ "scopeDataCheck": false,
+ "uglifyFileName": false,
+ "checkInvalidKey": true,
+ "checkSiteMap": true,
+ "uploadWithSourceMap": true,
+ "compileHotReLoad": false,
+ "useMultiFrameRuntime": true,
+ "useApiHook": true,
+ "useApiHostProcess": true,
+ "babelSetting": {
+ "ignore": [],
+ "disablePlugins": [],
+ "outputPath": ""
+ },
+ "enableEngineNative": false,
+ "useIsolateContext": false,
+ "userConfirmedBundleSwitch": false,
+ "packNpmManually": false,
+ "packNpmRelationList": [],
+ "minifyWXSS": true,
+ "showES6CompileOption": false,
+ "minifyWXML": true,
+ "disableUseStrict": false,
+ "useCompilerPlugins": false,
+ "useStaticServer": true
+ },
+ "compileType": "miniprogram",
+ "libVersion": "2.15.0",
+ "appid": "wxf1e9471c93f05ad6",
+ "projectname": "test_mini",
+ "simulatorType": "wechat",
+ "simulatorPluginLibVersion": {},
+ "condition": {},
+ "editorSetting": {
+ "tabIndent": "insertSpaces",
+ "tabSize": 2
+ }
+}
\ No newline at end of file
diff --git a/sitemap.json b/sitemap.json
new file mode 100644
index 0000000..ca02add
--- /dev/null
+++ b/sitemap.json
@@ -0,0 +1,7 @@
+{
+ "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+ "rules": [{
+ "action": "allow",
+ "page": "*"
+ }]
+}
\ No newline at end of file
diff --git a/utils/request.js b/utils/request.js
new file mode 100644
index 0000000..8c498f2
--- /dev/null
+++ b/utils/request.js
@@ -0,0 +1,107 @@
+function request(url, method, data) {
+ let promise = new Promise((resolve, reject) => {
+ wx.showNavigationBarLoading();
+ wx.request({
+ url: getApp().globalData.host + url,
+ method: method,
+ data: data,
+ header:{
+ 'Authorization': 'JWT ' + getApp().globalData.token
+ },
+ success: (res => {
+ if (res.data.code >= 200 && res.data.code < 400) {
+ resolve(res.data);
+ }else if(res.data.code == 401){
+ getApp().onLaunch()
+ wx.switchTab({
+ url: '/pages/main/main',
+ })
+ }
+ else {
+ var msg = '请求错误'
+ if(res.data.msg){
+ msg = res.data.msg
+ }
+ if (msg.indexOf('该操作的权限')!=-1){
+ msg = '权限不足或账户过期,请联系课程顾问'
+ }
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 1000
+ })
+ }
+
+ }),
+ fail: (res => {
+ wx.showToast({
+ title: '请求出错',
+ icon: 'none',
+ duration: 1500
+ })
+ console.log(res)
+ reject('网络出错');
+ }),
+ complete: function () {
+ wx.hideNavigationBarLoading();
+ }
+
+ })
+ })
+ return promise;
+}
+
+function requesta(url, method, data) {
+ let promise = new Promise((resolve, reject) => {
+ wx.showNavigationBarLoading();
+ wx.request({
+ url: getApp().globalData.host + url,
+ method: method,
+ data: data,
+ header:{
+ 'Authorization': 'JWT ' + getApp().globalData.admintoken
+ },
+ success: (res => {
+ if (res.data.code >= 200 && res.data.code < 400) {
+ resolve(res.data);
+ }else if(res.data.code == 401){
+
+ }
+ else {
+ var msg = '请求错误'
+ if(res.data.msg){
+ msg = res.data.msg
+ }
+ if (msg.indexOf('该操作的权限')!=-1){
+ msg = '权限不足或账户过期,请联系课程顾问'
+ }
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 1000
+ })
+ }
+
+ }),
+ fail: (res => {
+ wx.showToast({
+ title: '请求出错',
+ icon: 'none',
+ duration: 1500
+ })
+ console.log(res)
+ reject('网络出错');
+ }),
+ complete: function () {
+ wx.hideNavigationBarLoading();
+ }
+
+ })
+ })
+ return promise;
+}
+
+module.exports = {
+ request: request,
+ requesta: requesta
+}
\ No newline at end of file
diff --git a/utils/util.js b/utils/util.js
new file mode 100644
index 0000000..c5ce85b
--- /dev/null
+++ b/utils/util.js
@@ -0,0 +1,45 @@
+const formatTime = date => {
+ const year = date.getFullYear()
+ const month = date.getMonth() + 1
+ const day = date.getDate()
+ const hour = date.getHours()
+ const minute = date.getMinutes()
+ const second = date.getSeconds()
+
+ return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
+}
+
+const formatNumber = n => {
+ n = n.toString()
+ return n[1] ? n : '0' + n
+}
+
+function formatmil(mil) {
+ var allSecond = Math.floor(mil / 1000);
+ var h = Math.floor(allSecond / 3600);
+ var m = Math.floor((allSecond - h * 3600) / 60);
+ var s = Math.floor(allSecond - h * 3600 - m * 60);
+ h = toTow(h);
+ m = toTow(m);
+ s = toTow(s);
+ return h + ":" + m + ":" + s;
+}
+function formatSecond(val) {
+ var m = Math.floor(val/ 60)
+ var s = Math.floor(val - m * 60)
+ return m + '分' + s + '秒'
+}
+
+function toTow(num) {
+ if (num < 10) {
+ return "0" + num;
+ } else {
+ return num;
+ }
+}
+
+module.exports = {
+ formatTime: formatTime,
+ formatmil: formatmil,
+ formatSecond: formatSecond
+}