|
|
@@ -31,13 +31,13 @@
|
|
|
<div class="pull-left">
|
|
|
<span class="name">规格:</span>
|
|
|
<div class="specInput input">
|
|
|
- <input type="text" placeholder="请输入规格" v-model="chooseItem.spec" maxlength="40"/>
|
|
|
+ <input type="text" placeholder="请输入规格" v-model="chooseItem.spec" maxlength="50"/>
|
|
|
<img src="/images/mobile/product/close_icon.png" @click="deleteText('spec')"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="pull-right">
|
|
|
<span class="name">库存:</span>
|
|
|
- <input type="tel" placeholder="1" v-model="chooseItem.reserve" class="input reserveInput" maxlength="9" />
|
|
|
+ <input type="tel" placeholder="数量" v-model="chooseItem.reserve" class="input reserveInput" maxlength="9" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="list clearfix">
|
|
|
@@ -100,7 +100,7 @@
|
|
|
<li v-for="(item, index) in chooseItem.prices" v-bind:key="index">
|
|
|
<div class="clearfix">
|
|
|
<div class="pull-left">
|
|
|
- <input type="number" placeholder="数量" class="otherNumber" v-model.lazy="item.start" :disabled="index === 0" :readonly="index === 0" @blur="startpriceBlur(item, index)" maxlength="9"/>
|
|
|
+ <input type="number" placeholder="数量" class="otherNumber" :class="{firstNumber: index === 0}" v-model.lazy="item.start" :disabled="index === 0" :readonly="index === 0" @blur="startpriceBlur(item, index)" maxlength="9"/>
|
|
|
<label v-if="index !== chooseItem.prices.length - 1">-</label>
|
|
|
<label v-if="index === chooseItem.prices.length - 1">以上</label>
|
|
|
<input type="number" placeholder="数量" class="otherNumber" v-model.lazy="item.end" v-if="index !== chooseItem.prices.length - 1" @blur="endpriceBlur(item, index)" maxlength="9"/>
|
|
|
@@ -144,7 +144,7 @@
|
|
|
import { RemindBox } from '~components/mobile/common'
|
|
|
export default {
|
|
|
name: 'productDetails',
|
|
|
- layout: 'mobile',
|
|
|
+ layout: 'mobileNoFooter',
|
|
|
components: {
|
|
|
RemindBox
|
|
|
},
|
|
|
@@ -226,7 +226,7 @@
|
|
|
addPrice() {
|
|
|
if (this.chooseItem.prices.length === 3) {
|
|
|
this.timeoutCount++
|
|
|
- this.collectResult = '批次最多只能有三个分段'
|
|
|
+ this.collectResult = '价格梯度最多只能有三个分段'
|
|
|
return false
|
|
|
}
|
|
|
let copy = Object.assign({}, this.chooseItem.prices[this.chooseItem.prices.length - 1], {
|
|
|
@@ -338,9 +338,29 @@
|
|
|
// this.collectResult = '请输入正确的生产日期'
|
|
|
// return false
|
|
|
// }
|
|
|
- if (!this.chooseItem.reserve) {
|
|
|
+ if (!this.chooseItem.reserve && toString(this.chooseItem.reserve).trim()) {
|
|
|
this.timeoutCount++
|
|
|
- this.collectResult = '库存'
|
|
|
+ this.collectResult = '库存不能为空'
|
|
|
+ return false
|
|
|
+ } else if (!/^\d{1,9}$/.test(this.chooseItem.reserve)) {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '库存只能输入数字'
|
|
|
+ return false
|
|
|
+ } else if (!/^\d{1,6}$/.test(this.chooseItem.minPackQty)) {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '最小包装数只能输入数字'
|
|
|
+ return false
|
|
|
+ } else if (this.chooseItem.minPackQty && !toString(this.chooseItem.minPackQty).trim()) {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '最小包装数不能为空'
|
|
|
+ return false
|
|
|
+ } else if (!/^\d{1,6}$/.test(this.chooseItem.minBuyQty)) {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '最小起订量只能输入数字'
|
|
|
+ return false
|
|
|
+ } else if (this.chooseItem.minBuyQty && !toString(this.chooseItem.minBuyQty).trim()) {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '最小起订量不能为空'
|
|
|
return false
|
|
|
} else if (!this.chooseItem.tag) {
|
|
|
this.timeoutCount++
|
|
|
@@ -350,6 +370,18 @@
|
|
|
this.timeoutCount++
|
|
|
this.collectResult = '请填写生产日期'
|
|
|
return false
|
|
|
+ } else if (!this.chooseItem.minDelivery && !toString(this.chooseItem.minDelivery).trim()) {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '请填写最小交期时间'
|
|
|
+ return false
|
|
|
+ } else if (!this.chooseItem.maxDelivery && !toString(this.chooseItem.maxDelivery).trim()) {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '请填写最大交期时间'
|
|
|
+ return false
|
|
|
+ } else if (!/^\d{1,3}$/.test(this.chooseItem.minDelivery) || !/^\d{1,3}$/.test(this.chooseItem.maxDelivery)) {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '交期时间只能输入数字'
|
|
|
+ return false
|
|
|
} else {
|
|
|
let isHas = false
|
|
|
for (let i = 0; i < this.chooseItem.prices.length; i++) {
|
|
|
@@ -368,6 +400,16 @@
|
|
|
this.collectResult = '单价必须是大于0的数字'
|
|
|
isHas = true
|
|
|
break
|
|
|
+ } else if (!/^\d+$/.test(this.chooseItem.prices[i].start) || !/^\d+$/.test(this.chooseItem.prices[i].end)) {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '分段数量必须是正整数'
|
|
|
+ isHas = true
|
|
|
+ break
|
|
|
+ } else if (!/^[0-9]+([.]{1}[1-9]{1,6})?$/.test(this.chooseItem.prices[i].rMBPrice)) {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '单价只能输入数字'
|
|
|
+ isHas = true
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
if (isHas === true) {
|
|
|
@@ -403,7 +445,7 @@
|
|
|
.productDetails {
|
|
|
background: #fff;
|
|
|
margin: .2rem 0.2rem 0;
|
|
|
- padding: 0.9rem 0 1.2rem 0;
|
|
|
+ padding: 0.9rem 0 0.5rem 0;
|
|
|
.product {
|
|
|
/*background: #fff;*/
|
|
|
/*margin: .2rem 0.2rem 0;*/
|
|
|
@@ -465,7 +507,7 @@
|
|
|
vertical-align: top;
|
|
|
margin-left: 0.3rem;
|
|
|
margin-top: 0.26rem;
|
|
|
- background: #f1f3f7;
|
|
|
+ background: #c4c5c6;
|
|
|
.progress-btn {
|
|
|
position: absolute;
|
|
|
height: 0.28rem;
|
|
|
@@ -498,7 +540,7 @@
|
|
|
text-indent: 0;
|
|
|
input {
|
|
|
width: 2.02rem;
|
|
|
- color: #999;
|
|
|
+ color: #333;
|
|
|
font-size: .24rem;
|
|
|
height: 0.46rem;
|
|
|
vertical-align: top;
|
|
|
@@ -586,7 +628,7 @@
|
|
|
text-indent: 0;
|
|
|
input {
|
|
|
width: 4.7rem;
|
|
|
- color: #999;
|
|
|
+ color: #333;
|
|
|
font-size: .24rem;
|
|
|
height: 0.44rem;
|
|
|
vertical-align: top;
|
|
|
@@ -646,7 +688,7 @@
|
|
|
}
|
|
|
.firstNumber {
|
|
|
width: 0.4rem;
|
|
|
- background: #eeeeee;
|
|
|
+ background: #eeeeee !important;
|
|
|
height: 0.5rem;
|
|
|
border:1px solid #d2d2d2;
|
|
|
border-radius: 3px;
|
|
|
@@ -656,7 +698,7 @@
|
|
|
}
|
|
|
.otherNumber {
|
|
|
width: 1.6rem;
|
|
|
- background: #eeeeee;
|
|
|
+ background: #fff;
|
|
|
height: 0.5rem;
|
|
|
border:1px solid #d2d2d2;
|
|
|
border-radius: 3px;
|