lihongxiao 1 рік тому
батько
коміт
c92e8a6e50

+ 8 - 1
common/router/modules/routes.js

@@ -465,6 +465,13 @@ const routes = [{
 		meta: {
 			title: '积分账单',
 		},
-	},
+	},{
+		path: '/pages/product/creatStandard',
+		name: 'creatStandard',
+		meta: {
+			title: '添加品牌标品',
+		},
+	}
+	
 ]
 export default routes

+ 2 - 2
common/service/config.service.js

@@ -2,9 +2,9 @@ let BASE_URL = ''
 
 
 if (process.env.NODE_ENV == 'development') {
-	// BASE_URL = 'https://test.baoxianzhanggui.com/locallive-java' // 测试环境
+	BASE_URL = 'https://test.baoxianzhanggui.com/locallive-java' // 测试环境
 	// BASE_URL = 'http://192.168.0.36:8080/jeecg-boot' // 开发环境
-    BASE_URL = 'http://192.168.0.52:8081/jeecg-boot' // 开发环境
+    // BASE_URL = 'http://192.168.0.52:8081/jeecg-boot' // 开发环境
 
 } else {
 	BASE_URL = 'https://test.baoxianzhanggui.com/locallive-java' // 测试环境

+ 3 - 0
pages.json

@@ -341,6 +341,9 @@
 		},{
 			"path": "pages/financial/balanceBean",
 			"style": {}
+		},{
+			"path": "pages/product/creatStandard",
+			"style": {}
 		}
 		
 	],

+ 1 - 1
pages/coupon/coupon.vue

