Browse Source

鑫动力,鑫畅途 客户品牌自定义

caojunjie 1 year ago
parent
commit
03dd5f3c2c
3 changed files with 287 additions and 274 deletions
  1. 2 2
      pages.json
  2. 2 1
      pages/login/login.vue
  3. 283 271
      pages/tabBar/classification.vue

+ 2 - 2
pages.json

@@ -28,7 +28,7 @@
 	}, {
 		"path": "pages/tabBar/classification",
 		"style": {
-			"navigationBarTitleText": "分类"
+			"navigationBarTitleText": "商品"
 		}
 	},{
 		"path": "pages/tabBar/pointsMall",
@@ -214,7 +214,7 @@
 			"pagePath": "pages/tabBar/classification",
 			"iconPath": "static/images/tabBar/classification.png",
 			"selectedIconPath": "static/images/tabBar/classification_selected.png",
-			"text": "分类"
+			"text": "商品"
 		},{
 			"pagePath": "pages/tabBar/activity/index",
 			"iconPath": "static/images/tabBar/home.png",

+ 2 - 1
pages/login/login.vue

@@ -69,7 +69,8 @@
 				this.checked = !this.checked
 			},
 			//当前登录按钮操作
-			getPhoneNumber(e) {
+			getPhoneNumber(e) {
+				console.log(e,73);
 				let this_ = this
 				if(this.checkboxValue1.length == 0) return uni.showToast({icon: 'none',title: '请勾选用户协议',position: "bottom",mask: true})
 				if (e.detail.errMsg == 'getPhoneNumber:ok') {

+ 283 - 271
pages/tabBar/classification.vue

@@ -1,10 +1,10 @@
-<template>
+<template>
 	<view>
 		<view class="u-wrap">
 			<view class="u-search-box">
 				<u-tabs :list="tabbar" @click="click" lineColor="#fff" :activeStyle="{ color: '#fff' }"
 					:inactiveStyle="{ color: '#ffffff80' }">></u-tabs>
-				<view style="padding: 10rpx;">
+				<view style="padding: 10rpx; font-size: 40rpx;">
 					<u-search placeholder="请输入商品名称" :actionStyle="{ color: '#fff' }" v-model="name"
 					@search="custom" @custom="custom" :animation="false"></u-search>
 				</view>
@@ -19,7 +19,7 @@
 						<u-icon name="trash" size="20px" @click="searchDeleteShow = true" ></u-icon>
 					</view>
 				</view>
-				
+
 				<!-- <view>
 					<view class="searchBox" id="searchDis">
 						<view v-for="(item,index) in searcheslist" :key="index" class="searchItem" >{{item}}</view>
@@ -32,18 +32,18 @@
 						</view>
 					</view>
 				</view> -->
-				
+
 				<view class="recentSearches-text">
 					<u-tag v-for="(item,index) in recentSearches" :key="index"
-					:text="item" bgColor="#e7e7e7" color="#000" borderColor="#e7e7e7" 
-					size="medium" closable :show="item" 
+					:text="item" bgColor="#e7e7e7" color="#000" borderColor="#e7e7e7"
+					size="medium" closable :show="item"
 					@close="tagClose(index)" @click.stop="tagSearches(item)" ></u-tag>
 					<!-- <u-tag text="展开" bgColor="#e7e7e7" color="#000" borderColor="#e7e7e7"
 					size="medium" ></u-tag> -->
 				</view>
-				
+
 			</view>
-			<view style="margin: 20rpx 40rpx;display: flex;align-items: center;">
+			<view style="margin: 20rpx 10rpx;display: flex;align-items: center;">
 				<u-radio-group
 				    v-model="checkboxValue"
 				    placement="row"
@@ -59,12 +59,16 @@
 					    name="自修补">
 					</u-radio>
 					<u-radio
-					    :customStyle="{marginBottom: '8px',marginRight:'30rpx'}"
+					    :customStyle="{marginBottom: '8px'}"
 					    label="防爆"
 					    name="防爆">
 					</u-radio>
 				</u-radio-group>
-				<view><u-button type="warning" size="small" text="清空条件" @click="emptyfun" ></u-button></view>
+
+				<u-switch v-model="search.whether" size="22"
+				activeValue="1" inactiveValue="0" @change="dataList=[];onSearch()"></u-switch>
+
+				<view style="margin-left: 20rpx;"><u-button type="warning" size="small" text="清空" @click="emptyfun" ></u-button></view>
 			</view>
 			<view class="u-menu-wrap">
 				<view class="u-tab-view">
@@ -101,7 +105,7 @@
 														库存:{{Number(itemTwo.inventory) > 10?'充足':Number(itemTwo.inventory)}}
 													</view>
 												</view>
-												<view style="padding: 8rpx;border-radius: 50%;background: #edeef2;display: flex;align-items: center;justify-content: center;" 
+												<view style="padding: 8rpx;border-radius: 50%;background: #edeef2;display: flex;align-items: center;justify-content: center;"
 													@click.stop="shoppingCartfun(itemTwo)">
 													<u-icon name="shopping-cart" color="#dd4919" size="28"></u-icon>
 												</view>
@@ -116,17 +120,17 @@
 				</scroll-view>
 			</view>
 		</view>
-		
+
 		<u-modal :show="searchDeleteShow" content="确认删除搜索记录吗?" showCancelButton
 			@confirm="searchDeletefun" @cancel="searchDeleteShow = false"
 			ref="uModal" :asyncClose="true">
 		</u-modal>
-		
-		<view v-if="userInfo.tenant_id != '000000'" class="suspensionBox" 
+
+		<view v-if="userInfo.tenant_id != '000000'" class="suspensionBox"
 		@click="salesmanShow=true">
 			<u-icon name="server-fill" color="#2979ff" size="40"></u-icon>
 		</view>
-		
+
 		<u-modal :show="salesmanShow" title="是否要拨打业务员联系方式" showCancelButton
 		@confirm="clickCall"  @cancel="salesmanShow=false">
 			<view class="slot-content">
@@ -134,12 +138,12 @@
 				<view>联系方式:{{phoneNumber?phoneNumber:''}}</view>
 			</view>
 		</u-modal>
-	</view>
-</template>
-<script>
-	import {
-		listAll,
-		goodsList
+	</view>
+</template>
+<script>
+	import {
+		listAll,
+		goodsList
 	} from '@/api/tabBar/classification.js'
 	import {
 		details,
@@ -148,37 +152,39 @@
 	import {
 		appDetail,
 		addToCart
-	} from '@/api/tabBar/home.js'
-	export default {
-		data() {
-			return {
-				current: 0, // 预设当前项的值
-				tabbar: [],
-				dataList: [],
-				show: false,
-				status: 'loadmore',
-				filesList: [],
-				tabbarTwo: [],
-				name: '',
-				page: {
-					total: 0,
-					size: 10,
-					current: 1
-				},
-				search: {},
+	} from '@/api/tabBar/home.js'
+	export default {
+		data() {
+			return {
+				current: 0, // 预设当前项的值
+				tabbar: [],
+				dataList: [],
+				show: false,
+				status: 'loadmore',
+				filesList: [],
+				tabbarTwo: [],
+				name: '',
+				page: {
+					total: 0,
+					size: 10,
+					current: 1
+				},
+				search: {
+					whether:'0'
+				},
 				checkStatus:null,
 				recentSearches:[], // 搜索数据
-				searchDeleteShow:false, // 搜索全部删除弹窗 
+				searchDeleteShow:false, // 搜索全部删除弹窗
 				form:{}, // 详情数据
 				checkboxValue:'', // 多选
 				salesmanName:'', // 业务员姓名
 				phoneNumber:'', // 业务员联系电话
 				salesmanShow:false, // 联系业务员弹窗
-				userInfo:{}, // 当前用户数据
-			}
+				userInfo:{}, // 当前用户数据
+			}
 		},
 		mounted() {
-		},
+		},
 		onLoad() {
 			// 获取审核状态
 			details().then(res => {
@@ -193,7 +199,7 @@
 					uni.switchTab({
 						url:'/pages/tabBar/home'
 					})
-					return 
+					return
 				}
 				this.salesmanName = res.data.salesmanName
 				// 查询业务员详情拿取手机号
@@ -202,13 +208,13 @@
 						this.phoneNumber = res.data.phone
 					})
 				}
-			})
-			listAll({type:'PP', enableOrNot:'1'}).then(res => {
-				this.tabbarTwo = res.data
-				this.page = {
-					total: 0,
-					size: 10,
-					current: 1
+			})
+			listAll({type:'PP', enableOrNot:'1'}).then(res => {
+				this.tabbarTwo = res.data
+				this.page = {
+					total: 0,
+					size: 10,
+					current: 1
 				}
 				this.dataList = []
 				let searchCache = JSON.parse(JSON.stringify(uni.getStorageSync('homeSearch')))
@@ -222,23 +228,24 @@
 						this.current = 0
 					}
 					this.search = {
-						brandId: this.tabbarTwo[this.current].id
+						brandId: this.tabbarTwo[this.current].id,
+						whether:'0',
 					}
 					this.onSearch()
-				}
-			})
-		},
+				}
+			})
+		},
 		onShow() {
 			this.userInfo = uni.getStorageSync('userInfo')
 			// 获取最近搜索数据
 			if(uni.getStorageSync('recentSearches')) {
-				this.recentSearches = uni.getStorageSync('recentSearches'); 
+				this.recentSearches = uni.getStorageSync('recentSearches');
 			}
 		},
 		methods: {
 			// 点击联系业务员
 			clickCall() {
-				
+
 				uni.makePhoneCall({
 					phoneNumber: this.phoneNumber,
 					success: function() {
@@ -254,7 +261,9 @@
 				this.name = ''
 				this.current = -1
 				this.checkboxValue = ''
-				this.search = {}
+				this.search = {
+					whether:'0'
+				}
 				this.page = {
 					total: 0,
 					size: 10,
@@ -295,7 +304,7 @@
 						mask:true,
 						duration:2500
 					});
-					return 
+					return
 				}
 				// 获取详情数据
 				appDetail({id:row.id}).then(res=>{
@@ -319,7 +328,7 @@
 						})
 					})
 				})
