Authored by ccbikai

Merge branch 'develop' into release/1.0

1 const yoho = require('yoho'); 1 const yoho = require('yoho');
2 2
3 -const getImgHost = function(url) { 3 +const getImgHost = function(url, bucket = 'goodsimg') {
4 let urlArr = url.split('/'), 4 let urlArr = url.split('/'),
5 num = urlArr[urlArr.length - 1].substr(1, 1), 5 num = urlArr[urlArr.length - 1].substr(1, 1),
6 - domain = 'static.yhbimg.com/goodsimg'; 6 + domain = `static.yhbimg.com/${bucket}`;
7 7
8 url = domain + url; 8 url = domain + url;
9 if (num === '1') { 9 if (num === '1') {
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 } 15 }
16 16
17 p { 17 p {
18 - font-size: 21px; 18 + font-size: 30px;
19 text-align: center; 19 text-align: center;
20 margin: 20px 40px 48px; 20 margin: 20px 40px 48px;
21 } 21 }
@@ -11,4 +11,5 @@ @@ -11,4 +11,5 @@
11 .return select { 11 .return select {
12 background: transparent; 12 background: transparent;
13 border: 0; 13 border: 0;
  14 + -webkit-appearance: none;
14 } 15 }
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
20 data() { 20 data() {
21 return { 21 return {
22 page: 'brand', 22 page: 'brand',
  23 + channel: detaultChannel,
23 contentCode: contentCode.brand[detaultChannel] 24 contentCode: contentCode.brand[detaultChannel]
24 }; 25 };
25 }, 26 },
@@ -11,10 +11,8 @@ @@ -11,10 +11,8 @@
11 <h2 class="card-label"> 11 <h2 class="card-label">
12 <a href="{{item | goodsUrl}}" class="line-clamp-2">{{item.productName}}</a> 12 <a href="{{item | goodsUrl}}" class="line-clamp-2">{{item.productName}}</a>
13 </h2> 13 </h2>
14 - <div class="good-price-box clearfix">  
15 - <span class="good-price" :class="{'old-price': item.marketPrice}" v-if="item.marketPrice">¥ {{item.marketPrice | toFixed}}</span>  
16 - <span class="good-price" :class="{'sale-price': item.marketPrice}">¥ {{item.salesPrice | toFixed}}</span>  
17 - </div> 14 + <span class="good-price" :class="{'old-price': item.marketPrice}" v-if="item.marketPrice">¥ {{item.marketPrice | toFixed}}</span>
  15 + <span class="good-price" :class="{'sale-price': item.marketPrice}">¥ {{item.salesPrice | toFixed}}</span>
18 </div> 16 </div>
19 </li> 17 </li>
20 </ul> 18 </ul>
@@ -110,19 +108,15 @@ @@ -110,19 +108,15 @@
110 } 108 }
111 } 109 }
112 110
113 - .good-price-box {  
114 - white-space: nowrap;  
115 - }  
116 -  
117 .good-price { 111 .good-price {
118 - display: inline-block;  
119 - width: 50%;  
120 color: #b0b0b0; 112 color: #b0b0b0;
121 - 113 + margin-right: 10px;
  114 + &:last-of-type {
  115 + margin-right: 0;
  116 + }
122 &.old-price { 117 &.old-price {
123 text-decoration: line-through; 118 text-decoration: line-through;
124 } 119 }
125 -  
126 &.sale-price { 120 &.sale-price {
127 color: #d0021b; 121 color: #d0021b;
128 } 122 }
@@ -218,7 +218,7 @@ @@ -218,7 +218,7 @@
218 return true; 218 return true;
219 } 219 }
220 220
221 - if (isSpecialReason && !(goods.mark && goods.evidence_images)) { 221 + if (isSpecialReason && !(goods.remark && goods.evidence_images && goods.evidence_images.length)) {
222 msg = '换货原因 请填写完整'; 222 msg = '换货原因 请填写完整';
223 return true; 223 return true;
224 } 224 }
@@ -52,6 +52,7 @@ @@ -52,6 +52,7 @@
52 'use strict'; 52 'use strict';
53 const $ = require('jquery'); 53 const $ = require('jquery');
54 const tip = require('common/tip'); 54 const tip = require('common/tip');
  55 + const Modal = require('common/modal');
