junyuanz лет назад: 5
Родитель
Сommit
32a0a7b312

+ 2 - 1
packageUser/pages/user/order/order.wxml

@@ -25,7 +25,8 @@
 	    <view class="order-main">
 	      <image class="order-main__left" src="{{item.cover}}"></image>
 	      <view class="order-main__right">
-	        <view class="order-info__title ellipsisLn">{{item.name}}</view>
+	        <h6 class="ellipsisLn">{{item.name}}</h6>
+	        <view class="order-info__title ellipsisLn">{{item.color_name}} {{item.size_name}}</view>
 	<!--         <view class="order-info__type ellipsis">{{item.detail}}</view> -->
 	        <view class="order-info__price">
 	          <currency symbol="¥" value="{{item.robo_balance_price}}" wx:if="{{order.status === 'unpay'}}" />

+ 28 - 1
pages/projects/project-detail/project-detail.js

@@ -174,7 +174,6 @@ Page({
     	console.log('cbox',cbox)
       that.setData({
         productSize: val.data,
-        canpay:false,
         checkbox:cbox
       });
     }
@@ -348,6 +347,21 @@ Page({
   pay: function (e) {
     _handle.setFormId(e)
     var that = this
+    
+    //规格
+    let cflag = true;
+		for(let i in that.data.checkbox){
+			if(that.data[that.data.checkbox[i]] == 0) cflag = false;
+		}
+		if(!cflag){
+  		wx.showToast({
+        title: '请先选择商品规格~',
+        icon: 'none',
+        duration: 2000
+      })
+  		return false;
+		}
+    
     var url = "v1/product/" + that.data.productId + "/order/" + that.data.count
     var params = {}
     var success = function (res) {
@@ -373,6 +387,19 @@ Page({
   },
   addCart:function(){
   	var that = this;
+  	//规格
+    let cflag = true;
+		for(let i in that.data.checkbox){
+			if(that.data[that.data.checkbox[i]] == 0) cflag = false;
+		}
+		if(!cflag){
+  		wx.showToast({
+        title: '请先选择商品规格~',
+        icon: 'none',
+        duration: 2000
+      })
+  		return false;
+		}
   	console.log('that.data.productId',that.data.productId)
     var url = "v1/cart/" + that.data.productId + "/" + that.data.count
     var params = {}

+ 1 - 1
pages/projects/project-detail/project-detail.wxml

@@ -191,7 +191,7 @@
       
       
       <form bindsubmit="pay" report-submit="{{true}}" >
-        <button class="dialog-btn" formType="submit" wx:if="{{showpay}}" disabled="{{!canpay?'true':''}}"><text wx:if="{{!noproduct}}">立即购买</text><text wx:if="{{noproduct}}">暂无库存</text></button>
+        <button class="dialog-btn" formType="submit" wx:if="{{showpay}}" disabled="{{canpay?'':'true'}}"><text wx:if="{{!noproduct}}">立即购买</text><text wx:if="{{noproduct}}">暂无库存</text></button>
       </form>
       <button class="dialog-btn" open-type="share" wx:if="{{!showpay}}"><text wx:if="{{!noproduct}}">立即购买</text><text wx:if="{{noproduct}}">暂无库存</text></button>
     </view>

+ 1 - 1
project.config.json

@@ -19,7 +19,7 @@
 			"disablePlugins": [],
 			"outputPath": ""
 		},
-		"useCompilerModule": false,
+		"useCompilerModule": true,
 		"userConfirmedUseCompilerModuleSwitch": false,
 		"compileHotReLoad": false,
 		"useIsolateContext": true