Răsfoiți Sursa

商品优化

shish 11 luni în urmă
părinte
comite
b814d96c5c

+ 6 - 7
hdApp/src/admin/billing/components/app-commodity2.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="item-cmd_bx" @click.stop="showAddModelFn()">
 		<view class="img_bx" style="background:#eeeeee">
-			<block v-if="info.frontHide == 1">
+			<block v-if="info.status == 0">
 				<view class="sold-out">
 					<view class="hide">隐</view>
 				</view>
@@ -11,17 +11,17 @@
 		<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.frontHide && info.frontHide == 1">隐</text>
+				v-if="info.status == 0">隐</text>
 				{{ info.name || "" }}
 			</view>
 			<view class="kc" style="position:absolute;top:55upx;z-index:99">
-				<block v-if="info.ratioType == 0">{{info.ratio}}{{info.smallUnit}}/{{info.bigUnit}}</block>
-				<block v-else>若干{{info.smallUnit}}/{{info.bigUnit}}</block>
+				<block>备用字段</block>
 			</view>
 			<view class="kc num-open_bx flex-end">
-				<view class="price" style="position:absolute;top:55upx;font-weight:bold;">
+				<view class="price" style="position:absolute;top:55upx;font-weight:bold;" v-if="info.priceType == 1">
 					¥{{ parseFloat(info.price) }}
 				</view>
+				<view class="price" style="position:absolute;top:55upx;font-weight:bold;" v-else>--</view>
 				<view style="text-align: right;margin-right:20upx;" >
 					<view class="open-bx" >
 						<i class="iconfont iconjian" @click.stop="reduceItemFn()" v-if="bigCount > 0 || smallCount > 0"></i>
@@ -31,8 +31,7 @@
 						</text>
 						<i class="iconfont iconzeng" @click.stop="addItemFn()"></i>
 					</view>
-					<text v-if="parseFloat((Number(info.stock)+Number(info.onStock)).toFixed(2)) > Number(info.stockWarning)" style="color:#333;margin-right:65upx;">还剩 {{ parseFloat(info.stock) }}</text>
-					<text v-else style="color:red;font-weight:bold;margin-right:65upx;">还剩 {{ parseFloat(info.stock) }}</text>
+					<text v-if="(Number(info.stock)) > 0" style="color:#333;margin-right:65upx;">还剩 {{ parseFloat(info.stock) }}</text>
 				</view>
 			</view>
 		</view>

+ 3 - 1
hdApp/src/admin/billing/hs.vue

@@ -19,7 +19,7 @@
 			<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="globalSwitchClass(index,item)">
-					<text style="text-align: center;">{{ item.name || "" }}</text>
+					<text style="text-align: center;">{{ item.categoryName || "" }}</text>
 				</div>
 				<view style="height: 120upx"></view>
 			</scroll-view>
