Browse Source

‘增加游客

Limengbo 6 years ago
parent
commit
ff5835d592

+ 0 - 12
.idea/efunbox-schedule-miniApps.iml

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="WEB_MODULE" version="4">
-  <component name="NewModuleRootManager">
-    <content url="file://$MODULE_DIR$">
-      <excludeFolder url="file://$MODULE_DIR$/.tmp" />
-      <excludeFolder url="file://$MODULE_DIR$/temp" />
-      <excludeFolder url="file://$MODULE_DIR$/tmp" />
-    </content>
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-  </component>
-</module>

+ 0 - 6
.idea/misc.xml

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="JavaScriptSettings">
-    <option name="languageLevel" value="ES6" />
-  </component>
-</project>

+ 0 - 8
.idea/modules.xml

@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="ProjectModuleManager">
-    <modules>
-      <module fileurl="file://$PROJECT_DIR$/.idea/efunbox-schedule-miniApps.iml" filepath="$PROJECT_DIR$/.idea/efunbox-schedule-miniApps.iml" />
-    </modules>
-  </component>
-</project>

+ 0 - 6
.idea/vcs.xml

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="VcsDirectoryMappings">
-    <mapping directory="$PROJECT_DIR$" vcs="Git" />
-  </component>
-</project>

+ 0 - 180
.idea/workspace.xml

