Showing
5 changed files
with
50 additions
and
10 deletions
@@ -59,7 +59,8 @@ exports.fetchImHistory = (uid, pageSize, startTime, endTime) => { | @@ -59,7 +59,8 @@ exports.fetchImHistory = (uid, pageSize, startTime, endTime) => { | ||
59 | exports.fetchOrderList = (uid, createTimeBegin) => { | 59 | exports.fetchOrderList = (uid, createTimeBegin) => { |
60 | let params = { | 60 | let params = { |
61 | uid, | 61 | uid, |
62 | - encryptedUid: encryptedUid(uid) | 62 | + encryptedUid: encryptedUid(uid), |
63 | + imgSize: '90x120', | ||
63 | }; | 64 | }; |
64 | 65 | ||
65 | _.forEach({createTimeBegin}, (key, val) => { | 66 | _.forEach({createTimeBegin}, (key, val) => { |
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | {{!--inline partails--}} | 11 | {{!--inline partails--}} |
12 | {{#*inline 'order'}} | 12 | {{#*inline 'order'}} |
13 | <div class="chat-order"> | 13 | <div class="chat-order"> |
14 | - <img src="{{thumb}}"> | 14 | + <img src="{{imgSrc}}"> |
15 | <div class="order-info"> | 15 | <div class="order-info"> |
16 | <span class="label">订单号: </span><span>{{orderCode}}</span><br> | 16 | <span class="label">订单号: </span><span>{{orderCode}}</span><br> |
17 | <span class="label">金额: </span><span class="red">{{cost}}</span><br> | 17 | <span class="label">金额: </span><span class="red">{{cost}}</span><br> |
@@ -7,15 +7,51 @@ | @@ -7,15 +7,51 @@ | ||
7 | </header> | 7 | </header> |
8 | <section class="order-goods"> | 8 | <section class="order-goods"> |
9 | {{# goods}} | 9 | {{# goods}} |
10 | - {{> order/good}} | 10 | + <div class="order-good" data-id="{{id}}"> |
11 | + <div class="thumb-wrap"> | ||
12 | + {{#if link}} | ||
13 | + <a href="{{link}}"><img class="thumb lazy" src="{{image thumb 90 120}}"></a> | ||
14 | + {{else}} | ||
15 | + <img class="thumb lazy" src="{{image thumb 90 120}}"> | ||
16 | + {{/if}} | ||
17 | + <p class="tag{{#if gift}} gift-tag{{/if}}{{#if advanceBuy}} advance-buy-tag{{/if}}"></p> | ||
18 | + </div> | ||
19 | + <div class="deps"> | ||
20 | + <p class="name row">{{name}}</p> | ||
21 | + <p class="row"> | ||
22 | + {{#if color}} | ||
23 | + <span class="color"> | ||
24 | + {{#if tickets}}日期{{else}}颜色{{/if}}:{{color}} | ||
25 | + </span> | ||
26 | + {{/if}} | ||
27 | + | ||
28 | + {{#if size}} | ||
29 | + <span class="size"> | ||
30 | + {{#if tickets}}区域{{else}}尺码{{/if}}:{{size}} | ||
31 | + </span> | ||
32 | + {{/if}} | ||
33 | + </p> | ||
34 | + <p class="row price-wrap"> | ||
35 | + <span class="price"> | ||
36 | + ¥{{price}} | ||
37 | + </span> | ||
38 | + <span class="count"> | ||
39 | + ×{{count}} | ||
40 | + </span> | ||
41 | + {{#if appearDate}} | ||
42 | + <span class="appear-date">上市期:{{appearDate}}</span> | ||
43 | + {{/if}} | ||
44 | + </p> | ||
45 | + </div> | ||
46 | + </div> | ||
11 | {{/ goods}} | 47 | {{/ goods}} |
12 | </section> | 48 | </section> |
13 | <footer class="footer"> | 49 | <footer class="footer"> |
14 | - 共{{count}}件商品 实付<span class="sum-cost">¥{{sumCost}}</span> | 50 | + 共{{count}}件商品 实付<span class="sum-cost">¥{{lastOrderAmount}}</span> |
15 | {{#shippingCost}}(含运费¥{{.}}){{/shippingCost}} | 51 | {{#shippingCost}}(含运费¥{{.}}){{/shippingCost}} |
16 | </footer> | 52 | </footer> |
17 | <div class="send-order clearfix"> | 53 | <div class="send-order clearfix"> |
18 | - <button class="send-order-btn">发送订单</button> | 54 | + <button class="send-order-btn" data-action="select">发送订单</button> |
19 | </div> | 55 | </div> |
20 | </div> | 56 | </div> |
21 | <input class="js-create-time" type="hidden" name="human-time" value="{{time}}"> | 57 | <input class="js-create-time" type="hidden" name="human-time" value="{{time}}"> |
@@ -122,7 +122,8 @@ var chat = { | @@ -122,7 +122,8 @@ var chat = { | ||
122 | .on('selectOrder.OrderListView', function(event, data) { | 122 | .on('selectOrder.OrderListView', function(event, data) { |
123 | let msg = { | 123 | let msg = { |
124 | type: 'order', | 124 | type: 'order', |
125 | - data | 125 | + data, |
126 | + style: 'send-msg', | ||
126 | }; | 127 | }; |
127 | 128 | ||
128 | self.sendMSG(msg); | 129 | self.sendMSG(msg); |
@@ -96,6 +96,7 @@ RatingView.prototype = $.extend({}, EventEmitter.prototype, { | @@ -96,6 +96,7 @@ RatingView.prototype = $.extend({}, EventEmitter.prototype, { | ||
96 | this.rankText = rankMap[curVal]; | 96 | this.rankText = rankMap[curVal]; |
97 | this.$label.text(rankMap[curVal]); | 97 | this.$label.text(rankMap[curVal]); |
98 | 98 | ||
99 | + this.$ranks.removeClass('rated'); | ||
99 | this.$ranks.toggleClass(index => { | 100 | this.$ranks.toggleClass(index => { |
100 | return index <= curVal ? 'rated' : null; | 101 | return index <= curVal ? 'rated' : null; |
101 | }); | 102 | }); |
@@ -154,7 +155,7 @@ OrderListView.prototype = $.extend({}, EventEmitter.prototype, { | @@ -154,7 +155,7 @@ OrderListView.prototype = $.extend({}, EventEmitter.prototype, { | ||
154 | self.toggleHide(true); | 155 | self.toggleHide(true); |
155 | }) | 156 | }) |
156 | .on('click.OrderListView.select', '[data-action=select]', function() { | 157 | .on('click.OrderListView.select', '[data-action=select]', function() { |
157 | - | 158 | + self.selectOrder($(event.target)); |
158 | }); | 159 | }); |
159 | 160 | ||
160 | // 被通知显示,执行显示 | 161 | // 被通知显示,执行显示 |
@@ -164,13 +165,13 @@ OrderListView.prototype = $.extend({}, EventEmitter.prototype, { | @@ -164,13 +165,13 @@ OrderListView.prototype = $.extend({}, EventEmitter.prototype, { | ||
164 | /** | 165 | /** |
165 | * method: 选择订单,然后关闭 | 166 | * method: 选择订单,然后关闭 |
166 | */ | 167 | */ |
167 | - selectOrder: function() { | ||
168 | - let $order = $(event.target).closest('.order-page'); | 168 | + selectOrder: function($btn) { |
169 | + let $order = $btn.closest('.order-page'); | ||
169 | 170 | ||
170 | // 订单数据 | 171 | // 订单数据 |
171 | let data = { | 172 | let data = { |
172 | imgSrc: $order.find('.thumb').attr('src'), | 173 | imgSrc: $order.find('.thumb').attr('src'), |
173 | - orderCode: $order.find('[data-id]'), | 174 | + orderCode: $order.find('[data-id]').attr('data-id'), |
174 | cost: $order.find('.sum-cost').text(), | 175 | cost: $order.find('.sum-cost').text(), |
175 | createTime: $order.find('.js-create-time').val(), | 176 | createTime: $order.find('.js-create-time').val(), |
176 | orderStatus: $order.find('.order-status').text() | 177 | orderStatus: $order.find('.order-status').text() |
@@ -205,6 +206,7 @@ OrderListView.prototype = $.extend({}, EventEmitter.prototype, { | @@ -205,6 +206,7 @@ OrderListView.prototype = $.extend({}, EventEmitter.prototype, { | ||
205 | let html = self.orderListT({orders: result.data}); | 206 | let html = self.orderListT({orders: result.data}); |
206 | 207 | ||
207 | self.$localOrders.append(html); | 208 | self.$localOrders.append(html); |
209 | + lazyLoad($('img.lazy')); | ||
208 | }); | 210 | }); |
209 | } | 211 | } |
210 | }); | 212 | }); |
-
Please register or login to post a comment