@@ -175,6 +175,8 @@ export default {
 	},
 	methods: {
 		selectFlowerNumFn(){
+			this.$msg('开发中')
+			return false
 			this.$refs.globalClassImgRef.open('top')
 		},
 		confirmToSave() {

+ 26 - 31
hdApp/src/admin/goods/list.vue

@@ -25,12 +25,16 @@
               <view class="goods-list" v-for="(goodsItem, idx) in list.data" :key="idx">
                 <view class="goods-list-top" @click="edit(goodsItem.id)">
                   <view class="img-blo">
-                    <view v-if="goodsItem.stock <= 0 || goodsItem.status == 0" class="sold-out">
-                      <view class="sold-out-xj">
-                        已下架
-                        <view v-if="goodsItem.stock != 0 && goodsItem.status == 0">(商城隐藏)</view>
+                    <block v-if="goodsItem.stock <= 0">
+                      <view class="sold-out">
+                        <view class="sold-out-xj">已下架</view>
                       </view>
-                    </view>
+                    </block>
+                    <block v-else>
+                      <view v-if="goodsItem.status == 0" class="sold-out">
+                        <view class="sold-out-xj">隐藏</view>
+                      </view>
+                    </block>
                     <img :src="goodsItem.smallCover" mode="aspectFit" />
                   </view>
                   <view class="goods-det">
@@ -41,8 +45,8 @@
                       <view v-if="goodsItem.priceType == 1">
                         <!-- 当涨价开关开启时,显示涨价后价格和原价 -->
                         <view v-if="riseSwitch" class="price-container">
-                          <text class="goods-price" style="font-size:26upx;">¥{{ risePrice(goodsItem).toFixed(2) }}</text>
-                          <text class="original-price" style="font-size:22upx;">¥{{ goodsItem.price?parseFloat(goodsItem.price).toFixed(2):0 }}</text>
+                          <text class="goods-price" style="font-size:26upx;">¥{{ risePrice(goodsItem) }}</text>
+                          <text class="original-price" style="font-size:22upx;">¥{{ goodsItem.price?parseFloat(goodsItem.price):0 }}</text>
                         </view>
                         <!-- 当涨价开关关闭时,显示原价 -->
                         <view v-else class="goods-price" style="font-size:26upx;">¥{{ goodsItem.price?parseFloat(goodsItem.price):0 }}</view>
@@ -159,8 +163,8 @@ export default {
       searchTimer: null, // 搜索防抖定时器
       riseSwitch: false, // 价格上涨开关
       riseData: {}, // 价格上涨配置
-      lookStock:0, // 1:有库存 2:无库存
-      lookPrice:0, // 1:有价格 2:无价格
+      stockStatus:0, // 1:有库存 2:无库存
+      priceStatus:0, // 1:有价格 2:无价格
       // 新增筛选相关数据
       showFilterPanel: false,
       selectedPrice: null,  // 选中的价格筛选
@@ -246,8 +250,8 @@ export default {
       this.selectedFlowerNum = null;
       
       // 清空后立即更新筛选变量
-      this.lookPrice = 0;
-      this.lookStock = 0;
+      this.priceStatus = 0;
+      this.stockStatus = 0;
       this.flowerNum = 0;
       
       // 关闭筛选面板
@@ -260,8 +264,8 @@ export default {
     
     confirmFilters() {
       // 更新原有的筛选变量以保持兼容性
-      this.lookPrice = this.selectedPrice || 0;
-      this.lookStock = this.selectedStock || 0;
+      this.priceStatus = this.selectedPrice || 0;
+      this.stockStatus = this.selectedStock || 0;
       this.flowerNum = this.selectedFlowerNum || 0;
       
       // 关闭筛选面板
@@ -276,20 +280,12 @@ export default {
 		// 兼容保留:旧筛选弹窗相关方法已不再使用
 		moreToDo(item){
 			let that=this;
-			let doList = ['打1个标签', '打2个标签','打5个标签', '打10个标签', '销售记录', '设置为散花']
+			let doList = ['打1个标签', '打2个标签','打5个标签', '打10个标签']
 			let doNum = [1,2,5,10,20]
 			uni.showActionSheet({
 				itemList: doList,
 				success: function (respond) {
 					let index = respond.tapIndex
-          if(index == 4){
-            that.$msg('开发中')
-            return
-          }
-          if(index == 5){
-            that.$msg('开发中')
-            return
-          }
           let currentNum = Number(doNum[index])
           print({id:item.id,num:currentNum}).then(res=>{
             if(res.code == 1){
@@ -327,7 +323,7 @@ export default {
           this.catId = this.tabbar[0].id
           this.getGoodsList()
         }
-      });
+      })
     },
     searchFn(){
       // 清除之前的定时器
@@ -365,8 +361,8 @@ export default {
             flower:1,
             searchText:this.searchText,
             flowerNum:this.flowerNum,
-            lookPrice:this.lookPrice,
-            lookStock:this.lookStock
+            priceStatus:this.priceStatus,
+            stockStatus:this.stockStatus
           }).then(res => {
             this.completes(res);
           });
@@ -374,7 +370,7 @@ export default {
       }
     },
     getGoodsList() {
-      return getCategoryToGoods({ status:'', page: this.list.page, catId:this.catId, flowerNum:this.flowerNum, lookPrice:this.lookPrice, lookStock:this.lookStock }).then(res => {
+      return getCategoryToGoods({ status:'', page: this.list.page, catId:this.catId, flowerNum:this.flowerNum, priceStatus:this.priceStatus, stockStatus:this.stockStatus }).then(res => {
         this.completes(res)
       })
     },
@@ -489,12 +485,12 @@ page {
       .goods-list-bottom {
         width: 96%;
         margin-top: 16upx;
-        color: #bebebe;
+        color: rgb(180, 178, 178);
         text{
-          border:1px solid rgb(218, 216, 216);
-          border-radius: 20upx;
+          border:1px solid rgb(196, 193, 193);
+          border-radius: 15upx;
           font-size:22upx;
-          padding:9upx 25upx 9upx 25upx;
+          padding:12upx 25upx 12upx 25upx;
         }
       }
       .img-blo {
@@ -558,7 +554,6 @@ page {
         // 原价格划线样式
         .original-price {
           color: #999999;
-          text-decoration: line-through;
           margin-left: 10upx;
         }
       }

+ 4 - 0
hdApp/src/api/category/index.js

@@ -57,3 +57,7 @@ export const changeStatusB = data => {
 export const sort = data => {
 	return https.post('/category/sort', data)
 }
+
+export const getMenu = data => {
+	return https.post('/category/get-menu', data)
+}

+ 11 - 23
hdApp/src/mixins/hs.js

@@ -1,8 +1,8 @@
 import { mapGetters, mapActions } from "vuex";
 import { copyObject } from "@/utils/util"
 import { allProduct } from '@/api/product'
-import { getMenu } from "@/api/item-class";
-import { getItemList } from '@/api/item';
+import { getCategoryToGoods } from "@/api/goods"
+import {getMenu} from "@/api/category"
 export default {
 	data() {
 		return {
@@ -153,7 +153,7 @@ export default {
 						if(!that.$util.isEmpty(currentInfo)){
 							that.setSelectInfo({ selectJobType: that.selectJobType, info: currentInfo,selectJobId:that.selectJobId })
 						}
-						that.getGlobalProductList()
+						that.getGlobalGoodsList()
 					}
 				}
 			})
@@ -162,14 +162,14 @@ export default {
 			this.globalGoToTop()
             this.globalPage = 1
 			this.globalFinishGetItem = 0
-			this.getGlobalProductList()
+			this.getGlobalGoodsList()
 		},
-        getGlobalProductList(){
+        getGlobalGoodsList(){
             if(this.globalFinishGetItem == 1){
                 return false
             }
             let that = this
-			getItemList({classId:this.globalClassId,requestType:this.globalRequestType,page:this.globalPage,
+			getCategoryToGoods({classId:this.globalClassId,requestType:this.globalRequestType,page:this.globalPage,
 				search:this.globalPy,customId:this.globalCustomId,globalCgMyCharge:this.globalCgMyCharge,lookStock:this.globalLookStock}).then(res=>{
 				if(res.code == 1){
 					that.globalItemData = that.globalPage == 1 ? res.data.list : that.globalItemData.concat(res.data.list)
@@ -233,7 +233,7 @@ export default {
 					//无操作
 				}else{
 					let currentClass = this.globalClassDataIndex[currentClassId] ? this.globalClassDataIndex[currentClassId] : null
-					cName = currentClass.name ? currentClass.name : ''
+					cName = currentClass.categoryName ? currentClass.categoryName : ''
 					hasExists[currentClassId] = 1
 				}
 				that.globalItemData[i].className = cName
@@ -247,7 +247,7 @@ export default {
 			this.$refs.globalSearchRef.search = ''
             this.globalClassId = item.id
             this.globalFinishGetItem = 0
-            this.getGlobalProductList()
+            this.getGlobalGoodsList()
 		},
 		pushToSave(selectData){
 			this.setSelectInfo({ selectJobType: this.selectJobType, info: selectData,selectJobId:this.selectJobId })
@@ -259,7 +259,7 @@ export default {
 		},
 		removeFromSave(){
 			let that = this
-			that.$util.confirmModal({content:'确认清除花材?'},() => {
+			that.$util.confirmModal({content:'确认清除?'},() => {
 				that.removeFromSaveDirect()
 				that.$msg('已清除')
             })
@@ -269,10 +269,6 @@ export default {
 			//删除仓库
 			uni.removeStorageSync('selectList_'+that.selectJobType+'_target_'+that.selectJobId)
 			that.reSetSelectInfo({selectJobType:that.selectJobType,selectJobId:that.selectJobId})
-			//删除多颜色
-			if(that.selectJobType == 'bill'){
-				uni.removeStorageSync("xj"+that.selectJobId)
-			}
 			//删除显示
 			if(!this.$util.isEmpty(this.globalItemData)){
 				this.globalItemData.forEach((item,index,arr) =>{
@@ -291,7 +287,7 @@ export default {
 				this.globalGoToTop()
                 this.globalClassIndex = -1
                 this.globalFinishGetItem = 0
-                this.getGlobalProductList()
+                this.getGlobalGoodsList()
             }
         },
 		globalGoToTop(){
@@ -309,7 +305,7 @@ export default {
 				return false
 			}
 			this.globalIsRequesting = true
-			this.getGlobalProductList()
+			this.getGlobalGoodsList()
         },
 		getSelectItemById(id, classId) {
 			let info = { bigCount: null, smallCount: null, autoPrice: null, itemPrice: null }
@@ -461,14 +457,6 @@ export default {
 		},
 		//显示可以修改花材的弹框
 		showAddModelFn(info) {
-			if(info && info.variety == 1 && this.selectJobType == 'bill'){
-				let curPage = getCurrentPages();
-				let route = curPage[curPage.length - 1].route;
-				if(route == 'admin/billing/affirm'){
-					this.$msg('多颜色花材,请返回修改')
-					return false
-				}
-			}
 			if(info.bigNum <= 0 && info.smallNum <= 0){
 				if(this.globalCheckStock){
 					this.$util.noStockRemind()