55 56
56 module.exports = { 57 module.exports = {
57 data() { 58 data() {
@@ -99,20 +100,23 @@ @@ -99,20 +100,23 @@
99 * @param type refundType 1为退货,2为换货 100 * @param type refundType 1为退货,2为换货
100 */ 101 */
101 cancelApply(id, type) { 102 cancelApply(id, type) {
102 - $.ajax({  
103 - url: '/me/return/' + (Number(type) === 2 ? 'exchange' : 'refund') + '/cancel-apply',  
104 - type: 'post',  
105 - data: {  
106 - id: id  
107 - }  
108 - }).then(result => {  
109 - if (result.code === 200) {  
110 - location.reload();  
111 - } else {  
112 - tip(result.message);  
113 - }  
114 - }).fail(() => {  
115 - tip('操作失敗'); 103 + Modal.confirm('', '确认取消吗?', function() {
  104 + this.hide();
  105 + $.ajax({
  106 + url: '/me/return/' + (Number(type) === 2 ? 'exchange' : 'refund') + '/cancel-apply',
  107 + type: 'post',
  108 + data: {
  109 + id: id
  110 + }
  111 + }).then(result => {
  112 + if (result.code === 200) {
  113 + location.reload();
  114 + } else {
  115 + tip(result.message);
  116 + }
  117 + }).fail(() => {
  118 + tip('操作失敗');
  119 + });
116 }); 120 });
117 } 121 }
118 } 122 }
@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
60 <blockquote v-if="goods.remark">{{goods.remark}}</blockquote> 60 <blockquote v-if="goods.remark">{{goods.remark}}</blockquote>
61 <ul v-if="goods.evidenceImages.length > 0" class="exchange-img"> 61 <ul v-if="goods.evidenceImages.length > 0" class="exchange-img">
62 <li v-for="image in goods.evidenceImages"> 62 <li v-for="image in goods.evidenceImages">
63 - <img :src="image"> 63 + <img :src="image | resize 154 154">
64 </li> 64 </li>
65 </ul> 65 </ul>
66 </div> 66 </div>
@@ -73,8 +73,8 @@ @@ -73,8 +73,8 @@
73 <p>(现金:&yen;{{detail.returnAmountTotal}} - YOHO币:{{detail.returnYohoCoin}} - 优惠券:{{detail.returnCouponAmount}})</p> 73 <p>(现金:&yen;{{detail.returnAmountTotal}} - YOHO币:{{detail.returnYohoCoin}} - 优惠券:{{detail.returnCouponAmount}})</p>
74 </div> 74 </div>
75 <div class="exchange-type"> 75 <div class="exchange-type">
76 - <a href="" class="primary">退款方式<span class="right">{{detail.returnAmountModeName}}</span>  
77 - </a> 76 + <span href="" class="primary">退款方式<span class="right">{{detail.returnAmountModeName}}</span>
  77 + </span>
78 <div class="amount-modeinfo" v-if="detail.returnAmountModeInfo && detail.returnAmountModeInfo.length"> 78 <div class="amount-modeinfo" v-if="detail.returnAmountModeInfo && detail.returnAmountModeInfo.length">
79 <p v-if="detail.returnAmountModeInfo[0].bankName">银行 <span>{{detail.returnAmountModeInfo[0].bankName}}</span></p> 79 <p v-if="detail.returnAmountModeInfo[0].bankName">银行 <span>{{detail.returnAmountModeInfo[0].bankName}}</span></p>
80 <p v-if="detail.returnAmountModeInfo[0].bankCard">卡号 <span>{{detail.returnAmountModeInfo[0].bankCard}}</span></p> 80 <p v-if="detail.returnAmountModeInfo[0].bankCard">卡号 <span>{{detail.returnAmountModeInfo[0].bankCard}}</span></p>
@@ -91,8 +91,7 @@ @@ -91,8 +91,7 @@
91 <p>{{detail.province}}&nbsp;{{detail.city}}&nbsp;{{detail.county}} <br>{{detail.address}}</p> 91 <p>{{detail.province}}&nbsp;{{detail.city}}&nbsp;{{detail.county}} <br>{{detail.address}}</p>
92 </div> 92 </div>
93 <div class="exchange-type"> 93 <div class="exchange-type">
94 - <a href="" class="primary">换货方式<span class="right">{{detail.deliveryTpyeName}}</span>  
95 - </a> 94 + <span class="primary">换货方式<span class="right">{{detail.deliveryTpyeName}}</span></span>
96 </div> 95 </div>
97 </div> 96 </div>
98 <div class="exchange-order"> 97 <div class="exchange-order">
@@ -111,6 +110,7 @@ @@ -111,6 +110,7 @@
111 const tip = require('common/tip'); 110 const tip = require('common/tip');
112 const interceptClick = require('common/intercept-click'); 111 const interceptClick = require('common/intercept-click');
113 const yoho = require('yoho'); 112 const yoho = require('yoho');
  113 + const Modal = require('common/modal');
114 114
115 module.exports = { 115 module.exports = {
116 props: ['applyid', 'type'], 116 props: ['applyid', 'type'],
@@ -123,32 +123,33 @@ @@ -123,32 +123,33 @@
123 }, 123 },
124 methods: { 124 methods: {
125 cancel() { 125 cancel() {
126 - if (!this.id) {  
127 - return false;  
128 - }  
129 - 126 + let id = this.id;
130 let url = ''; 127 let url = '';
131 128
  129 + if (!id) {
  130 + return false;
  131 + }
132 if (this.type === 'refund') { 132 if (this.type === 'refund') {
133 url = '/me/return/refund/cancel-apply'; 133 url = '/me/return/refund/cancel-apply';
134 } else if (this.type === 'exchange') { 134 } else if (this.type === 'exchange') {
135 url = '/me/return/exchange/cancel-apply'; 135 url = '/me/return/exchange/cancel-apply';
136 } 136 }
137 137
138 - $.ajax({  
139 - method: 'POST',  
140 - url: url,  
141 - data: {  
142 - id: this.id,  
143 - }  
144 - }).then(data => {  
145 - if (data.code === 200) {  
146 - interceptClick.intercept('/me/return');  
147 - } else if (data.code === 400) {  
148 - tip(data.message);  
149 - } else {  
150 - tip('取消失败');  
151 - } 138 + Modal.confirm('', '确认取消吗?', function() {
  139 + this.hide();
  140 + $.ajax({
  141 + method: 'POST',
  142 + url: url,
  143 + data: {
  144 + id: id,
  145 + }
  146 + }).then(data => {
  147 + if (data.code === 200) {
  148 + interceptClick.intercept('/me/return');
  149 + } else {
  150 + tip(data.message);
  151 + }
  152 + });
152 }); 153 });
153 } 154 }
154 }, 155 },
@@ -169,9 +170,9 @@ @@ -169,9 +170,9 @@
169 this.id = this.detail.id; 170 this.id = this.detail.id;
170 this.sourceOrderCode = this.detail.sourceOrderCode; 171 this.sourceOrderCode = this.detail.sourceOrderCode;
171 this.detail.goodsList.forEach(d => { 172 this.detail.goodsList.forEach(d => {
172 - d.evidenceImages = d.evidenceImages.map(p => {  
173 - return util.getImgHost(p) + '?imageView2/2/w/154/h/154';  
174 - }) 173 + // d.evidenceImages = d.evidenceImages.map(p => {
  174 + // return util.getImgHost(p) + '?imageView2/2/w/154/h/154';
  175 + // })
175 }); 176 });
176 } 177 }
177 }); 178 });
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 <span v-on:click="deleteImage(image.index)" class="icon icon-close"></span> 21 <span v-on:click="deleteImage(image.index)" class="icon icon-close"></span>
22 <img v-bind:src="image.path"> 22 <img v-bind:src="image.path">
23 </div> 23 </div>
24 - <upload v-show="imageListForShow.length < 4" class="image-item" v-bind:image-list="product.imageList"></upload> 24 + <upload v-show="imageListForShow.length < 4" class="image-item" v-bind:image-list="product.imageList" v-bind:bucket="bucket"></upload>
25 </div> 25 </div>
26 </template> 26 </template>
27 </div> 27 </div>
@@ -37,6 +37,7 @@ @@ -37,6 +37,7 @@
37 props: ['product', 'data'], 37 props: ['product', 'data'],
38 data() { 38 data() {
39 return { 39 return {
  40 + bucket: 'evidenceImages',
40 reasons: [], 41 reasons: [],
41 specialReasons: [], 42 specialReasons: [],
42 specialNotice: {} 43 specialNotice: {}
@@ -49,7 +50,7 @@ @@ -49,7 +50,7 @@
49 this.product.imageList.forEach((path, index) => { 50 this.product.imageList.forEach((path, index) => {
50 list.push({ 51 list.push({
51 index: index, 52 index: index,
52 - path: util.getImgHost(path) + '?imageView2/2/w/160/h/160' 53 + path: util.getImgHost(path, this.bucket) + '?imageView2/2/w/160/h/160'
53 }); 54 });
54 }); 55 });
55 56