Selaa lähdekoodia

拆散功能优化

shish 1 vuosi sitten
vanhempi
commit
1d8a56ae8b
2 muutettua tiedostoa jossa 25 lisäystä ja 39 poistoa
  1. 2 2
      ghsApp/src/admin/breakage/index.vue
  2. 23 37
      ghsApp/src/admin/part/index.vue

+ 2 - 2
ghsApp/src/admin/breakage/index.vue

@@ -8,7 +8,7 @@
 			<view class="search-bar">
 				<app-search-module ref="globalSearchRef" v-model="globalPy" placeholder="这里搜索" @input="globalSearch" />
 			</view>
-			<view style="float:right">
+			<view style="float:right;margin-left:10upx;">
 				<button class="admin-button-com middle blue" @click="removeFromSave(0)">清除花材</button>
 			</view>
 		</view>
@@ -102,7 +102,7 @@ import ModalModule from "@/components/plugin/modal";
 import { COMMODITY_TYPE } from "@/utils/declare";
 import productMins from "@/mixins/product2";
 export default {
-	name: "breakageIndex",
+	name: "index",
 	components: {
 		AppTabs,
 		AppSearchModule,

+ 23 - 37
ghsApp/src/admin/part/index.vue

@@ -6,9 +6,9 @@
 				<button class="admin-button-com middle blue" @click="selectFlowerNumFn()">图片分类</button>
 			</view>
 			<view class="search-bar">
-				<app-search-module v-model="py" placeholder="输拼音首字母也可以搜" @input="searchFn" />
+				<app-search-module ref="globalSearchRef" v-model="globalPy" placeholder="这里搜索" @input="globalSearch" />
 			</view>
-			<view style="float:right">
+			<view style="float:right;margin-left:10upx;">
 				<button class="admin-button-com middle blue" @click="removeFromSave(0)">清除花材</button>
 			</view>
 		</view>
@@ -16,22 +16,20 @@
 		<view class="scroll-middle_bx">
 
 			<scroll-view scroll-y scroll-with-animation class="tab-view">
-				<!--分类 start -->
-				<div v-for="(item, index) in globalClassItemList" :key="index" class="tab-bar-item" :class="classIndex == index ? 'active' : ''" :data-current="index" @tap.stop="swichClass(index)">
-					<text>{{ item.className || "" }}</text>
+				<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>{{ item.name || "" }}</text>
 				</div>
-				<!--分类 end -->
 				<view style="height: 120upx"></view>
 			</scroll-view>
 
-			<scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true" @scroll="scroll_detail" lower-threshold="100" @scrolltolower="scroll_bottom">
-				<!--花材列表 start -->
-				<block v-if="!$util.isEmpty(globalClassItemList)">
-					<view class="item_list_bx selectAll" v-for="(classItem, classIndex) in globalClassItemList" :key="classIndex" :id="`class_${classIndex}`">
-						<view class="item_list_title">{{ classItem.className }}</view>
-						<template v-for="(productItem, productIndex) in classItem.child">
-							<view style="height: 175upx" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
-								<Commondity v-if="classItem.isActive"
+			<scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true" 
+			:scroll-top="globalScrollTopPlace" @scroll="globalGetScroll" lower-threshold="100" @scrolltolower="globalScrollBottom">
+				<block v-if="!$util.isEmpty(globalItemData)">
+					<view class="item_list_bx selectAll">
+						<template v-for="(productItem, productIndex) in globalItemData">
+							<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
+							<view style="height: 175upx" :key="productIndex">
+								<Commondity
 									:checkStock="true"
 									:info="productItem"
 									@showAddModelFn="showAddModelFn"
@@ -42,9 +40,8 @@
 					</view>
 				</block>
 				<block v-else>
-					<app-wrapper-empty title="加载中" :is-empty="$util.isEmpty(globalClassItemList)" />
+					<app-wrapper-empty title="加载中" :is-empty="$util.isEmpty(globalItemData)" />
 				</block>
-				<!--花材列表 end -->
 			</scroll-view>
 
 		</view>
@@ -52,10 +49,7 @@
 		<modal-module :show="isAddModel" @cancel="addItemModelHidden" @click="confirmAddItemModel" :title="customData.name" color="#333" :size="32" padding="30rpx 30rpx" >
 			<template slot="customContent">
 				<view class="select-cmd_bx" v-if="customData">
-					<view class="kc">
-						<text class="unit_price">库存 {{ customData.stock?parseFloat(customData.stock):0 }}</text>
-						<text style="margin-left:14upx;">{{customData.ratio}}{{customData.smallUnit}}/{{customData.bigUnit}}</text>
-					</view>
+					<view class="kc"><text class="unit_price">库存 {{ customData.stock||0 }}</text></view>
 					<view class="num_bx">
 
 						<!-- #ifdef APP-PLUS -->
@@ -81,21 +75,19 @@
 		<modal-module :show="showSubmitModel" title="确认下一步?" color="#333" :size="32" padding="30upx 30upx" >
 		</modal-module>
 
-		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmToSave" :selectJobType="selectJobType" ></FooterCart>
+		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmToSave" :displayTotalPrice="false"></FooterCart>
 
-		<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+		<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 globalClassItemList" :key="index" @tap.stop="changeClass(index)" style="margin-bottom:20upx;margin-left:3upx;">
-				<image :src="item.classCover" 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.className}}</view>
+				<view v-for="(item, index) in globalClassData" :key="index" @tap.stop="globalChangeClass(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>
@@ -108,7 +100,7 @@ import Commondity from "@/components/module/app-commodity";
 import FooterCart from "@/components/module/app-footer-cart";
 import ModalModule from "@/components/plugin/modal";
 import { COMMODITY_TYPE } from "@/utils/declare";
-import productMins from "@/mixins/product";
+import productMins from "@/mixins/product2";
 export default {
 	name: "index",
 	components: {
@@ -139,18 +131,12 @@ export default {
 		};
 	},
 	onLoad(){
-		this.initData({requestType:'part'})
+		this.globalRequestType = 'part'
+		this.initData()
 	},
 	methods: {
-		changeClass(index){
-			this.$refs.selectFlowerNumRef.close()
-			this.swichClass(index)
-		},
 		selectFlowerNumFn(){
-			this.$refs.selectFlowerNumRef.open('top')
-		},
-		hideClassRemind(){
-
+			this.$refs.globalClassImgRef.open('top')
 		},
 		switchGlobalUnitType(){
 			if(this.globalUnitType == 0){