@@ -1,180 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="ChangeListManager">
-    <list default="true" id="4f17d6f9-a5b0-4bb4-9071-d9334baf6515" name="Default" comment="">
-      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/pages/schedule/scheduleSubject/scheduleSubject.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/schedule/scheduleSubject/scheduleSubject.js" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/pages/schedule/scheduleSubject/scheduleSubject.json" beforeDir="false" afterPath="$PROJECT_DIR$/pages/schedule/scheduleSubject/scheduleSubject.json" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/pages/schedule/scheduleSubject/scheduleSubject.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/schedule/scheduleSubject/scheduleSubject.wxml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/project.config.json" beforeDir="false" afterPath="$PROJECT_DIR$/project.config.json" afterDir="false" />
-    </list>
-    <ignored path="$PROJECT_DIR$/.tmp/" />
-    <ignored path="$PROJECT_DIR$/temp/" />
-    <ignored path="$PROJECT_DIR$/tmp/" />
-    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
-    <option name="TRACKING_ENABLED" value="true" />
-    <option name="SHOW_DIALOG" value="false" />
-    <option name="HIGHLIGHT_CONFLICTS" value="true" />
-    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
-    <option name="LAST_RESOLUTION" value="IGNORE" />
-  </component>
-  <component name="FileEditorManager">
-    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
-      <file leaf-file-name="lessonList.wxml" pinned="false" current-in-tab="true">
-        <entry file="file://$PROJECT_DIR$/compontents/lesson_list/lessonList.wxml">
-          <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="100">
-              <caret line="5" column="34" selection-start-line="5" selection-start-column="34" selection-end-line="5" selection-end-column="34" />
-            </state>
-          </provider>
-        </entry>
-      </file>
-    </leaf>
-  </component>
-  <component name="FindInProjectRecents">
-    <findStrings>
-      <find>downUp</find>
-    </findStrings>
-    <dirStrings>
-      <dir>$PROJECT_DIR$</dir>
-    </dirStrings>
-  </component>
-  <component name="Git.Settings">
-    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
-  </component>
-  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
-  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
-  <component name="JsGulpfileManager">
-    <detection-done>true</detection-done>
-    <sorting>DEFINITION_ORDER</sorting>
-  </component>
-  <component name="NodePackageJsonFileManager">
-    <packageJsonPaths />
-  </component>
-  <component name="ProjectFrameBounds">
-    <option name="width" value="1920" />
-    <option name="height" value="1080" />
-  </component>
-  <component name="ProjectView">
-    <navigator proportions="" version="1">
-      <foldersAlwaysOnTop value="true" />
-    </navigator>
-    <panes>
-      <pane id="Scope" />
-      <pane id="ProjectPane">
-        <subPane>
-          <expand>
-            <path>
-              <item name="efunbox-schedule-miniApps" type="b2602c69:ProjectViewProjectNode" />
-              <item name="efunbox-schedule-miniApps" type="462c0819:PsiDirectoryNode" />
-            </path>
-            <path>
-              <item name="efunbox-schedule-miniApps" type="b2602c69:ProjectViewProjectNode" />
-              <item name="efunbox-schedule-miniApps" type="462c0819:PsiDirectoryNode" />
-              <item name="compontents" type="462c0819:PsiDirectoryNode" />
-            </path>
-            <path>
-              <item name="efunbox-schedule-miniApps" type="b2602c69:ProjectViewProjectNode" />
-              <item name="efunbox-schedule-miniApps" type="462c0819:PsiDirectoryNode" />
-              <item name="compontents" type="462c0819:PsiDirectoryNode" />
-              <item name="lesson_list" type="462c0819:PsiDirectoryNode" />
-            </path>
-            <path>
-              <item name="efunbox-schedule-miniApps" type="b2602c69:ProjectViewProjectNode" />
-              <item name="efunbox-schedule-miniApps" type="462c0819:PsiDirectoryNode" />
-              <item name="pages" type="462c0819:PsiDirectoryNode" />
-            </path>
-          </expand>
-          <select />
-        </subPane>
-      </pane>
-    </panes>
-  </component>
-  <component name="PropertiesComponent">
-    <property name="WebServerToolWindowFactoryState" value="false" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/.." />
-    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
-    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
-  </component>
-  <component name="RunDashboard">
-    <option name="ruleStates">
-      <list>
-        <RuleState>
-          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
-        </RuleState>
-        <RuleState>
-          <option name="name" value="StatusDashboardGroupingRule" />
-        </RuleState>
-      </list>
-    </option>
-  </component>
-  <component name="SvnConfiguration">
-    <configuration />
-  </component>
-  <component name="TaskManager">
-    <task active="true" id="Default" summary="Default task">
-      <changelist id="4f17d6f9-a5b0-4bb4-9071-d9334baf6515" name="Default" comment="" />
-      <created>1524652260223</created>
-      <option name="number" value="Default" />
-      <option name="presentableId" value="Default" />
-      <updated>1524652260223</updated>
-      <workItem from="1524652261658" duration="616000" />
-      <workItem from="1524663262852" duration="109000" />
-      <workItem from="1524705659225" duration="247000" />
-      <workItem from="1524792294462" duration="506000" />
-      <workItem from="1535342400968" duration="14000" />
-      <workItem from="1535355673275" duration="8000" />
-    </task>
-    <servers />
-  </component>
-  <component name="TimeTrackingManager">
-    <option name="totallyTimeSpent" value="1500000" />
-  </component>
-  <component name="ToolWindowManager">
-    <frame x="0" y="0" width="1280" height="720" extended-state="0" />
-    <layout>
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.20063192" />
-      <window_info anchor="bottom" id="TODO" order="6" />
-      <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
-      <window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
-      <window_info anchor="bottom" id="Version Control" order="7" />
-      <window_info anchor="bottom" id="Run" order="2" />
-      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
-      <window_info anchor="bottom" id="Terminal" order="7" />
-      <window_info id="Favorites" order="2" side_tool="true" />
-      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
-      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
-      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
-      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
-      <window_info anchor="bottom" id="Message" order="0" />
-      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
-      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
-      <window_info anchor="bottom" id="Find" order="1" />
-    </layout>
-  </component>
-  <component name="TypeScriptGeneratedFilesManager">
-    <option name="version" value="1" />
-  </component>
-  <component name="VcsContentAnnotationSettings">
-    <option name="myLimit" value="2678400000" />
-  </component>
-  <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/compontents/lesson_list/lessonList.wxml">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="100">
-          <caret line="5" column="34" lean-forward="true" selection-start-line="5" selection-start-column="34" selection-end-line="5" selection-end-column="34" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/compontents/lesson_list/lessonList.wxml">
-      <provider selected="true" editor-type-id="text-editor" />
-    </entry>
-    <entry file="file://$PROJECT_DIR$/compontents/lesson_list/lessonList.wxml">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="100">
-          <caret line="5" column="34" selection-start-line="5" selection-start-column="34" selection-end-line="5" selection-end-column="34" />
-        </state>
-      </provider>
-    </entry>
-  </component>
-</project>

