Authored by yyq

Merge branch 'develop' of git.yoho.cn:fe/xianyu-ufo-app-web into develop

@@ -34,6 +34,7 @@ export default { @@ -34,6 +34,7 @@ export default {
34 data: function() { 34 data: function() {
35 return { 35 return {
36 yasFirstId: 0, 36 yasFirstId: 0,
  37 + itemHeight: 0
37 }; 38 };
38 }, 39 },
39 methods: { 40 methods: {
@@ -59,14 +60,23 @@ export default { @@ -59,14 +60,23 @@ export default {
59 }); 60 });
60 }, 61 },
61 yasShowEvent: function(height) { 62 yasShowEvent: function(height) {
  63 + if (!this.itemHeight) {
  64 + let item = document.querySelector('.product-list-item');
  65 +
  66 + this.itemHeight = item && item.offsetHeight || 0;
  67 + }
  68 +
  69 + if (!this.itemHeight) {
  70 + return;
  71 + }
  72 +
62 // 获取列表单个元素高度 73 // 获取列表单个元素高度
63 let index = 0; 74 let index = 0;
64 75
65 if (Number(height) > 0) { 76 if (Number(height) > 0) {
66 // 获取第一个曝光元素 77 // 获取第一个曝光元素
67 - let item = document.querySelector('.product-list-item');  
68 - let itemHeight = item.offsetHeight;  
69 - let row = parseInt((height - 12) / itemHeight) + 1; 78 +
  79 + let row = parseInt((height - 12) / this.itemHeight) + 1;
70 80
71 index = row * 2 - 2; 81 index = row * 2 - 2;
72 } 82 }
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 :class="filterParams.brand.includes(item.itemId) && 'item-img-selected'" 11 :class="filterParams.brand.includes(item.itemId) && 'item-img-selected'"
12 v-for="(item,i) in filter.itemList" :style="i===0 && 'margin-left:1rem'" 12 v-for="(item,i) in filter.itemList" :style="i===0 && 'margin-left:1rem'"
13 @click="select({filterId:filter.filterId, itemId:item.itemId, row})"> 13 @click="select({filterId:filter.filterId, itemId:item.itemId, row})">
14 - <ImgSize class="item-img" :src="item.itemUrl" :width="140" :height="70"/> 14 + <img class="item-img" :src="(item.itemUrl || '').replace('http://', '//').replace('{width}', 140).replace('{height}', 70)" />
15 <div class="item-img-text">{{item.itemName}}</div> 15 <div class="item-img-text">{{item.itemName}}</div>
16 </div> 16 </div>
17 <div class="item-text item-size" v-if="filter.filterId === 'size'" :style="i===0 && 'margin-left:1rem'" 17 <div class="item-text item-size" v-if="filter.filterId === 'size'" :style="i===0 && 'margin-left:1rem'"
@@ -219,6 +219,10 @@ export default { @@ -219,6 +219,10 @@ export default {
219 size: filterParams.size.join(','), // 尺码id 219 size: filterParams.size.join(','), // 尺码id
220 }; 220 };
221 221
  222 + for (let i in params) {
  223 + !params[i] && delete params[i];
  224 + }
  225 +
222 this.selectedType = flag; 226 this.selectedType = flag;
223 if (flag === 1) { 227 if (flag === 1) {
224 this.setYasParam({tab: {index: 2, name: '价格'}}); 228 this.setYasParam({tab: {index: 2, name: '价格'}});
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <LayoutApp :show-back="true" title="确认订单" :back-action="backAction"> 2 <LayoutApp :show-back="true" title="确认订单" :back-action="backAction">
3 <div class="body"> 3 <div class="body">
4 <AddressInfo :data="address" class="order-item" :show-tip="false"></AddressInfo> 4 <AddressInfo :data="address" class="order-item" :show-tip="false"></AddressInfo>
5 - <ProductInfo :data="productDetail" class="product-info order-item"></ProductInfo> 5 + <ProductInfo :data="productDetail" class="order-item"></ProductInfo>
6 <Coupon class="order-item" v-if="couponList.length > 0" :data="orderDetail.recommendedCouponInfo" 6 <Coupon class="order-item" v-if="couponList.length > 0" :data="orderDetail.recommendedCouponInfo"
7 @click="onCouponClick"></Coupon> 7 @click="onCouponClick"></Coupon>
8 <Promotion class="order-item" v-if="promotionList.length > 0" :data="orderDetail.promotionTips" 8 <Promotion class="order-item" v-if="promotionList.length > 0" :data="orderDetail.promotionTips"
@@ -335,10 +335,6 @@ export default { @@ -335,10 +335,6 @@ export default {
335 border-top: 1px solid #eee; 335 border-top: 1px solid #eee;
336 } 336 }
337 337
338 -.product-info {  
339 - display: flex;  
340 -}  
341 -  
342 .tip { 338 .tip {
343 font-size: 24px; 339 font-size: 24px;
344 color: #999; 340 color: #999;
1 <template> 1 <template>
2 - <div class="product-wrapper">  
3 - <div class="good-image">  
4 - <ImageFormat :src="data.goodImg" :width="180" :height="180"></ImageFormat>  
5 - </div>  
6 - <div class="product-price">  
7 - <div class="red">¥{{data.goodPrice}}</div>  
8 - <div class="product-name">{{data.productName}}</div>  
9 - <div class="price">{{data.colorName}},{{data.sizeName}}</div> 2 + <div class="product-info">
  3 + <div class="product-wrapper">
  4 + <div class="good-image">
  5 + <ImageFormat :src="data.goodImg" :width="180" :height="180"></ImageFormat>
  6 + </div>
  7 + <div class="product-price">
  8 + <div class="red">¥{{data.goodPrice}}</div>
  9 + <div class="product-name">{{data.productName}}</div>
  10 + <div class="price">{{data.colorName}},{{data.sizeName}}</div>
  11 + </div>
10 </div> 12 </div>
  13 + <div v-if="!getLogin" class="no-login-tip">完成“有货”登录授权后将显示商品优惠及运费信息,请先完成登录查看最终支付金额</div>
11 </div> 14 </div>
12 </template> 15 </template>
13 16
14 <script> 17 <script>
  18 +import { mapGetters } from 'vuex';
  19 +
15 export default { 20 export default {
16 name: 'OrderProductInfo', 21 name: 'OrderProductInfo',
17 props: { 22 props: {
@@ -21,12 +26,20 @@ export default { @@ -21,12 +26,20 @@ export default {
21 return {}; 26 return {};
22 } 27 }
23 } 28 }
  29 + },
  30 + computed: {
  31 + ...mapGetters(['getLogin'])
24 } 32 }
25 }; 33 };
26 </script> 34 </script>
27 35
28 <style lang="scss" scoped> 36 <style lang="scss" scoped>
29 37
  38 +.product-info {
  39 + display: flex;
  40 + flex-direction: column;
  41 +}
  42 +
30 .good-image { 43 .good-image {
31 width: 180px; 44 width: 180px;
32 height: 180px; 45 height: 180px;
@@ -65,6 +78,10 @@ export default { @@ -65,6 +78,10 @@ export default {
65 line-height: 36px; 78 line-height: 36px;
66 } 79 }
67 80
  81 +.no-login-tip {
  82 + color: #d0021b;
  83 +}
  84 +
68 .red { 85 .red {
69 color: #d0021b; 86 color: #d0021b;
70 font-size: 28px; 87 font-size: 28px;