Browse Source

2021-12-3

hwq 3 years ago
parent
commit
0f807dfe8e

+ 6 - 40
pages.json

@@ -11,29 +11,13 @@
 					"titleNView": {
 						"type": "transparent",
 						"searchInput": {
-							"backgroundColor": "rgba(231, 231, 231,.7)",
+							"backgroundColor": "#ffffff",
 							"borderRadius": "16px",
 							"placeholder": "请输入关键字",
 							"disabled": true,
-							"placeholderColor": "#606266",
-							"align": "left"
-						},
-						"buttons": [{
-								"fontSrc": "/static/yticon.ttf",
-								"text": "\ue60d",
-								"fontSize": "26",
-								"color": "#303133",
-								"float": "left",
-								"background": "rgba(0,0,0,0)"
-							},
-							{
-								"fontSrc": "/static/yticon.ttf",
-								"text": "\ue744",
-								"fontSize": "27",
-								"color": "#303133",
-								"background": "rgba(0,0,0,0)"
-							}
-						]
+							"placeholderColor": "#B5B5B5",
+							"align": "center"
+						}
 					}
 				},
 				// #endif
@@ -348,25 +332,7 @@
 		{
 			"path": "pages/category/category",
 			"style": {
-				// #ifdef APP-PLUS
-				"navigationStyle": "custom",
-				// #endif
-				// #ifndef MP
-				"app-plus": {
-					"bounce": "none",
-					"titleNView": {
-						"searchInput": {
-							"backgroundColor": "rgba(231, 231, 231,.7)",
-							"borderRadius": "16px",
-							"placeholder": "商品搜索",
-							"disabled": true,
-							"placeholderColor": "#606266",
-							"align": "left"
-						}
-					}
-				},
-				// #endif
-				"navigationBarTitleText": "分类"
+				"navigationBarTitleText": "品牌故事"
 			}
 		},
 		{
@@ -424,7 +390,7 @@
 	},
 	"tabBar": {
 		"color": "#C0C4CC",
-		"selectedColor": "#5DBC7C",
+		"selectedColor": "#5ad5eb",
 		"borderStyle": "black",
 		"backgroundColor": "#ffffff",
 		"list": [{

+ 1 - 175
pages/category/category.vue

@@ -1,19 +1,6 @@
 <template>
 	<view class="content">
-		<scroll-view scroll-y class="left-aside">
-			<view v-for="item in flist" :key="item.id" class="f-item b-b" :class="{ active: item.id === currentId }" @click="tabtap(item)">{{ item.cate_name }}</view>
-		</scroll-view>
-		<scroll-view scroll-with-animation scroll-y class="right-aside" @scroll="asideScroll" :scroll-top="tabScrollTop">
-			<view v-for="item in flist" :key="item.id" class="s-list" :id="'main-' + item.id">
-				<text class="s-item">{{ item.cate_name }}</text>
-				<view class="t-list ">
-					<view @click="navToList(item.id, titem.id)" class="t-item" v-for="titem in item.children" :key="titem.id">
-						<image :src="titem.pic"></image>
-						<text>{{ titem.cate_name }}</text>
-					</view>
-				</view>
-			</view>
-		</scroll-view>
+		
 	</view>
 </template>
 
@@ -22,100 +9,15 @@ import { getCategoryList } from '@/api/product.js';
 export default {
 	data() {
 		return {
-			sizeCalcState: false,
-			tabScrollTop: 0,
-			currentId: 9,
-			flist: [],
 		};
 	},
 	onLoad() {
 		this.loadData();
 	},
-	// 监听导航栏输入框点击事件
-	onNavigationBarSearchInputClicked(e) {
-		uni.navigateTo({
-			url: '/pages/product/search'
-		});
-	},
 	methods: {
 		// 载入数据
 		async loadData() {
 			let obj = this;
-			getCategoryList({})
-				.then(({ data }) => {
-					obj.flist = data.map(function(s) {
-						return s;
-					});
-				})
-				.catch(err => {
-					console.log(err);
-				});
-		},
-		//一级分类点击
-		tabtap(item) {
-			console.log(item);
-			// 判断有没有初始化页面高度对象数据
-			if (!this.sizeCalcState) {
-				this.calcSize();
-			}
-			// 获取当前点击的id
-			this.currentId = item.id;
-			console.log(item.top);
-			this.tabScrollTop = item.top;
-			console.log(this.tabScrollTop);
-		},
-		//右侧栏滚动
-		asideScroll(e) {
-			// 判断有没有初始化页面高度对象数据
-			if (!this.sizeCalcState) {
-				this.calcSize();
-			}
-			let scrollTop = e.detail.scrollTop;
-			let box = 0; //列表包裹框高度初始化
-			let bottom = 10; //距离页面底部多少像素左侧列表切换到最后一个一级分类
-			// 查询当前页面对象
-			let view = uni.createSelectorQuery().select('.content');
-			view.fields(
-				{
-					id: true,
-					dataset: true,
-					rect: true,
-					size: true,
-					scrollOffset: true
-				},
-				function(e) {
-					// 保存包裹框高度
-					box = e.height;
-				}
-			).exec();
-			// 获取所有距离顶部大于滚轮距离页面高度的所有分类
-			let tabs = this.flist.filter(item =>( item.top-10) <= scrollTop).reverse();
-			if (tabs.length > 0) {
-				// 判断是否已经到达滚轮底部
-				if (box + scrollTop + bottom >= e.detail.scrollHeight) {
-					this.currentId = this.flist[this.flist.length - 1].id;
-				} else {
-					this.currentId = tabs[0].id;
-				}
-			}
-		},
-		//计算右侧栏每个tab的高度等信息
-		calcSize() {
-			let h = 0;
-			this.flist.forEach(item => {
-				let view = uni.createSelectorQuery().select('#main-' + item.id);
-				view.fields(
-					{
-						size: true
-					},
-					data => {
-						item.top = h;
-						h += data.height;
-						item.bottom = h;
-					}
-				).exec();
-			});
-			this.sizeCalcState = true;
 		},
 		navToList(sid, tid) {
 			// 点击导航跳转到详细页面
@@ -137,80 +39,4 @@ page,
 .content {
 	display: flex;
 }
-.left-aside {
-	flex-shrink: 0;
-	width: 200rpx;
-	height: 100%;
-	background-color: #fff;
-}
-.f-item {
-	display: flex;
-	align-items: center;
-	justify-content: center;
-	width: 100%;
-	height: 100rpx;
-	font-size: 28rpx;
-	color: $font-color-base;
-	position: relative;
-	&.active {
-		color: $base-color;
-		background: #f8f8f8;
-		&:before {
-			content: '';
-			position: absolute;
-			left: 0;
-			top: 50%;
-			transform: translateY(-50%);
-			height: 36rpx;
-			width: 8rpx;
-			background-color: $base-color;
-			border-radius: 0 4px 4px 0;
-			opacity: 0.8;
-		}
-	}
-}
-
-.right-aside {
-	flex: 1;
-	overflow: hidden;
-	padding-left: 20rpx;
-	padding-right: 20rpx;
-}
-.s-item {
-	display: flex;
-	align-items: center;
-	height: 70rpx;
-	padding-top: 8rpx;
-	font-size: 28rpx;
-	color: $font-color-dark;
-}
-.t-list {
-	display: flex;
-	flex-wrap: wrap;
-	border-radius: 15rpx;
-	width: 100%;
-	background: #fff;
-	padding-top: 12rpx;
-	&:after {
-		content: '';
-		flex: 99;
-		height: 0;
-	}
-}
-.t-item {
-	flex-shrink: 0;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	flex-direction: column;
-	width: 171rpx;
-	font-size: 26rpx;
-	color: #666;
-	padding-bottom: 20rpx;
-
-	image {
-		width: 140rpx;
-		height: 140rpx;
-	}
-}
 </style>

File diff suppressed because it is too large
+ 99 - 761
pages/index/index.vue


BIN
static/icon/c3.png


BIN
static/icon/c5.png


BIN
static/icon/c6.png


BIN
static/icon/c7.png


BIN
static/icon/c8.png


BIN
static/img/jiantou.png


BIN
static/tabBar/dingdan.png


BIN
static/tabBar/home.png


BIN
static/tabBar/tab-cart-current.png


BIN
static/tabBar/tab-cart.png


BIN
static/tabBar/tab-cate-current.png


BIN
static/tabBar/tab-cate.png


BIN
static/tabBar/tab-home-current.png


BIN
static/tabBar/tab-home.png


BIN
static/tabBar/tab-my-current.png


BIN
static/tabBar/tab-my.png


Some files were not shown because too many files changed in this diff