-				
+
 			},
 			// 搜索全部删除
 			searchDeletefun(){
@@ -371,44 +380,44 @@
 				this.dataList = []
 				this.onSearch()
 			},
-			// 左侧选择
-			swichMenu(index) {
-				this.current = index;
-				this.page = {
-					total: 0,
-					size: 10,
-					current: 1
+			// 左侧选择
+			swichMenu(index) {
+				this.current = index;
+				this.page = {
+					total: 0,
+					size: 10,
+					current: 1
 				}
 				this.search.brandId = this.tabbarTwo[this.current].id
-				this.search.cname = this.name?this.name:null
-				this.dataList = []
-				this.onSearch()
+				this.search.cname = this.name?this.name:null
+				this.dataList = []
+				this.onSearch()
+			},
+			// 列表数据获取
+			onSearch() {
+				uni.showLoading({
+					title: '加载中',
+					mask: true
+				});
+				goodsList({
+					size: this.page.size,
+					current: this.page.current,
+					...this.search
+				}).then(res => {
+					this.dataList = this.dataList.concat(res.data.records)
+					this.page.total = res.data.total
+					if (this.dataList.length == res.data.total) {
+						this.status = 'nomore'
+					}
+					uni.hideLoading();
+				}).catch(err => {
+					uni.hideLoading();
+				})
 			},
-			// 列表数据获取
-			onSearch() {
-				uni.showLoading({
-					title: '加载中',
-					mask: true
-				});
-				goodsList({
-					size: this.page.size,
-					current: this.page.current,
-					...this.search
-				}).then(res => {
-					this.dataList = this.dataList.concat(res.data.records)
-					this.page.total = res.data.total
-					if (this.dataList.length == res.data.total) {
-						this.status = 'nomore'
-					}
-					uni.hideLoading();
-				}).catch(err => {
-					uni.hideLoading();
-				})
-			},
-		}
-	}
-</script>
-
+		}
+	}
+</script>
+
 <style lang="scss" scoped>
 	.suspensionBox {
 		width: 100rpx;
@@ -428,7 +437,7 @@
 	    display: flex;
 	    width: 400px;
 	    flex-wrap: wrap;
-	
+
 	    .searchItem {
 	        background-color: aliceblue;
 	        height: 20px;
@@ -439,7 +448,7 @@
 	        text-overflow: ellipsis; //溢出用省略号显示
 	        white-space: nowrap; //溢出不换行
 	    }
-	
+
 	    .searchBtn {
 	        height: 20px;
 	        width: 40px;
@@ -450,9 +459,9 @@
 	        line-height: 20px;
 	        cursor: pointer;
 	    }
+
 	}
