yangc 7 years ago
parent
commit
62196555c2

+ 63 - 11
components/mobile/applyPurchase/PublishSeek.vue

@@ -13,7 +13,14 @@
         </div>
         <div class="content-line">
           <span><i>*</i>截止日期:</span>
-          <input type="date" v-model="applyObj.deadline" :min="getMin()" :max="getMax()" @blur="deadlineChange">
+          <input type="date" v-model="applyObj.deadline" :min="minDay" :max="maxDay" @blur="deadlineChange">
+          <!--<el-date-picker-->
+            <!--v-model="applyObj.deadline"-->
+            <!--type="date"-->
+            <!--:editable="false"-->
+            <!--:clearable="true"-->
+            <!--size="mini">-->
+          <!--</el-date-picker>-->
         </div>
         <div class="content-line">
           <span>币种:</span>
@@ -110,6 +117,16 @@
     computed: {
       user () {
         return this.$store.state.option.user
+      },
+      minDay: function () {
+        return formatDate(new Date(), 'yyyy-MM-dd')
+      },
+      maxDay: function () {
+        let deadDate = new Date()
+        deadDate.setMonth(deadDate.getMonth() + 3)
+        deadDate.setDate(deadDate.getDate() + 1)
+        deadDate = formatDate(deadDate, 'yyyy-MM-dd')
+        return deadDate
       }
     },
     watch: {
@@ -287,16 +304,6 @@
         } else if (this.applyObj.amount.length > 9) {
           this.applyObj.amount = cutOutString(this.applyObj.amount, 9)
         }
-      },
-      getMin: function () {
-        return formatDate(new Date(), 'yyyy-MM-dd')
-      },
-      getMax: function () {
-        let deadDate = new Date()
-        deadDate.setMonth(deadDate.getMonth() + 3)
-        deadDate.setDate(deadDate.getDate() + 1)
-        deadDate = formatDate(deadDate, 'yyyy-MM-dd')
-        return deadDate
       }
     }
   }
@@ -318,6 +325,7 @@
         padding-top: .1rem;
         padding-bottom: .4rem;
         .content-line {
+          position: relative;
           height: .8rem;
           line-height: .8rem;
           font-size: .26rem;
@@ -391,4 +399,48 @@
       }
     }
   }
+  .datepicker-overlay {
+    z-index: 9999;
+    .cov-date-body {
+      width: 4rem;
+      font-size: .16rem;
+      .cov-date-monthly {
+        height: 1.5rem;
+        div {
+          height: 1.5rem;
+        }
+        .cov-date-caption {
+          font-size: .24rem;
+          padding: .5rem 0 !important;
+        }
+        .cov-date-next {
+          text-indent: -3rem;
+        }
+      }
+      .cov-date-box {
+        .cov-picker-box {
+          padding: .25rem;
+          width: 4rem;
+          height: 2.8rem;
+          .week {
+            ul {
+              margin: 0 0 .08rem;
+            }
+          }
+          .day {
+            height: .34rem;
+            line-height: .34rem;
+          }
+        }
+      }
+    }
+    .button-box {
+      height: .5rem;
+      line-height: .5rem;
+      padding-right: .2rem;
+      span {
+        padding: .1rem .2rem;
+      }
+    }
+  }
 </style>

+ 6 - 3
components/mobile/applyPurchase/SayPrice.vue

@@ -39,14 +39,14 @@
         </span>
           </div>
           <div class="form-item" v-for="(reply, index) in sayPriceObj.replies">
-            <input type="number" placeholder="梯度" class="fl" @blur="onReplyLapQtyBlur(index)" @input="onReplyLapQtyInput(index)" v-model="reply.lapQty">
-            <input type="number" placeholder="单价" class="fr" @input="onReplyPriceInput(index)" @blur="onReplyPriceBlur(index)" v-model="reply.price">
+            <input type="text" placeholder="梯度" class="fl" @blur="onReplyLapQtyBlur(index)" @input="onReplyLapQtyInput(index)" v-model="reply.lapQty">
+            <input type="text" placeholder="单价" class="fr" @input="onReplyPriceInput(index)" @blur="onReplyPriceBlur(index)" v-model="reply.price">
             <i class="iconfont icon-minus" v-if="index > 0" @click="setReplies('sub', index)"></i>
             <i class="iconfont icon-add" v-if="index == 0 && sayPriceObj.replies.length < 5" @click="setReplies('add', index)"></i>
           </div>
           <div class="date">
             <span>交期(天)</span>
-            <input type="number" placeholder="最大值" @input="onLeadtimeInput" @blur="onLeadtimeBlur" v-model="sayPriceObj.leadtime" class="fr">
+            <input type="text" placeholder="最大值" @input="onLeadtimeInput" @blur="onLeadtimeBlur" v-model="sayPriceObj.leadtime" class="fr">
           </div>
           <a class="say-price-btn" @click="commitSayPrice">确定</a>
         </div>
@@ -190,6 +190,7 @@
         }
       },
       onLeadtimeInput: function () {
+        this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.replace(/[^\-?\d.]/g, '')
         if (this.sayPriceObj.leadtime.length > 3) {
           this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.substring(0, 3)
         }
@@ -203,6 +204,7 @@
         }
       },
       onReplyPriceInput: function (index) {
+        this.sayPriceObj.replies[index].price = this.sayPriceObj.replies[index].price.replace(/[^\-?\d.]/g, '')
         let price = this.sayPriceObj.replies[index].price
         if (price >= 10000) {
           this.sayPriceObj.replies[index].price = price.substring(0, 4)
@@ -249,6 +251,7 @@
         }
       },
       onReplyLapQtyInput: function (index) {
+        this.sayPriceObj.replies[index].lapQty = this.sayPriceObj.replies[index].lapQty.replace(/[^\-?\d.]/g, '')
         let lapQty = this.sayPriceObj.replies[index].lapQty
         if (lapQty.length > 9) {
           this.sayPriceObj.replies[index].lapQty = lapQty.substring(0, 9)

+ 1 - 1
pages/mobile/user/index.vue

@@ -8,7 +8,7 @@
       </div>
       <a v-if="isVendor" v-text="userType === 'saler' ? '切换至买家中心' : '切换至卖家中心'" @click="switchType"></a>
     </div>
-    <ul class="switch-list">
+    <ul class="switch-list" v-if="userType !== 'saler'">
       <li :class="{active: activeType == 'seek'}" @click="activeType = 'seek'" v-text="userType === 'saler' ? '求购询价' : '我的求购'"></li>
       <li :class="{active: activeType == 'comp'}" @click="activeType = 'comp'">器件收藏</li>
       <li :class="{active: activeType == 'store'}" @click="activeType = 'store'">店铺关注</li>