Authored by 陈轩

Merge remote-tracking branch 'origin/develop' into develop

... ... @@ -52,7 +52,7 @@ module.exports = {
}).catch(next);
},
/* 收藏店铺 */
/* 收藏品牌或者店铺 */
collectShop: (req, res, next) => {
if (!req.user.uid) {
return res.json({
... ... @@ -62,10 +62,10 @@ module.exports = {
}
shopModel.collectShopData({
shopId: req.body.shopId,
favId: req.body.favId,
id: req.body.isBlkShop ? req.body.shopId : req.body.brandId,
favId: req.body.isBlkShop ? req.body.shopId : req.body.brandId,
uid: req.user.uid,
type: 'shop',
type: req.body.isBlkShop ? 'shop' : 'brand',
isFav: req.body.isFav
}).then(result => {
res.json(result);
... ...
... ... @@ -103,8 +103,8 @@ module.exports = {
*/
collectShopOriginData(params) {
let finalParams = {
id: params.shopId,
fav_id: params.shopId,
id: params.id,
fav_id: params.favId,
uid: params.uid,
type: params.type
};
... ...
... ... @@ -28,7 +28,8 @@ const getShopData = params => {
/* 品牌名称 */
Object.assign(finalResult, {
brandName: result.data.brand_name
brandName: result.data.brand_name,
brandId: result.data.id
});
/* 品牌是否有店铺 */
... ...
... ... @@ -9,7 +9,6 @@ $white: #fff;
.order-wrapper {
background: #f6f6f6;
padding-top: 20px;
.order-item {
background: $white;
... ...
<template>
<div class="order-status">
<p>{{order.statusStr}}</p>
<p v-if="order.isCancel !== 'Y' && order.status == 0 && order.payLefttime != 0">剩余: <span v-count-down v-bind:left-time="order.payLefttime"></span>,订单将被取消</p>
</div>
<div class="order-address">
<p><span>{{order.userName}}</span><span>{{order.mobile}}</span></p>
<p>{{order.area}} <br>{{order.address}}</p>
</div>
<div class="order-code">
<p>订单号: {{order.orderCode}}</p>
<p>下单时间: {{order.createTime | convertTime}}</p>
</div>
<div class="order-goods">
<ul>
<li class="goods-info" v-for="product in order.orderGoods">
<div class="img-box">
<img v-bind:src="product.goodsImage | resize 49 65">
<label v-if="product.goodsType === 'gift'">赠品</label>
<label class="price-gift" v-if="product.goodsType === 'price_gift'">加价购</label>
</div>
<div class="goods-detail">
<p class="name">{{product.productName}}</p>
<p class="size">
<span>颜色:{{product.colorName}}</span>
<span>尺码:{{product.sizeName}}</span>
</p>
</div>
<div class="goods-price">
<p>&yen;{{product.goodsPrice}}</p>
<p>×{{product.buyNumber}}</p>
</div>
</li>
</ul>
</div>
<div class="order-amount">
<ul>
<li v-for="promotion in order.promotionFormulas">
<label>{{promotion.promotion}}:</label><span>{{promotion.promotionAmount}}</span>
</li>
<li class="sum"><label>总计:</label><span>{{order.amount}}</span></li>
</ul>
</div>
<div class="order-button" v-show="order.status != 1 && order.status != 2 && order.status != 3">
<button v-if="order.isCancel === 'Y'" @click="deleteOrder(order,index)" class="normal">删除订单</button>
<template v-else>
<button v-if="order.status == 0" @click="cancelOrder(order.orderCode)">取消订单</button>
<button v-if="order.status == 0 " class="countdown" @click="goBuy(order.orderCode)">去支付 <span v-count-down v-bind:left-time="order.payLefttime" v-bind:callback="autoCancel(order.orderCode)"></span></button>
<a v-if="order.status === 4 || order.status === 5 " href="/me/logistic?order_code={{order.orderCode}}">查看物流</a>
<button v-if="order.status == 4 || order.status == 5 " class="black" @click="confirmGoods(order.orderCode)">确认收货</button>
<button v-if="order.status == 6" @click="deleteOrder(order,index)" class="normal">删除订单</button>
<button v-if="order.isSupportRefund == 'Y' || order.isSupportExchange == 'Y'" class="normal" @click="applyRefund()">申请售后</button>
</template>
</div>
<select id="cancel-reason" class="cancel-reason" v-on:blur="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id,reason:option.reason}">{{option.reason}}</option>
</select>
<template v-if="show">
<div class="order-status">
<p>{{order.statusStr}}</p>
<p v-if="order.isCancel !== 'Y' && order.status == 0 && order.payLefttime != 0">剩余: <span v-count-down v-bind:left-time="order.payLefttime"></span>,订单将被取消</p>
</div>
<div class="order-address">
<p><span>{{order.userName}}</span><span>{{order.mobile}}</span></p>
<p>{{order.area}} <br>{{order.address}}</p>
</div>
<div class="order-code">
<p>订单号: {{order.orderCode}}</p>
<p>下单时间: {{order.createTime | convertTime}}</p>
</div>
<div class="order-goods">
<ul>
<li class="goods-info" v-for="product in order.orderGoods">
<div class="img-box">
<img v-bind:src="product.goodsImage | resize 49 65">
<label v-if="product.goodsType === 'gift'">赠品</label>
<label class="price-gift" v-if="product.goodsType === 'price_gift'">加价购</label>
</div>
<div class="goods-detail">
<p class="name">{{product.productName}}</p>
<p class="size">
<span>颜色:{{product.colorName}}</span>
<span>尺码:{{product.sizeName}}</span>
</p>
</div>
<div class="goods-price">
<p>&yen;{{product.goodsPrice}}</p>
<p>×{{product.buyNumber}}</p>
</div>
</li>
</ul>
</div>
<div class="order-amount">
<ul>
<li v-for="promotion in order.promotionFormulas">
<label>{{promotion.promotion}}:</label><span>{{promotion.promotionAmount}}</span>
</li>
<li class="sum"><label>总计:</label><span>{{order.amount}}</span></li>
</ul>
</div>
<div class="order-button" v-show="order.status != 1 && order.status != 2 && order.status != 3">
<button v-if="order.isCancel === 'Y'" @click="deleteOrder(order,index)" class="normal">删除订单</button>
<template v-else>
<button v-if="order.status == 0" @click="cancelOrder(order.orderCode)">取消订单</button>
<button v-if="order.status == 0 " class="countdown" @click="goBuy(order.orderCode)">去支付 <span v-count-down v-bind:left-time="order.payLefttime" v-bind:callback="autoCancel(order.orderCode)"></span></button>
<a v-if="order.status === 4 || order.status === 5 " href="/me/logistic?order_code={{order.orderCode}}">查看物流</a>
<button v-if="order.status == 4 || order.status == 5 " class="black" @click="confirmGoods(order.orderCode)">确认收货</button>
<button v-if="order.status == 6" @click="deleteOrder(order,index)" class="normal">删除订单</button>
<button v-if="order.isSupportRefund == 'Y' || order.isSupportExchange == 'Y'" class="normal" @click="applyRefund()">申请售后</button>
</template>
</div>
<select id="cancel-reason" class="cancel-reason" v-on:blur="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id,reason:option.reason}">{{option.reason}}</option>
</select>
</template>
</template>
<script>
'use strict';
... ... @@ -69,12 +71,13 @@
module.exports = {
data() {
return {
show: false,
order: {},
options: [],
selected: {}
};
},
ready() {
created() {
this.getOrderData();
yohoAPI.addNativeMethod('goToService', () => {
... ... @@ -91,6 +94,7 @@
}
}).then(result => {
if (result.code === 200) {
this.show = true;
this.$set('order', result.data);
genderSel = genderSel([{
key: this.order.isSupportRefund,
... ...
... ... @@ -89,6 +89,7 @@
isBlkShop: result.isBlkShop,
domain: locationQuery.domain,
brandName: result.brandName,
brandId: result.brandId, // 不是分享的参数,收藏店铺使用
shopId: result.shopId, // 不是分享的参数,收藏店铺使用
isFav: result.isFav // 不是分享的参数,收藏店铺使用
};
... ...
... ... @@ -84,8 +84,10 @@
/* 收藏或者取消收藏店铺 */
collectShop() {
let data = {
brandId: this.shareData.brandId,
shopId: this.shareData.shopId,
isFav: this.shareData.isFav
isFav: this.shareData.isFav,
isBlkShop: this.shareData.isBlkShop
};
$.post({
... ...