diff --git a/src/pages/confirmOrder/confirmOrder.vue b/src/pages/confirmOrder/confirmOrder.vue index 3d33064..c8317c2 100644 --- a/src/pages/confirmOrder/confirmOrder.vue +++ b/src/pages/confirmOrder/confirmOrder.vue @@ -71,117 +71,116 @@ ></image> <text>非常戴镜</text> </view> - - <view - class="infoBox" - v-if="isCart === 'true'" - v-for="(item, index) in checkedCartLst" - :key="index" - > - <view class="infoTop"> - <image - :src="item.img_index_url" - mode="aspectFill" - ></image> - <view class="infoRight"> - <text class="goodName">{{item.p_name}}</text> - <text class="remarks">支持7天无理由退货 顺丰发货</text> - <view class="priceBox"> - <view class="price">¥{{Number(item.nowPrice) }}<text class="originCost"> - ¥{{item.oldPrice}} - </text></view> - <view class="counter"> - <view - class="btn" - disabled="this.disabled" - type="default" - @click="counter(false,index)" - >-</view> - <text>{{checkedCartLst[index].num}}</text> - <view - class="btn" - type="default" - @click="counter(true,index)" - >+</view> + <template v-if="isCart === 'true'"> + <view + class="infoBox" + v-for="(item, index) in checkedCartLst" + :key="index" + > + <view class="infoTop"> + <image + :src="item.img_index_url" + mode="aspectFill" + ></image> + <view class="infoRight"> + <text class="goodName">{{item.p_name}}</text> + <text class="remarks">支持7天无理由退货 顺丰发货</text> + <view class="priceBox"> + <view class="price">¥{{Number(item.nowPrice) }}<text class="originCost"> + ¥{{item.oldPrice}} + </text></view> + <view class="counter"> + <view + class="btn" + disabled="this.disabled" + type="default" + @click="counter(false,index)" + >-</view> + <text>{{checkedCartLst[index].num}}</text> + <view + class="btn" + type="default" + @click="counter(true,index)" + >+</view> + </view> </view> </view> </view> - </view> - <view class="infoBottom"> - <view class="norm">规格 <text> - <!-- 长度超出变省略号未做 --> - <block>{{item.sku_name}}<block v-if="index !== current.length -1">/</block> - </block> - </text></view> - <view class="shippingMethod">使用人 <text> - {{item.peopleName}} - </text></view> - <view class="shippingMethod">配送方式 <text>快递</text></view> - <view class="message">买家留言 - <input - type="text" - :value="note" - placeholder="建议提前协商(50字以内)" - /> + <view class="infoBottom"> + <view class="norm">规格 <text> + <!-- 长度超出变省略号未做 --> + <block>{{item.sku_name}}<block v-if="index !== current.length -1">/</block> + </block> + </text></view> + <view class="shippingMethod">使用人 <text> + {{item.peopleName}} + </text></view> + <view class="shippingMethod">配送方式 <text>快递</text></view> + <view class="message">买家留言 + <input + type="text" + :value="note" + placeholder="建议提前协商(50字以内)" + /> + </view> </view> </view> - </view> - - <view - class="infoBox" - v-else - > - <view class="infoTop"> - <image - :src="buyItem.pic" - mode="aspectFill" - ></image> - <view class="infoRight"> - <text class="goodName">{{goodInfo.p_name}}</text> - <text class="remarks">支持7天无理由退货 顺丰发货</text> - <view class="priceBox"> - <view class="price">¥{{buyItem.real_price}}<text class="originCost"> - ¥{{buyItem.out_price}} - </text></view> - <view class="counter"> - <view - class="btn" - disabled="this.disabled" - type="default" - @click="counter(false)" - >-</view> - <text>{{count}}</text> - <view - class="btn" - type="default" - @click="counter(true)" - >+</view> + </template> + <template v-else> + <view class="infoBox"> + <view class="infoTop"> + <image + :src="buyItem.pic" + mode="aspectFill" + ></image> + <view class="infoRight"> + <text class="goodName">{{goodInfo.p_name}}</text> + <text class="remarks">支持7天无理由退货 顺丰发货</text> + <view class="priceBox"> + <view class="price">¥{{buyItem.real_price}}<text class="originCost"> + ¥{{buyItem.out_price}} + </text></view> + <view class="counter"> + <view + class="btn" + disabled="this.disabled" + type="default" + @click="counter(false)" + >-</view> + <text>{{count}}</text> + <view + class="btn" + type="default" + @click="counter(true)" + >+</view> + </view> </view> </view> </view> - </view> - <view class="infoBottom"> - <view class="norm">规格 <text> - <!-- 长度超出变省略号未做 --> - <block - v-for="(item, index) in current" - :key="index" - >{{attrList[index].attr[item].name}}<block v-if="index !== current.length -1">/</block> - </block> - </text></view> - <view class="shippingMethod">使用人 <text> - {{name}} - </text></view> - <view class="shippingMethod">配送方式 <text>快递</text></view> - <view class="message">买家留言 - <input - type="text" - :value="note" - placeholder="建议提前协商(50字以内)" - /> + <view class="infoBottom"> + <view class="norm">规格 <text> + <!-- 长度超出变省略号未做 --> + <block + v-for="(item, index) in current" + :key="index" + >{{attrList[index].attr[item].name}}<block v-if="index !== current.length -1">/</block> + </block> + </text></view> + <view class="shippingMethod">使用人 <text> + {{name}} + </text></view> + <view class="shippingMethod">配送方式 <text>快递</text></view> + <view class="message">买家留言 + <input + type="text" + :value="note" + placeholder="建议提前协商(50字以内)" + /> + </view> </view> </view> - </view> + </template> + </view> <view class="payWay"> <view class="item"> diff --git a/src/pages/myOrderPaying/myOrderPaying.vue b/src/pages/myOrderPaying/myOrderPaying.vue index 22dc83b..015e587 100644 --- a/src/pages/myOrderPaying/myOrderPaying.vue +++ b/src/pages/myOrderPaying/myOrderPaying.vue @@ -218,7 +218,10 @@ export default { }, // 订单付款时间 getLeftTime () { - return this.orderInfo.order_info ? this.orderInfo.order_info.lefttime : 1800 + const orderTime = new Date(this.orderInfo.pay_time.replace(/-/g, '/')).getTime() + const nowTime = new Date().getTime() + console.log('getLeftTime', 1800 - (nowTime - orderTime)) + return 1800 - (nowTime - orderTime) / 1000 }, // 计算总优惠额 totalDiscount() {