+ 46 - 34
pages/art/art.js

@@ -41,7 +41,8 @@ Page({
     timeList: [],
     teacher: '',
     messageNum: '',
-    uploadNum: ''
+    uploadNum: '',
+    userKey: ''
   },
 
   /* 区分答疑和分享 */
@@ -147,47 +148,58 @@ Page({
         loginType: ""
       })
     }
+    let scene = decodeURIComponent(options.scene);
+    if (scene && scene !== 'undefined') {
+			let idParam = scene.split('&')[0];
+      let showIdParam = scene.split('&')[1];
+			 
+      let idKey = idParam.split('=')[0];
+      let idvalue = idParam.split('=')[1];
+		 this.setData({
+      userKey: idvalue
+		 })
+    }
     if(wx.getStorageSync('user')) {
       this.setData({
         teacher: wx.getStorageSync('user').data.data.isTeacher
       })
     }
-    /*科目信息*/
-    login.getOpenidSessionKey((res) => {
-      APIClient.getEachSchedule({
-        uid: res.data.data.uid
-      }, {
-        "category": 6
-      }).success((res) => {
-        const lessonListLength = util.studyPageTime(res.data.data.lessonPage.list).length;
-        const previewLength = util.filter(res.data.data.lessonPage.list).length;
-        console.log(res)
-        if(lessonListLength > 4) {
-          this.setData({
-            lessonListHeight: 72
-          })
-        }
-        if(previewLength > 4){
-          this.setData({
-            previewHeight: 72
-          })
-        } 
-        this.setData({
-          courseData: res.data.data,
-          materialData: util.filter(res.data.data.lessonPage.list),
-          list: util.studyPageTime(res.data.data.lessonPage.list),
-          wxObjectives: util.strategy(res.data.data.weekCourseConfig.wxObjectives)
-        })
-      })
-    }, () => {
-      this.setData({
-        flag: !this.data.flag
-      })      
-    }, this.data.loginType);
     
   },
 
   onShow: function () {
+        /*科目信息*/
+        login.getOpenidSessionKey((res) => {
+          APIClient.getEachSchedule({
+            uid: res.data.data.uid
+          }, {
+            "category": 6
+          }).success((res) => {
+            const lessonListLength = util.studyPageTime(res.data.data.lessonPage.list).length;
+            const previewLength = util.filter(res.data.data.lessonPage.list).length;
+            console.log(res)
+            if(lessonListLength > 4) {
+              this.setData({
+                lessonListHeight: 72
+              })
+            }
+            if(previewLength > 4){
+              this.setData({
+                previewHeight: 72
+              })
+            } 
+            this.setData({
+              courseData: res.data.data,
+              materialData: util.filter(res.data.data.lessonPage.list),
+              list: util.studyPageTime(res.data.data.lessonPage.list),
+              wxObjectives: util.strategy(res.data.data.weekCourseConfig.wxObjectives)
+            })
+          })
+        }, () => {
+          this.setData({
+            flag: !this.data.flag
+          })      
+        }, this.data.loginType, this.data.userKey);
     const columnId = util.column('6').columnId;
     const uploadNum = this.data.uploadNum ? this.data.uploadNum : '2';
     const messageNum = this.data.messageNum ? this.data.messageNum : '2';
@@ -268,6 +280,6 @@ Page({
     this.setData({
       flag: !this.data.flag
     })
-    this.onLoad();
+    this.onShow();
   },
 })

+ 14 - 2
pages/chinese/chinese.js

@@ -20,7 +20,8 @@ Page({
     flag: true,
     materialData: [],
     loginType: 1,
-    timeList: []
+    timeList: [],
+    userKey: ''
   },
 
   /* 区分答疑和分享 */
@@ -87,6 +88,17 @@ Page({
         loginType: ""
       })
     }
