作者 吴孟雨

登录注册,绑定手机号,获取验证码,轮播图,本周实验,往期实验,立即预约,实验详情

要显示太多修改。

为保证性能只显示 25 of 25+ 个文件。

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="632eecf6-91e3-4185-aea4-06d243e51935" name="Default" comment="上传到远程wumengyu">
<list default="true" id="632eecf6-91e3-4185-aea4-06d243e51935" name="Default" comment="合并master">
<change afterPath="$PROJECT_DIR$/utils/qqmap-wx-jssdk.min.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/wxParse/html2json.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/wxParse/htmlparser.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/wxParse/showdown.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/wxParse/wxDiscode.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/wxParse/wxParse.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/wxParse/wxParse.wxml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/wxParse/wxParse.wxss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/app.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app.json" beforeDir="false" afterPath="$PROJECT_DIR$/app.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/clock/clock.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/clock/clock.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/clock/clock.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/clock/clock.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/clock/clock.wxss" beforeDir="false" afterPath="$PROJECT_DIR$/pages/clock/clock.wxss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/index/activity-detail/activity-detail.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/activity-detail/activity-detail.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/index/activity-detail/activity-detail.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/activity-detail/activity-detail.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/index/go-appointment/go-appointment.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/go-appointment/go-appointment.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/index/go-appointment/go-appointment.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/go-appointment/go-appointment.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/index/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/index.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/index/index.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/index.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/index/phone-code/phone-code.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/phone-code/phone-code.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/index/phone-code/phone-code.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/phone-code/phone-code.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/my/my.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/my/my.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/my/my.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/my/my.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/my/my.wxss" beforeDir="false" afterPath="$PROJECT_DIR$/pages/my/my.wxss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/my/protocol/protocol.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/my/protocol/protocol.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/my/protocol/protocol.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/my/protocol/protocol.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/start/start.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/start/start.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/project.config.json" beforeDir="false" afterPath="$PROJECT_DIR$/project.config.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/templates.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/templates/templates.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/utils/util.js" beforeDir="false" afterPath="$PROJECT_DIR$/utils/util.js" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/.tmp/" />
<ignored path="$PROJECT_DIR$/temp/" />
... ... @@ -26,44 +46,49 @@
<session id="-381596063">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.closed" value="3" />
<entry key="project.closed" value="5" />
<entry key="project.open.time.0" value="3" />
<entry key="project.open.time.1" value="1" />
<entry key="project.opened" value="4" />
<entry key="project.open.time.1" value="3" />
<entry key="project.opened" value="6" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="js" value="6" />
<entry key="json" value="4" />
<entry key="wxml" value="9" />
<entry key="wxss" value="5" />
<entry key="js" value="25" />
<entry key="json" value="11" />
<entry key="wxml" value="21" />
<entry key="wxss" value="10" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="CSS" value="5" />
<entry key="HTML" value="9" />
<entry key="JSON" value="4" />
<entry key="JavaScript" value="6" />
<entry key="CSS" value="10" />
<entry key="HTML" value="21" />
<entry key="JSON" value="11" />
<entry key="JavaScript" value="25" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="js" value="564" />
<entry key="json" value="27" />
<entry key="txt" value="36" />
<entry key="wxml" value="244" />
<entry key="wxss" value="21" />
<entry key="js" value="3215" />
<entry key="json" value="34" />
<entry key="txt" value="63" />
<entry key="wxml" value="748" />
<entry key="wxss" value="23" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="CSS" value="21" />
<entry key="HTML" value="244" />
<entry key="JSON" value="27" />
<entry key="JavaScript" value="564" />
<entry key="PLAIN_TEXT" value="36" />
<entry key="CSS" value="23" />
<entry key="HTML" value="748" />
<entry key="JSON" value="34" />
<entry key="JavaScript" value="3215" />
<entry key="PLAIN_TEXT" value="63" />
</counts>
</usages-collector>
<usages-collector id="statistics.vcs.git.usages">
<counts>
<entry key="git.branch.merge" value="1" />
</counts>
</usages-collector>
</session>
... ... @@ -71,100 +96,104 @@
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pages/index/index.wxml">
<entry file="file://$PROJECT_DIR$/pages/index/index.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="880">
<caret line="40" lean-forward="true" selection-start-line="40" selection-end-line="40" />
<state relative-caret-position="-418">
<caret line="8" column="23" selection-start-line="8" selection-start-column="23" selection-end-line="8" selection-end-column="23" />
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pages/index/index.wxss">
<entry file="file://$PROJECT_DIR$/pages/start/start.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="154">
<caret line="7" column="21" lean-forward="true" selection-start-line="7" selection-start-column="21" selection-end-line="7" selection-end-column="21" />
<state relative-caret-position="676">
<caret line="37" column="25" lean-forward="true" selection-start-line="37" selection-start-column="25" selection-end-line="37" selection-end-column="25" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pages/index/index.js">
<entry file="file://$PROJECT_DIR$/app.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="506">
<caret line="98" column="64" selection-start-line="98" selection-start-column="64" selection-end-line="98" selection-end-column="64" />
<state relative-caret-position="344">
<caret line="140" column="12" selection-start-line="140" selection-start-column="4" selection-end-line="140" selection-end-column="12" />
<folding>
<element signature="n#!!doc" expanded="true" />
<element signature="e#1018#1103#0" />
<element signature="e#1121#1191#0" />
<element signature="e#1219#1288#0" />
<element signature="e#1321#1468#0" />
<element signature="e#1499#1619#0" />
<element signature="e#1750#1766#0" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/templates/templates.wxml">
<entry file="file://$PROJECT_DIR$/utils/util.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="29" column="65" selection-start-line="29" selection-start-column="65" selection-end-line="29" selection-end-column="65" />
<state relative-caret-position="946">
<caret line="43" column="15" selection-start-line="43" selection-start-column="2" selection-end-line="43" selection-end-column="15" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/pages/index/activity-detail/activity-detail.wxml">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pages/index/go-appointment/go-appointment.wxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198">
<caret line="9" column="35" selection-start-line="9" selection-start-column="35" selection-end-line="9" selection-end-column="35" />
<state relative-caret-position="638">
<caret line="41" column="90" selection-start-line="41" selection-start-column="72" selection-end-line="41" selection-end-column="90" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pages/start/start.wxml">
<entry file="file://$PROJECT_DIR$/pages/index/activity-detail/activity-detail.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="6" column="15" lean-forward="true" selection-start-line="6" selection-start-column="15" selection-end-line="6" selection-end-column="15" />
<state relative-caret-position="374">
<caret line="29" column="44" lean-forward="true" selection-start-line="29" selection-start-column="44" selection-end-line="29" selection-end-column="44" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pages/index/activity-detail/activity-detail.json">
<provider selected="true" editor-type-id="text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pages/index/activity-detail/activity-detail.js">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/pages/index/go-appointment/go-appointment.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="550">
<caret line="25" column="32" selection-start-line="25" selection-start-column="32" selection-end-line="25" selection-end-column="32" />
<state relative-caret-position="198">
<caret line="125" column="20" lean-forward="true" selection-start-line="125" selection-start-column="20" selection-end-line="125" selection-end-column="20" />
<folding>
<element signature="e#243#454#0" />
<element signature="e#462#673#0" />
<element signature="e#681#893#0" />
<element signature="e#901#1114#0" />
<element signature="e#1177#2298#0" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pages/start/start.js">
<entry file="file://$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="29" column="49" lean-forward="true" selection-start-line="29" selection-start-column="12" selection-end-line="29" selection-end-column="49" />
<state relative-caret-position="302">
<caret line="44" column="20" lean-forward="true" selection-start-line="44" selection-start-column="20" selection-end-line="44" selection-end-column="20" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app.json">
<entry file="file://$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.wxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="440">
<caret line="20" column="38" selection-start-line="20" selection-start-column="38" selection-end-line="20" selection-end-column="38" />
<state relative-caret-position="852">
<caret line="50" column="42" selection-start-line="50" selection-start-column="42" selection-end-line="50" selection-end-column="42" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pages/index/go-appointment/go-appointment.json">
<provider selected="true" editor-type-id="text-editor" />
</entry>
</file>
</leaf>
</component>
<component name="FindInProjectRecents">
... ... @@ -172,6 +201,21 @@
<find>chooseYes</find>
<find>baseUrl</find>
<find>getUserInfo</find>
<find>协议</find>
<find>serviceProtocol</find>
<find>goTestDetail</find>
<find>modal</find>
<find>goPhoneCode</find>
<find>QQMapWX</find>
<find>XX</find>
<find>showM</find>
<find>goAppointment</find>
<find>bindPickerChange</find>
<find>show_submit_btn</find>
<find>submit</find>
<find>current_test_id</find>
<find>current_session_id</find>
<find>currentId</find>
</findStrings>
</component>
<component name="Git.Settings">
... ... @@ -182,16 +226,30 @@
<list>
<option value="$PROJECT_DIR$/templates/templates.wxss" />
<option value="$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.wxss" />
<option value="$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.js" />
<option value="$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.wxml" />
<option value="$PROJECT_DIR$/app.js" />
<option value="$PROJECT_DIR$/pages/start/start.js" />
<option value="$PROJECT_DIR$/pages/index/index.wxml" />
<option value="$PROJECT_DIR$/templates/templates.wxml" />
<option value="$PROJECT_DIR$/pages/index/index.js" />
<option value="$PROJECT_DIR$/pages/my/protocol/protocol.wxml" />
<option value="$PROJECT_DIR$/pages/my/protocol/protocol.js" />
<option value="$PROJECT_DIR$/project.config.json" />
<option value="$PROJECT_DIR$/pages/start/start.js" />
<option value="$PROJECT_DIR$/pages/clock/clock.wxml" />
<option value="$PROJECT_DIR$/pages/my/my.wxml" />
<option value="$PROJECT_DIR$/pages/clock/clock.wxss" />
<option value="$PROJECT_DIR$/pages/my/my.wxss" />
<option value="$PROJECT_DIR$/pages/my/my.js" />
<option value="$PROJECT_DIR$/pages/clock/clock.js" />
<option value="$PROJECT_DIR$/app.json" />
<option value="$PROJECT_DIR$/pages/index/activity-detail/activity-detail.js" />
<option value="$PROJECT_DIR$/pages/index/phone-code/phone-code.wxml" />
<option value="$PROJECT_DIR$/pages/index/phone-code/phone-code.js" />
<option value="$PROJECT_DIR$/pages/index/index.js" />
<option value="$PROJECT_DIR$/pages/index/index.wxml" />
<option value="$PROJECT_DIR$/pages/index/activity-detail/activity-detail.wxml" />
<option value="$PROJECT_DIR$/pages/index/activity-detail/activity-detail.js" />
<option value="$PROJECT_DIR$/app.js" />
<option value="$PROJECT_DIR$/utils/util.js" />
<option value="$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.js" />
<option value="$PROJECT_DIR$/pages/index/go-appointment/go-appointment.wxml" />
<option value="$PROJECT_DIR$/pages/index/go-appointment/go-appointment.js" />
</list>
</option>
</component>
... ... @@ -243,7 +301,14 @@
<item name="ScienceCaptain" type="462c0819:PsiDirectoryNode" />
<item name="pages" type="462c0819:PsiDirectoryNode" />
<item name="index" type="462c0819:PsiDirectoryNode" />
<item name="phone-code" type="462c0819:PsiDirectoryNode" />
<item name="confirm-appointment-info" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="ScienceCaptain" type="b2602c69:ProjectViewProjectNode" />
<item name="ScienceCaptain" type="462c0819:PsiDirectoryNode" />
<item name="pages" type="462c0819:PsiDirectoryNode" />
<item name="index" type="462c0819:PsiDirectoryNode" />
<item name="go-appointment" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="ScienceCaptain" type="b2602c69:ProjectViewProjectNode" />
... ... @@ -254,7 +319,7 @@
<path>
<item name="ScienceCaptain" type="b2602c69:ProjectViewProjectNode" />
<item name="ScienceCaptain" type="462c0819:PsiDirectoryNode" />
<item name="templates" type="462c0819:PsiDirectoryNode" />
<item name="utils" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
... ... @@ -264,11 +329,17 @@
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="D:/project/life" />
<property name="last_opened_file_path" value="D:/info/informationPlatform" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="settings.editor.selected.configurable" value="project.propDebugger" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="D:\小程序\scienceCaptain\ScienceCaptain" />
<recent name="D:\小程序\scienceCaptain\ScienceCaptain\utils" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
... ... @@ -295,7 +366,9 @@
<workItem from="1542249556873" duration="6568000" />
<workItem from="1542594514355" duration="2482000" />
<workItem from="1542676616270" duration="2495000" />
<workItem from="1543297125303" duration="4846000" />
<workItem from="1543297125303" duration="6704000" />
<workItem from="1543303923342" duration="8358000" />
<workItem from="1543367358458" duration="25214000" />
</task>
<task id="LOCAL-00001" summary="modal 模板">
<created>1542274356914</created>
... ... @@ -311,11 +384,25 @@
<option name="project" value="LOCAL" />
<updated>1542275805566</updated>
</task>
<option name="localTasksCounter" value="3" />
<task id="LOCAL-00003" summary="对接本周实验,往期实验,登录接口">
<created>1543302198978</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1543302198978</updated>
</task>
<task id="LOCAL-00004" summary="合并master">
<created>1543303397807</created>
<option name="number" value="00004" />
<option name="presentableId" value="LOCAL-00004" />
<option name="project" value="LOCAL" />
<updated>1543303397807</updated>
</task>
<option name="localTasksCounter" value="5" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="16627000" />
<option name="totallyTimeSpent" value="52057000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
... ... @@ -375,7 +462,9 @@
<component name="VcsManagerConfiguration">
<MESSAGE value="modal 模板" />
<MESSAGE value="上传到远程wumengyu" />
<option name="LAST_COMMIT_MESSAGE" value="上传到远程wumengyu" />
<MESSAGE value="对接本周实验,往期实验,登录接口" />
<MESSAGE value="合并master" />
<option name="LAST_COMMIT_MESSAGE" value="合并master" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/pages/myProfile/myProfile.json" />
... ... @@ -390,160 +479,255 @@
<entry file="file://$PROJECT_DIR$/pages/my/all-appointment/all-appointment.wxml">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/pages/my/protocol/protocol.wxml">
<entry file="file://$PROJECT_DIR$/templates/templates.wxss">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="34" selection-start-column="34" selection-end-column="34" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.wxss">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="462">
<caret line="21" column="6" selection-start-line="21" selection-start-column="6" selection-end-line="21" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/my/myCard/myCard.wxml">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/project.config.json">
<entry file="file://$PROJECT_DIR$/pages/start/start.wxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="352">
<caret line="16" column="21" selection-start-line="16" selection-start-column="21" selection-end-line="16" selection-end-column="21" />
<state relative-caret-position="132">
<caret line="6" column="15" selection-start-line="6" selection-start-column="15" selection-end-line="6" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/templates/templates.wxss">
<entry file="file://$PROJECT_DIR$/templates/templates.wxml">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="34" selection-start-column="34" selection-end-column="34" />
<state relative-caret-position="242">
<caret line="11" column="57" selection-start-line="11" selection-start-column="32" selection-end-line="11" selection-end-column="57" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/phone-code/phone-code.js">
<entry file="file://$PROJECT_DIR$/pages/my/groupBuy/groupBuy.wxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="550">
<caret line="25" column="28" selection-start-line="25" selection-start-column="28" selection-end-line="25" selection-end-column="28" />
<state relative-caret-position="2684">
<caret line="122" column="59" selection-start-line="122" selection-start-column="44" selection-end-line="122" selection-end-column="59" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/phone-code/phone-code.wxml">
<entry file="file://$PROJECT_DIR$/pages/my/groupBuy/groupBuy.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
<caret line="10" selection-start-line="10" selection-end-line="12" selection-end-column="21" />
<state relative-caret-position="528">
<caret line="24" selection-start-line="24" selection-end-line="29" selection-end-column="4" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/activity-detail/activity-detail.json">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/pages/my/protocol/protocol.wxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="66">
<caret line="3" column="27" selection-start-line="3" selection-start-column="27" selection-end-line="3" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/phone-code/phone-code.wxss">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="924">
<state relative-caret-position="828">
<caret line="42" selection-start-line="42" selection-end-line="59" selection-end-column="1" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.wxss">
<entry file="file://$PROJECT_DIR$/pages/index/phone-code/phone-code.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="462">
<caret line="21" column="6" selection-start-line="21" selection-start-column="6" selection-end-line="21" selection-end-column="6" />
<state relative-caret-position="44">
<caret line="2" column="1" selection-start-line="2" selection-start-column="1" selection-end-line="2" selection-end-column="1" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.wxml">
<entry file="file://$PROJECT_DIR$/pages/my/protocol/protocol.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1100">
<caret line="50" column="42" selection-start-line="50" selection-start-column="42" selection-end-line="50" selection-end-column="42" />
<state relative-caret-position="418">
<caret line="19" column="7" lean-forward="true" selection-start-line="19" selection-start-column="7" selection-end-line="19" selection-end-column="7" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.js">
<entry file="file://$PROJECT_DIR$/pages/my/my.wxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="924">
<caret line="42" column="10" lean-forward="true" selection-start-line="42" selection-start-column="10" selection-end-line="42" selection-end-column="10" />
<state relative-caret-position="66">
<caret line="3" column="2" selection-start-line="3" selection-start-column="2" selection-end-line="3" selection-end-column="2" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/my/protocol/protocol.js">
<entry file="file://$PROJECT_DIR$/pages/index/index.wxss">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198">
<caret line="9" selection-start-line="9" selection-end-line="18" selection-end-column="1" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/clock/clock.wxss">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="15" column="1" selection-start-line="15" selection-start-column="1" selection-end-line="15" selection-end-column="1" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/my/my.wxss">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="15" column="19" lean-forward="true" selection-start-line="15" selection-start-column="19" selection-end-line="15" selection-end-column="19" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/clock/clock.wxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="66">
<caret line="3" column="40" selection-start-line="3" selection-start-column="32" selection-end-line="3" selection-end-column="40" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/clock/clock.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="814">
<caret line="37" selection-start-line="37" selection-end-line="37" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/utils/qqmap-wx-jssdk.min.js">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/pages/my/myCard/myCard.wxml">
<entry file="file://$PROJECT_DIR$/pages/my/my.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="154">
<caret line="7" column="22" selection-start-line="7" selection-start-column="22" selection-end-line="7" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app.wxss">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/phone-code/phone-code.json">
<entry file="file://$PROJECT_DIR$/project.config.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="44">
<caret line="2" column="1" selection-start-line="2" selection-start-column="1" selection-end-line="2" selection-end-column="1" />
<state relative-caret-position="308">
<caret line="14" column="32" selection-start-line="14" selection-start-column="14" selection-end-line="14" selection-end-column="32" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app.js">
<entry file="file://$PROJECT_DIR$/app.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="47">
<caret line="58" column="67" lean-forward="true" selection-start-line="58" selection-start-column="67" selection-end-line="58" selection-end-column="67" />
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
<state relative-caret-position="44">
<caret line="2" column="24" selection-start-line="2" selection-start-column="24" selection-end-line="2" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/index.wxss">
<entry file="file://$PROJECT_DIR$/pages/index/phone-code/phone-code.wxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="154">
<caret line="7" column="21" lean-forward="true" selection-start-line="7" selection-start-column="21" selection-end-line="7" selection-end-column="21" />
<state relative-caret-position="264">
<caret line="12" column="68" selection-start-line="12" selection-start-column="68" selection-end-line="12" selection-end-column="68" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/start/start.js">
<entry file="file://$PROJECT_DIR$/pages/index/phone-code/phone-code.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="29" column="49" lean-forward="true" selection-start-line="29" selection-start-column="12" selection-end-line="29" selection-end-column="49" />
<state relative-caret-position="1870">
<caret line="85" column="40" selection-start-line="85" selection-start-column="40" selection-end-line="85" selection-end-column="40" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/index.wxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="880">
<caret line="40" lean-forward="true" selection-start-line="40" selection-end-line="40" />
<state relative-caret-position="542">
<caret line="74" column="70" selection-start-line="74" selection-start-column="70" selection-end-line="74" selection-end-column="70" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/templates/templates.wxml">
<entry file="file://$PROJECT_DIR$/pages/index/activity-detail/activity-detail.wxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="29" column="65" selection-start-line="29" selection-start-column="65" selection-end-line="29" selection-end-column="65" />
<state relative-caret-position="220">
<caret line="10" column="68" lean-forward="true" selection-start-line="10" selection-start-column="68" selection-end-line="10" selection-end-column="68" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/index.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="506">
<caret line="98" column="64" selection-start-line="98" selection-start-column="64" selection-end-line="98" selection-end-column="64" />
<state relative-caret-position="-418">
<caret line="8" column="23" selection-start-line="8" selection-start-column="23" selection-end-line="8" selection-end-column="23" />
<folding>
<element signature="n#!!doc" expanded="true" />
<element signature="e#1018#1103#0" />
<element signature="e#1121#1191#0" />
<element signature="e#1219#1288#0" />
<element signature="e#1321#1468#0" />
<element signature="e#1499#1619#0" />
<element signature="e#1750#1766#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app.json">
<entry file="file://$PROJECT_DIR$/pages/index/go-appointment/go-appointment.json">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/activity-detail/activity-detail.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="440">
<caret line="20" column="38" selection-start-line="20" selection-start-column="38" selection-end-line="20" selection-end-column="38" />
<state relative-caret-position="374">
<caret line="29" column="44" lean-forward="true" selection-start-line="29" selection-start-column="44" selection-end-line="29" selection-end-column="44" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/activity-detail/activity-detail.json">
<provider selected="true" editor-type-id="text-editor" />
<entry file="file://$PROJECT_DIR$/pages/start/start.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="676">
<caret line="37" column="25" lean-forward="true" selection-start-line="37" selection-start-column="25" selection-end-line="37" selection-end-column="25" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/start/start.wxml">
<entry file="file://$PROJECT_DIR$/app.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="6" column="15" lean-forward="true" selection-start-line="6" selection-start-column="15" selection-end-line="6" selection-end-column="15" />
<state relative-caret-position="344">
<caret line="140" column="12" selection-start-line="140" selection-start-column="4" selection-end-line="140" selection-end-column="12" />
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/activity-detail/activity-detail.js">
<entry file="file://$PROJECT_DIR$/utils/util.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="550">
<caret line="25" column="32" selection-start-line="25" selection-start-column="32" selection-end-line="25" selection-end-column="32" />
<state relative-caret-position="946">
<caret line="43" column="15" selection-start-line="43" selection-start-column="2" selection-end-line="43" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/activity-detail/activity-detail.wxml">
<entry file="file://$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.wxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="852">
<caret line="50" column="42" selection-start-line="50" selection-start-column="42" selection-end-line="50" selection-end-column="42" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/confirm-appointment-info/confirm-appointment-info.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="302">
<caret line="44" column="20" lean-forward="true" selection-start-line="44" selection-start-column="20" selection-end-line="44" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/go-appointment/go-appointment.wxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="638">
<caret line="41" column="90" selection-start-line="41" selection-start-column="72" selection-end-line="41" selection-end-column="90" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pages/index/go-appointment/go-appointment.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198">
<caret line="9" column="35" selection-start-line="9" selection-start-column="35" selection-end-line="9" selection-end-column="35" />
<caret line="125" column="20" lean-forward="true" selection-start-line="125" selection-start-column="20" selection-end-line="125" selection-end-column="20" />
<folding>
<element signature="e#243#454#0" />
<element signature="e#462#673#0" />
<element signature="e#681#893#0" />
<element signature="e#901#1114#0" />
<element signature="e#1177#2298#0" />
</folding>
</state>
</provider>
</entry>
... ...
... ... @@ -89,6 +89,7 @@ App({
success: function (res) { }
})
} else {
console.log(res.data);
wx.showModal({
title: '提示',
content: res.data.msg,
... ... @@ -123,6 +124,7 @@ App({
})
},
//获取当前时间
nowDate() {
let date = new Date();
let month = date.getMonth() + 1;
... ...
... ... @@ -6,7 +6,12 @@ Page({
*/
data: {
punchState: true,
address: ''
address: '',
hasPhone: true,
},
//首次登录小程序,跳转到认证手机页面
goPhoneCode() {
wx.navigateTo({url: '/pages/index/phone-code/phone-code'})
},
//打卡申诉
punchApply() {
... ... @@ -30,6 +35,7 @@ Page({
})
},
})
// wx.chooseLocation({
// success: function(res) {
// console.log(res)
... ...
<!--pages/clock/clock.wxml-->
<view class='content_box'>
<!--蒙层-->
<view class="modal" wx:if="{{!hasPhone}}" bindtap="goPhoneCode"></view>
<view class='circle_large'>
<view class='circle_middle'>
<view class='circle_small'>
... ...
... ... @@ -13,7 +13,16 @@
align-items: center;
padding-top: 115rpx;
}
.modal {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
background-color: #000000;
opacity: 0.8;
z-index: 10;
}
.circle_large, .circle_middle, .circle_small {
width: 327rpx;
height: 327rpx;
... ...
// pages/index/activity-detail/activity-detail.js
var WxParse = require('../../../wxParse/wxParse.js');
const app = getApp();
Page({
... ... @@ -18,21 +19,39 @@ Page({
let params = {
id: this.data.test_id,//当前实验的id
};
let headers= {
let header = {
"XX-token": wx.getStorageSync('token')
};
app.post(url, params,headers).then((res) => {
app.post(url, params,header).then((res) => {
console.log(res);
this.setData({detail: res})
if(res.code === 0) {
wx.navigateTo({url: '/pages/index/phone-code/phone-code'})
}else {
this.setData({detail: res});
var article = res.content;
WxParse.wxParse('article', 'html', article, this, 5);
}
// console.log(this.data.this_week_test_info);
})
},
//服务协议
goServiceProtocol() {
wx.navigateTo({
url: '/pages/my/protocol/protocol',
})
},
goAppointment() {
wx.navigateTo({url: '/pages/index/go-appointment/go-appointment?experiment_id=' + this.data.detail.id})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options);
this.setData({test_id: +options.id});
this.setData({
test_id: +options.id,
is_the_week: options.is_the_week
});
this.getDetail()
},
... ...
... ... @@ -2,24 +2,27 @@
<view class="content">
<view class="head">
<view class="img_box">
<image src="../../../images/test_img.jpg" class="activity_img"></image>
<image src="{{detail.thumb}}" class="activity_img" mode="aspectFill"></image>
</view>
<view class="title">
<view class="line"></view>
<view class="test_detail">
<text>{{detail.name}}科学队长实验室:雷电的产生!</text>
<view class="describe">云和云摩擦碰撞发出的声音是雷声产生火花是闪电。</view>
<text>{{detail.name}}</text>
<view class="describe">{{detail.description}}</view>
</view>
</view>
</view>
<view class="jiexi">解析长图</view>
<view class="footer" wx:if="{{is_the_week}}">
<view class="service" bindtap="clickAgreeBtn" bindtap='serviceProtocol'>
<view class="jiexi">解析长图
<import src="/wxParse/wxParse.wxml"/>
<template is="wxParse" data="{{wxParseData:article.nodes}}"/>
</view>
<view class="footer" wx:if="{{detail.allow_res}}">
<view class="service" bindtap="clickAgreeBtn">
<view class="agree_box">
<view class="agree_btn" wx:if="{{is_agree}}"></view>
</view>
<text>服务协议</text>
<text catchtap="goServiceProtocol">服务协议</text>
</view>
<view class="order_btn" bindtap='goAppointment'>去预约</view>
</view>
... ...
... ... @@ -49,12 +49,15 @@ Page({
addStudent() {
wx.navigateTo({url: './add-student/add-student'})
},
getAppointmentInfo() {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
console.log(options);
},
/**
* 生命周期函数--监听页面初次渲染完成
... ...
// pages/index/go-appointment/go-appointment.js
const util = require('../../../utils/util.js');
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
array: ['北京市', '天津市', '上海市', '河北省'],
cityList: [],
// city_index: 0,
currentCity: '北京市',
current_test_id: '',
is_change: false,
is_choose: false,
description: '',
session_list: {},
show_submit_btn: false,
areaTest: [{
area: '朝阳区',
... ... @@ -104,28 +111,49 @@ Page({
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
index: e.detail.value,
city_index: e.detail.value,
is_change: true,
})
});
this.getChooseSession(this.data.cityList[e.detail.value])
},
//选择实验室
chooseTest(e) {
console.log(e.currentTarget.dataset.index);
// console.log(e);
// console.log('实验',e.currentTarget.dataset.index);
const current = e.currentTarget.dataset.index;
const current_id = e.currentTarget.dataset.id;
this.setData({
// console.log(this.data.areaTest[0].lab_list[0].session_list[0].id);
this.setData({
currentTest: current,
currentId: current_id
})
current_test_id: current_id,
is_choose: false,//恢复默认值
// current_session_id: this.data.areaTest[current].lab_list ? this.data.areaTest[current].lab_list[0].session_list[0].id : '',
// description: this.data.areaTest[current].lab_list[current].description
});
// console.log(util.formatTimeTwo(1543375800,'h:m'),'1543375800');
return this.data.areaTest.forEach((item,index) => {
if(item.lab_list[current].id === current_id) {
// console.log(current_id, item.lab_list[current].id,item.lab_list[current].description);
this.setData({
description: item.lab_list[current].description ? item.lab_list[current].description : '',
session_list: item.lab_list[current].session_list ? item.lab_list[current].session_list: '',
});
// return
}
});
// console.log(a);
// console.log(this.data.areaTest[current].lab_list[current].description);
},
//选择时段
//选择场次
chooseTime(e) {
console.log(e.currentTarget.dataset.index);
const current = e.currentTarget.dataset.index;
const current_id = e.currentTarget.dataset.id;
this.setData({
currentTime: current
currentTime: current,
current_session_id: current_id,
is_choose: true,
})
},
... ... @@ -135,7 +163,7 @@ Page({
// show_submit_btn: true
// })
wx.navigateTo({
url: '/pages/index/confirm-appointment-info/confirm-appointment-info'
url: '/pages/index/confirm-appointment-info/confirm-appointment-info?num=' + 1
})
},
... ... @@ -145,20 +173,93 @@ Page({
// show_submit_btn: true
// })
wx.navigateTo({
url: '/pages/index/confirm-appointment-info/confirm-appointment-info'
url: '/pages/index/confirm-appointment-info/confirm-appointment-info?num=' + 2
})
},
submit() {
wx.navigateTo({
url: '/pages/index/confirm-appointment-info/confirm-appointment-info'
})
if(this.data.is_choose) {
wx.navigateTo({
url: '/pages/index/confirm-appointment-info/confirm-appointment-info?experiment_id=' + this.data.current_test_id
+ '&session_id=' + this.data.current_session_id
})
}else {
wx.showToast({title: '请选择场次!',icon: 'none'})
}
},
//获取城市列表
getCity() {
let url = '/portal/Experiment/cityList';
let header = {
"XX-token": wx.getStorageSync('token')
};
app.post(url, {},header).then((res) => {
console.log(res);
var city_list = [];
res.forEach((item,index) => {
city_list.push(item.city)
});
console.log(city_list,res);
this.setData({
cityList: city_list,
// description: res.list[0].lab_list[0].description,//默认显示第一个实验室的描述
// session_list: res.list[0].lab_list[0].session_list//默认显示第一个实验室的实验时间
})
// console.log(this.data.this_week_test_info);
})
},
//获取预约城市、区、实验室、场次
getChooseSession(city) {
let url = '/portal/Experiment/choose_session';
let params = {
experiment_id: this.data.experiment_id,
city: city,
};
let header = {
"XX-token": wx.getStorageSync('token')
};
app.post(url, params,header).then((res) => {
console.log(res,res.list);
res.list.forEach((item,index) => {
if(item.lab_list) {
item.lab_list.forEach((i,k) => {
if(i.session_list) {
i.session_list.forEach((j,b) => {
j.start_time = util.formatTimeTwo(j.start_time, 'h:m');
j.end_time = util.formatTimeTwo(j.end_time, 'h:m');
})
}
})
}
});
console.log(res,res.list);
// console.log(res.list[0].lab_list[0].id);
this.setData({
areaTest: res.list,
// current_test_id: res.list[0].lab_list ? res.list[0].lab_list[0].id : '',//默认实验室id
// current_session_id: res.list[0].lab_list ? res.list[0].lab_list[0].session_list[0].id : '',//默认场次id
description: res.list[0].lab_list ? res.list[0].lab_list[0].description : '',//默认显示第一个实验室的描述
session_list: res.list[0].lab_list ? res.list[0].lab_list[0].session_list :''//默认显示第一个实验室的实验时间
})
// console.log(this.data.this_week_test_info);
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
const self = this;
self.setData({experiment_id: +options.experiment_id});
if(wx.getStorageSync('city')) {
const city = wx.getStorageSync('city');
self.getChooseSession(city);
}else {
const city = '北京市';
self.getChooseSession(city);
}
self.getCity();
this.data.areaTest.forEach((v, i) => {
Object.keys(v).forEach(v => {
console.log(v) //取到了key
... ...
<!--pages/index/go-appointment/go-appointment.wxml-->
<view class="content">
<view class="city_box">
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<picker bindchange="bindPickerChange" value="{{city_index}}" range="{{cityList}}">
<view class="select">
<view class="picker" wx:if="{{is_change}}">
{{array[index]}}
{{cityList[city_index]}}
</view>
<view wx:else>北京市</view>
<view class="iconfont icon-daosanjiao"></view>
... ... @@ -15,16 +15,16 @@
<view class="section">
<scroll-view class="area_box" scroll-y>
<block wx:for="{{areaTest}}" wx:key="index">
<view class="area-test">
<view class="area">{{item.area}}</view>
<view class="area-test" data-index="{{index}}" wx:for-index="{{idx}}">
<view class="area">{{item.name}}</view>
<view class="test-list">
<view class="list-item-box">
<block wx:for="{{item.list}}" wx:key="index">
<block wx:for="{{item.lab_list}}" wx:key="index">
<view class="list-item" bindtap="chooseTest" data-index="{{index}}"
data-id="{{item.id}}">
<image src="../../../images/blue_line.png" wx:if="{{currentId === item.id}}"
<image src="../../../images/blue_line.png" wx:if="{{current_test_id === item.id}}"
class="blue-line"></image>
<view class="test {{currentId === item.id?'change-color':''}}">{{item.name}}</view>
<view class="test {{current_test_id === item.id?'change-color':''}}">{{item.name}}</view>
</view>
</block>
</view>
... ... @@ -35,17 +35,17 @@
<view class="test_box">
<scroll-view scroll-y class="test_describe">
{{test.title}}
{{description}}
</scroll-view>
<scroll-view class="time-list-box" scroll-y>
<view wx:for="{{test.list}}" wx:key="index" class="time-list" bindtap="chooseTime" data-index="{{index}}">
<image src="../../../images/blue_line.png" wx:if="{{currentTime === index && item.rest !== 0}}"
<view wx:for="{{session_list}}" wx:key="index" class="time-list" bindtap="chooseTime" data-index="{{index}}" data-id="{{item.id}}">
<image src="../../../images/blue_line.png" wx:if="{{current_session_id === item.id}}"
class="blue-line"></image>
<view class="right-content {{item.rest === 0? 'change-gray':''}}">
<view class="{{currentTime === index && item.rest !== 0? 'change-color':''}}">{{item.week}} {{item.date}}</view>
<view class="{{current_session_id === item.id? 'change-color':''}}">{{item.weekday}} {{item.date}}</view>
<view class="bottom-time-box">
<text class="time {{currentTime === index && item.rest !== 0? 'change-color':''}}">{{item.time}}</text>
<text class="rest {{item.rest === 0? 'change-gray':''}}">剩余: {{item.rest}}</text>
<text class="time {{current_session_id === item.id? 'change-color':''}}">{{item.time}}</text>
<text class="rest {{item.rest === 0? 'change-gray':''}}">剩余: {{item.surplus_num}}</text>
</view>
</view>
</view>
... ... @@ -54,13 +54,14 @@
</view>
<view class="footer">
<view class="confirm_btn" bindtap="submit" wx:if="{{show_submit_btn}}">
<!--<view class="confirm_btn" bindtap="submit" wx:if="{{show_submit_btn}}">-->
<view class="confirm_btn" bindtap="submit">
<text>提 交</text>
</view>
<view class="appointment-box" wx:else>
<text class="single" bindtap="singleAppointment">单人预约</text>
<text class="double" bindtap="doubleAppointment">双人预约</text>
</view>
<!--<view class="appointment-box" wx:else>-->
<!--<text class="single" bindtap="singleAppointment">单人预约</text>-->
<!--<text class="double" bindtap="doubleAppointment">双人预约</text>-->
<!--</view>-->
<!--<view>提 交</view>-->
</view>
</view>
... ...
//index.js
//获取应用实例
const app = getApp()
const app = getApp();
// 引入SDK核心类
var QQMapWX = require('../../utils/qqmap-wx-jssdk.min.js');
Page({
data: {
hasPhone: true,
hasPhone: false,
imgUrls: [
{'url': '../../images/banner.jpg'},
{'url': '../../images/banner.jpg'},
... ... @@ -28,6 +30,21 @@ Page({
is_past: true,
},
},
//判断手机号是否绑定
checkMobile() {
let url = '/portal/Index/check_mobile';
let header = {
"XX-token": wx.getStorageSync('token')
};
app.post(url, {},header).then((res) => {
console.log(res);
if(res.is_binding) {
this.setData({hasPhone: true})
}else {
this.setData({hasPhone: false})
}
})
},
swiperChange: function (e) { //切换轮播图
this.setData({
currentSwiper: e.detail.current
... ... @@ -44,13 +61,17 @@ Page({
//点击进入活动详情
goTestDetail(e) {
// console.log(e);
const current = e.currentTarget.dataset.index;
wx.navigateTo({url: './activity-detail/activity-detail'})
const is_the_week = e.currentTarget.dataset.is_the_week;
const id = e.currentTarget.dataset.id;
wx.navigateTo({
url: './activity-detail/activity-detail?is_the_week=' + is_the_week +
'&id=' + id
})
},
//前往预约
goAppointment(e) {
const current = e.currentTarget.dataset.index;
wx.navigateTo({url: './go-appointment/go-appointment'})
const id = e.currentTarget.dataset.id;
wx.navigateTo({url: './go-appointment/go-appointment?experiment_id=' + id})
},
//获取轮播图
getSlideImage() {
... ... @@ -58,15 +79,9 @@ Page({
let params = {
city: this.data.city,
};
app.post(url, params).then((ret) => {
wx.setStorageSync('token', ret.token)
app.globalData.userInfo = ret.user_type
// console.log('userInfo',app.globalData.userInfo,ret);
if (ret.user_type == 2) {
wx.switchTab({
url: '/pages/index/index',
})
}
app.post(url, params).then((res) => {
console.log(res);
this.setData({imgUrls: res.list})
})
},
//获取本周实验
... ... @@ -99,22 +114,52 @@ Page({
const id = e.currentTarget.dataset.id;
wx.navigateTo({url: '/pages/index/activity-detail/activity-detail?test_id=' + id})
},
getUser() {
let url = '/user/Profile/getUserInfo';
let header = {
"XX-token": wx.getStorageSync('token')
};
app.post(url, {},header).then((res) => {
console.log('个人信息结果',res);
// self.setData({past_test_info: res})
// console.log(self.data.this_week_test_info);
});
},
onLoad: function () {
this.getTheWeekTest();
this.getPastWeekTest();
const self = this;
self.getTheWeekTest();
self.getPastWeekTest();
self.getUser();
self.checkMobile();
//获取当前城市
wx.getLocation({
type: 'wgs84',
success: function(res) {
console.log(res);
let url = '/public/getAddressInfoByCoordinate';
let params = {
latitude: res.latitude,//纬度
longitude: res.longitude//经度
};
// app.post(url,params).then((res) => {
// // console.log('获取城市',res);
// self.setData({city: res.city})
// })
// 实例化API核心类
var demo = new QQMapWX({
key: 'CLVBZ-KHZKP-KWLDW-VDJTA-QVUST-XOBVO' // 必填
});
// 调用接口
demo.reverseGeocoder({
location: {
latitude: res.latitude,//纬度
longitude: res.longitude//经度
},
success: function (res) {
console.log(res);
self.setData({city: res.result.address_component.city});
wx.setStorageSync('city', res.result.address_component.city);
self.getSlideImage();
},
fail: function (res) {
console.log(res);
},
complete: function (res) {
// console.log(res);
}
});
}
});
},
... ...
<!--index.wxml-->
<view class="container">
<!--蒙层-->
<view class="modal" wx:if="{{!hasPhone}}" bindtap="goPhoneCode"></view>
<!--蒙层-->
<view class="modal" wx:if="{{!hasPhone}}" bindtap="goPhoneCode"></view>
<!--轮播图-->
<view class="wrap">
<swiper autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" circular="true" bindchange="swiperChange">
<block wx:for="{{imgUrls}}" wx:key="index">
<swiper-item>
<navigator url="{{item.url}}" hover-class="navigator-hover">
<view class="index_top">
<image src="{{item.url}}" class="slide-image" mode="aspectFill" />
</view>
</navigator>
</swiper-item>
</block>
</swiper>
<view class="dots">
<block wx:for="{{ imgUrls}}" wx:key>
<view class="dot{{index == currentSwiper ? ' active' : ''}}"></view>
</block>
<!--轮播图-->
<view class="wrap">
<swiper autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" circular="true"
bindchange="swiperChange">
<block wx:for="{{imgUrls}}" wx:key="index">
<swiper-item>
<navigator url="{{item.url}}" hover-class="navigator-hover">
<view class="index_top">
<image src="{{item.image}}" class="slide-image" mode="aspectFill"/>
</view>
</navigator>
</swiper-item>
</block>
</swiper>
<view class="dots">
<block wx:for="{{ imgUrls}}" wx:key>
<view class="dot{{index == currentSwiper ? ' active' : ''}}"></view>
</block>
</view>
</view>
</view>
<!--购买-->
<view class="btn-box" bindtap="goBuyCard">
<view class="buy-btn">
<text>点击图片可跳转到购买页</text>
<!--购买-->
<view class="btn-box" bindtap="goBuyCard">
<view class="buy-btn">
<text>点击图片可跳转到购买页</text>
</view>
</view>
</view>
<!--实验列表-->
<!--<import src="/templates/templates.wxml" />-->
<!--实验列表-->
<!--<import src="/templates/templates.wxml"/>-->
<!--<view class="past_template">-->
<!--<template is="experiment" data="{{...this_week_test_info}}"></template>-->
<!--<template is="experiment" data="{{...past_test_info}}"></template>-->
<!--<template is="experiment" data="{{this_week_test_info}}"></template>-->
<!--<template is="experiment" data="{{...past_test_info}}"></template>-->
<!--</view>-->
<!-- <import src="/templates/templates.wxml" /> -->
<view class="past_template">
<!-- <template is="experiment" data="{{...this_week_test_info}}"></template>
<template is="experiment" data="{{...past_test_info}}"></template> -->
<view class='experiment_box'>
<view class="title_box">
<view class="line"></view>
<text>本周实验</text>
<!-- <text>往期实验</text> -->
</view>
<view wx:for="{{info}}" wx:key="index" data-index="{{index}}" bindtap="goTestDetail" data-is_the_week='{{true}}'>
<view class="test_box">
<view class="time">{{item.time}}</view>
<view class="img_box">
<image src="{{item.url}}"></image>
</view>
</view>
<view class="order_box">
<text catchtap="goAppointment" data-index="{{index}}">前往预约</text>
<!-- <import src="/templates/templates.wxml" /> -->
<view class="past_template">
<!-- <template is="experiment" data="{{...this_week_test_info}}"></template>
<template is="experiment" data="{{...past_test_info}}"></template> -->
<view class='experiment_box'>
<view class="title_box">
<view class="line"></view>
<text>本周实验</text>
<!-- <text>往期实验</text> -->
</view>
<view bindtap="goTestDetail"
data-is_the_week='{{true}}' data-id="{{this_week_test_info.id}}">
<view class="test_box">
<view class="time">{{this_week_test_info.start_time}} - {{this_week_test_info.end_time}}</view>
<view class="img_box">
<image src="{{this_week_test_info.thumb}}" mode="aspectFill"></image>
</view>
</view>
<view class="order_box">
<text catchtap="goAppointment" data-index="{{index}}" data-id="{{this_week_test_info.id}}">前往预约</text>
</view>
</view>
</view>
</view>
</view>
<view class='experiment_box'>
<view class="title_box" bindtap="goTestDetail" data-is_the_week='{{false}}'>
<view class="line"></view>
<text>往期实验</text>
</view>
<view wx:for="{{info}}" wx:key="index" data-index="{{index}}" bindtap="goTestDetail" data-is_the_week='{{false}}'>
<view class="test_box">
<view class="time">{{item.time}}</view>
<view class="img_box">
<image src="{{item.url}}"></image>
</view>
</view>
<view class="order_box">
<text>查看</text>
<view class='experiment_box'>
<view class="title_box" bindtap="goTestDetail" data-is_the_week='{{false}}'>
<view class="line"></view>
<text>往期实验</text>
</view>
<view wx:for="{{past_test_info.list}}" wx:key="index" data-index="{{index}}" data-id="{{item.id}}" bindtap="goTestDetail"
data-is_the_week='{{false}}'>
<view class="test_box">
<view class="time">{{item.start_time}} - {{item.end_time}}</view>
<view class="img_box">
<image src="{{item.thumb}}" mode="aspectFill"></image>
</view>
</view>
<view class="order_box">
<text>查看</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
// pages/index/phone-code/phone-code.js
const app = getApp();
var interval = null //倒计时函数
Page({
/**
* 页面的初始数据
*/
data: {
fun_id: 2,
time: '获取验证码', //倒计时
currentTime: 61
},
getCode: function(options) {
var that = this;
var currentTime = that.data.currentTime;
interval = setInterval(function() {
currentTime--;
that.setData({
time: currentTime + '秒'
})
if (currentTime <= 0) {
clearInterval(interval);
that.setData({
time: '重新发送',
currentTime: 61,
disabled: false
/**
* 页面的初始数据
*/
data: {
fun_id: 2,
time: '获取验证码', //倒计时
currentTime: 61,
phone_number: '',
verification_code: '',
},
phoneInput(e) {
this.setData({phone_number: e.detail.value})
},
codeInput(e) {
this.setData({verification_code: e.detail.value})
},
getCode: function (options) {
var that = this;
var currentTime = that.data.currentTime;
interval = setInterval(function () {
currentTime--;
that.setData({
time: currentTime + '秒'
})
if (currentTime <= 0) {
clearInterval(interval);
that.setData({
time: '重新发送',
currentTime: 61,
disabled: false
})
}
}, 1000);
let url = '/user/Profile/getCode';
let params = {
mobile: that.data.phone_number,
};
let header = {
"XX-token": wx.getStorageSync('token')
};
app.post(url, params,header).then((res) => {
console.log(res);
that.setData({verification_code: res.code})
// console.log(this.data.this_week_test_info);
})
}
}, 1000)
},
getVerificationCode() {
this.getCode();
var that = this;
that.setData({
disabled: true
})
},
//确认
confirm() {
wx.switchTab({
url: '../../index/index'
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
},
getVerificationCode() {
var that = this;
if(that.data.phone_number !== '') {
that.getCode();
that.setData({
disabled: true
})
}else {
that.setData({
disabled: false
});
wx.showToast({title: '请输入手机号!',icon: 'none'})
}
},
//确认绑定
formSubmit(e) {
console.log(e.detail);
const self = this;
if(self.data.phone_number === '') {
wx.showToast({title: '请输入手机号!',icon: 'none'})
}else if(self.data.verification_code === '') {
wx.showToast({title: '请输入验证码!',icon: 'none'})
}else {
let url = '/user/Profile/bindingMobile';
let params = {
_type: 1,
formId: e.detail.formId,
mobile: e.detail.value.phone_number,
verification_code: e.detail.value.verification_code,
};
let header = {
"XX-token": wx.getStorageSync('token')
};
app.post(url, params,header).then((res) => {
console.log('绑定结果',res);
// self.setData({past_test_info: res})
// console.log(self.data.this_week_test_info);
});
wx.switchTab({
url: '../../index/index'
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
... ... @@ -4,19 +4,23 @@
<image src="../../../images/logo.png"></image>
</view>
<view class="phone_box">
<input type="number" placeholder="请输入您的手机号" placeholder-class="placeholder" class="phone_num"/>
<view class="code_box">
<input type="number" placeholder="输入验证码" placeholder-class="placeholder"/>
<button class="button" disabled="{{disabled}}" data-id="2" bindtap="getVerificationCode" >
{{time}}
</button>
<form bindsubmit="formSubmit" bindreset="formReset" report-submit="true">
<view class="phone_box">
<input type="number" placeholder="请输入您的手机号" placeholder-class="placeholder" class="phone_num"
value="{{phone_number}}" bindinput="phoneInput" name="phone_number"/>
<view class="code_box">
<input type="number" placeholder="输入验证码" placeholder-class="placeholder" value="{{verification_code}}"
bindinput="codeInput" name="verification_code"/>
<button class="button" disabled="{{disabled}}" data-id="2" bindtap="getVerificationCode">
{{time}}
</button>
</view>
</view>
</view>
<view class="confirm_box">
<view class="confirm_btn" bindtap='confirm'>
<text>确 定</text>
<view class="confirm_box">
<button class="confirm_btn" form-type="submit">
<text>确 定</text>
</button>
</view>
</view>
</form>
</view>
... ...
... ... @@ -5,7 +5,11 @@
* 页面的初始数据
*/
data: {
hasPhone: true,
},
//首次登录小程序,跳转到认证手机页面
goPhoneCode() {
wx.navigateTo({url: '/pages/index/phone-code/phone-code'})
},
//兑换
charge() {
... ...
<!--pages/my/my.wxml-->
<view class='box'>
<!--蒙层-->
<view class="modal" wx:if="{{!hasPhone}}" bindtap="goPhoneCode"></view>
<view class='header_box '>
<view class='head_box'>
<view class='head_img'>
... ...
... ... @@ -15,6 +15,16 @@
padding: 0 24rpx;
box-sizing: border-box;
}
.modal {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
background-color: #000000;
opacity: 0.8;
z-index: 10;
}
.icon-bianji2{
font-size: 50rpx;
text-align: center;
... ...
// pages/protocol/protocol.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
/**
* 页面的初始数据
*/
data: {
service_protocol: {},
},
getServiceProtocol() {
let url = '/wxapp/public/arc_service';
app.post(url, {},{}).then((res) => {
console.log(res);
this.setData({service_protocol: res})
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getServiceProtocol();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
<!--pages/protocol/protocol.wxml-->
<view class='content_box'>
还有简短的汉字以内的文字介绍还有简短的汉字以内 的文字介绍还有简短的汉字以内的文字介绍还有简短 的汉字以 还有简短的汉字以内的文字介绍还有简短的汉字以内 的文字介绍还有简短的汉字以内的文字介绍还有简短 的汉字以
<view>{{service_protocol.title}}</view>
<view>{{service_protocol.description}}</view>
</view>
\ No newline at end of file
... ...
... ... @@ -12,12 +12,7 @@ Page({
// 获取用户信息
start(e) {
let that = this;
console.log('点击');
// wx.redirectTo({
// url: '/pages/index/index',
// })
let url = '/wxapp/public/login';
// console.log(that.data.openid)
let params = {
encrypted_data: e.detail.encryptedData,
iv: e.detail.iv,
... ... @@ -30,11 +25,9 @@ Page({
wx.setStorageSync('token', ret.token)
app.globalData.userInfo = ret.user_type
// console.log('userInfo',app.globalData.userInfo,ret);
if (ret.user_type == 2) {
wx.switchTab({
url: '/pages/index/index',
})
}
})
},
example() {
... ... @@ -55,11 +48,10 @@ Page({
let url = '/wxapp/public/getSessionKey'
wx.login({
success: function (res) {
console.log(res)
// console.log(res)
app.post(url, {
code: res.code
}, {}).then((ret) => {
console.log('res',ret);
that.setData({
openid: ret.openid,
session_key: ret.session_key
... ...
... ... @@ -12,7 +12,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.4.0",
"appid": "wxaab44bbcfc0e5bc5",
"appid": "wx9053b434e50ee2dd",
"projectname": "science",
"debugOptions": {
"hidedInDevtools": []
... ...
var _createClass=function(){function a(e,c){for(var b=0;b<c.length;b++){var d=c[b];d.enumerable=d.enumerable||false;d.configurable=true;if("value" in d){d.writable=true}Object.defineProperty(e,d.key,d)}}return function(d,b,c){if(b){a(d.prototype,b)}if(c){a(d,c)}return d}}();function _classCallCheck(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}var ERROR_CONF={KEY_ERR:311,KEY_ERR_MSG:"key格式错误",PARAM_ERR:310,PARAM_ERR_MSG:"请求参数信息有误",SYSTEM_ERR:600,SYSTEM_ERR_MSG:"系统错误",WX_ERR_CODE:1000,WX_OK_CODE:200};var BASE_URL="https://apis.map.qq.com/ws/";var URL_SEARCH=BASE_URL+"place/v1/search";var URL_SUGGESTION=BASE_URL+"place/v1/suggestion";var URL_GET_GEOCODER=BASE_URL+"geocoder/v1/";var URL_CITY_LIST=BASE_URL+"district/v1/list";var URL_AREA_LIST=BASE_URL+"district/v1/getchildren";var URL_DISTANCE=BASE_URL+"distance/v1/";var Utils={location2query:function location2query(c){if(typeof c=="string"){return c}var b="";for(var a=0;a<c.length;a++){var e=c[a];if(!!b){b+=";"}if(e.location){b=b+e.location.lat+","+e.location.lng}if(e.latitude&&e.longitude){b=b+e.latitude+","+e.longitude}}return b},getWXLocation:function getWXLocation(c,b,a){wx.getLocation({type:"gcj02",success:c,fail:b,complete:a})},getLocationParam:function getLocationParam(b){if(typeof b=="string"){var a=b.split(",");if(a.length===2){b={latitude:b.split(",")[0],longitude:b.split(",")[1]}}else{b={}}}return b},polyfillParam:function polyfillParam(a){a.success=a.success||function(){};a.fail=a.fail||function(){};a.complete=a.complete||function(){}},checkParamKeyEmpty:function checkParamKeyEmpty(c,b){if(!c[b]){var a=this.buildErrorConfig(ERROR_CONF.PARAM_ERR,ERROR_CONF.PARAM_ERR_MSG+b+"参数格式有误");c.fail(a);c.complete(a);return true}return false},checkKeyword:function checkKeyword(a){return !this.checkParamKeyEmpty(a,"keyword")},checkLocation:function checkLocation(c){var a=this.getLocationParam(c.location);if(!a||!a.latitude||!a.longitude){var b=this.buildErrorConfig(ERROR_CONF.PARAM_ERR,ERROR_CONF.PARAM_ERR_MSG+" location参数格式有误");c.fail(b);c.complete(b);return false}return true},buildErrorConfig:function buildErrorConfig(a,b){return{status:a,message:b}},buildWxRequestConfig:function buildWxRequestConfig(c,a){var b=this;a.header={"content-type":"application/json"};a.method="GET";a.success=function(d){var e=d.data;if(e.status===0){c.success(e)}else{c.fail(e)}};a.fail=function(d){d.statusCode=ERROR_CONF.WX_ERR_CODE;c.fail(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,result.errMsg))};a.complete=function(d){var e=+d.statusCode;switch(e){case ERROR_CONF.WX_ERR_CODE:c.complete(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,d.errMsg));break;case ERROR_CONF.WX_OK_CODE:var f=d.data;if(f.status===0){c.complete(f)}else{c.complete(b.buildErrorConfig(f.status,f.message))}break;default:c.complete(b.buildErrorConfig(ERROR_CONF.SYSTEM_ERR,ERROR_CONF.SYSTEM_ERR_MSG))}};return a},locationProcess:function locationProcess(f,e,c,a){var d=this;c=c||function(g){g.statusCode=ERROR_CONF.WX_ERR_CODE;f.fail(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,g.errMsg))};a=a||function(g){if(g.statusCode==ERROR_CONF.WX_ERR_CODE){f.complete(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE,g.errMsg))}};if(!f.location){d.getWXLocation(e,c,a)}else{if(d.checkLocation(f)){var b=Utils.getLocationParam(f.location);e(b)}}}};var QQMapWX=function(){function b(i){_classCallCheck(this,b);if(!i.key){throw Error("key值不能为空")}this.key=i.key}_createClass(b,[{key:"search",value:function f(i){var l=this;i=i||{};Utils.polyfillParam(i);if(!Utils.checkKeyword(i)){return}var k={keyword:i.keyword,orderby:i.orderby||"_distance",page_size:i.page_size||10,page_index:i.page_index||1,output:"json",key:l.key};if(i.address_format){k.address_format=i.address_format}if(i.filter){k.filter=i.filter}var n=i.distance||"1000";var j=i.auto_extend||1;var m=function m(o){k.boundary="nearby("+o.latitude+","+o.longitude+","+n+","+j+")";wx.request(Utils.buildWxRequestConfig(i,{url:URL_SEARCH,data:k}))};Utils.locationProcess(i,m)}},{key:"getSuggestion",value:function h(i){var k=this;i=i||{};Utils.polyfillParam(i);if(!Utils.checkKeyword(i)){return}var j={keyword:i.keyword,region:i.region||"全国",region_fix:i.region_fix||0,policy:i.policy||0,output:"json",key:k.key};wx.request(Utils.buildWxRequestConfig(i,{url:URL_SUGGESTION,data:j}))}},{key:"reverseGeocoder",value:function a(i){var k=this;i=i||{};Utils.polyfillParam(i);var j={coord_type:i.coord_type||5,get_poi:i.get_poi||0,output:"json",key:k.key};if(i.poi_options){j.poi_options=i.poi_options}var l=function l(m){j.location=m.latitude+","+m.longitude;wx.request(Utils.buildWxRequestConfig(i,{url:URL_GET_GEOCODER,data:j}))};Utils.locationProcess(i,l)}},{key:"geocoder",value:function g(i){var k=this;i=i||{};Utils.polyfillParam(i);if(Utils.checkParamKeyEmpty(i,"address")){return}var j={address:i.address,output:"json",key:k.key};wx.request(Utils.buildWxRequestConfig(i,{url:URL_GET_GEOCODER,data:j}))}},{key:"getCityList",value:function c(i){var k=this;i=i||{};Utils.polyfillParam(i);var j={output:"json",key:k.key};
wx.request(Utils.buildWxRequestConfig(i,{url:URL_CITY_LIST,data:j}))}},{key:"getDistrictByCityId",value:function d(i){var k=this;i=i||{};Utils.polyfillParam(i);if(Utils.checkParamKeyEmpty(i,"id")){return}var j={id:i.id||"",output:"json",key:k.key};wx.request(Utils.buildWxRequestConfig(i,{url:URL_AREA_LIST,data:j}))}},{key:"calculateDistance",value:function e(i){var k=this;i=i||{};Utils.polyfillParam(i);if(Utils.checkParamKeyEmpty(i,"to")){return}var j={mode:i.mode||"walking",to:Utils.location2query(i.to),output:"json",key:k.key};var l=function l(m){j.from=m.latitude+","+m.longitude;wx.request(Utils.buildWxRequestConfig(i,{url:URL_DISTANCE,data:j}))};if(i.from){i.location=i.from}Utils.locationProcess(i,l)}}]);return b}();module.exports=QQMapWX;
\ No newline at end of file
... ...
... ... @@ -14,6 +14,32 @@ const formatNumber = n => {
return n[1] ? n : '0' + n
}
/**
* 时间戳转化为年 月 日 时 分 秒
* number: 传入时间戳
* format:返回格式,支持自定义,但参数必须与formateArr里保持一致
*/
function formatTimeTwo(number, format) {
var formateArr = ['Y', 'M', 'D', 'h', 'm', 's'];
var returnArr = [];
var date = new Date(number * 1000);
returnArr.push(date.getFullYear());
returnArr.push(formatNumber(date.getMonth() + 1));
returnArr.push(formatNumber(date.getDate()));
returnArr.push(formatNumber(date.getHours()));
returnArr.push(formatNumber(date.getMinutes()));
returnArr.push(formatNumber(date.getSeconds()));
for (var i in returnArr) {
format = format.replace(formateArr[i], returnArr[i]);
}
return format;
}
module.exports = {
formatTime: formatTime
formatTime: formatTime,
formatTimeTwo: formatTimeTwo
}
... ...
/**
* html2Json 改造来自: https://github.com/Jxck/html2json
*
*
* author: Di (微信小程序开发工程师)
* organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
* 垂直微信小程序开发交流社区
*
* github地址: https://github.com/icindy/wxParse
*
* for: 微信小程序富文本解析
* detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
*/
var __placeImgeUrlHttps = "https";
var __emojisReg = '';
var __emojisBaseSrc = '';
var __emojis = {};
var wxDiscode = require('./wxDiscode.js');
var HTMLParser = require('./htmlparser.js');
// Empty Elements - HTML 5
var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
// Block Elements - HTML 5
var block = makeMap("br,a,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
// Inline Elements - HTML 5
var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
// Elements that you can, intentionally, leave open
// (and which close themselves)
var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
// Attributes that have their values filled in disabled="disabled"
var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
// Special Elements (can contain anything)
var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
function makeMap(str) {
var obj = {}, items = str.split(",");
for (var i = 0; i < items.length; i++)
obj[items[i]] = true;
return obj;
}
function q(v) {
return '"' + v + '"';
}
function removeDOCTYPE(html) {
return html
.replace(/<\?xml.*\?>\n/, '')
.replace(/<.*!doctype.*\>\n/, '')
.replace(/<.*!DOCTYPE.*\>\n/, '');
}
function trimHtml(html) {
return html
.replace(/\r?\n+/g, '')
.replace(/<!--.*?-->/ig, '')
.replace(/\/\*.*?\*\//ig, '')
.replace(/[ ]+</ig, '<')
}
function html2json(html, bindName) {
//处理字符串
html = removeDOCTYPE(html);
html = trimHtml(html);
html = wxDiscode.strDiscode(html);
//生成node节点
var bufArray = [];
var results = {
node: bindName,
nodes: [],
images:[],
imageUrls:[]
};
var index = 0;
HTMLParser(html, {
start: function (tag, attrs, unary) {
//debug(tag, attrs, unary);
// node for this element
var node = {
node: 'element',
tag: tag,
};
if (bufArray.length === 0) {
node.index = index.toString()
index += 1
} else {
var parent = bufArray[0];
if (parent.nodes === undefined) {
parent.nodes = [];
}
node.index = parent.index + '.' + parent.nodes.length
}
if (block[tag]) {
node.tagType = "block";
} else if (inline[tag]) {
node.tagType = "inline";
} else if (closeSelf[tag]) {
node.tagType = "closeSelf";
}
if (attrs.length !== 0) {
node.attr = attrs.reduce(function (pre, attr) {
var name = attr.name;
var value = attr.value;
if (name == 'class') {
// console.dir(value);
// value = value.join("")
node.classStr = value;
}
// has multi attibutes
// make it array of attribute
if (name == 'style') {
console.dir(value);
// value = value.join("")
node.styleStr = value;
}
if (value.match(/ /)) {
value = value.split(' ');
}
// if attr already exists
// merge it
if (pre[name]) {
if (Array.isArray(pre[name])) {
// already array, push to last
pre[name].push(value);
} else {
// single value, make it array
pre[name] = [pre[name], value];
}
} else {
// not exist, put it
pre[name] = value;
}
return pre;
}, {});
}
//对img添加额外数据
if (node.tag === 'img') {
node.imgIndex = results.images.length;
var imgUrl = node.attr.src;
if (imgUrl[0] == '') {
imgUrl.splice(0, 1);
}
imgUrl = wxDiscode.urlToHttpUrl(imgUrl, __placeImgeUrlHttps);
node.attr.src = imgUrl;
node.from = bindName;
results.images.push(node);
results.imageUrls.push(imgUrl);
}
// 处理font标签样式属性
if (node.tag === 'font') {
var fontSize = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large'];
var styleAttrs = {
'color': 'color',
'face': 'font-family',
'size': 'font-size'
};
if (!node.attr.style) node.attr.style = [];
if (!node.styleStr) node.styleStr = '';
for (var key in styleAttrs) {
if (node.attr[key]) {
var value = key === 'size' ? fontSize[node.attr[key]-1] : node.attr[key];
node.attr.style.push(styleAttrs[key]);
node.attr.style.push(value);
node.styleStr += styleAttrs[key] + ': ' + value + ';';
}
}
}
//临时记录source资源
if(node.tag === 'source'){
results.source = node.attr.src;
}
if (unary) {
// if this tag doesn't have end tag
// like <img src="hoge.png"/>
// add to parents
var parent = bufArray[0] || results;
if (parent.nodes === undefined) {
parent.nodes = [];
}
parent.nodes.push(node);
} else {
bufArray.unshift(node);
}
},
end: function (tag) {
//debug(tag);
// merge into parent tag
var node = bufArray.shift();
if (node.tag !== tag) console.error('invalid state: mismatch end tag');
//当有缓存source资源时于于video补上src资源
if(node.tag === 'video' && results.source){
node.attr.src = results.source;
delete results.source;
}
if (bufArray.length === 0) {
results.nodes.push(node);
} else {
var parent = bufArray[0];
if (parent.nodes === undefined) {
parent.nodes = [];
}
parent.nodes.push(node);
}
},
chars: function (text) {
//debug(text);
var node = {
node: 'text',
text: text,
textArray:transEmojiStr(text)
};
if (bufArray.length === 0) {
node.index = index.toString()
index += 1
results.nodes.push(node);
} else {
var parent = bufArray[0];
if (parent.nodes === undefined) {
parent.nodes = [];
}
node.index = parent.index + '.' + parent.nodes.length
parent.nodes.push(node);
}
},
comment: function (text) {
//debug(text);
// var node = {
// node: 'comment',
// text: text,
// };
// var parent = bufArray[0];
// if (parent.nodes === undefined) {
// parent.nodes = [];
// }
// parent.nodes.push(node);
},
});
return results;
};
function transEmojiStr(str){
// var eReg = new RegExp("["+__reg+' '+"]");
// str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
var emojiObjs = [];
//如果正则表达式为空
if(__emojisReg.length == 0 || !__emojis){
var emojiObj = {}
emojiObj.node = "text";
emojiObj.text = str;
array = [emojiObj];
return array;
}
//这个地方需要调整
str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
var eReg = new RegExp("[:]");
var array = str.split(eReg);
for(var i = 0; i < array.length; i++){
var ele = array[i];
var emojiObj = {};
if(__emojis[ele]){
emojiObj.node = "element";
emojiObj.tag = "emoji";
emojiObj.text = __emojis[ele];
emojiObj.baseSrc= __emojisBaseSrc;
}else{
emojiObj.node = "text";
emojiObj.text = ele;
}
emojiObjs.push(emojiObj);
}
return emojiObjs;
}
function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
__emojisReg = reg;
__emojisBaseSrc=baseSrc;
__emojis=emojis;
}
module.exports = {
html2json: html2json,
emojisInit:emojisInit
};
... ...
/**
*
* htmlParser改造自: https://github.com/blowsie/Pure-JavaScript-HTML5-Parser
*
* author: Di (微信小程序开发工程师)
* organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
* 垂直微信小程序开发交流社区
*
* github地址: https://github.com/icindy/wxParse
*
* for: 微信小程序富文本解析
* detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
*/
// Regular Expressions for parsing tags and attributes
var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/,
attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
// Empty Elements - HTML 5
var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
// Block Elements - HTML 5
var block = makeMap("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
// Inline Elements - HTML 5
var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
// Elements that you can, intentionally, leave open
// (and which close themselves)
var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
// Attributes that have their values filled in disabled="disabled"
var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
// Special Elements (can contain anything)
var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
function HTMLParser(html, handler) {
var index, chars, match, stack = [], last = html;
stack.last = function () {
return this[this.length - 1];
};
while (html) {
chars = true;
// Make sure we're not in a script or style element
if (!stack.last() || !special[stack.last()]) {
// Comment
if (html.indexOf("<!--") == 0) {
index = html.indexOf("-->");
if (index >= 0) {
if (handler.comment)
handler.comment(html.substring(4, index));
html = html.substring(index + 3);
chars = false;
}
// end tag
} else if (html.indexOf("</") == 0) {
match = html.match(endTag);
if (match) {
html = html.substring(match[0].length);
match[0].replace(endTag, parseEndTag);
chars = false;
}
// start tag
} else if (html.indexOf("<") == 0) {
match = html.match(startTag);
if (match) {
html = html.substring(match[0].length);
match[0].replace(startTag, parseStartTag);
chars = false;
}
}
if (chars) {
index = html.indexOf("<");
var text = ''
while (index === 0) {
text += "<";
html = html.substring(1);
index = html.indexOf("<");
}
text += index < 0 ? html : html.substring(0, index);
html = index < 0 ? "" : html.substring(index);
if (handler.chars)
handler.chars(text);
}
} else {
html = html.replace(new RegExp("([\\s\\S]*?)<\/" + stack.last() + "[^>]*>"), function (all, text) {
text = text.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, "$1$2");
if (handler.chars)
handler.chars(text);
return "";
});
parseEndTag("", stack.last());
}
if (html == last)
throw "Parse Error: " + html;
last = html;
}
// Clean up any remaining tags
parseEndTag();
function parseStartTag(tag, tagName, rest, unary) {
tagName = tagName.toLowerCase();
if (block[tagName]) {
while (stack.last() && inline[stack.last()]) {
parseEndTag("", stack.last());
}
}
if (closeSelf[tagName] && stack.last() == tagName) {
parseEndTag("", tagName);
}
unary = empty[tagName] || !!unary;
if (!unary)
stack.push(tagName);
if (handler.start) {
var attrs = [];
rest.replace(attr, function (match, name) {
var value = arguments[2] ? arguments[2] :
arguments[3] ? arguments[3] :
arguments[4] ? arguments[4] :
fillAttrs[name] ? name : "";
attrs.push({
name: name,
value: value,
escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //"
});
});
if (handler.start) {
handler.start(tagName, attrs, unary);
}
}
}
function parseEndTag(tag, tagName) {
// If no tag name is provided, clean shop
if (!tagName)
var pos = 0;
// Find the closest opened tag of the same type
else {
tagName = tagName.toLowerCase();
for (var pos = stack.length - 1; pos >= 0; pos--)
if (stack[pos] == tagName)
break;
}
if (pos >= 0) {
// Close all the open elements, up the stack
for (var i = stack.length - 1; i >= pos; i--)
if (handler.end)
handler.end(stack[i]);
// Remove the open elements from the stack
stack.length = pos;
}
}
};
function makeMap(str) {
var obj = {}, items = str.split(",");
for (var i = 0; i < items.length; i++)
obj[items[i]] = true;
return obj;
}
module.exports = HTMLParser;
... ...