Forráskód Böngészése

Merge branch '2024鹅状元' of https://gogs.mtavip.com/wangguoyu/uniProject into 2024鹅状元

tanxue 6 hónapja
szülő
commit
116f472321

+ 39 - 12
App.vue

@@ -1,26 +1,53 @@
 <script>
-	 import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
+	import {
+		onBackPress
+	} from "@dcloudio/uni-app"
+	import {
+		toast,
+		getUserIdentity
+	} from "@/utils/common";
+	import cacheManager from "@/utils/cacheManager.js";
 	export default {
 		// creat by wgy 0619  生命周期 钩子  
 		onLaunch: function() {
-		//	console.log('App Launch')
+			//console.log('App Launch')
 		},
 		onShow: function() {
-		//	console.log('App Show')
+			// #ifdef APP-PLUS
+			if (cacheManager.get('auth')) {	
+				uni.redirectTo({
+					url: `/pages/study/index`
+				})
+			} else {
+				cacheManager.clearAll()
+				uni.redirectTo({
+					url: '/pages/login/index'
+				});
+			}
+			const webview = plus.webview.currentWebview();
+			plus.key.addEventListener('backbutton', () => {
+				event.preventDefault();
+				return false
+			});
+			// #endif
 		},
 		onHide: function() {
-			//console.log('App Hide')
+		//	console.log('App Hide')
+
 		}
 	}
 </script>
 
 <style lang="scss">
 	/* 公共样式 */
- @import '/common/styles/index.scss';
- body, html, #app {
-   font-family: "Helvetica Neue","Microsoft YaHei", "SimHei","SimSun", "Arial", sans-serif;
-   margin: 0;
-   padding: 0;
-   box-sizing: border-box;
- }
-</style>
+	@import '/common/styles/index.scss';
+
+	body,
+	html,
+	#app {
+		font-family: "Helvetica Neue", "Microsoft YaHei", "SimHei", "SimSun", "Arial", sans-serif;
+		margin: 0;
+		padding: 0;
+		box-sizing: border-box;
+	}
+</style>

+ 2 - 24
api/shipin.js

@@ -1,31 +1,9 @@
 import request from '../utils/request.js'
-export function videoPolicy(data = {}) {
-  return request({
-    'url': '/admin/video/policy',
-    headers: {
-      isToken: true
-    },
-    method: 'post',
-    data,
-    timeout: 20000
-  })
-}
 
-export function getVideoAuth(data = {}) {
-  return request({
-    'url': '/admin/video/auth',
-    headers: {
-      isToken: true
-    },
-    method: 'post',
-    data,
-    timeout: 20000
-  })
-}
 
-export function getVideoRefresh(data = {}) {
+export function getVideoAuth(data = {}) {
   return request({
-    'url': '/admin/video/refresh',
+    'url': '/app/video/auth',
     headers: {
       isToken: true
     },

+ 8 - 1
components/chengji/chengji.vue

@@ -36,7 +36,14 @@
 									<!-- 答案 -->
 									<view >
 										<text class="answer-item-title">正确答案</text>
-										<view v-for="ict in showAnswerResult(item)">{{ict}}</view>
+										<view v-for="(ict,cindex) in showAnswerResult(item)" :key="cindex">
+                      <text>{{cindex+1}}</text>
+                      <text v-for="(xItem,xindex) in ict" :key="xindex">
+                        <text > {{xItem}} </text>
+                        <text v-if="xindex != ict.length-1">/</text>
+                      </text>
+
+                    </view>
 									</view>
 								</view>
 								

+ 3 - 3
components/question/FillItem.vue

@@ -27,11 +27,11 @@
 	})
 	
 	function showPopup() {
-		fillRef.value.open();
+    fillRef.value &&	fillRef.value.open();
 	}	
 	
 	function handleConfirm() {
-		fillRef.value.close();
+    fillRef.value &&	fillRef.value.close();
 	}
 	
 	function onBlur() {
@@ -41,7 +41,7 @@
 	
 	uni.$on("swiper-change", () => {
 		emits("blur", {result: result.value,index: props.index});
-		fillRef.value.close()
+		fillRef.value && fillRef.value.close()
 	})
 	
 	defineExpose({

+ 0 - 2
components/questionJiexi/questionJiexi.vue

@@ -37,9 +37,7 @@
 		onReady
 	} from '@dcloudio/uni-app';
 	import {
-		videoPolicy,
 		getVideoAuth,
-		getVideoRefresh
 	} from "@/api/shipin.js"
 	export default {
 		data() {

+ 14 - 9
main.js

@@ -1,4 +1,5 @@
-import { createApp } from 'vue'
+import { createSSRApp } from 'vue'
+
 import App from './App.vue'
 //import plugins from './plugins' // plugins
 //import './permission' // permission
@@ -7,11 +8,15 @@ import uviewPlus from 'uview-plus'
 import {state,setGlobalVariable} from './common/prototype.js'//全局挂载
 const pinia = createPinia()
 // 创建Vue应用实例
-const app = createApp(App)
-app.config.globalProperties.$state = state;
-app.config.globalProperties.$setGlobalVariable = setGlobalVariable;
-//app.use(plugins)
-app.use(createPinia())
-app.use(uviewPlus)
-// 挂载Vue应用实例
-app.mount('#app')
+export function createApp() {
+    const app = createSSRApp(App)
+	app.config.globalProperties.$state = state;
+	app.config.globalProperties.$setGlobalVariable = setGlobalVariable;
+    app.use(createPinia())
+    app.use(uviewPlus)
+  //  app.use(pinia)
+
+    return {
+        app
+    };
+}

+ 0 - 2
pages/study/lookShipin.vue

@@ -46,9 +46,7 @@
 		onReady
 	} from '@dcloudio/uni-app';
 	import {
-		videoPolicy,
 		getVideoAuth,
-		getVideoRefresh
 	} from "@/api/shipin.js"
 	import {
 		toast,

+ 2 - 2
pages/wrong/index.vue

@@ -191,14 +191,14 @@
 		}
 
 		if (code == 0) {
-			if (data.shuxue.state == 'no-more' && !refresh) return;
+			if (data.shuxue.state == 'no-more') return;
 			// 数学
 			data.shuxue.state = 'loading';
 			data.shuxue.page++;
 			opt.page = data.shuxue.page;
 		} else if (code == 1) {
 			// 英语
-			if (data.yingyu.state == 'no-more' && !refresh) return;
+			if (data.yingyu.state == 'no-more') return;
 			data.yingyu.state = 'loading';
 			data.yingyu.page++;
 			opt.page = data.yingyu.page;