+    let scene = decodeURIComponent(options.scene);
+    if (scene && scene !== 'undefined') {
+			let idParam = scene.split('&')[0];
+      let showIdParam = scene.split('&')[1];
+			 
+      let idKey = idParam.split('=')[0];
+      let idvalue = idParam.split('=')[1];
+		 this.setData({
+      userKey: idvalue
+		 })
+    }
   },
 
   onShow: function () {
@@ -151,7 +163,7 @@ Page({
       this.setData({
         flag: !this.data.flag
       })       
-    }, this.data.loginType);
+    }, this.data.loginType, this.data.userKey);
   },
   /*获取个人信息弹框*/
   jurisdiction: function () {

+ 14 - 2
pages/english/english.js

@@ -20,7 +20,8 @@ Page({
     flag: true,
     materialData: [],
     loginType: 1,
-    timeList: []    
+    timeList: [],
+    userKey: ''    
   },
 
   /* 区分答疑和分享 */
@@ -87,6 +88,17 @@ Page({
         loginType: ""
       })
     } 
+    let scene = decodeURIComponent(options.scene);
+    if (scene && scene !== 'undefined') {
+			let idParam = scene.split('&')[0];
+      let showIdParam = scene.split('&')[1];
+			 
+      let idKey = idParam.split('=')[0];
+      let idvalue = idParam.split('=')[1];
+		 this.setData({
+      userKey: idvalue
+		 })
+    }
     if(wx.getStorageSync('user')) {
       this.setData({
         teacher: wx.getStorageSync('user').data.data.isTeacher
@@ -152,7 +164,7 @@ Page({
       this.setData({
         flag: !this.data.flag
       })     
-    }, this.data.loginType);
+    }, this.data.loginType, this.data.userKey);
   },
   /*获取个人信息弹框*/
   jurisdiction: function () {

+ 14 - 2
pages/language/language.js

@@ -20,7 +20,8 @@ Page({
     flag: true,
     materialData: [],
     loginType: 1,
-    timeList: []        
+    timeList: [],
+    userKey: ''        
   },
 
   /* 区分答疑和分享 */
@@ -87,6 +88,17 @@ Page({
         loginType: ""
       })
     }
+    let scene = decodeURIComponent(options.scene);
+    if (scene && scene !== 'undefined') {
+			let idParam = scene.split('&')[0];
+      let showIdParam = scene.split('&')[1];
+			 
+      let idKey = idParam.split('=')[0];
+      let idvalue = idParam.split('=')[1];
+		 this.setData({
+      userKey: idvalue
+		 })
+    }
     if(wx.getStorageSync('user')) {
       this.setData({
         teacher: wx.getStorageSync('user').data.data.isTeacher
@@ -150,7 +162,7 @@ Page({
       this.setData({
         flag: !this.data.flag
       })   
-    }, this.data.loginType);
+    }, this.data.loginType, this.data.userKey);
   },
   /*获取个人信息弹框*/
   jurisdiction: function () {

+ 14 - 2
pages/mathematics/mathematics.js

@@ -20,7 +20,8 @@ Page({
     flag: true,
     materialData: [],
     loginType: 1,
-    timeList: []
+    timeList: [],
+    userKey: ''
   },
 
   /* 区分答疑和分享 */
@@ -79,6 +80,17 @@ Page({
         loginType: ""
       })
     }
+    let scene = decodeURIComponent(options.scene);
+    if (scene && scene !== 'undefined') {
+			let idParam = scene.split('&')[0];
+      let showIdParam = scene.split('&')[1];
+			 
+      let idKey = idParam.split('=')[0];
+      let idvalue = idParam.split('=')[1];
+		 this.setData({
+      userKey: idvalue
+		 })
+    }
     if(wx.getStorageSync('user')) {
       this.setData({
         teacher: wx.getStorageSync('user').data.data.isTeacher
@@ -152,7 +164,7 @@ Page({
       this.setData({
         flag: !this.data.flag
       })        
-    }, this.data.loginType);
+    }, this.data.loginType, this.data.userKey);
   },
   /*获取个人信息弹框*/
   jurisdiction: function () {

+ 19 - 7
pages/science/science.js

@@ -26,7 +26,8 @@ Page({
     loginType: 1 ,
     timeList: [],
     messageNum: '',
-    uploadNum: ''  
+    uploadNum: '',
+    userKey: ''  
   },
   /* 区分答疑和分享 */
   distinction: function(type, columnId, pageNo, pageSize, success) {
@@ -129,11 +130,26 @@ Page({
         loginType: ""
       })
     } 
+    let scene = decodeURIComponent(options.scene);
+    if (scene && scene !== 'undefined') {
+			let idParam = scene.split('&')[0];
+      let showIdParam = scene.split('&')[1];
+			 
+      let idKey = idParam.split('=')[0];
+      let idvalue = idParam.split('=')[1];
+		 this.setData({
+      userKey: idvalue
+		 })
+    }
     if(wx.getStorageSync('user')) {
       this.setData({
         teacher: wx.getStorageSync('user').data.data.isTeacher
       })
     }
+   
+  },
+
+  onShow: function () {
     /*科目信息*/
     login.getOpenidSessionKey((res) => {
       //console.log(res.data.data.uid);
@@ -166,11 +182,7 @@ Page({
       this.setData({
         flag: !this.data.flag
       })     
-    }, this.data.loginType);
-   
-  },
-
-  onShow: function () {
+    }, this.data.loginType, this.data.userKey);    
     const columnId = util.column('5').columnId;
     const uploadNum = this.data.uploadNum ? this.data.uploadNum : '2';
     const messageNum = this.data.messageNum ? this.data.messageNum : '2';
@@ -248,7 +260,7 @@ Page({
     this.setData({
       flag: !this.data.flag
     })
-    this.onLoad();
+    this.onShow();
   }    
 })
 

+ 2 - 2
utils/const.js

@@ -6,9 +6,9 @@ module.exports = {
 	// apiUrl: 'https://weixin.ai160.com/',
 	// host: 'wss://weixin.ai160.com/wx/websocket'
 	// ----测试环境-----
-   //apiUrl: 'https://weixin.efunbox.cn/',
+   apiUrl: 'https://weixin.efunbox.cn/',
    // ----正式环境-----
-   apiUrl: 'https://schedule.api.ai160.com/',
+   //apiUrl: 'https://schedule.api.ai160.com/',
    // ----正式环境----- 另一个小程序
    apiUrlTwo: 'https://weixin.ai160.com/',
 

+ 6 - 3
utils/loginSchedule.js

@@ -32,7 +32,7 @@ function wxLogin(successcallback, failcallback) {
 }
 
 // 获取原来的 openid 和 session_key
-function getOpenidSessionKey(successcallback, failcallback, loginType) {
+function getOpenidSessionKey(successcallback, failcallback, loginType, userKey) {
     console.log('users......',wx.getStorageSync('user'))
   if (wx.getStorageSync('user')) {
     successcallback(
@@ -74,7 +74,7 @@ function getOpenidSessionKey(successcallback, failcallback, loginType) {
         //console.log('获取sessionKey等内容'+JSON.stringify(res.data));
         let sessionKey = JSON.parse(res.data).session_key;
         let openId = JSON.parse(res.data).openid;
-        getLoginSchedule(sessionKey, openId, successcallback, failcallback, false, loginType);
+        getLoginSchedule(sessionKey, openId, successcallback, failcallback, false, loginType, userKey);
     },function(res) {
         failcallback(res);
     })    
@@ -103,7 +103,7 @@ function getOpenidSessionKeyTwo(successcallback, failcallback) {
   }
 
 //登录
-function getLoginSchedule(sessionKey, openId, successcallback, failcallback, affirm, loginType) {
+function getLoginSchedule(sessionKey, openId, successcallback, failcallback, affirm, loginType, userKey) {
     wx.getSetting({
         success: function(res) {
             // 已经授权,可以直接调用 getUserInfo 获取头像昵称
@@ -145,6 +145,9 @@ function getLoginSchedule(sessionKey, openId, successcallback, failcallback, aff
                         if(loginType != "") {
                             userData.loginType = "1";
                         }
+                        if(userKey != "") {
+                            userData.userKey = userKey;
+                        }
                         request.getInstance().url(url).data(userData).method('GET').send().success(res => {
                             wx.hideToast()
                             wx.showToast({