caojunjie 1 年之前
父節點
當前提交
f7b3c4847f
共有 4 個文件被更改,包括 88 次插入21 次删除
  1. 1 1
      manifest.json
  2. 1 1
      pages/tabBar/classification.vue
  3. 84 17
      pages/tabBar/home.vue
  4. 2 2
      pages/views/buyGoods/commodityDetails.vue

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "易车配轮胎批发精灵",
-    "appid" : "__UNI__E1B82BE",
+    "appid" : "__UNI__1EEACB7",
     "description" : "",
     "versionName" : "1.0.32",
     "versionCode" : 32,

+ 1 - 1
pages/tabBar/classification.vue

@@ -74,7 +74,7 @@
 			}
 		},
 		onShow() {
-			listAll().then(res => {
+			listAll({type:'PP'}).then(res => {
 				this.tabbarTwo = res.data
 				this.page = {
 					total: 0,

+ 84 - 17
pages/tabBar/home.vue

@@ -5,9 +5,16 @@
 				<u-search placeholder="请输入商品名称" inputAlign="center" bgColor="#fff" shape="square" v-model="search.cname"
 					@search="searchButton" @custom="searchButton" :animation="true"></u-search>
 			</view>
-			<view style="margin: -15rpx auto 10rpx auto;display: flex;padding: 0 20rpx;z-index: 999;" v-if="show == true">
-				<u-tag :text="search.brandNmae" borderColor="#FD4B09" color="#FD4B09" plain size="medium" closable
+			<view style="margin: -15rpx auto 10rpx auto;display: flex;padding: 0 20rpx;z-index: 999;" >
+				<u-tag :text="search.brandNmae" borderColor="#FD4B09" color="#FD4B09" plain size="medium" closable v-if="show == true"
 					:show="show" @close="close" @click="close"></u-tag>
+					
+				<u-tag text="原厂" borderColor="#FD4B09" color="#FD4B09" plain size="medium" closable v-if="originalFactory"
+					:show="originalFactory" @close="yuanchangclose('originalFactory')" @click="yuanchangclose('originalFactory')"></u-tag>
+				<u-tag text="自修补" borderColor="#FD4B09" color="#FD4B09" plain size="medium" closable v-if="selfRecovery"
+					:show="selfRecovery" @close="yuanchangclose('selfRecovery')" @click="yuanchangclose('selfRecovery')"></u-tag>
+				<u-tag text="防爆" borderColor="#FD4B09" color="#FD4B09" plain size="medium" closable v-if="explosionProof"
+					:show="explosionProof" @close="yuanchangclose('explosionProof')" @click="yuanchangclose('explosionProof')"></u-tag>
 			</view>
 		</view>
 		<view :style="{marginTop:show == true?'164rpx':'108rpx'}">
@@ -30,7 +37,25 @@
 						</view>
 					</u-grid-item>
 				</u-grid>
-			</view>
+			</view>
+			
+			
+			<view style="margin-top: 10rpx;display: flex;justify-content: space-around;">
+				<view style="display: flex;align-items: center;" @click="dianjiqiehuan('originalFactory')">
+					<view style="margin-right: 10rpx;" :style="originalFactory?'color:#4070fc':''">原厂</view>
+					<!-- <u-switch v-model="originalFactory"></u-switch> -->
+				</view>
+				<view style="display: flex;align-items: center;" @click="dianjiqiehuan('selfRecovery')">
+					<view style="margin-right: 10rpx;" :style="selfRecovery?'color:#4070fc':''">自修补</view>
+					<!-- <u-switch v-model="selfRecovery"></u-switch> -->
+				</view>
+				<view style="display: flex;align-items: center;" @click="dianjiqiehuan('explosionProof')">
+					<view style="margin-right: 10rpx;" :style="explosionProof?'color:#4070fc':''">防爆</view>
+					<!-- <u-switch v-model="explosionProof"></u-switch> -->
+				</view>
+			</view>
+			
+			
 			<view style="padding: 20rpx 20rpx;">
 				<u-divider text="爆品推荐"></u-divider>
 			</view>
@@ -113,7 +138,13 @@
 					'https://td.echepei.com/file/applets/temporary/images/swiper2.jpg',
 					'https://td.echepei.com/file/applets/temporary/images/swiper3.jpg'
 				],
-				brandList: []
+				brandList: [],
+				// 原厂
+				originalFactory:0,
+				// 自修补
+				selfRecovery:0,
+				// 防爆
+				explosionProof:0
 			}
 		},
 		onReachBottom() {
@@ -154,15 +185,36 @@
 				uni.$u.route('/pages/views/personalInformation/index');
 			})
 		},
-		methods: {
+		methods: {
+			// 点击筛选条件
+			dianjiqiehuan(name){
+				if (this[name] == 0) {
+					this[name] = 1
+				}else {
+					this[name] = 0
+				}
+				this.click()
+			},
+			// 获取列表数据
 			onSearch() {
 				uni.showLoading({
 					title: '加载中',
 					mask: true
-				});
+				});
+				let obj = {}
+				if(this.originalFactory){
+					obj.originalFactory = 1
+				}
+				if (this.selfRecovery){
+					obj.selfRecovery = 1
+				}
+				if (this.explosionProof) {
+					obj.explosionProof = 1
+				}
 				appList({
 					size: this.page.size,
-					current: this.page.current,
+					current: this.page.current,
+					...obj,
 					...this.search
 				}).then(res => {
 					this.dataList = this.dataList.concat(res.data.records)
@@ -179,20 +231,35 @@
 				this.show = false
 				this.search.brandId = ''
 				this.search.brandName = ''
-			},
-			click(name) {
+			},
+			// 原厂点击差号
+			yuanchangclose(type){
+				if (type == 'originalFactory') {
+					this.originalFactory = false
+				}else if (type == 'selfRecovery') {
+					this.selfRecovery = false
+				}else {
+					this.explosionProof = false
+				}
+				this.click()
+			},
+			
+			click(name) {
+				console.log(name,239);
 				this.page = {
 					total: 0,
 					size: 10,
-					current: 1
+					current: 1,
+				}
+				this.dataList = []
+				if (name) {
+					this.search = {
+						...this.search,
+						brandId: this.brandList[name].id,
+						brandNmae: this.brandList[name].cname,
+					}
+					this.show = true
 				}
-				this.dataList = []
-				this.search = {
-					...this.search,
-					brandId: this.brandList[name].id,
-					brandNmae: this.brandList[name].cname,
-				}
-				this.show = true
 				this.onSearch()
 			},
 			searchButton(value) {

+ 2 - 2
pages/views/buyGoods/commodityDetails.vue

@@ -80,10 +80,10 @@
 				</u-cell>
 				<u-cell :isLink="false" :border="false" center>
 					<template slot="title">
-						<text>原厂:{{form.originalFactory||''}}</text>
+						<text>原厂:{{form.originalFactory==1?'是':'否'}}</text>
 					</template>
 					<template slot="value">
-						<text>自修补:{{form.selfRecovery||''}}</text>
+						<text>自修补:{{form.selfRecovery==1?'是':'否'}}</text>
 					</template>
 				</u-cell>
 			</u-cell-group>