瀏覽代碼

no message

lansir 1 年之前
父節點
當前提交
4273e333bc
共有 7 個文件被更改,包括 73 次插入144 次删除
  1. 5 83
      App.vue
  2. 15 14
      manifest.json
  3. 1 0
      pages/studentRanked/components/random-roll-call.vue
  4. 5 1
      pages/studentRanked/studentRanked.vue
  5. 2 0
      store/index.js
  6. 39 39
      template.h5.html
  7. 6 7
      utils/DateUtils.js

+ 5 - 83
App.vue

@@ -18,55 +18,12 @@
 	import Util from "@/common/js/util.js"
 
 	export default {
-
 		onLaunch: function() {
-			// #ifdef H5
-			// console.log(
-			// 	`%c hello uniapp %c v${version} `,
-			// 	'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px;  color: #fff',
-			// 	'background:#007aff ;padding: 1px; border-radius: 0 3px 3px 0;  color: #fff; font-weight: bold;'
-			// )
-			// #endif
-			// 线上示例使用
-			// console.log('%c uni-app官方团队诚邀优秀前端工程师加盟,一起打造更卓越的uni-app & uniCloud,欢迎投递简历到 hr2013@dcloud.io', 'color: red');
-			// console.log('App Launch');
-			// #ifdef APP-PLUS
-			// App平台检测升级,服务端代码是通过uniCloud的云函数实现的,详情可参考:https://ext.dcloud.net.cn/plugin?id=4542
-			if (plus.runtime.appid !== 'HBuilder') { // 真机运行不需要检查更新,真机运行时appid固定为'HBuilder',这是调试基座的appid
-				checkUpdate()
-			}
-
-			// 一键登录预登陆,可以显著提高登录速度
-			uni.preLogin({
-				provider: 'univerify',
-				success: (res) => {
-					// 成功
-					this.setUniverifyErrorMsg();
-					console.log("preLogin success: ", res);
-				},
-				fail: (res) => {
-					this.setUniverifyLogin(false);
-					this.setUniverifyErrorMsg(res.errMsg);
-					// 失败
-					console.log("preLogin fail res: ", res);
-				}
-			})
-			uni.getSetting({
-				success: (res) => {
-					if (!res.authSetting['scope.writePhotosAlbum']) {
-						uni.authorize({
-							scope: 'scope.writePhotosAlbum',
-							success: () => {
-								console.log('用户已授权')
-							},
-							fail: () => {
-								console.log('用户拒绝授权')
-							}
-						})
-					}
-				}
-			})
-			// #endif
+            let teacherInfo = uni.getStorageSync("teacherInfo");
+            console.log('读取teacherInfo', teacherInfo)
+            if(teacherInfo){
+                this.$store.commit("setTeacherInfo", teacherInfo)
+            }
 		},
 		onShow: function() {},
 		onHide: function() {
@@ -79,46 +36,11 @@
 			...mapMutations(['setUniverifyErrorMsg', 'setUniverifyLogin'])
 		},
 		mounted() {
-		
-			// list.filter(item => {
-			// 	if (item.path == this.$route.meta.pagePath) {
-			// 		editDDtitle(item.title)
-			// 	}
-
-			// })
-			// if (dd.env.platform !== "notInDingTalk") {
-			// 	dd.biz.navigation.hideBar({
-			// 		hidden: true, // true:隐藏,false:显示
-			// 		onSuccess: function(result) {},
-			// 		onFail: function(err) {}
-			// 	})
-			// }
-
 			list.filter(item => {
 				if (item.path == this.$route.meta.pagePath) {
 					editDDtitle(item.title)
 				}
 			})
-
-		},
-		created() {
-			
-			if (sessionStorage.getItem('store')) {
-				// this.$store.replaceState(
-				// 	Object.assign({},
-				// 		this.$store.state,
-				// 		JSON.parse(sessionStorage.getItem('store'))
-				// 	)
-				// )
-				this.$store.replaceState(Util.deepClone(JSON.parse(sessionStorage.getItem('store'))))
-			}
-			
-			// 在页面刷新时将vuex里的信息保存到sessionStorage里
-			// beforeunload事件在页面刷新时先触发
-			window.addEventListener('beforeunload', () => {
-				sessionStorage.setItem('store', JSON.stringify(this.$store.state))
-			})
-
 		},
 		watch: {
 			$route() {

+ 15 - 14
manifest.json

@@ -80,7 +80,7 @@
             "orientation" : [ "portrait-primary" ]
         },
         "uniStatistics" : {
-            "enable" : true
+            "enable" : false
         }
     },
     /* 快应用特有相关 */
@@ -119,19 +119,19 @@
             }
         },
         "uniStatistics" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-alipay" : {
         "usingComponents" : true,
         "uniStatistics" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-baidu" : {
         "usingComponents" : true,
         "uniStatistics" : {
-            "enable" : true
+            "enable" : false
         },
         "dynamicLib" : {
             "editorLib" : {
@@ -142,13 +142,13 @@
     "mp-toutiao" : {
         "usingComponents" : true,
         "uniStatistics" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-jd" : {
         "usingComponents" : true,
         "uniStatistics" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "h5" : {
@@ -168,7 +168,8 @@
         // },
         "template" : "template.h5.html",
         "router" : {
-            "mode" : "hash"
+            "mode" : "hash",
+            "base" : "./"
         },
         // "base" : "/"
         "sdkConfigs" : {
@@ -182,37 +183,37 @@
             "timeout" : 20000
         },
         "uniStatistics" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "vueVersion" : "2",
     "mp-kuaishou" : {
         "uniStatistics" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-lark" : {
         "uniStatistics" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-qq" : {
         "uniStatistics" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "quickapp-webview-huawei" : {
         "uniStatistics" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "quickapp-webview-union" : {
         "uniStatistics" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "uniStatistics" : {
         "version" : "2",
-        "enable" : true
+        "enable" : false
     }
 }

+ 1 - 0
pages/studentRanked/components/random-roll-call.vue

@@ -66,6 +66,7 @@
                 }
             },
             makeRandom() {
+                this.checkList = [];
                 let max = this.list.length - 1;
                 let numList = this.generateUniqueRandomNumbers(this.num, 0, max);
                 this.stuList = [];

+ 5 - 1
pages/studentRanked/studentRanked.vue

@@ -225,7 +225,8 @@
                 this.activeList = [];
             },
             loginOut() {
-                uni.setStorageSync("token", '')
+                uni.removeStorageSync("teacherInfo")
+                uni.removeStorageSync("token", '')
                 uni.reLaunch({
                     url: "/pages/login/login"
                 })
@@ -359,6 +360,9 @@
                     if(!this.seatMove){
                         return;
                     }
+                    if(this.seatMove && this.activeList.length == 0){
+                        return;
+                    }
                 }
                 if (this.seatMove) { //单个换位置
                     if (this.activeList.length == 0) {

+ 2 - 0
store/index.js

@@ -101,6 +101,8 @@ const store = new Vuex.Store({
 					setTeacherInfo(state, data) {
 						state.teacherInfo = data
 						state.teacher_id=data.id
+                        
+                        uni.setStorageSync('teacherInfo', data)
 					},
 					
 				},

+ 39 - 39
template.h5.html

@@ -1,23 +1,23 @@
 <!DOCTYPE html>
 <html lang="zh-CN">
-	<head>
-		<meta charset="utf-8">
-		<meta http-equiv="X-UA-Compatible" content="IE=edge">
-		<script  src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.inc.min.js"></script>
-		<script src="/static/js/echarts.min.js"></script>
-		</head>
-		<script>
-      var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
-        CSS.supports('top: constant(a)'))
-      document.write(
-        '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
-        (coverSupport ? ', viewport-fit=cover' : '') + '" />')
+    <head>
+        <meta charset="utf-8">
+        <meta http-equiv="X-UA-Compatible" content="IE=edge">
+        <script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.inc.min.js"></script>
+        <script src="/static/js/echarts.min.js"></script>
+    </head>
+    <script>
+        var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
+            CSS.supports('top: constant(a)'))
+        document.write(
+            '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
+            (coverSupport ? ', viewport-fit=cover' : '') + '" />')
     </script>
-		<title>
-			<%= htmlWebpackPlugin.options.title %>
-		</title>
-		<!-- 正式发布的时候使用,开发期间不启用。↓ -->
-        <!-- <script src="/h5/touch-emulator.js"></script>
+    <title>
+        <%= htmlWebpackPlugin.options.title %>
+    </title>
+    <!-- 正式发布的时候使用,开发期间不启用。↓ -->
+    <!-- <script src="/h5/touch-emulator.js"></script>
 		<script>
             TouchEmulator();
 			if (document.documentElement.clientWidth > 1024) {
@@ -38,25 +38,25 @@
                 s.parentNode.insertBefore(hm, s);
             })();
         </script> -->
-        <!-- 正式发布的时候使用,开发期间不启用。↑ -->
-		<script>
-			// document.addEventListener('DOMContentLoaded', function() {
-			// 	document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
-			// })
-		</script>
-		<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
-	</head>
-	<body>
-		<!-- 该文件为 H5 平台的模板 HTML,并非应用入口。 -->
-		<!-- 请勿在此文件编写页面代码或直接运行此文件。 -->
-		<!-- 详见文档:https://uniapp.dcloud.io/collocation/manifest?id=h5-template -->
-		<noscript>
-			<strong>Please enable JavaScript to continue.</strong>
-		</noscript>
-		<div id="app"></div>
-		<!-- built files will be auto injected -->
-		<script>
-			/*BAIDU_STAT*/
-		</script>
-	</body>
-</html>
+    <!-- 正式发布的时候使用,开发期间不启用。↑ -->
+    <script>
+        // document.addEventListener('DOMContentLoaded', function() {
+        // 	document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
+        // })
+    </script>
+    <link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
+    </head>
+    <body>
+        <!-- 该文件为 H5 平台的模板 HTML,并非应用入口。 -->
+        <!-- 请勿在此文件编写页面代码或直接运行此文件。 -->
+        <!-- 详见文档:https://uniapp.dcloud.io/collocation/manifest?id=h5-template -->
+        <noscript>
+            <strong>Please enable JavaScript to continue.</strong>
+        </noscript>
+        <div id="app"></div>
+        <!-- built files will be auto injected -->
+        <script>
+            /*BAIDU_STAT*/
+        </script>
+    </body>
+</html>

+ 6 - 7
utils/DateUtils.js

@@ -1,11 +1,10 @@
-import dd from '@/static/dd.js'
+// import dd from '@/static/dd.js'
 export function editDDtitle(text) {
-	dd.ready(function() {
-
-		dd.biz.navigation.setTitle({
-			title: text, // 替换为你想要设置的导航栏文字
-		});
-	});
+	// dd.ready(function() {
+	// 	dd.biz.navigation.setTitle({
+	// 		title: text, // 替换为你想要设置的导航栏文字
+	// 	});
+	// });
 }
 export function addColor(list) {