cb-biz-ui 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,7 +79,19 @@
79
79
  <ui-icon name="add" :size="19" color="red"></ui-icon>
80
80
  </view>
81
81
  <view v-else class="number-box" @tap.stop="() => {}">
82
- <ui-numberbox
82
+ <uni-number-box
83
+ :value="goodsCount"
84
+ :min="0"
85
+ :max="
86
+ entity.unlimitedInventory
87
+ ? 99999
88
+ : entity.inventoryCapacity || 100
89
+ "
90
+ :step="1"
91
+ @change="change"
92
+ ></uni-number-box>
93
+
94
+ <!-- <ui-numberbox
83
95
  :value="goodsCount"
84
96
  :min="0"
85
97
  :max="
@@ -96,7 +108,7 @@
96
108
  :step="1"
97
109
  :backgroundColor="textFontSize.numberBoxBg"
98
110
  iconColor="#C7C7CC"
99
- ></ui-numberbox>
111
+ ></ui-numberbox> -->
100
112
  </view>
101
113
  <ui-cubic-bezier
102
114
  v-if="bezier"
@@ -205,14 +217,11 @@ const getDiscount = (discount: number | string) => {
205
217
  return `${discount} 折`;
206
218
  };
207
219
 
208
- const change = (val: changeValueType) => {
209
- // if (val.value > item.skuInfo.inventoryCapacity) {
210
- // uni.showToast({
211
- // title: '库存不足,最大库存为' + item.skuInfo.inventoryCapacity,
212
- // icon: 'none',
213
- // })
214
- // }
215
- emit('countChange', val, props.entity);
220
+ const change = (val: number) => {
221
+ if (val > props.entity.inventoryCapacity) {
222
+ triggerMax();
223
+ }
224
+ emit('countChange', { value: val, type: 'reduce', index: 0 }, props.entity);
216
225
  };
217
226
 
218
227
  const triggerMax = () => {
@@ -36,7 +36,7 @@ export interface changeValueType {
36
36
  value: number;
37
37
  type: 'plus' | 'reduce' | 'blur';
38
38
  index: number;
39
- custom: any;
39
+ custom?: any;
40
40
  }
41
41
 
42
42
  export interface skuInfoType {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cb-biz-ui",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "cb-biz-ui",
5
5
  "main": "index.js",
6
6
  "keywords": [