Ver Fonte

Merge branch 'zhongqi-chat'

shizhongqi há 11 meses atrás
pai
commit
ce526c903b
1 ficheiros alterados com 19 adições e 13 exclusões
  1. 19 13
      mallApp/src/pages/chat/chatPage.vue

+ 19 - 13
mallApp/src/pages/chat/chatPage.vue

@@ -49,10 +49,12 @@
                   <view class="goods-name-wrapper">
                   <view class="goods-name-wrapper">
                     <text class="goods-name">{{message.goodsInfo.goodsName}}</text>
                     <text class="goods-name">{{message.goodsInfo.goodsName}}</text>
                   </view>
                   </view>
-                  <!-- <view class="sales-info">
-                    <text class="delivery-time">48小时发</text>
-                  </view> -->
-                  <!-- 2 是报价类型,专门为报价类型使用 -->
+                  <view class="sales-info" v-if="message.goodsInfo.goodsPriceType == 2">
+                    <text class="delivery-time">商家标价</text>
+                  </view>
+                  <view class="sales-info" v-if="message.goodsInfo.notExpired === false">
+                    <text class="delivery-time">报价窗口过期</text>
+                  </view>
                   <text v-if="message.goodsInfo.goodsPriceType != 0" class="goods-price">¥{{ parseFloat(message.goodsInfo.goodsPrice).toFixed(2) }}</text>
                   <text v-if="message.goodsInfo.goodsPriceType != 0" class="goods-price">¥{{ parseFloat(message.goodsInfo.goodsPrice).toFixed(2) }}</text>
                 </view>
                 </view>
               </view>
               </view>
@@ -64,9 +66,9 @@
                 <button class="action-btn spec-btn" @click="toBuy(message.goodsInfo)">查看商品</button>
                 <button class="action-btn spec-btn" @click="toBuy(message.goodsInfo)">查看商品</button>
                 <button class="action-btn buy-btn" @click="toBuy(message.goodsInfo)">去购买</button>
                 <button class="action-btn buy-btn" @click="toBuy(message.goodsInfo)">去购买</button>
               </view>
               </view>
-              <view v-else class="action-buttons">
+              <view v-if="message.goodsInfo.goodsPriceType == 1" class="action-buttons">
                 <button class="action-btn spec-btn" @click="toGoodsDetail(message.goodsInfo)">查看商品</button>
                 <button class="action-btn spec-btn" @click="toGoodsDetail(message.goodsInfo)">查看商品</button>
-                <button v-if="message.goodsInfo.goodsPriceType == 1" class="action-btn buy-btn" @click="toBuy(message.goodsInfo)">去购买</button>
+                <button  class="action-btn buy-btn" @click="toBuy(message.goodsInfo)">去购买</button>
               </view>
               </view>
             </view>
             </view>
             <view class="message-time align-right">{{ message.time }}</view>
             <view class="message-time align-right">{{ message.time }}</view>
@@ -88,18 +90,20 @@
             </view>
             </view>
             <view class="goods-info right-bubble">
             <view class="goods-info right-bubble">
               <view class="goods-main" @click="toGoodsDetail(message.goodsInfo)">
               <view class="goods-main" @click="toGoodsDetail(message.goodsInfo)">
-                <image
-                  class="goods-image"
-                  :src="message.goodsInfo.goodsImg"
-                  mode="aspectFill"
-                />
+                <image class="goods-image" :src="message.goodsInfo.goodsImg" mode="aspectFill"/>
                 <view class="goods-details">
                 <view class="goods-details">
                   <view class="goods-name-wrapper">
                   <view class="goods-name-wrapper">
                     <text class="goods-name">{{ message.goodsInfo.goodsName }}</text>
                     <text class="goods-name">{{ message.goodsInfo.goodsName }}</text>
                   </view>
                   </view>
-                  <view class="sales-info" v-if="message.goodsInfo.goodsPriceType == 0">
+                  <view class="sales-info" v-if="message.goodsInfo.goodsPriceType == 2">
+                    <text class="delivery-time">商家标价</text>
+                  </view>
+                  <view class="sales-info" v-if="(message.goodsInfo.goodsPriceType == 0 && message.goodsInfo.notExpired === true)">
                     <text class="delivery-time">等待商家标价</text>
                     <text class="delivery-time">等待商家标价</text>
                   </view>
                   </view>
+                  <view class="sales-info" v-if="message.goodsInfo.notExpired === false">
+                    <text class="delivery-time">报价窗口过期</text>
+                  </view>
                   <text v-if="message.goodsInfo.goodsPriceType != 0" class="goods-price">¥{{ parseFloat(message.goodsInfo.goodsPrice).toFixed(2) }}</text>
                   <text v-if="message.goodsInfo.goodsPriceType != 0" class="goods-price">¥{{ parseFloat(message.goodsInfo.goodsPrice).toFixed(2) }}</text>
                 </view>
                 </view>
               </view>
               </view>
@@ -1088,8 +1092,10 @@ export default {
             const now = Math.floor(Date.now()/1000);
             const now = Math.floor(Date.now()/1000);
             const timeDiff = now - timestamp;
             const timeDiff = now - timestamp;
             const expireTime = 24 * 60 * 60;
             const expireTime = 24 * 60 * 60;
+            parsed.notExpired = true; // 默认未过期
             if (timeDiff > expireTime) {
             if (timeDiff > expireTime) {
               //console.log("timeDiff > expireTime", timeDiff, expireTime)
               //console.log("timeDiff > expireTime", timeDiff, expireTime)
+              parsed.notExpired = false;
               return parsed;
               return parsed;
             }
             }
 
 
@@ -1464,7 +1470,7 @@ export default {
       font-size: 28rpx;
       font-size: 28rpx;
       color: #ff5050;
       color: #ff5050;
       font-weight: bold;
       font-weight: bold;
-      margin-top: 12rpx;
+      margin-top: 2rpx;
     }
     }
   }
   }