Browse Source

Merge remote-tracking branch 'origin/2024鹅状元' into 2024鹅状元

wangxy 5 months ago
parent
commit
26ae73060d

+ 12 - 0
api/login.js

@@ -42,4 +42,16 @@ export function wxLogin(data = {}) {
     data,
     timeout: 20000
   })
+}
+
+export function telBind(data = {}) {
+  return request({
+    'url': '/app/user/my/change/tel',
+    headers: {
+      isToken: false
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
 }

+ 2 - 0
manifest.json

@@ -16,6 +16,8 @@
             "autoclose" : true,
             "delay" : 0
         },
+		/* 禁止左右滑动 */
+		"disableSwipeBack": true,
         /*底部安全区*/
         "safearea" : {
             "bottom" : {

+ 35 - 13
pages/my/index.vue

@@ -14,7 +14,7 @@
 			<view class="hyqy-btn" @click="hyqyBtn" v-if="!myInfoData.vipFlag"></view>
 		</view>
 		<view class="my-list-box">
-			<view class="list-row">
+			<view class="list-row" @click="telClick">
 				<icon class="list-icon tel-icon"></icon>
 				<text>手机号码</text>
 			</view>
@@ -35,8 +35,9 @@
 				<text>退出登录</text>
 			</view>
 		</view>
-		<CustomTabBar></CustomTabBar>
+		<CustomTabBar :cardId="cardId" :nianji="nianji" :zhangId="zhangId"></CustomTabBar>
 		<tip-small-dialog ref="exitDialogRef" @confirm-btn="exitBtn" :content="tipContent"></tip-small-dialog>
+		<tel-dialog @telClose="telClose" v-if="telDialogFlag"></tel-dialog>
 	</view>
 </template>
 
@@ -48,13 +49,17 @@
 	import {getCurrentInstance} from 'vue';
 	import {onLoad} from '@dcloudio/uni-app';
 	import {reactive,ref} from "vue";
-	import { toast, getUserIdentity } from "../../utils/common";
-	import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue'
+	import { toast } from "../../utils/common";
+	import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue';
+	import telDialog from './telDialog.vue'
 	import {MESSAGE_VISITER_TO_LOGIN} from "@/utils/constant.js"
-	
+	const zhangId = ref(null);
+	const nianji = ref(null);
+	const cardId = ref(null);
 	const tipContent = '你确定要执行这个操作吗?'; 
 
 	let loginFlag = ref(false);
+	let telDialogFlag = ref(false);
 	let myInfoData = reactive({
 		userImg: 'static/images/my/head-unlogin-img.png',
 		userName: '',
@@ -73,6 +78,20 @@
 			url: '/pages/login/index'
 		});
 	}
+	
+	// 手机号码
+	function telClick(){
+		console.log('telClick');
+		telDialogFlag.value = true;
+		console.log(telDialogFlag.value,'telDialogFlag.value');
+	}
+	
+	// 关闭手机号码弹窗
+	function telClose(){
+		console.log('telClose');
+		telDialogFlag.value = false;
+	}
+	
 	// 关于我们
 	function aboutClick(){
 		uni.redirectTo({
@@ -138,19 +157,22 @@
 		if (LocalStorage) {
 			// 非游客
 			loginFlag.value = true;
-			// console.log(loginFlag.value,'非游客');
 			getMyInfo();
-		} else {
-			loginFlag.value = false;
-			myInfoData.userName = '游客';
-			myInfoData.userImg = 'static/images/my/head-unlogin-img.png'
-			// console.log(loginFlag.value,'游客');
 		}
 	}
 	
 	onLoad((options) => {
-		myGetAuth();
-		const instance = getCurrentInstance();
+		if(options){
+					zhangId.value = options.zhangId
+					nianji.value = options.nianji
+					cardId.value = options.cardId
+					// my游客
+					loginFlag.value = false;
+					myInfoData.userName = '游客';
+					myInfoData.userImg = 'static/images/my/head-unlogin-img.png'
+				}else{
+					myGetAuth();
+				}
 		// console.log(instance.appContext.config.globalProperties,'instance.appContext.config.globalProperties')
 	})
 

+ 24 - 21
pages/study/index.vue

@@ -1,12 +1,16 @@
 <template>
 	<view class="ezy-study-page">
-		<shuxueZhangjie @clickGradeTerm="clickGradeTerm" @onLeft="onLeft" @onRight="onRight"
-			@handleCheckCatalogue="handleCheckCatalogue" :options="infoData">
-		</shuxueZhangjie>
+		<shuxueZhangjie v-if="currentProduct ==1" @clickGradeTerm="clickGradeTerm" @onLeft="onLeft" @onRight="onRight"
+			@handleCheckCatalogue="handleCheckCatalogue" @listClick="listClick" :options="infoData">
+		</shuxueZhangjie>
+		<yingyuZhangjie v-if="currentProduct ==2" @clickGradeTerm="clickGradeTerm" @onLeft="onLeft" @onRight="onRight"
+			@handleCheckCatalogue="handleCheckCatalogue" @listClick="listClick" :options="infoData">
+		</yingyuZhangjie>
 		<!-- 蛋 -->
 		<egg-dialog ref="eggDialogRef" @eggBtn="eggBtn"></egg-dialog>
 		<catalogue ref="catalogueRef" @change-zhang="handleChangeZhang"></catalogue>
-		<CustomTabBar :cardId="cardId" :nianji="nianji" :zhangId="zhangId"></CustomTabBar>
+		<CustomTabBar :cardId="cardId" :nianji="nianji" :zhangId="zhangId"></CustomTabBar>
+				<tip-small-dialog ref="goPayDialogRef" @confirm-btn="goPay" :content="tipContent"></tip-small-dialog>
 	</view>
 
 </template>
@@ -28,8 +32,12 @@
 		onLoad
 	} from '@dcloudio/uni-app';
 	import catalogue from "@/components/catalogue/catalogue.vue";
-	import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
-	import shuxueZhangjie from './product/shuxue.vue';
+	import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
+		import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue'
+		
+	import shuxueZhangjie from './product/shuxue.vue';
+	import yingyuZhangjie from './product/yingyu.vue';
+	
 	import {
 		useTabBarHistory
 	} from '@/utils/emitEvents.js';
@@ -38,12 +46,13 @@
 		toast,getUserIdentity
 	} from "@/utils/common";
 	import cacheManager from "@/utils/cacheManager.js";
-
-
+	const tipContent = '付费章节,是否前往开通付费?'; 
+	const currentProduct = cacheManager.get('auth').cardId; //当前产品
+	const goPayDialogRef = ref(null);
 	const eggDialogRef = ref(null);
-	const zhangId = ref(null);
-	const nianji = ref(null);
-	const cardId = ref(null);
+	const zhangId = ref(null); //游客使用
+	const nianji = ref(null);//游客使用
+	const cardId = ref(null);//游客使用
 	const catalogueRef = ref(null);
 	const selectZhang = ref(null);
 	let infoData = reactive({
@@ -262,18 +271,12 @@
 			})
 			return;
 		}
-
-		// if(index !=0&&data.jieId!=79){
-
-		//             toast("付费章节!")
-		//             return false
-		// }
-
-		if (!data.vipFlag) {
-			toast("付费章节!")
+		const authCode = getUserIdentity();
+		if (!(authCode=='VIP' || data.number == 1)) {
+			goPayDialogRef.value.handleShow();
 			return false
 		}
-		if (index == infoData.jieList.length - 1) {
+		if (data.number == infoData.jieList.length) {
 			// 最后一项
 			goKaoshi(data)
 		} else {

+ 38 - 14
pages/study/product/shuxue.vue

@@ -8,19 +8,19 @@
 				<view class="brand-item" v-for="(item, index) in options.jieList" :key="item.jieId"
 					@click="listClick(item, index)" :class="{ 'brand-active': index === 0 }">
 					<view class="brand-icon">
-						<template v-if="item.vipFlag">{{ index + 1 }}</template>
-						<template v-else-if="index === 0">1</template>
+						{{ item.number }}
 					</view>
-					<view class="brand-lock" v-if="item.vipFlag==0 && index !== 0"></view>
-					<view class="brand-growth">
-						<template v-if="item.vipFlag ==1">
-							<template v-if="item.growth === 0">蛋</template>
-							<template v-else-if="item.growth === 10">小鹅</template>
-							<template v-else-if="item.growth === 20">中鹅</template>
-							<template v-else-if="item.growth === 50">大鹅</template>
-						</template>
+					<view v-if="item.daeFlag">
+					<template v-if="growthType ==0">蛋</template>
+					<template v-if="growthType ==1">小鹅</template>
+					<template v-if="growthType ==2">中鹅</template>
+					<template v-if="growthType ==3">大鹅</template>
+					</view>
+					<!-- 如果用户不是 VIP 且不是第一项,则添加 brand-lock 类 -->
+					<view v-if="!(isVip=='VIP' || item.number == 1)" class="brand-lock"></view>
+					<view class="brand-content">
+						{{ item.jieName }}
 					</view>
-					<view class="brand-content">{{ item.jieName }}</view>
 				</view>
 			</view>
 		</view>
@@ -36,12 +36,18 @@
 		onMounted
 	} from "vue";
 	import cacheManager from "@/utils/cacheManager.js";
-	const $emit = defineEmits(['clickGradeTerm', 'onLeft', 'onRight', 'handleCheckCatalogue'])
+	import {
+		toast,
+		getUserIdentity
+	} from "@/utils/common";
+	const $emit = defineEmits(['clickGradeTerm', 'onLeft', 'onRight', 'handleCheckCatalogue', 'listClick'])
 	const props = defineProps({
 		options: {
 			type: Object,
 		},
 	})
+	const isVip = getUserIdentity();
+	const growthType = cacheManager.get('auth').growthType;
 	const gradeMapping = {
 		1: '一年级',
 		2: '二年级',
@@ -52,8 +58,8 @@
 	};
 
 	const termMapping = {
-		1: '数学',
-		2: '英语'
+		1: ' 数学',
+		2: ' 英语'
 	};
 
 	let startX = ref(0);
@@ -65,6 +71,10 @@
 		$emit('clickGradeTerm');
 	}
 
+	function listClick(data) {
+		$emit('listClick', data);
+	}
+
 	function translateData(data) {
 		return gradeMapping[data.nianji] + termMapping[data.cardId]
 	}
@@ -114,11 +124,25 @@
 			console.log('error');
 		}
 	}
+	function dataRecom(data){
+		if(data&&data.jieList.length>0){
+			data.jieList.some(item => {
+			    if (item.studyFlag == 0) {
+			        item.daeFlag = true;
+			        return true; // 返回 true 以终止 some 循环
+			    }
+			    return false;
+			});
+		}
+		console.log(data);
+		console.log("1111");
+	}
 	watch(() => props.options, (newVal, oldVal) => {
 		console.log('New options:', newVal);
 		console.log('Old options:', oldVal);
 		// 在这里可以根据新的 options 做一些操作,比如发起请求等
 		gradeTerm.value = translateData(newVal);
+		dataRecom(newVal)
 	}, {
 		deep: true,
 		immediate: true

+ 155 - 0
pages/study/product/yingyu.vue

@@ -0,0 +1,155 @@
+<template>
+	<view>
+		英语	英语	英语	英语	英语
+		<view class="study-school-year" @click="clickGradeTerm">{{gradeTerm}}</view>
+		<view class="ezy-study-wrap" @touchstart="onTouchStart" @touchend="onTouchEnd">
+			<view class="chapter-box" @click="handleCheckCatalogue">{{options.numberStr}}</view>
+			<view class="chapter-title-box">{{options.zhangName}}</view>
+			<view>
+				<view class="brand-item" v-for="(item, index) in options.jieList" :key="item.jieId"
+					@click="listClick(item, index)" :class="{ 'brand-active': index === 0 }">
+					<view class="brand-icon">
+						{{ item.number }}
+					</view>
+					<view v-if="item.daeFlag">
+					<template v-if="growthType ==0">蛋</template>
+					<template v-if="growthType ==1">小鹅</template>
+					<template v-if="growthType ==2">中鹅</template>
+					<template v-if="growthType ==3">大鹅</template>
+					</view>
+					<!-- 如果用户不是 VIP 且不是第一项,则添加 brand-lock 类 -->
+					<view v-if="!(isVip=='VIP' || item.number == 'Lesson 1')" class="brand-lock"></view>
+					<view class="brand-content">
+						{{ item.jieName }}
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		reactive,
+		ref,
+		watch,
+		getCurrentInstance,
+		onMounted
+	} from "vue";
+	import cacheManager from "@/utils/cacheManager.js";
+	import {
+		toast,
+		getUserIdentity
+	} from "@/utils/common";
+	const $emit = defineEmits(['clickGradeTerm', 'onLeft', 'onRight', 'handleCheckCatalogue', 'listClick'])
+	const props = defineProps({
+		options: {
+			type: Object,
+		},
+	})
+	const isVip = getUserIdentity();
+	const growthType = cacheManager.get('auth').growthType;
+	const gradeMapping = {
+		1: '一年级',
+		2: '二年级',
+		3: '三年级',
+		4: '四年级',
+		5: '五年级',
+		6: '六年级'
+	};
+
+	const termMapping = {
+		1: ' 数学',
+		2: ' 英语'
+	};
+
+	let startX = ref(0);
+	let isSliding = ref(false);
+	let endX = ref(0);
+	let gradeTerm = ref('');
+
+	function clickGradeTerm() {
+		$emit('clickGradeTerm');
+	}
+
+	function listClick(data) {
+		$emit('listClick', data);
+	}
+
+	function translateData(data) {
+		return gradeMapping[data.nianji] + termMapping[data.cardId]
+	}
+
+	function handleCheckCatalogue() {
+		$emit('handleCheckCatalogue');
+	}
+
+	function onTouchStart(event) {
+		console.log(event.touches.length);
+		isSliding.value = false
+		if (event.touches.length === 1) {
+			isSliding.value = true;
+			startX.value = event.touches[0].pageX;
+		} else {
+			isSliding.value = false;
+			event.preventDefault()
+			return
+		}
+	}
+
+	function onSwipeLeft(event) {
+		console.log('11111');
+		if (cacheManager.get('auth')) {
+			$emit('onLeft');
+		}
+	}
+
+	function onSwipeRight(event) {
+		console.log('22222');
+		if (cacheManager.get('auth')) {
+			$emit('onRight');
+		}
+
+	}
+
+	function onTouchEnd(event) {
+		if (isSliding.value) {
+			const distanceX = event.changedTouches[0].clientX - startX.value
+			if (distanceX > 0) {
+				onSwipeLeft();
+			} else if (distanceX < 0) {
+				onSwipeRight();
+			}
+			isSliding.value = false
+		} else {
+			console.log('error');
+		}
+	}
+	function dataRecom(data){
+		if(data&&data.jieList.length>0){
+			data.jieList.some(item => {
+			    if (item.studyFlag == 0) {
+			        item.daeFlag = true;
+			        return true; // 返回 true 以终止 some 循环
+			    }
+			    return false;
+			});
+		}
+		console.log(data);
+		console.log("1111");
+	}
+	watch(() => props.options, (newVal, oldVal) => {
+		console.log('New options:', newVal);
+		console.log('Old options:', oldVal);
+		// 在这里可以根据新的 options 做一些操作,比如发起请求等
+		gradeTerm.value = translateData(newVal);
+		dataRecom(newVal)
+	}, {
+		deep: true,
+		immediate: true
+	});
+</script>
+
+<style>
+
+</style>

BIN
static/images/pay/svip-page-bj.png


+ 9 - 21
unpackage/dist/cache/.vite/deps/_metadata.json

@@ -1,31 +1,19 @@
 {
-  "hash": "2a404f3e",
-  "configHash": "088a760f",
-  "lockfileHash": "e3b0c442",
-  "browserHash": "316c4aa5",
+  "hash": "84373a44",
+  "configHash": "988bddf2",
+  "lockfileHash": "7eed52a7",
+  "browserHash": "37170371",
   "optimized": {
-    "jsencrypt": {
-      "src": "../../../../../node_modules/jsencrypt/lib/index.js",
-      "file": "jsencrypt.js",
-      "fileHash": "e90645e5",
-      "needsInterop": false
-    },
-    "ts-md5/dist/md5": {
-      "src": "../../../../../node_modules/ts-md5/dist/md5.js",
-      "file": "ts-md5_dist_md5.js",
-      "fileHash": "a21b68a0",
-      "needsInterop": true
-    },
     "uview-plus": {
       "src": "../../../../../node_modules/uview-plus/index.js",
       "file": "uview-plus.js",
-      "fileHash": "216d018e",
+      "fileHash": "91c97fcb",
       "needsInterop": false
     },
-    "aliplayer": {
-      "src": "../../../../../node_modules/aliplayer/lib/index.umd.js",
-      "file": "aliplayer.js",
-      "fileHash": "822c51ae",
+    "ts-md5/dist/md5": {
+      "src": "../../../../../node_modules/ts-md5/dist/md5.js",
+      "file": "ts-md5_dist_md5.js",
+      "fileHash": "13268c9b",
       "needsInterop": true
     }
   },