shish 4 лет назад
Родитель
Сommit
ebb6c5787b

+ 9 - 4
hdPad/src/admin/home/components/leftItem.vue

@@ -8,9 +8,15 @@
                         <view class="current-item-title"><text class="name">{{item.name}}</text><text @click.stop="delItem(item)" class="del">删除</text></view>
                     </view>
                     <view class="item-price-num">
-                        <view v-if="item.unitType == 0">{{parseFloat(item.bigPrice)}}元/{{item.bigUnit}}</view>
-                        <view v-else>{{parseFloat(item.smallPrice)}}元/{{item.smallUnit}}</view>
-                        <view>{{item.buyNum}} {{item.unitType == 0 ? item.bigUnit : item.smallUnit}}</view>
+                        <template v-if="item.property && item.property == 1">
+                            <view v-if="item.unitType == 0">{{parseFloat(item.bigPrice)}}元/{{item.bigUnit}}</view>
+                            <view v-else>{{parseFloat(item.smallPrice)}}元/{{item.smallUnit}}</view>
+                            <view>{{item.buyNum}} {{item.unitType == 0 ? item.bigUnit : item.smallUnit}}</view>
+                        </template>
+                        <template v-else>
+                            <view>{{parseFloat(item.unitPrice)}}/份</view>
+                            <view>{{item.buyNum}}份</view>
+                        </template>
                         <view>¥{{parseFloat((item.buyNum * item.unitPrice).toFixed(2))}}</view>
                     </view>
                 </view>
@@ -25,7 +31,6 @@
             </view>
             <view> 合计 <text style="margin-left:5upx;">¥{{allPrice}}</text> </view>
         </view>
-
     </view>
 </template>
 <script>

+ 2 - 0
hdPad/src/admin/home/components/middleButton.vue

@@ -68,8 +68,10 @@ export default {
 				this.$msg('请选择商品')
 				return false
 			}
+			uni.showLoading({mask:true})
 			let product = this.selectList.map(i=>({ productId:i.id, unitType: i.unitType, num: i.buyNum, property: i.property, unitPrice: i.unitPrice }))
 			createCreateOrder({...params,product:JSON.stringify(product)}).then(res=>{
+				uni.hideLoading()
 				if(res.code == 1){
 					this.$refs.settlePopRef.close()
 					this.$refs.toPayRef.open('center')

+ 1 - 1
hdPad/src/admin/home/components/rightGoodsArea.vue

@@ -93,7 +93,7 @@ export default {
             })
         },
         getGoodsData(){
-            getGoodsList({cId:this.currentCategory.id,page:this.list.page,flowerNum:this.flowerNum}).then(res=>{
+            getGoodsList({cId:this.currentCategory.id,page:this.list.page,pageSize:30,flowerNum:this.flowerNum}).then(res=>{
                 if(res.code == 1){
                     this.completes(res)
                 }

+ 23 - 14
hdPad/src/components/app-kd-select-num-price.vue

@@ -2,10 +2,12 @@
     <view class="boardset-flowert">
         <view class="flower-input_box">
             <view class="flower-title">{{customData.name}}</view>
-            <view class="flower-ratio">{{customData.ratio}}{{customData.smallUnit}}/{{customData.bigUnit}}</view>
+            <view class="flower-ratio" v-if="customData.property && customData.property==1">{{customData.ratio}}{{customData.smallUnit}}/{{customData.bigUnit}}</view>
+
             <view class="flower-open_box">
                 <view>
-                    <view class="desc">{{Number(unitType) == 0 ? customData.bigUnit : customData.smallUnit}}数</view>
+                    <view class="desc" v-if="customData.property && customData.property==1">{{Number(unitType) == 0 ? customData.bigUnit : customData.smallUnit}}数</view>
+                    <view class="desc" v-else>数量</view>
                     <div class="flower-unit_box" @tap="checkCurrent(0)">
                         <text :class="{selected:checkType == 0}">{{buyNum}}</text>
                     </div>
@@ -17,14 +19,18 @@
                     </div>
                 </view>
             </view>
-            <view class="set-residue_box">
+
+            <view class="set-residue_box" v-if="customData.property && customData.property==1">
                 还剩
                 <text v-if="bigStockNum>0">{{bigStockNum}}{{customData.bigUnit}}</text>
                 <text v-if="smallStockNum>0">{{smallStockNum}}{{customData.smallUnit}}</text>
-                </view>
-            <view class="switch-button">
+            </view>
+            <view class="set-residue_box" v-else> 还剩 <text>{{customData.stock}}</text> </view>
+
+            <view class="switch-button" v-if="customData.property && customData.property==1">
                 <image @tap="changeUnitType" class="change-unit" :src="`${constant.imgUrl}/icon/switch/switch128.png`"></image>
             </view>
+
         </view>
         <view class="keyboard-body_box">
          <VKeyboard ref="keyboard" :pointIsShow="true" :digital="true" :disorderly="false" @typing="typing" @enter="enter" @cancel="cancel"> </VKeyboard>
@@ -57,15 +63,18 @@ export default {
     },
 	watch:{
 		customData:{
-			handler(){
-				this.buyNum = this.customData.buyNum ? parseFloat(this.customData.buyNum) : 1
-				this.unitPrice = this.customData.bigPrice ? parseFloat(this.customData.bigPrice) : 0
-
-                this.bigStockNum = Math.floor(this.customData.stock)
-                let smallCount = this.customData.stock - this.bigStockNum
-                let smallStockNum = smallCount*this.customData.ratio
-                this.smallStockNum = smallStockNum.toFixed(2)
-                this.smallStockNum = parseFloat(this.smallStockNum)
+			handler(newData){
+				this.buyNum = newData.buyNum ? parseFloat(newData.buyNum) : 1
+                if(newData.property && newData.property == 1){
+                    this.bigStockNum = Math.floor(newData.stock)
+                    let smallCount = newData.stock - this.bigStockNum
+                    let smallStockNum = smallCount*newData.ratio
+                    this.smallStockNum = smallStockNum.toFixed(2)
+                    this.smallStockNum = parseFloat(this.smallStockNum)
+                    this.unitPrice = newData.bigPrice ? parseFloat(newData.bigPrice) : 0
+                }else{
+                    this.unitPrice = newData.price ? parseFloat(newData.price) : 0
+                }
 			},
 			deep:true,
             immediate:true