Browse Source

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

tanxue 1 month ago
parent
commit
302997ff55
2 changed files with 67 additions and 27 deletions
  1. 10 27
      components/custom-tabbar/custom-tabbar.vue
  2. 57 0
      components/custom-tabbar/tishiDl.vue

+ 10 - 27
components/custom-tabbar/custom-tabbar.vue

@@ -1,13 +1,13 @@
 <template>
 	<view class="ezy-custom-tabbar">
 		<view class="tabbar-item-box" v-for="(item, index) in tabList" :key="index" @click="switchTab(item.path,index)">
-			<view class="tabbar-item" 
+			<view class="tabbar-item"
 				:style="{ backgroundImage: 'url(' + (currentTab == index ? item.activePath : item.iconPath) + ')' }">
 			</view>
 		</view>
 	</view>
 	<tip-big-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :imgShow="true"></tip-big-dialog>
-
+	<tishiDlVue ref="popupRef"></tishiDlVue>
 </template>
 
 <script>
@@ -27,10 +27,12 @@
 	import {
 		nextTick,
 	} from "vue";
+	import tishiDlVue from './tishiDl.vue';
 	export default {
 		components: {
 			tipMiddleDialog,
-			tipBigDialog
+			tipBigDialog,
+			tishiDlVue
 		},
 		data() {
 			return {
@@ -92,32 +94,13 @@
 					// 同页面不刷新
 					return;
 				}
-				if (path !== '/pages/game/index') {
-					this.currentTab = index;
-				}
-				if (getUserIdentity() == 'Visitor') {
-					if (path === '/pages/game/index') {
-						this.$refs.youkeDialogRef.handleShow();
-						return;
-					}
-					uni.navigateTo({
-						url: path + '?levelId=' + this.levelId + '&typeId=' + this.typeId + '&subjectId=' +
-							this.subjectId + '&tipFlag=' + this.tipFlag
-					});
-				} else {
-					/* if (path === '/pages/game/index') {
-						// 游戏需要返回功能
-						uni.navigateTo({
-							url: path,
-							"animationType": "fade-in",
-							"animationDuration":0
-						});
-						return;
-					} */
-
-					this.navigateToEditPage(path)
 
+				if (path == '/pages/chanpinneirong/index' && !cacheManager.get('auth').typeId) {
+					this.$refs.popupRef.open();
+					return false
 				}
+				this.currentTab = index;
+				this.navigateToEditPage(path)
 
 			},
 			navigateToEditPage(path) {

+ 57 - 0
components/custom-tabbar/tishiDl.vue

@@ -0,0 +1,57 @@
+<template>
+	<!-- 弹窗 -->
+	<uni-popup ref="popupRef" :animation="false" :is-mask-click="false" mask-background-color="rgba(0,0,0, 0.76);">
+		<view class="ezy-tip-dialog tip-e-dialog ">
+			<view class="close-btn" @click="handleClose"></view>
+			<view class="e-img bs-e-img"></view>
+			<view class="text-score">暂无在学课程</view>
+			<view class="time-tip-box" v-if="times">({{count}}S)</view>
+		</view>
+	</uni-popup>
+</template>
+
+<script setup>
+	import {
+		nextTick,
+		ref
+	} from "vue"
+
+	const times = ref(null)
+	const count = ref(2);
+	const popupRef = ref(null);
+
+
+	function initTime() {
+		times.value = setTimeout(() => {
+			if (count.value == 0) {
+				handleClose();
+				return;
+			}
+			count.value--;
+			initTime()
+		}, 1000)
+	}
+
+	function clearTime() {
+		clearTimeout(times.value);
+		times.value = null;
+		count.value = 2;
+	}
+
+	function handleClose() {
+		clearTime();
+		popupRef.value.close();
+	}
+
+	function open() {
+		popupRef.value.open();
+		nextTick(() => initTime())
+	}
+
+	defineExpose({
+		open
+	})
+</script>
+
+<style>
+</style>