future 1 an în urmă
părinte
comite
fef449272a

+ 1 - 22
xs-app/pages/bookstore/bookstore.vue

@@ -2,7 +2,7 @@
 	<view class="content">
 		<view class="content__container" v-for="(item,index) in data_list" :key="index">			
 			<templateSearch v-if="item.template_type==config.template_stype.SEARCH" ></templateSearch>
-			<templateBanner v-if="item.template_type==config.template_stype.BANNER" :dataList='item.list' ></templateBanner>
+			<templateBanner v-if="item.template_type==config.template_stype.BANNER" :dataList='item.list' @clickBook='clickBook'></templateBanner>
 			<templateBookH3 v-if="item.template_type==config.template_stype.H_3" :dataList='H3_data_list' @clickBook='clickBook'></templateBookH3>
 			<templateBookV3 v-if="item.template_type==config.template_stype.V_3" :dataList='item.list' @clickBook='clickBook'></templateBookV3>
 			<templateBookList v-if="item.template_type==config.template_stype.LIST" :dataList='item.list' @clickBook='clickBook'></templateBookList>
@@ -17,7 +17,6 @@
 	import templateBookV3 from '../bookstore/template/template-book-V-3.vue'
 	import templateBookList from '../bookstore/template/template-book-List.vue'
     import { ref } from 'vue';
-    import { util } from '../../framework/util';
     import { bookstore_template_data, book_item_data } from '../../data/data';
     import { tools } from '../../framework/tools';
     import { http } from '../../framework/http';
@@ -50,26 +49,6 @@
 				log.Error(err)
 			}
 		})
-		// let test_data = 
-		// [{'id':1,'n':'玄鉴仙族','c':'https://www.uuks5.com/cover/766295.jpg'},
-		// {'id':2,'n':'走进不科学','c':'https://www.mayiwsk.com/files/article/image/88/88817/88817s.jpg'},
-		// {'id':3,'n':'光阴之外','c':'https://www.deqixs.com/files/cover/202304/91c935a0-be7c-450f-bedb-aab07a242207.jpg'},
-		// {'id':4,'n':'全球灾变:我召唤无限军团横推万物','c':'https://bookcover.yuewen.com/qdbimg/349573/1036611416/600.webp'},
-		// {'id':5,'n':'这游戏也太真实了','c':'https://img.22biqu.com/4/4729/4729s.jpg'},
-		// {'id':6,'n':'全球冰封,我囤积了千亿物资','c':'http://img.shulala.org/90/90967/90967s.jpg'}]
-		
-		// for (let i = 0; i < test_data.length; i++) {
-		// 	let element = test_data[i]
-		// 	let book_data = new book_item_data()
-		// 	book_data.book_id = element.id
-		// 	book_data.book_name = element.n
-		// 	book_data.book_cover = element.c
-		// 	if(i<3) {
-		// 		book_3_data_list.value.push(book_data)
-		// 	} else {
-		// 		book_3_data_list_1.value.push(book_data)
-		// 	}
-		// }
 	}
 	
 	function clickBook(data:book_item_data) {

+ 12 - 3
xs-app/pages/bookstore/template/template-book-Banner.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="book-Banner-content">
 		<swiper class="swiper" :indicator-dots="true" :autoplay="true" :interval="3000" :duration="500" :circular="true">
-			<swiper-item v-for="(item, index) in dataList" :key="index" @click="clickToItem(item)">
+			<swiper-item v-for="(item, index) in dataList" :key="index" @click="clickItem(item)">
 				<image class="banner" :src="item.cover" mode=""></image>
 			</swiper-item>
 		</swiper>
@@ -9,15 +9,25 @@
 </template>
 
 <script setup lang="ts">
+    import { banner_data, book_item_data } from '../../../data/data';
 	defineProps({
 		dataList: Array,
 	})
+	const emits = defineEmits(['clickBook'])
+	
+	function clickItem(data:banner_data) {
+		// 跳转类型 0 不跳转 1 小说 2 公告
+		if(data.jump_type==1) {
+			let book_data = new book_item_data()
+			book_data.book_id = data.jump_id
+			emits('clickBook',book_data)
+		}
+	}
 </script>
 
 <style lang="scss">
 	.book-Banner-content{
 		display: flex;
-		// height: 280rpx;
 		justify-content: center; //水平居中
 		align-items: center; //垂直居中
 		overflow: hidden;//内容超出隐藏
@@ -30,7 +40,6 @@
 			.banner{
 				width: 100%;
 				height: 100%;
-				// border-radius: 20rpx;
 				// background-color: orange;
 			}
 		}