Authored by 李奇

fixed: 不能取消订单

@@ -82,8 +82,9 @@ const order = { @@ -82,8 +82,9 @@ const order = {
82 const orderCode = req.body.orderCode; 82 const orderCode = req.body.orderCode;
83 const reasonId = req.body.reasonId; 83 const reasonId = req.body.reasonId;
84 const reason = req.body.reason; 84 const reason = req.body.reason;
  85 + const uid = req.user.uid;
85 86
86 - orderModel.cancelOrder(orderCode, reasonId, reason).then(result => { 87 + orderModel.cancelOrder(uid, orderCode, reasonId, reason).then(result => {
87 return res.json(result); 88 return res.json(result);
88 }).catch(next); 89 }).catch(next);
89 }, 90 },
@@ -47,9 +47,10 @@ exports.getOrderDetail = (uid, orderCode) => { @@ -47,9 +47,10 @@ exports.getOrderDetail = (uid, orderCode) => {
47 * @param reason 原因描述 47 * @param reason 原因描述
48 * @returns {Promise.<T>|*} 48 * @returns {Promise.<T>|*}
49 */ 49 */
50 -exports.cancelOrder = (orderCode, reasonId, reason) => { 50 +exports.cancelOrder = (uid, orderCode, reasonId, reason) => {
51 return api.post('', { 51 return api.post('', {
52 method: 'app.SpaceOrders.close', 52 method: 'app.SpaceOrders.close',
  53 + uid,
53 order_code: orderCode, 54 order_code: orderCode,
54 reason_id: reasonId, 55 reason_id: reasonId,
55 reason: reason ? reason : '' 56 reason: reason ? reason : ''
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 import $ from 'jquery'; 10 import $ from 'jquery';
11 import yoho from 'yoho'; 11 import yoho from 'yoho';
12 import tip from 'common/tip'; 12 import tip from 'common/tip';
13 - 13 +
14 export default { 14 export default {
15 data() { 15 data() {
16 return { 16 return {
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 <button @click="readdOrder(order)" class="normal">再次购买</button> 53 <button @click="readdOrder(order)" class="normal">再次购买</button>
54 </template> 54 </template>
55 <template v-else> 55 <template v-else>
56 - <button v-if="order.status == 0" @click="cancelOrder()">取消订单</button> 56 + <button v-if="order.status == 0" @click="cancelOrder">取消订单</button>
57 <button v-if="order.status == 0 " class="countdown" @click="goBuy(order)">去支付 <span class="count-down" v-count-down="{leftTime: order.pay_lefttime, callback: autoCancel()}"></span></button> 57 <button v-if="order.status == 0 " class="countdown" @click="goBuy(order)">去支付 <span class="count-down" v-count-down="{leftTime: order.pay_lefttime, callback: autoCancel()}"></span></button>
58 <a v-if="order.status == 4 || order.status == 5 || order.status == 6" :href="`/me/logistic?order_code=${order.order_code}`">查看物流</a> 58 <a v-if="order.status == 4 || order.status == 5 || order.status == 6" :href="`/me/logistic?order_code=${order.order_code}`">查看物流</a>
59 <button v-if="order.status == 4 || order.status == 5 " class="black" @click="confirmGoods(order.order_code)">确认收货</button> 59 <button v-if="order.status == 4 || order.status == 5 " class="black" @click="confirmGoods(order.order_code)">确认收货</button>