Authored by 沈志敏

Merge branch 'develop' into release/1.0

const yoho = require('yoho');
const getImgHost = function(url) {
const getImgHost = function(url, bucket = 'goodsimg') {
let urlArr = url.split('/'),
num = urlArr[urlArr.length - 1].substr(1, 1),
domain = 'static.yhbimg.com/goodsimg';
domain = `static.yhbimg.com/${bucket}`;
url = domain + url;
if (num === '1') {
... ...
... ... @@ -15,7 +15,7 @@
}
p {
font-size: 21px;
font-size: 30px;
text-align: center;
margin: 20px 40px 48px;
}
... ...
... ... @@ -11,4 +11,5 @@
.return select {
background: transparent;
border: 0;
-webkit-appearance: none;
}
... ...
... ... @@ -20,6 +20,7 @@
data() {
return {
page: 'brand',
channel: detaultChannel,
contentCode: contentCode.brand[detaultChannel]
};
},
... ...
... ... @@ -11,10 +11,8 @@
<h2 class="card-label">
<a href="{{item | goodsUrl}}" class="line-clamp-2">{{item.productName}}</a>
</h2>
<div class="good-price-box clearfix">
<span class="good-price" :class="{'old-price': item.marketPrice}" v-if="item.marketPrice">¥ {{item.marketPrice | toFixed}}</span>
<span class="good-price" :class="{'sale-price': item.marketPrice}">¥ {{item.salesPrice | toFixed}}</span>
</div>
<span class="good-price" :class="{'old-price': item.marketPrice}" v-if="item.marketPrice">¥ {{item.marketPrice | toFixed}}</span>
<span class="good-price" :class="{'sale-price': item.marketPrice}">¥ {{item.salesPrice | toFixed}}</span>
</div>
</li>
</ul>
... ... @@ -110,19 +108,15 @@
}
}
.good-price-box {
white-space: nowrap;
}
.good-price {
display: inline-block;
width: 50%;
color: #b0b0b0;
margin-right: 10px;
&:last-of-type {
margin-right: 0;
}
&.old-price {
text-decoration: line-through;
}
&.sale-price {
color: #d0021b;
}
... ...
... ... @@ -218,7 +218,7 @@
return true;
}
if (isSpecialReason && !(goods.mark && goods.evidence_images)) {
if (isSpecialReason && !(goods.remark && goods.evidence_images && goods.evidence_images.length)) {
msg = '换货原因 请填写完整';
return true;
}
... ...
... ... @@ -52,6 +52,7 @@
'use strict';
const $ = require('jquery');
const tip = require('common/tip');
const Modal = require('common/modal');
module.exports = {
data() {
... ... @@ -99,20 +100,23 @@
* @param type refundType 1为退货,2为换货
*/
cancelApply(id, type) {
$.ajax({
url: '/me/return/' + (Number(type) === 2 ? 'exchange' : 'refund') + '/cancel-apply',
type: 'post',
data: {
id: id
}
}).then(result => {
if (result.code === 200) {
location.reload();
} else {
tip(result.message);
}
}).fail(() => {
tip('操作失敗');
Modal.confirm('', '确认取消吗?', function() {
this.hide();
$.ajax({
url: '/me/return/' + (Number(type) === 2 ? 'exchange' : 'refund') + '/cancel-apply',
type: 'post',
data: {
id: id
}
}).then(result => {
if (result.code === 200) {
location.reload();
} else {
tip(result.message);
}
}).fail(() => {
tip('操作失敗');
});
});
}
}
... ...
... ... @@ -60,7 +60,7 @@
<blockquote v-if="goods.remark">{{goods.remark}}</blockquote>
<ul v-if="goods.evidenceImages.length > 0" class="exchange-img">
<li v-for="image in goods.evidenceImages">
<img :src="image">
<img :src="image | resize 154 154">
</li>
</ul>
</div>
... ... @@ -73,8 +73,8 @@
<p>(现金:&yen;{{detail.returnAmountTotal}} - YOHO币:{{detail.returnYohoCoin}} - 优惠券:{{detail.returnCouponAmount}})</p>
</div>
<div class="exchange-type">
<a href="" class="primary">退款方式<span class="right">{{detail.returnAmountModeName}}</span>
</a>
<span href="" class="primary">退款方式<span class="right">{{detail.returnAmountModeName}}</span>
</span>
<div class="amount-modeinfo" v-if="detail.returnAmountModeInfo && detail.returnAmountModeInfo.length">
<p v-if="detail.returnAmountModeInfo[0].bankName">银行 <span>{{detail.returnAmountModeInfo[0].bankName}}</span></p>
<p v-if="detail.returnAmountModeInfo[0].bankCard">卡号 <span>{{detail.returnAmountModeInfo[0].bankCard}}</span></p>
... ... @@ -91,8 +91,7 @@
<p>{{detail.province}}&nbsp;{{detail.city}}&nbsp;{{detail.county}} <br>{{detail.address}}</p>
</div>
<div class="exchange-type">
<a href="" class="primary">换货方式<span class="right">{{detail.deliveryTpyeName}}</span>
</a>
<span class="primary">换货方式<span class="right">{{detail.deliveryTpyeName}}</span></span>
</div>
</div>
<div class="exchange-order">
... ... @@ -111,6 +110,7 @@
const tip = require('common/tip');
const interceptClick = require('common/intercept-click');
const yoho = require('yoho');
const Modal = require('common/modal');
module.exports = {
props: ['applyid', 'type'],
... ... @@ -123,32 +123,33 @@
},
methods: {
cancel() {
if (!this.id) {
return false;
}
let id = this.id;
let url = '';
if (!id) {
return false;
}
if (this.type === 'refund') {
url = '/me/return/refund/cancel-apply';
} else if (this.type === 'exchange') {
url = '/me/return/exchange/cancel-apply';
}
$.ajax({
method: 'POST',
url: url,
data: {
id: this.id,
}
}).then(data => {
if (data.code === 200) {
interceptClick.intercept('/me/return');
} else if (data.code === 400) {
tip(data.message);
} else {
tip('取消失败');
}
Modal.confirm('', '确认取消吗?', function() {
this.hide();
$.ajax({
method: 'POST',
url: url,
data: {
id: id,
}
}).then(data => {
if (data.code === 200) {
interceptClick.intercept('/me/return');
} else {
tip(data.message);
}
});
});
}
},
... ... @@ -169,9 +170,9 @@
this.id = this.detail.id;
this.sourceOrderCode = this.detail.sourceOrderCode;
this.detail.goodsList.forEach(d => {
d.evidenceImages = d.evidenceImages.map(p => {
return util.getImgHost(p) + '?imageView2/2/w/154/h/154';
})
// d.evidenceImages = d.evidenceImages.map(p => {
// return util.getImgHost(p) + '?imageView2/2/w/154/h/154';
// })
});
}
});
... ...
... ... @@ -21,7 +21,7 @@
<span v-on:click="deleteImage(image.index)" class="icon icon-close"></span>
<img v-bind:src="image.path">
</div>
<upload v-show="imageListForShow.length < 4" class="image-item" v-bind:image-list="product.imageList"></upload>
<upload v-show="imageListForShow.length < 4" class="image-item" v-bind:image-list="product.imageList" v-bind:bucket="bucket"></upload>
</div>
</template>
</div>
... ... @@ -37,6 +37,7 @@
props: ['product', 'data'],
data() {
return {
bucket: 'evidenceImages',
reasons: [],
specialReasons: [],
specialNotice: {}
... ... @@ -49,7 +50,7 @@
this.product.imageList.forEach((path, index) => {
list.push({
index: index,
path: util.getImgHost(path) + '?imageView2/2/w/160/h/160'
path: util.getImgHost(path, this.bucket) + '?imageView2/2/w/160/h/160'
});
});
... ...