Jelajahi Sumber

批量隐藏功能

shish 6 bulan lalu
induk
melakukan
5a1d39623a

+ 429 - 0
ghsApp/src/admin/changePrice/changeHide.vue

@@ -0,0 +1,429 @@
+<template>
+<view class="app-content" style="background:white;">
+    <view class="modern-tabs-container">
+        <view class="modern-tabs">
+            <view class="modern-tab" :class="{ 'active': globalLookStock === 0 }" @click="changeHasStock(0)">
+                <view class="tab-content">
+                    <text class="tab-text">全部</text>
+                </view>
+            </view>
+            <view class="modern-tab" :class="{ 'active': globalLookStock === 1 }" @click="changeHasStock(1)">
+                <view class="tab-content">
+                    <text class="tab-text">有库存</text>
+                </view>
+            </view>
+            <view class="modern-tab" :class="{ 'active': globalLookStock === 2 }" @click="changeHasStock(2)">
+                <view class="tab-content">
+                    <text class="tab-text">没库存</text>
+                </view>
+            </view>
+        </view>
+    </view>
+	<view class="billing_box_bg">
+    <view class="input-wrap">
+			<view style="padding:0upx 0upx 0upx 0upx;margin-right:10upx;" >
+				<button class="admin-button-com middle blue" @click="selectFlowerNumFn()">图片分类</button>
+			</view>
+			<view class="search-bar">
+				<app-search-module ref="globalSearchRef" v-model="globalPy" placeholder="这里搜索" @input="globalSearch" />
+			</view>
+		</view>
+		<view class="scroll-middle_bx">
+			<scroll-view scroll-y scroll-with-animation class="tab-view">
+				<div v-for="(item, index) in globalClassData" :key="index" class="tab-bar-item" :class="[globalClassIndex == index ? 'active' : '']" :data-current="index" @tap.stop="currentSwitchClass(index,item)">
+					<text>{{ item.name || "" }}</text>
+				</div>
+			</scroll-view>
+				<scroll-view scroll-y class="right-box"
+					:scroll-top="globalScrollTopPlace"
+					@scroll="globalGetScroll"
+					:scroll-into-view="scroll_into_view" 
+					scroll-with-animation="true"
+					lower-threshold="100"
+					@scrolltolower="globalScrollBottom">
+
+				<block v-if="!$util.isEmpty(globalItemData)">
+					<view class="item_list_bx selectAll">
+						<view v-if="!$util.isEmpty(globalItemData)">
+							<template v-for="(productItem, productIndex) in globalItemData">
+								<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
+								<view style="height:190upx" :key="productIndex">
+									<ItemComponent :isPrice="false" :info="productItem" @saveStock="saveStock" :ref="`productRef${productItem.id}`" 
+									@hideChangeFn="hideChangeFn" @cancelPreSellFn="cancelPreSellFn">
+								</ItemComponent>
+								</view>
+							</template>
+						</view>
+						<view v-else>
+							<view style="height:260upx;text-align:center;color:#CCCCCC;position: relative;">
+								<view style="position: absolute;margin:auto;top:130upx;left:0;right:0;bottom:0;">暂无花材</view>
+							</view>
+						</view>
+
+					</view>
+				</block>
+				<block v-else>
+					<view style="width: 100%">
+						<app-wrapper-empty  title="暂无数据" :is-empty="$util.isEmpty(globalItemData)"/>
+					</view>
+				</block>
+
+			</scroll-view>
+		</view>
+
+      <div class="app-footer">
+        <button class="admin-button-com big blue" @click="commitPrice">批量隐藏</button>
+      </div>
+
+		<uni-popup ref="globalClassImgRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+			<view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
+				<view v-for="(item, index) in globalClassData" :key="index" @tap.stop="currentChangeClass(index,item)" style="margin-bottom:20upx;margin-left:3upx;">
+				<image :src="item.cover" style="width:120upx;height:120upx;border-radius:10upx;"></image>
+				<view style="margin-top:5upx;overflow: hidden;white-space: nowrap;width:120upx;text-align:center;">{{item.name}}</view>
+				</view>
+			</view>
+		</uni-popup>
+
+		<image v-if="showClassRemind" @click="hideClassRemind" style="position:absolute;width:610upx;height:699upx;top:225upx;left:80upx;z-index:9999;" :src="`${constant.imgUrl}/class_remind.png`"></image>
+
+	</view>
+</view>
+</template>
+<script>
+import AppSearchModule from "@/components/module/app-search";
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import ItemComponent from "./components/changeHide";
+import productMins from "@/mixins/product2";
+import { mapGetters } from "vuex";
+import { checkOrderApi } from "@/api/inventory";
+import { changeFrontHide } from "@/api/item";
+import { cancelPreSell } from '@/api/product'
+export default {
+	name: "item_list",
+	components: {
+		AppSearchModule,
+		AppWrapperEmpty,
+		ItemComponent
+	},
+	mixins: [productMins],
+	data() {
+		return {
+			autoLoad: false,
+			selectJobType: "stock",
+			tabIndex: 0,
+			stockArr:[],
+			showClassRemind:false
+		};
+	},
+	computed:{
+		...mapGetters(["getMyShopInfo","getLoginInfo"]),
+	},
+	onLoad() {
+		this.initProduct()
+	},
+	methods: {
+		selectFlowerNumFn(){
+			this.$refs.globalClassImgRef.open('top')
+		},
+		changeHasStock(check){
+			this.globalLookStock = check
+			this.reGetGlobalProductList()
+		},
+		hideClassRemind(){
+		},
+		cancelPreSellFn(item){
+			let that = this
+			this.$util.confirmModal({content:'确认取消预售?'},() => {
+				cancelPreSell({id:item.id}).then(res=>{
+					if(res.code == 1){
+						that.$msg(res.msg)
+					}
+				})
+			})
+		},
+		hideChangeFn(item,status){
+			let that = this
+			changeFrontHide({id:item.id,status:status}).then(res=>{
+				if(res.code == 1){
+					that.$refs[`productRef${item.id}`][0].frontHide = status
+				}
+			})
+		},
+		initProduct(){
+			this.globalRequestType = 'itemList'
+			this.initData()
+			uni.hideLoading()
+		},
+		commitPrice(){
+			let that = this
+			if(this.stockArr.length == 0){
+				this.$msg('没有修改')
+				return;
+			}
+			this.$util.confirmModal({content:'确认修改?'},() => {
+				that.commitChange()
+			})
+		},
+		commitChange(){
+			let that = this
+			let data = JSON.stringify(this.stockArr);
+			checkOrderApi({pdType:'',itemInfo:data,remark:'修改库存'}).then(res => {
+				if(res.code == 1){
+					that.clearPrice()
+					that.reGetGlobalProductList()
+				}
+				this.$msg(res.msg)					
+			})
+		},
+		currentSwitchClass(index,item){
+			this.clearPrice()
+			this.globalSwitchClass(index,item)
+		},
+		currentChangeClass(index,item){
+			this.clearPrice()
+			this.globalChangeClass(index,item)
+		},
+		clearPrice(){
+			let that = this
+			this.stockArr.forEach(function(value,index,array){
+				that.$refs[`productRef${value.productId}`][0].modifyStock = ''
+			})
+			that.stockArr = []
+		},
+		saveStock(stock,id){
+			if(this.stockArr.length > 0){
+				this.stockArr.forEach(function(value,index,array){
+					if(value.productId == id){
+						array.splice(index,1)
+					}
+				});
+			}
+			this.stockArr.push({productId:id,bigNum:stock,smallNum:null})
+		},
+		affirm(val) {
+			if (val.index === 0) {
+				this.modalCancel();
+			}
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.app-content {
+	display: flex;
+	flex-direction: column;
+	height: 100vh;
+	overflow: hidden;
+}
+
+.modern-tabs-container {
+	flex-shrink: 0;
+}
+
+.billing_box_bg {
+	flex: 1;
+	background: white;
+	display: flex;
+	flex-direction: column;
+	overflow: hidden;
+	.input-wrap {
+		display: flex;
+		padding: 22upx 20upx 22upx 13upx;
+		.search-bar {
+			flex: 1;
+		}
+		.city-select {
+			display: flex;
+			flex-shrink: 0;
+			align-items: center;
+			margin-right: 15upx;
+			margin-left: 45upx;
+			background-color: #ffff;
+			.iconfont {
+				margin-left: 20upx;
+				font-size: 30upx;
+			}
+		}
+	}
+	.scroll-middle_bx {
+		flex: 1;
+		display: flex;
+		width: 100%;
+		height: 100%;
+		overflow: hidden;
+	}
+	.tab-view {
+		padding-bottom:100upx;
+		// height: calc(100vh - 140upx);
+		width: 170upx;
+		flex-shrink: 0;
+		background-color: #f0f2f6;
+		.tab-bar-item {
+			position: relative;
+			width: 170upx;
+			height: 90upx;
+			box-sizing: border-box;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			font-size: 26upx;
+			color: #444;
+			font-weight: 400;
+			.tag {
+				display: flex;
+				padding: 0 20upx;
+				align-items: center;
+				position: absolute;
+				right: 0;
+				top: 0;
+				height: 32upx;
+				background: #ff2842;
+				border-radius: 16upx;
+				color: #fff;
+				font-size: 20upx;
+			}
+      &:last-child{
+        margin-bottom: 110upx;
+      }
+		}
+
+		.active {
+			position: relative;
+			color: $mainColor;
+			font-size: 26upx;
+			background: #fff;
+		}
+
+		.active::before {
+			content: "";
+			position: absolute;
+			border-left: 8upx solid $mainColor;
+			height: 100%;
+			left: 0;
+		}
+	}
+	.right-box {
+		// height: calc(100vh - 200upx);
+		flex: 1;
+		box-sizing: border-box;
+	}
+	.item_list_bx {
+		padding: 40upx 16upx;
+	}
+	.item_list_title {
+			margin-bottom: 20upx;
+			font-size: 30upx;
+			font-weight: 600;
+			color: #3385FF;
+	}
+	.select-cmd_bx {
+		& .kc {
+			color: #999999;
+			font-size: 28upx;
+			font-weight: 400;
+			margin-bottom: 60upx;
+			text-align: center;
+			margin-top: 10upx;
+		}
+		& .num_bx {
+			display: flex;
+			align-items: center;
+			margin-bottom: 80upx;
+			& > input {
+				width: 212upx;
+				height: 80upx;
+				border: 1upx solid #dddddd;
+				border-radius: 4upx;
+				text-align: center;
+				margin-right: 24upx;
+			}
+		}
+	}
+	.app-footer {
+		justify-content: space-evenly;
+		z-index: 9999;
+		.admin-button-com {
+			width: 60%;
+		}
+		button{
+			width:600upx;
+		}
+	}
+}
+.class-popup-style{
+	z-index:999999;
+}
+
+.modern-tabs-container {
+  padding: 0;
+  background-color: #f8f9fa;
+  width: 100%;
+  flex-shrink: 0;
+}
+
+.modern-tabs {
+  display: flex;
+  background-color: #ffffff;
+  padding: 6upx;
+  box-shadow: 0 2upx 12upx rgba(0, 0, 0, 0.06);
+  border: 2upx solid #f0f2f5;
+  position: relative;
+  z-index: 5;
+  width: 100%;
+}
+
+.modern-tab {
+  flex: 1;
+  text-align: center;
+  padding: 30upx 0;
+  position: relative;
+  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
+  border-radius: 12upx;
+  margin: 0 2upx;
+  background-color: #e2dfdf; /* 未选中态背景 */
+  border: 2upx solid #f2f4f7; /* 未选中态边框 */
+  box-shadow: none;
+  
+  .tab-content {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+  }
+  
+  .tab-icon {
+    font-size: 32upx;
+    margin-bottom: 4upx;
+    display: block;
+    opacity: 0.85; /* 未选中态图标降低对比 */
+  }
+  
+  &.active .tab-icon {
+    filter: brightness(1.15);
+    opacity: 1;
+  }
+  
+  .tab-text {
+    font-size: 30upx;
+    color: #666;
+    font-weight: 700;
+  }
+  
+  &.active {
+    background: #3385FF;
+    
+    .tab-text {
+      color: #ffffff;
+      font-weight: 700;
+      font-size: 30upx;
+    }
+  }
+  
+  /* H5 未选中态悬停效果(其它端不影响) */
+  &:not(.active):hover {
+    background-color: #f6f7f9;
+    border-color: #e9ecef;
+  }
+}
+</style>

+ 256 - 0
ghsApp/src/admin/changePrice/components/changeHide.vue

@@ -0,0 +1,256 @@
+<template>
+<view class="product">
+	<view class="item-cmd_bx">
+		<view class="img_bx" @click="pageTo({url: '/admin/item/detail?id='+info.id})">
+			<block v-if="info.status == 2">
+				<view class="sold-out">
+					<view class="sold-out-xj">已下架</view>
+				</view>
+			</block>
+			<block v-else>
+				<view v-if="info.frontHide == 1" class="sold-out">
+					<view class="hide">隐</view>
+				</view>
+			</block>
+			<image :src="info.cover" style="width:160upx;height:160upx;" lazy-load="true" :lazy-load-margin="0"></image>
+		</view>
+		<view class="cmd-info_bx">
+			<view class="tit">
+				<text style="font-size:22upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;" 
+				v-if="info.presell == 1">预售</text>
+				{{ info.name || "" }}
+			</view>
+			<view class="kc">¥{{ parseFloat(info.price) }}</view>
+			<view class="num-open_bx">
+				<view>
+					<view class="open-bx" >
+						<text style="color:#333333;">¥{{ parseFloat(info.skPrice) }}</text>
+						<view class="hd-price-area">
+							<input class="change-input" @click.stop @blur="saveStock" placeholder-style="color:#CCCCCC" v-model="modifyStock" type="digit" placeholder="填写数量" @focus="clear()" />
+						</view>
+						<text v-if="info.frontHide == 1" class="front-hide-color">隐</text>
+					</view>
+				</view>
+			</view>
+			<text style="position:absolute;right:70upx;color:#333333;font-weight:bold;bottom:0upx;">
+			剩余 {{info.stock?parseFloat(info.stock):0}}
+			</text>
+		</view>
+	</view>
+
+</view>
+</template>
+<script>
+export default {
+	name: "item",
+	components: {
+	},
+	props: {
+		isPrice: {
+			type: Boolean,
+			default: true
+		},
+		isEdit: {
+			type: Boolean,
+			default: true
+		},
+		info: {
+			required: true
+		}
+	},
+	data() {
+		return {
+			modifyStock:''
+		};
+	},
+	methods: {
+		clear(){
+			this.modifyStock = ''
+		},
+		cancelPreSellFn(item){
+			this.$emit("cancelPreSellFn",item)
+		},
+		hideChangeFn(item,status){
+			this.$emit("hideChangeFn",item,status)
+		},
+		saveStock() {
+			if(Number(this.modifyStock)>=0){
+				this.$emit("saveStock",this.modifyStock,this.info.id)
+			}
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.product{
+	height:230upx;
+	.level-price{
+		display:flex;
+		color:#CCCCCC;
+		text-align: right;
+		font-size:24upx;
+		justify-content:space-around;
+	}
+}
+.item-cmd_bx {
+	height:160upx;
+	position: relative;
+	margin-bottom: 20upx;
+	.img_bx {
+		z-index:999;
+		height: 160upx;
+		width: 160upx;
+		position: absolute;
+		left: 0upx;
+		top: 0upx;
+		.sold-out{
+			z-index:10;
+			width:160upx;
+			height:160upx;
+			background-color:black;
+			position:absolute;
+			top:0;
+			left:0;
+			opacity: 0.6;
+			color:white;
+			text-align:center;
+			.sold-out-xj{
+				line-height:160upx;
+				font-size:28upx;
+			}
+			.hide{
+				line-height:160upx;
+				font-size:30upx;
+			}
+		}
+	}
+	.cmd-info_bx {
+		position: relative;
+		padding-left: 177upx;
+		&.active{
+			&:before{
+				content: ' ';
+				height: 22upx;
+				width: 22upx;
+				border-width: 2upx 2upx 0 0;
+				border-color: #b2b2b2;
+				border-style: solid;
+				-webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				position: absolute;
+				top: 50%;
+				margin-top: -12upx;
+				right: 30upx;
+			}
+		}
+		& .tit {
+			font-size: 30upx;
+			font-weight: bold;
+			color: #333333;
+			padding-top: 0upx;
+			overflow: hidden;
+			white-space: nowrap;
+			text-overflow: ellipsis;
+			width:360upx;
+		}
+		.front-hide-color{
+			position:absolute;
+			top:52upx;
+			right:206upx;
+			display:inline-block;
+			width:56upx;
+			padding:10upx 0;
+			background-color:#3385ff;
+			border:none;
+			margin-left:8upx;
+			color:white;
+			text-align:center;
+			border-radius:10upx;
+		}
+		& .kc {
+			color:red;
+			font-size: 31upx;
+			padding: 17upx 0 24upx;
+			font-weight: 700;
+		}
+		& .num-open_bx {
+			display: flex;
+			align-items: center;
+			& .price {
+				font-size: 30upx;
+				color: red;
+				flex: 1;
+			}
+			& .open-bx {
+				color:#999999;
+				width:300upx;
+				text{
+					font-size: 24upx;
+				}
+				*.warn {
+					color: $redColor;
+				}
+				.hd-price-area{
+					width:190upx;
+					position: absolute;
+					top:50upx;
+					right:-10upx;
+					/* #ifdef MP-WEIXIN */
+					/* #ifdef APP-PLUS */
+					/* #else */
+					// 苹果微信小程序特殊处理 - 防止滚动问题
+					position: relative;
+					z-index: 1;
+					/* #endif */
+					/* #endif */
+					.change-input {
+						width: 150upx;
+						height: 60upx;
+						line-height: 60upx;
+						text-align: center;
+						background: #ffffff;
+						border: 1upx solid #b4b4b4;
+						border-radius: 4upx;
+						font-size: 25upx;
+						color:#777777;
+						display:inline-block;
+						/* #ifdef MP-WEIXIN */
+						/* #ifdef APP-PLUS */
+						/* #else */
+						// 苹果微信小程序 iOS WebKit 特殊修复
+						-webkit-appearance: none;
+						-webkit-tap-highlight-color: transparent;
+						-webkit-user-select: none;
+						/* #endif */
+						/* #endif */
+					}
+					.change-text{
+						font-size:22upx;
+					}
+				}
+				.sk-price-area{
+					width:190upx;
+					position: absolute;
+					top:100upx;
+					right:-10upx;
+					.change-input {
+						width: 150upx;
+						height: 60upx;
+						line-height: 60upx;
+						text-align: center;
+						background: #ffffff;
+						border: 1upx solid #b4b4b4;
+						border-radius: 4upx;
+						font-size: 25upx;
+						color:#777777;
+						display:inline-block;
+					}
+					.change-text{
+						font-size:22upx;
+					}
+				}
+			}
+		}
+	}
+}
+</style>

+ 1 - 0
ghsApp/src/admin/home/apply.vue

@@ -53,6 +53,7 @@ export default {
                         {name: "花材排序",img: `${this.$constant.hostUrl}/image/ghs/home/hcgl.png`,url: "/admin/itemClass/sort"},
                         {name: "已下架",img: `${this.$constant.hostUrl}/image/ghs/home/hcgl.png`,url: "/admin/changePrice/outList"},
                         {name: "已删除",img: `${this.$constant.hostUrl}/image/ghs/home/hcgl.png`,url: "/admin/changePrice/stopList"},
+                        {name: "批量隐藏",img: `${this.$constant.hostUrl}/image/ghs/home/hcgl.png`,url: "/admin/changePrice/changeHide"},
                         {name: "采购人管理",img: `${this.$constant.hostUrl}/image/ghs/home/hcgl.png`,url: "/admin/changePrice/changeCgStaff"},
                         {name: "公告",img: `${this.$constant.hostUrl}/image/ghs/home/hcgl.png`,url: "/admin/picText/purchaseGuide"},
                         {name: "图文",img: `${this.$constant.hostUrl}/image/ghs/home/hcgl.png`,url: "/admin/picText/picTextList"},

+ 1 - 0
ghsApp/src/pages.json

@@ -143,6 +143,7 @@
 				{"path": "list","style": {"navigationBarTitleText": "改价"}},
 				{"path": "list2","style": {"navigationBarTitleText": "改价"}},
 				{"path": "changeStock","style": {"navigationBarTitleText": "修改库存"}},
+				{"path": "changeHide","style": {"navigationBarTitleText": "批量隐藏"}},
 				{"path": "changeStock2","style": {"navigationBarTitleText": "修改库存"}},
 				{"path": "changeList","style": {"navigationBarTitleText": "价格变动记录"}},
 				{"path": "costChangeList","style": {"navigationBarTitleText": "成本变动"}},