商品管理
This commit is contained in:
parent
ff2c438d88
commit
5d29f788c3
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<u--form :model="model1" ref="uForm" labelPosition="left" :labelStyle="{fontSize:'32rpx',color:'#444444'}"
|
||||
labelWidth='120' borderBottom>
|
||||
labelWidth='120' borderBottom style="padding-bottom: 100rpx;">
|
||||
|
||||
<view class="description">
|
||||
产品属性
|
||||
|
|
|
@ -44,7 +44,8 @@
|
|||
<view class=" card-li">
|
||||
<text style="font-size: 32rpx;">商品库存</text>
|
||||
<view class="" style="width: 300rpx;">
|
||||
<u--input type='number' placeholder="请填写库存数量" inputAlign='right' v-model="item.stock"></u--input>
|
||||
<u--input type='number' placeholder="请填写库存数量" inputAlign='right' :value="item.stock"
|
||||
@input="onInput($event,item)"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<u-line direction="row" style="margin: 25rpx 0;" color="#ECECEC"></u-line>
|
||||
|
@ -179,6 +180,20 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
onInput(event, item) {
|
||||
|
||||
if (!/^\d*$/.test(event)) {
|
||||
event = event.replace(/[^\d]/g, '');
|
||||
}
|
||||
console.log(event);
|
||||
|
||||
item.stock = event;
|
||||
this.$forceUpdate();
|
||||
// 更新整数值
|
||||
},
|
||||
|
||||
|
||||
delFn(index) {
|
||||
if (this.attrValue.length == 1) {
|
||||
return this.$util.Tips({
|
||||
|
|
|
@ -15,12 +15,11 @@
|
|||
{{short.store_name}}
|
||||
</view>
|
||||
<view class="" style="font-size: 24rpx;color: #989898;margin-top: 10rpx;">
|
||||
<!-- 库存: {{short.attrValue[0].stock}}个 -->
|
||||
库存: {{attrvalueStock}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="color: #FC452F;font-size: 24rpx;">
|
||||
<text style="font-size: 22rpx;">¥</text><text>10.00</text><text
|
||||
<text style="font-size: 22rpx;">¥</text><text>{{short.attrValue[0].price}}</text><text
|
||||
style="color: #828282;">/{{short.attrValue && short.attrValue[0].unit_name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -30,13 +29,13 @@
|
|||
{{item.sku||'单规格'}}
|
||||
</view>
|
||||
<u-line color="#CECECE" style="margin: 30rpx 0 28rpx 0"></u-line>
|
||||
<view class="" style="display: flex;justify-content: space-between;font-size: 32rpx;">
|
||||
<view class="" style="display: flex;justify-content: space-between;font-size: 32rpx;align-items: center;">
|
||||
<view class="">
|
||||
商品库存
|
||||
</view>
|
||||
<view class="" style="display: flex;align-items: center;color: #FC452F;">
|
||||
<u--input border="surround" color='#FC452F' inputAlign='right' style='padding: 0;'
|
||||
v-model="item.stock"></u--input>{{item.unit_name}}
|
||||
<u--input type="number" border="surround" color='#FC452F' inputAlign='right' style='padding: 0;'
|
||||
:value="item.stock" @input="onInput($event,item)"></u--input>{{item.unit_name}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -110,6 +109,14 @@
|
|||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
onInput(event, item) {
|
||||
if (!/^\d*$/.test(event)) {
|
||||
event = event.replace(/[^\d]/g, '');
|
||||
}
|
||||
item.stock = event;
|
||||
this.$forceUpdate();
|
||||
// 更新整数值
|
||||
},
|
||||
preViewImg(url) {
|
||||
let that = this
|
||||
uni.previewImage({
|
||||
|
@ -246,6 +253,8 @@
|
|||
position: fixed;
|
||||
bottom: 50rpx;
|
||||
width: 670rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
// old
|
||||
|
|
Loading…
Reference in New Issue