Authored by zzzzzzz

发送订单ok

... ... @@ -59,7 +59,8 @@ exports.fetchImHistory = (uid, pageSize, startTime, endTime) => {
exports.fetchOrderList = (uid, createTimeBegin) => {
let params = {
uid,
encryptedUid: encryptedUid(uid)
encryptedUid: encryptedUid(uid),
imgSize: '90x120',
};
_.forEach({createTimeBegin}, (key, val) => {
... ...
... ... @@ -11,7 +11,7 @@
{{!--inline partails--}}
{{#*inline 'order'}}
<div class="chat-order">
<img src="{{thumb}}">
<img src="{{imgSrc}}">
<div class="order-info">
<span class="label">订单号: </span><span>{{orderCode}}</span><br>
<span class="label">金额: </span><span class="red">{{cost}}</span><br>
... ...
... ... @@ -7,15 +7,51 @@
</header>
<section class="order-goods">
{{# goods}}
{{> order/good}}
<div class="order-good" data-id="{{id}}">
<div class="thumb-wrap">
{{#if link}}
<a href="{{link}}"><img class="thumb lazy" src="{{image thumb 90 120}}"></a>
{{else}}
<img class="thumb lazy" src="{{image thumb 90 120}}">
{{/if}}
<p class="tag{{#if gift}} gift-tag{{/if}}{{#if advanceBuy}} advance-buy-tag{{/if}}"></p>
</div>
<div class="deps">
<p class="name row">{{name}}</p>
<p class="row">
{{#if color}}
<span class="color">
{{#if tickets}}日期{{else}}颜色{{/if}}:{{color}}
</span>
{{/if}}
{{#if size}}
<span class="size">
{{#if tickets}}区域{{else}}尺码{{/if}}:{{size}}
</span>
{{/if}}
</p>
<p class="row price-wrap">
<span class="price">
¥{{price}}
</span>
<span class="count">
×{{count}}
</span>
{{#if appearDate}}
<span class="appear-date">上市期:{{appearDate}}</span>
{{/if}}
</p>
</div>
</div>
{{/ goods}}
</section>
<footer class="footer">
{{count}}件商品 实付<span class="sum-cost">¥{{sumCost}}</span>
{{count}}件商品 实付<span class="sum-cost">¥{{lastOrderAmount}}</span>
{{#shippingCost}}(含运费¥{{.}}){{/shippingCost}}
</footer>
<div class="send-order clearfix">
<button class="send-order-btn">发送订单</button>
<button class="send-order-btn" data-action="select">发送订单</button>
</div>
</div>
<input class="js-create-time" type="hidden" name="human-time" value="{{time}}">
... ...
... ... @@ -122,7 +122,8 @@ var chat = {
.on('selectOrder.OrderListView', function(event, data) {
let msg = {
type: 'order',
data
data,
style: 'send-msg',
};
self.sendMSG(msg);
... ...
... ... @@ -96,6 +96,7 @@ RatingView.prototype = $.extend({}, EventEmitter.prototype, {
this.rankText = rankMap[curVal];
this.$label.text(rankMap[curVal]);
this.$ranks.removeClass('rated');
this.$ranks.toggleClass(index => {
return index <= curVal ? 'rated' : null;
});
... ... @@ -154,7 +155,7 @@ OrderListView.prototype = $.extend({}, EventEmitter.prototype, {
self.toggleHide(true);
})
.on('click.OrderListView.select', '[data-action=select]', function() {
self.selectOrder($(event.target));
});
// 被通知显示,执行显示
... ... @@ -164,13 +165,13 @@ OrderListView.prototype = $.extend({}, EventEmitter.prototype, {
/**
* method: 选择订单,然后关闭
*/
selectOrder: function() {
let $order = $(event.target).closest('.order-page');
selectOrder: function($btn) {
let $order = $btn.closest('.order-page');
// 订单数据
let data = {
imgSrc: $order.find('.thumb').attr('src'),
orderCode: $order.find('[data-id]'),
orderCode: $order.find('[data-id]').attr('data-id'),
cost: $order.find('.sum-cost').text(),
createTime: $order.find('.js-create-time').val(),
orderStatus: $order.find('.order-status').text()
... ... @@ -205,6 +206,7 @@ OrderListView.prototype = $.extend({}, EventEmitter.prototype, {
let html = self.orderListT({orders: result.data});
self.$localOrders.append(html);
lazyLoad($('img.lazy'));
});
}
});
... ...