Commit 4171c8beae1bbc3a9e749f8a3ccdc90bbd91bd67
1 parent
081c50da0c
Exists in
master
倒计时添加
Showing
2 changed files
with
104 additions
and
102 deletions
Show diff stats
src/pages/confirmOrder/confirmOrder.vue
... | ... | @@ -71,117 +71,116 @@ |
71 | 71 | ></image> |
72 | 72 | <text>非常戴镜</text> |
73 | 73 | </view> |
74 | - | |
75 | - <view | |
76 | - class="infoBox" | |
77 | - v-if="isCart === 'true'" | |
78 | - v-for="(item, index) in checkedCartLst" | |
79 | - :key="index" | |
80 | - > | |
81 | - <view class="infoTop"> | |
82 | - <image | |
83 | - :src="item.img_index_url" | |
84 | - mode="aspectFill" | |
85 | - ></image> | |
86 | - <view class="infoRight"> | |
87 | - <text class="goodName">{{item.p_name}}</text> | |
88 | - <text class="remarks">支持7天无理由退货 顺丰发货</text> | |
89 | - <view class="priceBox"> | |
90 | - <view class="price">¥{{Number(item.nowPrice) }}<text class="originCost"> | |
91 | - ¥{{item.oldPrice}} | |
92 | - </text></view> | |
93 | - <view class="counter"> | |
94 | - <view | |
95 | - class="btn" | |
96 | - disabled="this.disabled" | |
97 | - type="default" | |
98 | - @click="counter(false,index)" | |
99 | - >-</view> | |
100 | - <text>{{checkedCartLst[index].num}}</text> | |
101 | - <view | |
102 | - class="btn" | |
103 | - type="default" | |
104 | - @click="counter(true,index)" | |
105 | - >+</view> | |
74 | + <template v-if="isCart === 'true'"> | |
75 | + <view | |
76 | + class="infoBox" | |
77 | + v-for="(item, index) in checkedCartLst" | |
78 | + :key="index" | |
79 | + > | |
80 | + <view class="infoTop"> | |
81 | + <image | |
82 | + :src="item.img_index_url" | |
83 | + mode="aspectFill" | |
84 | + ></image> | |
85 | + <view class="infoRight"> | |
86 | + <text class="goodName">{{item.p_name}}</text> | |
87 | + <text class="remarks">支持7天无理由退货 顺丰发货</text> | |
88 | + <view class="priceBox"> | |
89 | + <view class="price">¥{{Number(item.nowPrice) }}<text class="originCost"> | |
90 | + ¥{{item.oldPrice}} | |
91 | + </text></view> | |
92 | + <view class="counter"> | |
93 | + <view | |
94 | + class="btn" | |
95 | + disabled="this.disabled" | |
96 | + type="default" | |
97 | + @click="counter(false,index)" | |
98 | + >-</view> | |
99 | + <text>{{checkedCartLst[index].num}}</text> | |
100 | + <view | |
101 | + class="btn" | |
102 | + type="default" | |
103 | + @click="counter(true,index)" | |
104 | + >+</view> | |
105 | + </view> | |
106 | 106 | </view> |
107 | 107 | </view> |
108 | 108 | </view> |
109 | - </view> | |
110 | - <view class="infoBottom"> | |
111 | - <view class="norm">规格 <text> | |
112 | - <!-- 长度超出变省略号未做 --> | |
113 | - <block>{{item.sku_name}}<block v-if="index !== current.length -1">/</block> | |
114 | - </block> | |
115 | - </text></view> | |
116 | - <view class="shippingMethod">使用人 <text> | |
117 | - {{item.peopleName}} | |
118 | - </text></view> | |
119 | - <view class="shippingMethod">配送方式 <text>快递</text></view> | |
120 | - <view class="message">买家留言 | |
121 | - <input | |
122 | - type="text" | |
123 | - :value="note" | |
124 | - placeholder="建议提前协商(50字以内)" | |
125 | - /> | |
109 | + <view class="infoBottom"> | |
110 | + <view class="norm">规格 <text> | |
111 | + <!-- 长度超出变省略号未做 --> | |
112 | + <block>{{item.sku_name}}<block v-if="index !== current.length -1">/</block> | |
113 | + </block> | |
114 | + </text></view> | |
115 | + <view class="shippingMethod">使用人 <text> | |
116 | + {{item.peopleName}} | |
117 | + </text></view> | |
118 | + <view class="shippingMethod">配送方式 <text>快递</text></view> | |
119 | + <view class="message">买家留言 | |
120 | + <input | |
121 | + type="text" | |
122 | + :value="note" | |
123 | + placeholder="建议提前协商(50字以内)" | |
124 | + /> | |
125 | + </view> | |
126 | 126 | </view> |
127 | 127 | </view> |
128 | - </view> | |
129 | - | |
130 | - <view | |
131 | - class="infoBox" | |
132 | - v-else | |
133 | - > | |
134 | - <view class="infoTop"> | |
135 | - <image | |
136 | - :src="buyItem.pic" | |
137 | - mode="aspectFill" | |
138 | - ></image> | |
139 | - <view class="infoRight"> | |
140 | - <text class="goodName">{{goodInfo.p_name}}</text> | |
141 | - <text class="remarks">支持7天无理由退货 顺丰发货</text> | |
142 | - <view class="priceBox"> | |
143 | - <view class="price">¥{{buyItem.real_price}}<text class="originCost"> | |
144 | - ¥{{buyItem.out_price}} | |
145 | - </text></view> | |
146 | - <view class="counter"> | |
147 | - <view | |
148 | - class="btn" | |
149 | - disabled="this.disabled" | |
150 | - type="default" | |
151 | - @click="counter(false)" | |
152 | - >-</view> | |
153 | - <text>{{count}}</text> | |
154 | - <view | |
155 | - class="btn" | |
156 | - type="default" | |
157 | - @click="counter(true)" | |
158 | - >+</view> | |
128 | + </template> | |
129 | + <template v-else> | |
130 | + <view class="infoBox"> | |
131 | + <view class="infoTop"> | |
132 | + <image | |
133 | + :src="buyItem.pic" | |
134 | + mode="aspectFill" | |
135 | + ></image> | |
136 | + <view class="infoRight"> | |
137 | + <text class="goodName">{{goodInfo.p_name}}</text> | |
138 | + <text class="remarks">支持7天无理由退货 顺丰发货</text> | |
139 | + <view class="priceBox"> | |
140 | + <view class="price">¥{{buyItem.real_price}}<text class="originCost"> | |
141 | + ¥{{buyItem.out_price}} | |
142 | + </text></view> | |
143 | + <view class="counter"> | |
144 | + <view | |
145 | + class="btn" | |
146 | + disabled="this.disabled" | |
147 | + type="default" | |
148 | + @click="counter(false)" | |
149 | + >-</view> | |
150 | + <text>{{count}}</text> | |
151 | + <view | |
152 | + class="btn" | |
153 | + type="default" | |
154 | + @click="counter(true)" | |
155 | + >+</view> | |
156 | + </view> | |
159 | 157 | </view> |
160 | 158 | </view> |
161 | 159 | </view> |
162 | - </view> | |
163 | - <view class="infoBottom"> | |
164 | - <view class="norm">规格 <text> | |
165 | - <!-- 长度超出变省略号未做 --> | |
166 | - <block | |
167 | - v-for="(item, index) in current" | |
168 | - :key="index" | |
169 | - >{{attrList[index].attr[item].name}}<block v-if="index !== current.length -1">/</block> | |
170 | - </block> | |
171 | - </text></view> | |
172 | - <view class="shippingMethod">使用人 <text> | |
173 | - {{name}} | |
174 | - </text></view> | |
175 | - <view class="shippingMethod">配送方式 <text>快递</text></view> | |
176 | - <view class="message">买家留言 | |
177 | - <input | |
178 | - type="text" | |
179 | - :value="note" | |
180 | - placeholder="建议提前协商(50字以内)" | |
181 | - /> | |
160 | + <view class="infoBottom"> | |
161 | + <view class="norm">规格 <text> | |
162 | + <!-- 长度超出变省略号未做 --> | |
163 | + <block | |
164 | + v-for="(item, index) in current" | |
165 | + :key="index" | |
166 | + >{{attrList[index].attr[item].name}}<block v-if="index !== current.length -1">/</block> | |
167 | + </block> | |
168 | + </text></view> | |
169 | + <view class="shippingMethod">使用人 <text> | |
170 | + {{name}} | |
171 | + </text></view> | |
172 | + <view class="shippingMethod">配送方式 <text>快递</text></view> | |
173 | + <view class="message">买家留言 | |
174 | + <input | |
175 | + type="text" | |
176 | + :value="note" | |
177 | + placeholder="建议提前协商(50字以内)" | |
178 | + /> | |
179 | + </view> | |
182 | 180 | </view> |
183 | 181 | </view> |
184 | - </view> | |
182 | + </template> | |
183 | + | |
185 | 184 | </view> |
186 | 185 | <view class="payWay"> |
187 | 186 | <view class="item"> | ... | ... |
src/pages/myOrderPaying/myOrderPaying.vue
... | ... | @@ -218,7 +218,10 @@ export default { |
218 | 218 | }, |
219 | 219 | // 订单付款时间 |
220 | 220 | getLeftTime () { |
221 | - return this.orderInfo.order_info ? this.orderInfo.order_info.lefttime : 1800 | |
221 | + const orderTime = new Date(this.orderInfo.pay_time.replace(/-/g, '/')).getTime() | |
222 | + const nowTime = new Date().getTime() | |
223 | + console.log('getLeftTime', 1800 - (nowTime - orderTime)) | |
224 | + return 1800 - (nowTime - orderTime) / 1000 | |
222 | 225 | }, |
223 | 226 | // 计算总优惠额 |
224 | 227 | totalDiscount() { | ... | ... |