-	
-	
+
 	.recentSearches{
 		padding: 10rpx 20rpx;
 		.recentSearches-head {
@@ -464,7 +473,7 @@
 				align-items: center;
 			}
 			.recentSearches-headRight {
-				
+
 			}
 		}
 		.recentSearches-text {
@@ -476,175 +485,178 @@
 			}
 		}
 	}
-	
-	.submitBar {
-		width: 100%;
-		font-size: 32rpx;
-		color: #000;
-		text-align: center;
-		// border-top: 1rpx solid #f2f2f6;
-	}
-
-	.u-wrap {
-		height: calc(100vh);
-		/* #ifdef H5 */
-		height: calc(100vh - var(--window-top));
-		/* #endif */
-		display: flex;
-		flex-direction: column;
-	}
-
-	.u-search-box {
-		padding: 10rpx;
-		padding-top: 0;
-		background-color: #FD4B09;
-	}
-
-	.u-menu-wrap {
-		flex: 1;
-		display: flex;
-		overflow: hidden;
-	}
-
-	.u-search-inner {
-		background-color: rgb(234, 234, 234);
-		border-radius: 100rpx;
-		display: flex;
-		align-items: center;
-		padding: 10rpx 16rpx;
-	}
-
-	.u-search-text {
-		font-size: 26rpx;
-		color: $u-tips-color;
-		margin-left: 10rpx;
-	}
-
-	.u-tab-view {
-		width: 200rpx;
-		overflow-x: scroll;
-		white-space: nowrap;
-	}
-
-	.u-tab-item {
-		height: 110rpx;
-		background: #f6f6f6;
-		box-sizing: border-box;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		font-size: 26rpx;
-		color: #444;
-		font-weight: 400;
-		line-height: 1;
-
-		white-space: normal;
-		word-break: break-all;
-		word-wrap: break-word;
-		overflow: hidden;
-		text-overflow: ellipsis;
-		// display: -webkit-box;
-		-webkit-line-clamp: 2;
-		-webkit-box-orient: vertical;
-	}
-
-	.u-tab-item-active {
-		position: relative;
-		color: #000;
-		font-size: 30rpx;
-		font-weight: 600;
-		background: #fff;
-	}
-
-	.u-tab-item-active::before {
-		content: "";
-		position: absolute;
-		border-left: 4px solid #FD4B09;
-		height: 32rpx;
-		left: 0;
-		top: 39rpx;
-	}
-
-	.u-tab-view {
-		height: 100%;
-	}
-
-	.right-box {
-		width: 100%;
+
+	.submitBar {
+		width: 100%;
+		font-size: 32rpx;
+		color: #000;
+		text-align: center;
+		// border-top: 1rpx solid #f2f2f6;
+	}
+
+	.u-wrap {
+		height: calc(100vh);
+		/* #ifdef H5 */
+		height: calc(100vh - var(--window-top));
+		/* #endif */
+		display: flex;
+		flex-direction: column;
+	}
+
+	.u-search-box {
+		padding: 10rpx;
+		padding-top: 0;
+		background-color: #FD4B09;
+	}
+
+	.u-menu-wrap {
+		flex: 1;
+		display: flex;
+		overflow: hidden;
+	}
+
+	.u-search-inner {
+		background-color: rgb(234, 234, 234);
+		border-radius: 100rpx;
+		display: flex;
+		align-items: center;
+		padding: 10rpx 16rpx;
+	}
+
+	.u-search-text {
+		font-size: 26rpx;
+		color: $u-tips-color;
+		margin-left: 10rpx;
+	}
+
+	.data-v-1a326067{
+		font-size: 40rpx;
+	}
+	.u-tab-view {
+		width: 200rpx;
+		overflow-x: scroll;
+		white-space: nowrap;
+	}
+
+	.u-tab-item {
+		height: 110rpx;
+		background: #f6f6f6;
+		box-sizing: border-box;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		font-size: 26rpx;
+		color: #444;
+		font-weight: 400;
+		line-height: 1;
+
+		white-space: normal;
+		word-break: break-all;
+		word-wrap: break-word;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		// display: -webkit-box;
+		-webkit-line-clamp: 2;
+		-webkit-box-orient: vertical;
+	}
+
+	.u-tab-item-active {
+		position: relative;
+		color: #000;
+		font-size: 30rpx;
+		font-weight: 600;
+		background: #fff;
+	}
+
+	.u-tab-item-active::before {
+		content: "";
+		position: absolute;
+		border-left: 4px solid #FD4B09;
+		height: 32rpx;
+		left: 0;
+		top: 39rpx;
+	}
+
+	.u-tab-view {
+		height: 100%;
+	}
+
+	.right-box {
+		width: 100%;
 		background-color: rgb(250, 250, 250);
-		padding-bottom: 20rpx;
-	}
-
-	.page-view {
-		padding: 16rpx;
-	}
-
-	.class-item {
-		// margin-bottom: 30rpx;
-		background-color: #fff;
-		padding: 16rpx;
-		border-radius: 8rpx;
-	}
-
-	// .class-item:last-child {
-	// 	min-height: 100vh;
-	// }
-
-	.item-title {
-		font-size: 26rpx;
-		color: $u-main-color;
-		font-weight: bold;
-	}
-
-	.item-menu-name {
-		font-weight: normal;
-		font-size: 24rpx;
-		color: $u-main-color;
-	}
-
-	.item-container {
-		display: flex;
-		flex-wrap: wrap;
-	}
-
-	.thumb-box {
-		width: 33.33333%;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		flex-direction: column;
-		margin-top: 20rpx;
-	}
-
-	.thumb {
-		width: 100%;
-		align-items: center;
-		margin: 10rpx auto;
-	}
-
-	.thumb-text {
-		font-size: 26rpx;
-		white-space: normal;
-		word-break: break-all;
-		word-wrap: break-word;
-		overflow: hidden;
-		text-overflow: ellipsis;
-		display: -webkit-box;
-		-webkit-line-clamp: 2;
-		-webkit-box-orient: vertical;
-	}
-
-	.thumb ::v-deep .u-cell__body {
-		padding: 20rpx 0;
-	}
-
-	.item-menu-image {
-		width: 150rpx;
-		height: 150rpx;
-		border-radius: 20rpx;
-	}
-
-	::v-deep .u-popup {
-		flex: 0;
-	}
-</style>
+		padding-bottom: 20rpx;
+	}
+
+	.page-view {
+		padding: 16rpx;
+	}
+
+	.class-item {
+		// margin-bottom: 30rpx;
+		background-color: #fff;
+		padding: 16rpx;
+		border-radius: 8rpx;
+	}
+
+	// .class-item:last-child {
+	// 	min-height: 100vh;
+	// }
+
+	.item-title {
+		font-size: 26rpx;
+		color: $u-main-color;
+		font-weight: bold;
+	}
+
+	.item-menu-name {
+		font-weight: normal;
+		font-size: 24rpx;
+		color: $u-main-color;
+	}
+
+	.item-container {
+		display: flex;
+		flex-wrap: wrap;
+	}
+
+	.thumb-box {
+		width: 33.33333%;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		flex-direction: column;
+		margin-top: 20rpx;
+	}
+
+	.thumb {
+		width: 100%;
+		align-items: center;
+		margin: 10rpx auto;
+	}
+
+	.thumb-text {
+		font-size: 26rpx;
+		white-space: normal;
+		word-break: break-all;
+		word-wrap: break-word;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		display: -webkit-box;
+		-webkit-line-clamp: 2;
+		-webkit-box-orient: vertical;
+	}
+
+	.thumb ::v-deep .u-cell__body {
+		padding: 20rpx 0;
+	}
+
+	.item-menu-image {
+		width: 150rpx;
+		height: 150rpx;
+		border-radius: 20rpx;
+	}
+
+	::v-deep .u-popup {
+		flex: 0;
+	}
+</style>