@@ -214,7 +214,7 @@ export default {
             }).then(res => {
                 if (res.data.success) {
                     this.dataList['couponList' + this.currentTab] =res.data.result.pages? this.dataList['couponList' + this.currentTab].concat(res.data.result.records) : this.dataList['couponList' + this.currentTab]
-                }
+                }   
                 else {
                     this.$tip.error(res.data.message);
                 }

+ 63 - 38
pages/product/creatProduct.vue

@@ -4,7 +4,7 @@
 		<view class="head">
 			<span class="cuIcon-back" @click="back"></span>
 			<view class="case">
-				创建商品
+				{{productId?'编辑商品':'创建商品' }}
 			</view>
 		</view>
 		<view class="content">
@@ -27,7 +27,7 @@
 						商品名称<span>*</span>
 					</view>
 					<view class="picker">
-						<u-input v-model="form.productName" placeholder="输入商品名称" />
+						<u-input :disabled="tabIndex==1" v-model="form.productName" placeholder="输入商品名称" />
 					</view>
 				</view>
 				<view class="item upload">
@@ -37,17 +37,23 @@
 					<view class="tips">
 						支持jpg、png格式
 					</view>
-					<u-upload ref="uUpload" :action="action" :file-list="fmImageList" @on-success="handleSuccess"
-						@on-remove="handleRemove" max-count="1" width="140rpx" height="140rpx"></u-upload>
+					<view v-if="tabIndex==1">
+						<image  v-for="(val,index) in fmImageList" :key="index" :src="val.url" mode="" style="width: 140rpx;height:140rpx;border-radius: 4px; border: 1px solid #ebecee;margin-right:20rpx;margin-bottom:10rpx" ></image>
+					</view>
+					<u-upload v-else ref="uUpload" :action="action" :file-list="fmImageList" @on-success="handleSuccess"
+						@on-remove=" handleRemove" max-count="1" width="140rpx" height="140rpx"></u-upload>
 				</view>
 				<view class="item upload">
 					<view class="label">
-						商品详情图<span>*</span>
+						商品详情图<span v-if="tabIndex=='0'">*</span>
 					</view>
 					<view class="tips">
 						支持jpg、png格式,最多20张
 					</view>
-					<u-upload ref="dUpload" :action="action" :file-list="xqImage" @on-success="detailsSuccess"
+					<view v-if="tabIndex==1">
+						<view v-html="form.richText"></view>
+					</view>
+					<u-upload v-else ref="dUpload" :action="action" :file-list="xqImage" @on-success="detailsSuccess"
 						@on-remove="detailsRemove" max-count="20" width="140rpx" height="140rpx"></u-upload>
 				</view>
 				<view class="item">
@@ -55,7 +61,7 @@
 						原价<span>*</span>
 					</view>
 					<view class="picker">
-						<u-input v-model="form.price" placeholder="输入商品原价" />
+						<u-input :disabled="tabIndex==1"  v-model="form.price" placeholder="输入商品原价" />
 					</view>
 					<view class="unit">
@@ -66,7 +72,7 @@
 						实际售价<span>*</span>
 					</view>
 					<view class="picker">
-						<u-input type="num" v-model="form.soldPrice" placeholder="输入客户实际支付价" />
+						<u-input type="num" :disabled="form.isUpdatePrice==0" v-model="form.soldPrice" placeholder="输入客户实际支付价" />
 					</view>
 					<view class="unit">
@@ -93,7 +99,7 @@
 							金豆奖励
 						</view>
 						<view class="picker set">
-							<u-switch v-model="jindouChecked" style="margin-left:8rpx;" size="28" @change="e=>e==false?form.goldAward='':''"></u-switch>
+							<u-switch v-model="jindouChecked" :disabled="tabIndex==1" style="margin-left:8rpx;" size="28" @change="e=>e==false?form.goldAward='':''"></u-switch>
 						</view>
 					</view>
 					<view  style="border:none;" v-if="jindouChecked">
@@ -108,7 +114,7 @@
 							积分奖励
 						</view>
 						<view class="picker set">
-							<u-switch v-model="jifenChecked" style="margin-left:8rpx;" size="28" @change="e=>e==false?form.integralAward='':''"></u-switch>
+							<u-switch v-model="jifenChecked" :disabled="tabIndex==1" style="margin-left:8rpx;" size="28" @change="e=>e==false?form.integralAward='':''"></u-switch>
 						</view>
 					</view>
 					<view  style="border:none;" v-if="jifenChecked">
@@ -128,7 +134,7 @@
 							售卖时间<span>*</span>
 						</view>
 						<view class="picker set inp" @click="selectDate">
-							<u-input placeholder="去设置" v-model="showDate" @click="selectDate" />
+							<u-input :disabled="tabIndex==1" placeholder="去设置" v-model="showDate" @click="selectDate" />
 							<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
 						</view>
 					</view>
@@ -160,14 +166,14 @@
 							需要预约<span>*</span>
 						</view>
 						<view class="picker set">
-							<u-switch v-model="makeChecked" style="margin-left:8rpx;" size="28"></u-switch>
+							<u-switch v-model="makeChecked" :disabled="tabIndex==1" style="margin-left:8rpx;" size="28"></u-switch>
 						</view>
 					</view>
 					<view class="item">
 						<view class="label">
 							退款规则
 						</view>
-						<view class="picker set" @click="isRefund = true">
+						<view class="picker set" @click="tabIndex==0?isRefund = true:''">
 							<view class="" v-if="showRule" style="color: #333333;">
 								{{ showRule }}
 							</view>
@@ -182,7 +188,7 @@
 							使用说明
 						</view>
 						<view class="textarea">
-							<u-input v-model="form.instructions" type="textarea" placeholder="请输入" maxlength="500" />
+							<u-input v-model="form.instructions" :disabled="tabIndex==1"  type="textarea" placeholder="请输入" maxlength="500" />
 						</view>
 						<view class="num">
 							<span
@@ -255,6 +261,7 @@ export default {
 	},
 	data() {
 		return {
+			tabIndex:'0',
 			mode: 1,
 			form: {
 				instructions: '',
@@ -302,12 +309,12 @@ export default {
 	methods: {
 		// 上传封面图成功回调
 		handleSuccess(res, index, lists) {
-
 			this.form.productImage = this.imageHttp + res.message
+			
 		},
 		// 移除封面图文件回调
 		handleRemove(index, lists) {
-			this.fmImageList = [];
+				this.fmImageList = [];
 		},
 		//上传详情图
 		detailsSuccess(res, index, lists) {
@@ -320,13 +327,15 @@ export default {
 		},
 		//下一步
 		next() {
+			console.log(this.tabIndex);
+			
 			let temp = []
 			if (this.postImage.length > 0) {
 				this.postImage.forEach(item => {
 					temp.push(this.imageHttp + item.response.message)
 				})
 			}
-			if (this.xqImage.length > 0) {
+			if ( this.xqImage.length > 0) {
 				this.xqImage.forEach((item => {
 					temp.push(item.url)
 				}))
@@ -355,7 +364,7 @@ export default {
 				});
 				return
 			}
-			if (!this.form.detailImages) {
+			if (this.tabIndex=='0' && !this.form.detailImages) {
 				uni.showToast({
 					title: '请上传商品详情图',
 					icon: 'none'
@@ -382,9 +391,12 @@ export default {
 		},
 		// 跳转至组合商品页
 		goGroup() {
-			uni.navigateTo({
-				url: '/pages/product/group'
-			})
+			if(this.tabIndex==0){
+				uni.navigateTo({
+					url: '/pages/product/group'
+				})
+			}
+
 		},
 		//返回
 		back() {
@@ -403,9 +415,12 @@ export default {
 		},
 		//跳转至可用时间
 		setUsable() {
-			uni.navigateTo({
-				url: '/pages/product/usable'
-			})
+			if(this.tabIndex==0){
+				uni.navigateTo({
+					url: '/pages/product/usable'
+				})
+			}
+
 		},
 		// 保存退款规则
 		saveFound(rules) {
@@ -451,13 +466,16 @@ export default {
 			})
 		},
 		selectProductType() {
-			this.isSelectType = true
-			this.showText = ''
-			this.productType = []
-			this.selectTypeList = []
-			this.currentLeft = null
-			this.currentCenter = null
-			this.currentRight = null
+			if(this.tabIndex=='0'){
+				this.isSelectType = true
+				this.showText = ''
+				this.productType = []
+				this.selectTypeList = []
+				this.currentLeft = null
+				this.currentCenter = null
+				this.currentRight = null
+			}
+
 		},
 		//选中一级
 		selectLeft(item, index) {
@@ -585,13 +603,17 @@ export default {
 					this.fmImageList.push({
 						url: res.data.result.productImage
 					})
-					let xqtemp = []
-					xqtemp = res.data.result.detailImages.split(',')
-					xqtemp.map(item => {
-						this.xqImage.push({
-							url: item
+					
+					if(res.data.result.detailImages){
+						let xqtemp = []
+						xqtemp = res.data.result.detailImages.split(',')
+						xqtemp.map(item => {
+							this.xqImage.push({
+								url: item
+							})
 						})
-					})
+					}
+					
 					this.showDate = res.data.result.saleStartDate.slice(0, 10) + '-' + res.data.result.saleEndDate.slice(0,
 						10)
 					if (res.data.result.availableEndDate) {
@@ -613,12 +635,15 @@ export default {
 	mounted() {
 		this.getLeftTree()
 		this.getForm()
-		console.log(configService.apiUrl)
 	},
 	onLoad(options) {
 		if (options.productId) {
 			this.productId = options.productId
 		}
+		if (options.tabIndex) {
+			this.tabIndex = options.tabIndex
+		}
+		
 	},
 	onShow() {
 		let that = this

+ 657 - 0
pages/product/creatStandard.vue

@@ -0,0 +1,657 @@
+<template>
+	<view class="product">
+		<view class="top"></view>
+		<view class="head">
+			<view class="handle">
+				<view class="head_left">
+					<span class="cuIcon-back" @click="back"></span>
+				</view>
+				<span class="center">添加品牌标品</span>
+			</view>
+
+
+			<view class="search">
+				<span class="cuIcon-search"></span>
+				<!-- <input @blur="InputBlur" :adjust-position="false" type="text" placeholder="请输入关键词" confirm-type="search"> -->
+				<u-input v-model="productName" />
+				</input>
+				<view class="search_btn" @click.stop="getProductList">
+					<span></span>搜索
+				</view>
+			</view>
+		</view>
+		<view class="list">
+			<view class="product_item" v-for="(item,index) in productList" :key="index" >
+				<view class="details">
+					<view class="img">
+						<image :src="item.productImage" mode=""></image>
+					</view>
+					<view class="data">
+						<span>{{item.productName}}</span>
+						<!-- <span>售卖时间:{{item.time}}</span> -->
+						<view class="repertory">售卖时间:{{item.saleStartDate}} - {{ item.saleEndDate }}</view>
+						<view class="price">
+							<span style="font-size: 22rpx;margin: 0px;">¥</span>{{item.soldPrice}}
+							<span style="color:#999 ;font-size: 22rpx; text-decoration: line-through;">¥{{item.price}}</span>
+						</view>
+					</view>
+					<view class="tag"  @click.stop="select(item)">
+						<!-- <span>组合套餐</span>
+						<span class="frame"></span> -->
+						<image src="/static/product/select.png" mode="" v-if="item.select"></image>
+						<image src="/static/product/round.png" mode="" v-else></image>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="creat">
+			<view class="operate" >
+				<view class="all" @click="allSelect">
+					<image src="/static/product/select.png" mode="" v-if="isAll"></image>
+					<image src="/static/product/round.png" mode="" v-else></image>
+					全选
+				</view>
+				<view class="delete delist" @click="add()" >确认添加</view>
+			</view>
+			
+		</view>
+	</view>
+</template>
+
+<script>
+import configService from '../../common/service/config.service'
+	export default {
+		data() {
+			return {
+				isManage: false,
+				currentIndex: 0,
+				productStatus: 0, //商品状态,默认1售卖中,0未上架,2审核中,3未通过
+				isAll: false,
+				canBeDelete: true,
+				productName: '',
+				productList: [],
+				merchantId: '',
+				productHandleList: [],
+				tabIndex:1
+			}
+		},
+		methods: {
+			//返回
+			back() {
+				uni.navigateTo({
+					url: '/pages/product/index'
+				})
+			},
+			handleClear() {
+				this.getProductList()
+				// 这里可以添加其他逻辑
+			},
+			//切换分类
+			selectType(item, index) {
+				if (!this.isManage) {
+					this.currentIndex = index
+					this.productStatus = item.code
+					this.getProductList()
+				}
+
+			},
+			add(){
+				this.productList.forEach((item => {
+					this.productHandleList.push(item.productId)
+				}))
+				let ids = this.productHandleList.join(',')
+				this.$http.get("/app/product/addPurveyorProduct?ids="+ ids)
+					.then(res => {
+						if (res.data.code == 200) {
+							this.$tip.error(res.data.message ||'添加成功');
+							this.back()
+						}	
+					})
+			},
+			select(item) {
+				item.select = !item.select
+				this.productHandleList.push(item.productId)
+			},
+			//全选
+			allSelect() {
+				if (this.isAll) {
+					this.isAll = false
+					this.productList.forEach(item => {
+						item.select = false
+					})
+				} else {
+					this.isAll = true
+					this.productList.forEach(item => {
+						item.select = true
+					})
+				}
+			},
+			getProductList() {
+				this.$http.get("/app/product/purveyor/list?merchantId=" + this.merchantId + "&productStatus=" + this.productStatus +
+						'&productName=' + this.productName, )
+					.then(res => {
+						if (res.data.code == 200) {
+							res.data.result.records.forEach((item) => {
+								item.select = false;
+								item.productImage=configService.apiUrl +'/'+ item.productImage
+							})
+							this.productList = res.data.result.records
+						}
+					})
+			},
+			
+		},
+		onShow() {
+			let that = this
+			uni.getStorage({
+				key: 'login_user_info',
+				success: function(res) {
+					that.merchantId = res.data.merchantId
+				}
+			})
+			uni.removeStorage({
+				key: 'smdate',
+			});
+			uni.removeStorage({
+				key: 'group',
+			});
+			this.getProductList()
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.product {
+		width: 100%;
+		height: 100vh;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+		background: #F7F8FC;
+
+		.top {
+			width: 100%;
+			height: var(--status-bar-height);
+			background: linear-gradient(87deg, #FFFFFF 0%, #A3CDFF 100%), linear-gradient(360deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
+		}
+
+		.head {
+			width: 100%;
+			background: #ffffff;
+
+			.handle {
+				height: 112rpx;
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				padding: 0px 24rpx;
+				position: relative;
+				background: linear-gradient(87deg, #FFFFFF 0%, #A3CDFF 100%), linear-gradient(360deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
+
+				.head_left {
+					font-size: 40rpx;
+				}
+
+				.center {
+					position: absolute;
+					left: 50%;
+					top: 50%;
+					transform: translate(-50%, -50%);
+					font-size: 36rpx;
+					font-weight: 600;
+				}
+
+				.head_right {
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+
+					span {
+						width: 40rpx;
+						height: 40rpx;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+					}
+
+					.manage {
+						// width: 150rpx;
+						margin-left: 28rpx;
+					}
+				}
+			}
+
+			.search {
+				width: 93%;
+				height: 56rpx;
+				background: #F7F8FC;
+				border-radius: 12rpx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				margin: 24rpx auto;
+				font-size: 26rpx;
+				padding: 13rpx 20rpx;
+
+				span {
+					margin-right: 15rpx;
+
+				}
+
+				input {
+					flex: 1;
+					font-size: 26rpx;
+				}
+
+				.search_btn {
+					width: 72rpx;
+					color: #333333;
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+
+					span {
+						display: block;
+						width: 1px;
+						height: 26rpx;
+						background-color: #eeeeee;
+					}
+				}
+			}
+
+			.type {
+				display: flex;
+				justify-content: space-between;
+				background-color: #fff;
+				padding: 8px 24rpx 16rpx;
+
+				.type_item {
+					height: 54rpx;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					font-size: 26rpx;
+					color: #888888;
+					position: relative;
+					padding: 8rpx 12rpx;
+					background: #F2F3F5;
+					border-radius: 8rpx;
+				}
+
+				.active {
+					color: #2D88F4;
+					background: #ECF5FF;
+				}
+			}
+		}
+
+		.list {
+			width: 100%;
+			flex: 1;
+			// padding: 0px 20rpx;
+			overflow-y: auto;
+
+			.product_item {
+				width: 100%;
+				background-color: #fff;
+				border-radius: 20rpx;
+				padding: 20rpx 40rpx;
+				margin-top: 20rpx;
+
+				.status {
+					display: flex;
+					align-items: center;
+
+					.round {
+						display: flex;
+						align-items: center;
+						color: #49A03F;
+					}
+
+					.round::before {
+						content: "";
+						display: inline-block;
+						width: 9rpx;
+						height: 9rpx;
+						background: #49A03F;
+						border-radius: 50%;
+						margin-right: 8rpx;
+					}
+
+					.no {
+						color: #666666;
+					}
+
+					.no::before {
+						content: "";
+						display: inline-block;
+						width: 9rpx;
+						height: 9rpx;
+						background: #666666;
+						border-radius: 50%;
+						margin-right: 8rpx;
+					}
+
+					.audit {
+						display: flex;
+						align-items: center;
+						color: #596ABB;
+					}
+
+					.audit::before {
+						content: "";
+						display: inline-block;
+						width: 9rpx;
+						height: 9rpx;
+						background: #596ABB;
+						border-radius: 50%;
+						margin-right: 8rpx;
+					}
+
+					.reject {
+						display: flex;
+						align-items: center;
+						color: #F55D65;
+					}
+
+					.reject::before {
+						content: "";
+						display: inline-block;
+						width: 9rpx;
+						height: 9rpx;
+						background: #F55D65;
+						border-radius: 50%;
+						margin-right: 8rpx;
+					}
+
+					.line {
+						display: block;
+						width: 1rpx;
+						height: 20rpx;
+						background: #d9d9d9;
+						margin: 0 12rpx;
+					}
+				}
+
+				.details {
+					width: 100%;
+					height: auto;
+					min-height: 132rpx;
+					height: 132rpx;
+					display: flex;
+					align-items: center;
+					margin-top: 20rpx;
+
+					.img {
+						margin-right: 16rpx;
+						border-radius: 12rpx;
+						overflow: hidden;
+
+						image {
+							width: 132rpx;
+							height: 132rpx;
+						}
+					}
+
+					.data {
+						flex: 1;
+						height: 100%;
+						display: flex;
+						flex-direction: column;
+						justify-content: space-between;
+						font-weight: 600;
+						font-style: 28rpx;
+
+						.repertory {
+							font-size: 24rpx;
+							display: flex;
+							align-items: center;
+							color: #8A91A8;
+							font-weight: 400;
+							margin: 6rpx 0 10rpx 0;
+						}
+
+						.price {
+							display: flex;
+							align-items: center;
+							font-size: 30rpx;
+							font-weight: 600;
+
+							span {
+								font-size: 26rpx;
+								margin-left: 20rpx;
+								font-weight: 400;
+
+							}
+						}
+					}
+
+					.tag {
+						width: 40rpx;
+						height: 40rpx;
+						display: flex;
+						flex-direction: column;
+						align-items: center;
+
+						image {
+							width: 40rpx;
+							height: 40rpx;
+						}
+					}
+
+				}
+
+				.btn_box {
+					width: 100%;
+					display: flex;
+					justify-content: flex-end;
+					align-items: center;
+					margin-top: 20rpx;
+
+					.delist {
+						width: 100rpx;
+						height: 50rpx;
+						border-radius: 8rpx;
+						border: 1px solid #CCCCCC;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+						font-size: 26rpx;
+						color: #666666;
+					}
+
+					.edit {
+						margin-left: 20rpx;
+						background: rgba(68, 154, 255, 0.05);
+						border: 1px solid #449AFF;
+						color: #449AFF;
+					}
+				}
+			}
+		}
+
+		.creat {
+			width: 100%;
+			height: 100rpx;
+			background-color: #fff;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+
+			.btn {
+				width: 672rpx;
+				height: 76rpx;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
+				border-radius: 75rpx;
+				font-size: 28rpx;
+				color: #FFFFFF;
+
+				image {
+					width: 40rpx;
+					height: 40rpx;
+					margin-right: 10rpx;
+				}
+			}
+
+			.operate {
+				width: 100%;
+				display: flex;
+				// justify-content: space-between;
+				align-items: center;
+				padding: 0px 20rpx;
+				justify-content: space-between;
+				.delete {
+					width: 205rpx;
+					height: 76rpx;
+					background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
+					border-radius: 49rpx;
+					font-size: 28rpx;
+					color: #FFFFFF;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					margin-right: 24rpx;
+					margin-left: 140rpx;
+				}
+
+				.delist {
+					margin-left: 0rpx;
+					background: linear-gradient(90deg, #FFA05B 0%, #FF7918 100%);
+				}
+
+				.all {
+					width: 25%;
+					// height: 60rpx;
+					// border: 1px solid #999;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+
+					image {
+						width: 40rpx;
+						height: 40rpx;
+						margin-right: 10rpx;
+					}
+				}
+			}
+		}
+
+		.popup {
+			width: 100vw;
+			height: 100vh;
+			position: fixed;
+			top: 0;
+			left: 0;
+			background: rgba(0, 0, 0, 0.4);
+			display: flex;
+			align-items: center;
+			justify-content: center;
+
+			.content {
+				width: 570rpx;
+				background: #FFFFFF;
+				border-radius: 16rpx;
+				padding: 0px 24rpx;
+				padding-bottom: 16rpx;
+
+				.title {
+					width: 100%;
+					height: 86rpx;
+					font-size: 32rpx;
+					color: #333333;
+					font-weight: 600;
+					border-bottom: 1px solid #EEEEEE;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+				}
+
+				.center {
+					font-size: 30rpx;
+					color: #333333;
+					line-height: 35rpx;
+					display: flex;
+					flex-direction: column;
+					align-items: center;
+					justify-content: center;
+					padding-top: 28rpx;
+					border-bottom: 1px solid #EEEEEE;
+					padding-bottom: 40rpx;
+					margin-bottom: 16rpx;
+
+					.error {
+						text-align: center;
+					}
+
+					image {
+						width: 100rpx;
+						height: 100rpx;
+						margin-bottom: 10rpx;
+					}
+				}
+
+				.sub {
+					width: 320rpx;
+					height: 68rpx;
+					border-radius: 66rpx;
+					font-size: 28rpx;
+					color: #FFFFFF;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					margin: 0rpx auto;
+
+					.button {
+						width: 320rpx;
+						height: 68rpx;
+						background: #449AFF;
+						border-radius: 66rpx;
+						display: flex;
+						align-items: center;
+						justify-content: center;
+					}
+				}
+
+				.start {
+					background: #53CC48;
+				}
+
+				.rest {
+					background: #FF8024;
+				}
+			}
+		}
+	}
+.tab-container {
+  display: flex;
+  justify-content: space-around;
+
+.tab-item {
+  position: relative;
+  padding: 18rpx 0;
+  cursor: pointer;
+  color: #333;
+  font-weight: 400;
+  font-size: 28rpx;
+}
+
+.tab-item.active {
+	color: #449AFF;
+	font-weight: 600;
+}
+
+.tab-item.active::after {
+  content: '';
+  position: absolute;
+  bottom: -28px;
+  left: 35%;
+  width: 38rpx;
+  height: 100%;
+  background: url(/static/product/tab-act.png) no-repeat;
+  background-size: contain;
+}
+}
+</style>

+ 69 - 13
pages/product/index.vue

@@ -14,12 +14,18 @@
 					</view>
 				</view>
 			</view>
+
+			<div class="tab-container">
+				<div class="tab-item" :class="tabIndex == 1?'active':''" @click="tabIndex=1;productName='';productStatus=0;getProductList();getStatus()">品牌标品</div>
+				<div class="tab-item" :class="tabIndex == 0?'active':''" @click="tabIndex=0;productName='';productStatus=0;getProductList();getStatus()">自有商品</div>
+			</div>
+
 			<view class="search">
 				<span class="cuIcon-search"></span>
 				<!-- <input @blur="InputBlur" :adjust-position="false" type="text" placeholder="请输入关键词" confirm-type="search"> -->
 				<u-input v-model="productName" />
 				</input>
-				<view class="search_btn" @click.stop="getProductList">
+				<view class="search_btn" @click.stop="getProductList()">
 					<span></span>搜索
 				</view>
 			</view>
@@ -88,9 +94,13 @@
 				<view class="delete delist" @click="deletes(1)" v-if="currentIndex == 0">上架</view>
 				<view class="delete delist" @click="deletes(0)" v-else>下架</view>
 			</view>
-			<view class="btn" @click="creatProduct" v-else>
+			<view class="btn" @click="creatProduct" v-else-if="tabIndex==0">
 				<image src="/static/product/product.png" mode=""></image>
-				创建商品
+				创建自有商品
+			</view>
+			<view class="btn" @click="creatStandard" v-else-if="tabIndex==1">
+				<image src="/static/product/standard.png" mode=""></image>
+				添加品牌标品
 			</view>
 		</view>
 		<view class="popup" v-if="isDelete">
@@ -149,7 +159,8 @@
 				],
 				productList: [],
 				merchantId: '',
-				productHandleList: []
+				productHandleList: [],
+				tabIndex:1
 			}
 		},
 		methods: {
@@ -165,7 +176,6 @@
 			},
 			//切换分类
 			selectType(item, index) {
-				console.log(item)
 				if (!this.isManage) {
 					this.currentIndex = index
 					this.productStatus = item.code
@@ -197,10 +207,17 @@
 					url: '/pages/product/creatProduct'
 				})
 			},
+			//跳转至品牌标品
+			creatStandard() {
+				uni.navigateTo({
+					url: '/pages/product/creatStandard'
+				})
+				
+			},
 			//编辑
 			edit(item) {
 				uni.navigateTo({
-					url: '/pages/product/creatProduct?productId=' + item.productId
+					url: '/pages/product/creatProduct?productId=' + item.productId+'&tabIndex='+this.tabIndex
 				})
 			},
 			select(item) {
@@ -219,17 +236,15 @@
 				
 				let that = this
 				uni.showModal({
-					title: '确定下架商品?',
+					title: this.productStatus==0?'确定上架商品?':'确定下架商品?',
 					success: function(res) {
 						if (res.confirm) {
 						
 							that.$http.post("/app/product/shelves", shelves)
 								.then(res => {
 									if (res.data.code == 200) {
-										console.log(res)
-
 										uni.showToast({
-											title: '下架成功',
+											title: this.productStatus==0?'上架成功':'下架成功',
 											duration: 2000,
 											icon: 'none'
 										});
@@ -295,7 +310,7 @@
 			},
 			getProductList() {
 				this.$http.get("/app/product/list?merchantId=" + this.merchantId + "&productStatus=" + this.productStatus +
-						'&productName=' + this.productName, )
+						'&productName=' + this.productName +'&isPlatform='+this.tabIndex, )
 					.then(res => {
 						if (res.data.code == 200) {
 							res.data.result.records.forEach((item) => {
@@ -305,6 +320,18 @@
 						}
 					})
 			},
+			// getStandardList() {
+			// 	this.$http.get("/app/product/purveyor/list?merchantId=" + this.merchantId + "&productStatus=" + this.productStatus +
+			// 			'&productName=' + this.productName, )
+			// 		.then(res => {
+			// 			if (res.data.code == 200) {
+			// 				res.data.result.records.forEach((item) => {
+			// 					item.select = false;
+			// 				})
+			// 				this.productList = res.data.result.records
+			// 			}
+			// 		})
+			// },
 			delist(item) {
 				let shelves = []
 				shelves.push({
@@ -368,7 +395,7 @@
 				});
 			},
 			getStatus() {
-				this.$http.get("/app/product/statusCount?merchantId=" + this.merchantId, ).then(res => {
+				this.$http.get("/app/product/statusCount?merchantId=" + this.merchantId+'&isPlatform='+this.tabIndex ).then(res => {
 					if (res.data.code == 200) {
 						this.typeList = res.data.result
 					}
@@ -466,7 +493,7 @@
 				display: flex;
 				align-items: center;
 				justify-content: space-between;
-				margin: 16rpx auto;
+				margin: 24rpx auto;
 				font-size: 26rpx;
 				padding: 13rpx 20rpx;
 
@@ -869,4 +896,33 @@
 			}
 		}
 	}
+.tab-container {
+  display: flex;
+  justify-content: space-around;
+
+.tab-item {
+  position: relative;
+  padding: 18rpx 0;
+  cursor: pointer;
+  color: #333;
+  font-weight: 400;
+  font-size: 28rpx;
+}
+
+.tab-item.active {
+	color: #449AFF;
+	font-weight: 600;
+}
+
+.tab-item.active::after {
+  content: '';
+  position: absolute;
+  bottom: -28px;
+  left: 35%;
+  width: 38rpx;
+  height: 100%;
+  background: url(/static/product/tab-act.png) no-repeat;
+  background-size: contain;
+}
+}
 </style>

BIN
static/product/standard.png


BIN
static/product/tab-act.png