|
@@ -24,21 +24,24 @@
|
|
</v-chip>
|
|
</v-chip>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
- <!-- 购买数量 -->
|
|
|
|
|
|
+ <!-- 购买数量- 库存 -->
|
|
<div class="modal-content">
|
|
<div class="modal-content">
|
|
- <div>
|
|
|
|
- <div class="buyCount mb-10">
|
|
|
|
|
|
+ <!-- 只展示库存 -->
|
|
|
|
+ <div v-if="props.goodsType === 99" class="parameterColor mb-10"><span class="l-s-10">库存</span>:{{ totalStock }}</div>
|
|
|
|
+ <div v-else class="d-flex align-center mb-10">
|
|
|
|
+ <div class="buyCount mr-3">
|
|
<span class="parameterColor"><span class="l-s-10">数量</span>:</span>
|
|
<span class="parameterColor"><span class="l-s-10">数量</span>:</span>
|
|
<su-number-box
|
|
<su-number-box
|
|
:min="1"
|
|
:min="1"
|
|
:max="state.selectedSku.stock"
|
|
:max="state.selectedSku.stock"
|
|
- :totalStock="totalStock"
|
|
|
|
:step="1"
|
|
:step="1"
|
|
ref="selectSkuRef"
|
|
ref="selectSkuRef"
|
|
v-model="state.selectedSku.goods_num"
|
|
v-model="state.selectedSku.goods_num"
|
|
@change="onNumberChange($event)"
|
|
@change="onNumberChange($event)"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 数量可加减 库存 -->
|
|
|
|
+ <span style="color: #b7b7b7; font-size: 14px;">库存:{{ totalStock }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- 操作区 -->
|
|
<!-- 操作区 -->
|
|
@@ -50,19 +53,23 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-defineOptions({name: 'wares-s-select-sku'})
|
|
|
|
-import Snackbar from '@/plugins/snackbar'
|
|
|
|
-import suNumberBox from '@/components/FormUI/su-number-box/su-number-box.vue'
|
|
|
|
-import { computed, reactive, watch, ref } from 'vue'
|
|
|
|
-import { convertProductPropertyList } from '@/views/mall/utils'
|
|
|
|
-
|
|
|
|
-const emits = defineEmits(['change', 'addCart', 'buy', 'close']);
|
|
|
|
-const props = defineProps({
|
|
|
|
- goodsInfo: {
|
|
|
|
- type: Object,
|
|
|
|
- default() {},
|
|
|
|
- },
|
|
|
|
-});
|
|
|
|
|
|
+ defineOptions({name: 'wares-s-select-sku'})
|
|
|
|
+ import Snackbar from '@/plugins/snackbar'
|
|
|
|
+ import suNumberBox from '@/components/FormUI/su-number-box/su-number-box.vue'
|
|
|
|
+ import { computed, reactive, watch, ref } from 'vue'
|
|
|
|
+ import { convertProductPropertyList } from '@/views/mall/utils'
|
|
|
|
+
|
|
|
|
+ const emits = defineEmits(['change', 'addCart', 'buy', 'close']);
|
|
|
|
+ const props = defineProps({
|
|
|
|
+ goodsInfo: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default() {},
|
|
|
|
+ },
|
|
|
|
+ goodsType: {
|
|
|
|
+ type: Number,
|
|
|
|
+ default: 0,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
|
|
const totalStock = ref(props.goodsInfo?.stock-0 || 0)
|
|
const totalStock = ref(props.goodsInfo?.stock-0 || 0)
|
|
const state = reactive({
|
|
const state = reactive({
|