Parcourir la source

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss_wx_app

zhoux il y a 1 an
Parent
commit
f96e4e3fcb

+ 1 - 1
components/dkbase/dk-form-bill/dk-form-bill.wxml

@@ -172,7 +172,7 @@
           </view>
           </view>
           <view wx:if="{{sumAmountColFlag}}" class="amount-item-class">
           <view wx:if="{{sumAmountColFlag}}" class="amount-item-class">
             <!--条数-->
             <!--条数-->
-            <dk-cell titleColor="#95A8CB;" title="{{$t['together'] + (card[sumQuantityCol]?card[sumQuantityCol]:0) + $t['piece']}}" amount="{{false}}"></dk-cell>
+            <dk-cell titleColor="#95A8CB;" title="{{$t['goodsQuantity']+':' + (card[sumQuantityCol]?card[sumQuantityCol]:0) + $t['piece']}}" amount="{{false}}"></dk-cell>
             <!--合计金额-->
             <!--合计金额-->
             <dk-cell fontSize="16" fontWeight="bold" contentFontWeight="700" contentColor="#FF7B1A" titleColor="#1B365D;" title="合计金额" content="{{card[sumAmountCol]?card[sumAmountCol]:0}}"></dk-cell>
             <dk-cell fontSize="16" fontWeight="bold" contentFontWeight="700" contentColor="#FF7B1A" titleColor="#1B365D;" title="合计金额" content="{{card[sumAmountCol]?card[sumAmountCol]:0}}"></dk-cell>
             <!-- <view style="display: flex;width: calc(100% - 260rpx);">
             <!-- <view style="display: flex;width: calc(100% - 260rpx);">

+ 8 - 0
components/dkbase/dk-save-button/dk-save-button.js

@@ -40,6 +40,14 @@ Component({
       type: String,
       type: String,
       value: 'default'
       value: 'default'
     },
     },
