Преглед на файлове

调整购物车的商品列表长度

增加指定商品下单时的必须输入微博名
baolei преди 1 месец
родител
ревизия
5da9f55cd6

+ 1 - 1
components/product-list/product-list.wxss

@@ -1,6 +1,6 @@
 /* components/product-list/product-list.wxss */
 .scrollView{
-    height: calc(100vh - 550rpx);
+    height: calc(100vh);
 }
 .scrollViewIndex{
     height: 2080rpx;

+ 29 - 2
pages/order/confirmOrder/confirmOrder.js

@@ -8,9 +8,12 @@ Page({
    * 页面的初始数据
    */
   data: {
+    form:{},
     prods:[],
     totalPrice:0, // 订单总金额
-    address:""
+    showRemark: false,
+    address:"",
+    remark:""
   },
   // 获取地址列表
   getAddressList(){
@@ -32,9 +35,27 @@ Page({
         url: '/pages/my/addressManage/addressManage?moldify=true',
       })
   },
+  inputChange(e){
+    let key = e.currentTarget.dataset.key;
+    let value = e.detail.value;
+    this.setData({
+        remark:value
+    })
+  },
   // 确认订单
   submitOrder(){
+
+    if(this.data.showRemark && !this.data.remark){
+      wx.showToast({
+        title: "请输入微博名",
+        icon:"none",
+        duration:3000
+      })  
+      return;
+    }
+
       let data = {
+        remark:this.data.remark,
         orderItemDTOS:this.data.orderItemDTOS,
         userAddressId:this.data.address.userAddressId
       }
@@ -79,13 +100,19 @@ Page({
     let total = 0;
     let orderItemDTOS = [];
     list.forEach(item=>{
+      console.log(item);
         total += item.quantity*item.price;
         orderItemDTOS.push({
             cartsId:item.cartsId,
             mercProdId:item.mercProdId,
             prodAttrId:item.prodAttrId,
             count:item.quantity
-        })
+        });
+        if (item.thirdIdConfirmFlag==="Y") {
+          this.setData({
+            showRemark : true
+          })
+        }
     })
     this.setData({
         prods:list,

+ 6 - 0
pages/order/confirmOrder/confirmOrder.wxml

@@ -32,6 +32,12 @@
         <text class="value">无备注</text>
       </view>
    </view> -->
+  <view class="info" wx:if="{{showRemark}}">
+    <view>
+      <text class="title">微博名</text>
+      <input type="text" class="input" data-key="remark" placeholder="请输入微博名" bindinput="inputChange"/>
+    </view>
+  </view>
    <view class="info">
       <text class="title">商品总件数</text>
       <text class="value">共{{prods.length}}件商品</text>

+ 7 - 2
pages/order/confirmOrder/confirmOrder.wxss

@@ -44,8 +44,13 @@
     margin-left: 20rpx;
 }
 .orderInfo .info .value{
-    margin-right: 100rpx;
-    float: right;
+  margin-right: 100rpx;
+  float: right;
+}
+.orderInfo .info .input{
+  margin-right: 100rpx;
+  margin-top: 8rpx;
+  float: right;
 }
 
 /* 确认订单 */