Jelajahi Sumber

样式修改

tanxue 1 bulan lalu
induk
melakukan
12ca61fc54

+ 24 - 0
api/my.js

@@ -31,4 +31,28 @@ export function duihuanmaCode(data = {}) {
     data,
     timeout: 20000
   })
+}
+// 普通card list
+export function myCardList(data = {}) {
+  return request({
+    'url': '/app/user/my/card/list',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}
+//游客card list
+export function commonCardList(data = {}) {
+  return request({
+    'url': '/common/card/list',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
 }

+ 27 - 50
pages/my/index.vue

@@ -12,10 +12,10 @@
 		</view>
 		<swiper class="my-hyqy-swiper" circular :indicator-dots="hyqyData.indicatorDots" :autoplay="hyqyData.autoplay"
 			:interval="hyqyData.interval" :duration="hyqyData.duration" indicator-color="#5195d3"
-			indicator-active-color="#83d9ff">
+			indicator-active-color="#83d9ff" v-if="bannerArr">
 			<!-- 1.数学 2.英语-->
-			<swiper-item v-for="(item, index) in 2" :key="index" class="hyqy-box" :class="getHyqyClass(index)">
-				<view class="hyqy-btn" @click="hyqyBtn(index)" v-if="getHyqyBtn(index)"></view>
+			<swiper-item v-for="(item, index) in bannerArr" :key="index" class="hyqy-box" @click="hyqyBtn(item)">
+				<img :src="item.addCover" class="hyqy-box-img"/>
 			</swiper-item>
 		</swiper>
 		<view class="my-list-box">
@@ -84,7 +84,9 @@
 	import {
 		myInfo,
 		zhuxiao,
-		duihuanmaCode
+		duihuanmaCode,
+		myCardList,
+		commonCardList
 	} from '@/api/my.js'
 	import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
 	import {
@@ -146,6 +148,7 @@
 	const youkeDialogRef = ref(null);
 	const zhuxiaoDialogRef = ref(null);
 	const duihuanmaDialogRef = ref(null);
+	const bannerArr = ref(null);
 
 	const exitLogin = () => {
 		exitDialogRef.value.handleShow();
@@ -282,6 +285,19 @@
 			myInfoData.userName = res.data.userName;
 			myInfoData.credit = res.data.credit;
 		})
+		getMyCardList();
+	}
+	// 登录人员的cardlist
+	function getMyCardList(){
+		myCardList({}).then(res => {
+			bannerArr.value = res.data;
+		})
+	}
+	// 游客的cardList
+	function getCommonCardList(){
+		commonCardList({}).then(res => {
+			bannerArr.value = res.data;
+		})
 	}
 
 	// 获取用户头像
@@ -305,19 +321,11 @@
 
 		}
 	}
-	// 会员权益按钮
-	function hyqyBtn(index) {
-		let cardId = index + 1;
-		/* index为学科 1数学 2英语 */
-		if (loginFlag.value) {
-			// 非游客
-			uni.redirectTo({
-				url: `/pages/pay/svip?cardId=${cardId}&formPage=my`
-			})
-		} else {
-			// 游客
-			youkeDialogRef.value.handleShow();
-		}
+	// 点击card
+	function hyqyBtn(data) {
+		uni.redirectTo({
+			url: '/pages/mall/mallPage?cardId='+data.id+'&subjectId='+data.subjectId+'&from=myPage'
+		})
 	}
 
 	// 判断是否是游客
@@ -333,6 +341,8 @@
 
 	// 游客
 	function youkeFun() {
+		// 获取广告
+		getCommonCardList();
 		zhangId.value = routerOpt.zhangId
 		nianji.value = routerOpt.nianji
 		cardId.value = routerOpt.cardId
@@ -349,39 +359,6 @@
 		getMyInfo();
 	}
 
-	// 获取会员权益card class
-	function getHyqyClass(index) {
-		// let VipIndex = index + 1;
-		// if (cacheManager.get('auth')) {
-		// 	// 非游客
-		// 	let VipArr = cacheManager.get('auth').cardList;
-		// 	if (VipArr.includes(VipIndex)) {
-		// 		return 'hyqy-box' + VipIndex;
-		// 	} else {
-		// 		return 'hyqy-disabled-box' + VipIndex;
-		// 	}
-		// } else {
-		// 	// 游客
-		// 	return 'yk-disabled-box';
-		// }
-
-	}
-
-	//获取会员权益按钮是否显示
-	function getHyqyBtn(index) {
-		// let VipIndex = index + 1;
-		// if (cacheManager.get('auth')) {
-		// 	let VipArr = cacheManager.get('auth').cardList;
-		// 	if (VipArr.includes(VipIndex)) {
-		// 		return false;
-		// 	} else {
-		// 		return true;
-		// 	}
-		// } else {
-		// 	// 游客
-		// 	return false;
-		// }
-	}
 	function isIOSorAndroid(){
 		const systemInfo = uni.getSystemInfoSync();
 		

+ 16 - 50
pages/study/product/shuxueNew.vue

@@ -1,13 +1,8 @@
 <template>
-	<view class="ezy-study-page ezy-shuxue-study-page">
+	<view class="ezy-study-page ezy-jstx-study-page">
 		<view class="study-school-year" @click="clickGradeTerm">{{gradeTerm}}</view>
 		<view class="ezy-study-wrap">
-			<view class="chapter-box" @click="handleCheckCatalogue">{{options.numberStr}}</view>
-			<view @click="handleCheckCatalogue" :class="getTitleClass(options.zhangName)">
-				{{getZhangName(options.zhangName)}}
-			</view>
-			<!-- 动物类型 -->
-			<view v-if="growthType!=null" :class="currentGrowth()"></view>
+			<img class="study-name-img" :src="growthImg"/>
 			<view>
 				<!-- 小岛 -->
 				<view class="brand-item" v-for="(item, index) in options.jieList" :key="item.jieId"
@@ -20,31 +15,29 @@
 						<!-- 箭头 -->
 						<view v-if="item.daeFlag &&animalNum == index" class="brand-arrow"></view>
 						<!-- 节名称 -->
-						<view class="brand-content">{{ item.jieName }}</view>
+						<view class="brand-content"><text>{{ item.jieName }}</text></view>
 					</view>
 					<view v-if="isVip == 'Not-Vip'">
-						<!-- 序号或锁 -->
-						<view v-if="options.number ==1 && item.firstFlag ==1" class="brand-icon">{{ item.number }}
-						</view>
+						<!-- 序号 -->
+						<view v-if="options.number ==1 && item.firstFlag ==1" class="brand-icon">{{ item.number }} </view>
+						<!-- 锁 -->
 						<view v-else class="brand-lock"></view>
 						<!-- 箭头 -->
-						<view v-if="item.daeFlag  &&  animalNum == index &&isVip != 'Visitor'" class="brand-arrow">
-						</view>
+						<view v-if="item.daeFlag  &&  animalNum == index &&isVip != 'Visitor'" class="brand-arrow"> </view>
 						<!-- 节名称 -->
-						<view class="brand-content"> {{ item.jieName }} </view>
+						<view class="brand-content"><text>{{ item.jieName }}</text></view>
 					</view>
 					
+					
 					<view v-if="isVip == 'Visitor'">
-						<!-- 序号或锁 -->
-						<view   class="brand-icon">{{ item.number }}
-						</view>
+						<!-- 序号 -->
+						<view   class="brand-icon">{{ item.number }} </view>
 						<!-- 锁 -->
 						<view  v-if="options.number !='1' || item.type==2"  class="brand-lock"></view>
 						<!-- 箭头 -->
-						<view v-if="item.daeFlag  &&  animalNum == index &&isVip != 'Visitor'" class="brand-arrow">
-						</view>
+						<view v-if="item.daeFlag  &&  animalNum == index &&isVip != 'Visitor'" class="brand-arrow"> </view>
 						<!-- 节名称 -->
-						<view class="brand-content"> {{ item.jieName }} </view>
+						<view class="brand-content"><text>{{ item.jieName }}</text></view>
 					</view>
 				</view>
 			</view>
@@ -70,8 +63,10 @@
 		onShow
 	} from '@dcloudio/uni-app';
 	const growthType = ref(null);
+	const growthImg = ref(null);
 	onShow(() => {
-		growthType.value = cacheManager.get('auth') ? cacheManager.get('auth').growthType : null
+		growthType.value = cacheManager.get('auth') ? cacheManager.get('auth').growthType : null;
+		growthImg.value = cacheManager.get('auth') ? cacheManager.get('zhangInfo').icon : null;
 	})
 
 	const $emit = defineEmits(['clickGradeTerm', 'onLeft', 'onRight', 'handleCheckCatalogue', 'listClick'])
@@ -154,18 +149,6 @@
 		return firstLine + '\n' + secondLine;
 	}
 
-	// 章class
-	function getTitleClass(data) {
-
-		if (data.length <= 5) {
-			return 'chapter-title-box chapter-small-title-box'
-		} else if (data.length <= 9) {
-			return 'chapter-title-box chapter-middle-title-box'
-		} else if (data.length > 9) {
-			return 'chapter-title-box chapter-big-title-box'
-		}
-	}
-
 	// 获取节class
 	function getClass(data, index, isVip,item) {
 		//	console.log('data',data);
@@ -179,24 +162,7 @@
 		} else {
 			brandActive = '';
 		}
-		let indexLast = data.jieList.length - 1;
-		// 判断最后一个为名称是否为单元测试,是单元测试则返回ceshi-jie
-		if (index === indexLast && data.jieList[data.jieList.length - 1].jieName == '单元测试') {
-			return 'ceshi-brand-item' + ' ' + brandActive;
-		} else {
-			return getJieClass(data, index, brandActive)
-		}
 	}
-	// 根据获取节字数获取class
-	function getJieClass(data, index, active) {
-		let itemJieName = data.jieList[index].jieName.length;
-		if (itemJieName > 7) {
-			return 'big-brand-item' + ' ' + active;
-		} else {
-			return 'small-brand-item' + ' ' + active;
-		}
-	}
-
 
 
 	function handleCheckCatalogue() {

TEMPAT SAMPAH
static/images/my/hyqy-btn.png


TEMPAT SAMPAH
static/images/my/hyqy-img-disabled1.png


TEMPAT SAMPAH
static/images/my/hyqy-img-disabled2.png


TEMPAT SAMPAH
static/images/my/hyqy-img1.png


TEMPAT SAMPAH
static/images/my/hyqy-img2.png


TEMPAT SAMPAH
static/images/my/hyqy-img3.png


TEMPAT SAMPAH
static/images/study/jstx/study-wrap-bj.png