+    countName: {  
+      type: String,
+      value: '数量'
+    },
+    countEnd: {  
+      type: String,
+      value: '件'
+    },
     // 结果集
     // 结果集
     value: {
     value: {
       type: String,
       type: String,

+ 5 - 3
components/dkbase/dk-save-button/dk-save-button.wxml

@@ -11,6 +11,7 @@
         </view>
         </view>
         <!--数字-->
         <!--数字-->
         <dk-cell wx:if="{{item.type=='number'}}" fontSize="{{item.fontSize?item.fontSize:16}}" contentFontSize="{{item.fontSize?item.fontSize:16}}" height="{{item.height?item.height:'44rpx'}}" spaceWidth="10rpx" fontWeight="{{item.fontWeight?item.fontWeight:600}}" left="0rpx" contentColor="{{item.color?item.color:'#FF7B1A'}}" titleColor="{{'#002340'}}" title="{{item.title}}" content="{{ item.content}}" amount="{{true}}"></dk-cell>
         <dk-cell wx:if="{{item.type=='number'}}" fontSize="{{item.fontSize?item.fontSize:16}}" contentFontSize="{{item.fontSize?item.fontSize:16}}" height="{{item.height?item.height:'44rpx'}}" spaceWidth="10rpx" fontWeight="{{item.fontWeight?item.fontWeight:600}}" left="0rpx" contentColor="{{item.color?item.color:'#FF7B1A'}}" titleColor="{{'#002340'}}" title="{{item.title}}" content="{{ item.content}}" amount="{{true}}"></dk-cell>
+
         <!--选择框-->
         <!--选择框-->
         <view wx:if="{{item.type=='checkbox'}}" style="display: flex;margin-top: 10rpx; margin-bottom: 10rpx;">
         <view wx:if="{{item.type=='checkbox'}}" style="display: flex;margin-top: 10rpx; margin-bottom: 10rpx;">
           <van-checkbox disabled="{{item.disabled}}" value="{{ form[item.code] }}" icon-size="{{item.iconSize?item.iconSize:'16px'}}" data-code="{{item.code}}" bind:change="change"></van-checkbox>
           <van-checkbox disabled="{{item.disabled}}" value="{{ form[item.code] }}" icon-size="{{item.iconSize?item.iconSize:'16px'}}" data-code="{{item.code}}" bind:change="change"></van-checkbox>
@@ -18,15 +19,16 @@
         </view>
         </view>
         <!--单数和件数-->
         <!--单数和件数-->
         <view wx:if="{{item.type == 'count'}}" style="display: flex ;margin-top: 10rpx;color: {{item.color?item.color:'#2B2B2B'}};font-size: {{item.fontSize?item.fontSize:'12px'}}">
         <view wx:if="{{item.type == 'count'}}" style="display: flex ;margin-top: 10rpx;color: {{item.color?item.color:'#2B2B2B'}};font-size: {{item.fontSize?item.fontSize:'12px'}}">
-          <view wx:if="{{item.bill || item.bill == 0}}">共:{{item.bill}}{{item.tail?item.tail:'单'}}</view> 
-          <view wx:if="{{item.quantity!=null}}" style="padding-left: {{(item.bill || item.bill == 0)?'20rpx':''}} ">数量:{{item.quantity}}件 </view>
+          <view wx:if="{{item.bill || item.bill == 0}}">共:{{item.bill}}{{item.tail?item.tail:'单'}}</view>
+          <view wx:if="{{item.quantity!=null}}" style="padding-left: {{(item.bill || item.bill == 0)?'20rpx':''}} ">{{countName}}:{{item.quantity}}{{countEnd}}
+          </view>
         </view>
         </view>
       </view>
       </view>
     </view>
     </view>
 
 
     <!-- 保存确定区域 -->
     <!-- 保存确定区域 -->
     <!-- <view style="display: flex;width: {{contentList && contentList.length > 0?'50%':'100%'}};justify-content: {{btnRightFlag?'flex-end':'left'}};"> -->
     <!-- <view style="display: flex;width: {{contentList && contentList.length > 0?'50%':'100%'}};justify-content: {{btnRightFlag?'flex-end':'left'}};"> -->
-      <view style="display: flex;width: {{contentList && contentList.length > 0?'auto':'100%'}};justify-content: {{btnRightFlag?'flex-end':'left'}};min-width:236rpx;">
+    <view style="display: flex;width: {{contentList && contentList.length > 0?'auto':'100%'}};justify-content: {{btnRightFlag?'flex-end':'left'}};min-width:236rpx;">
       <view class="btn-class" style="margin-right: {{(btnAutoWidthFlag && index != buttonList.length - 1)?'20rpx':''}};  width:{{btnAutoWidthFlag?(100/buttonList.length + '%'): (item.width?item.width:'156rpx')}};" wx:for="{{buttonList}}" wx:for-item="item" data-item="{{item}}" wx:key="index">
       <view class="btn-class" style="margin-right: {{(btnAutoWidthFlag && index != buttonList.length - 1)?'20rpx':''}};  width:{{btnAutoWidthFlag?(100/buttonList.length + '%'): (item.width?item.width:'156rpx')}};" wx:for="{{buttonList}}" wx:for-item="item" data-item="{{item}}" wx:key="index">
         <van-button size="large" plain="{{item.plain}}" data-item="{{item}}" color="{{item.color?item.color:'#3E69F6'}}" custom-style="height:88rpx;border-radius:15rpx ;" bind:click="submit" type="info">{{item.title}}
         <van-button size="large" plain="{{item.plain}}" data-item="{{item}}" color="{{item.color?item.color:'#3E69F6'}}" custom-style="height:88rpx;border-radius:15rpx ;" bind:click="submit" type="info">{{item.title}}
         </van-button>
         </van-button>

+ 6 - 5
pages/shopping/shopping.js

@@ -80,7 +80,7 @@ Page({
         type: 'number',
         type: 'number',
         title: mixins.$t("totalAmount")
         title: mixins.$t("totalAmount")
       },
       },
-      {
+      { 
         type: 'count',
         type: 'count',
         code: 'count',
         code: 'count',
         quantity: 0
         quantity: 0
@@ -178,7 +178,7 @@ Page({
    */
    */
   editItemsBox(e) {
   editItemsBox(e) {
     let dataItem = JSON.parse(this.data.dataItem)
     let dataItem = JSON.parse(this.data.dataItem)
-    dataItem['itemQty'] = dataItem['box'] * dataItem['packBox'] + dataItem['piece']
+    dataItem['itemQty'] = Number(dataItem['box']) * Number(dataItem['packBox']) + Number(dataItem['piece']) 
     dataItem.packageBox = dataItem['box'] + dataItem.subUnitName + dataItem['piece'] + dataItem.unitName
     dataItem.packageBox = dataItem['box'] + dataItem.subUnitName + dataItem['piece'] + dataItem.unitName
     dataItem.sumPrice = dataItem.priceSale * dataItem.itemQty
     dataItem.sumPrice = dataItem.priceSale * dataItem.itemQty
     this.setData({
     this.setData({
@@ -344,7 +344,7 @@ Page({
     let item = e.currentTarget.dataset.item
     let item = e.currentTarget.dataset.item
     item.itemQty = 1 //打开 popur 数量默认为1
     item.itemQty = 1 //打开 popur 数量默认为1
     item['box'] = parseInt(item.itemQty / item.packBox)
     item['box'] = parseInt(item.itemQty / item.packBox)
-    item['piece'] = Number(item.itemQty % item.packBox)
+    item['piece'] = Number(item.itemQty) % Number(item.packBox)
     item.packageBox = item['box'] + item.subUnitName + item['piece'] + item.unitName
     item.packageBox = item['box'] + item.subUnitName + item['piece'] + item.unitName
     //选了辅助计量单位 正好 包装也有值 那么直接给出公式
     //选了辅助计量单位 正好 包装也有值 那么直接给出公式
     if (item.flgSubUnit && item.subUnitName) {
     if (item.flgSubUnit && item.subUnitName) {
@@ -412,8 +412,8 @@ Page({
     let sumAmt = Number(0)
     let sumAmt = Number(0)
     let sumQty = Number(0)
     let sumQty = Number(0)
     choosedGoodsList.forEach(res => {
     choosedGoodsList.forEach(res => {
-      sumAmt +=  res.sumPrice
-      sumQty += res.itemQty
+      sumAmt += Number(res.sumPrice)
+      sumQty += Number(res.itemQty)
     })
     })
     contentList[0].content = sumAmt
     contentList[0].content = sumAmt
     contentList[1].quantity = sumQty
     contentList[1].quantity = sumQty
@@ -465,6 +465,7 @@ Page({
         that.setData({ // 购物车点击结算清空已选
         that.setData({ // 购物车点击结算清空已选
           choosedGoodsList:[]
           choosedGoodsList:[]
         })
         })
+        that.calculateParameters()
       }
       }
     })
     })
   
   

+ 1 - 1
pages/shopping/shopping.wxml

@@ -186,4 +186,4 @@
 <!-- 箱片 -->
 <!-- 箱片 -->
 <dk-popup   type="basic"  title="修改包装数量"    titleCol="skuModel"  iconCol="imagesUrl"   value="{{dataItem}}" show="{{showPopBox}}" routeObjName="{{routeObjName}}"   contentObj="{{popContentBox}}" bind:changeStep="changeStep" bind:commit="editItemsBox" stepperDecimal ="decimalPlaces" ></dk-popup>
 <dk-popup   type="basic"  title="修改包装数量"    titleCol="skuModel"  iconCol="imagesUrl"   value="{{dataItem}}" show="{{showPopBox}}" routeObjName="{{routeObjName}}"   contentObj="{{popContentBox}}" bind:changeStep="changeStep" bind:commit="editItemsBox" stepperDecimal ="decimalPlaces" ></dk-popup>
 
 
-<dk-save-button  cssType="sale" model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="submit"></dk-save-button>
+<dk-save-button  countName="商品数量" countEnd="" cssType="sale" model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="submit"></dk-save-button>