Authored by 李奇

猜你喜欢修改

@@ -240,15 +240,6 @@ const component = { @@ -240,15 +240,6 @@ const component = {
240 * @param next 240 * @param next
241 */ 241 */
242 mightLike: (req, res, next) => { 242 mightLike: (req, res, next) => {
243 - const uid = req.user.uid;  
244 -  
245 - if (!uid) {  
246 - return res.json({  
247 - code: 200,  
248 - data: []  
249 - });  
250 - }  
251 -  
252 const channel = req.query.channel || req.cookies._Channel || 'men'; 243 const channel = req.query.channel || req.cookies._Channel || 'men';
253 const params = { 244 const params = {
254 uid: req.user.uid, 245 uid: req.user.uid,
@@ -262,6 +253,7 @@ const component = { @@ -262,6 +253,7 @@ const component = {
262 }; 253 };
263 254
264 model.mightLike(params).then(result => { 255 model.mightLike(params).then(result => {
  256 + console.log(result.data.product_list);
265 if (result && result.code === 200) { 257 if (result && result.code === 200) {
266 res.json({ 258 res.json({
267 code: 200, 259 code: 200,
@@ -124,7 +124,7 @@ @@ -124,7 +124,7 @@
124 font-size: 20px; 124 font-size: 20px;
125 line-height: 1.4; 125 line-height: 1.4;
126 height: 67.1999999999px; 126 height: 67.1999999999px;
127 - font-weight: normal; 127 + font-weight: normal;
128 128
129 a { 129 a {
130 color: #888; 130 color: #888;
@@ -3,8 +3,10 @@ @@ -3,8 +3,10 @@
3 <div class="list-wrap"> 3 <div class="list-wrap">
4 <div class="product-item" v-for="item in list"> 4 <div class="product-item" v-for="item in list">
5 <a :href="item.url"> 5 <a :href="item.url">
6 - <img :src="item.default_images">  
7 - <p class="product-name">{{item.product_name}}</p> 6 + <a href="{{item | goodsUrl}}">
  7 + <img :src="item.default_images | resize 250 335">
  8 + <p class="product-name">{{item.product_name}}</p>
  9 + </a>
8 </a> 10 </a>
9 <div class="price"> 11 <div class="price">
10 <span class="discount" v-if="item.sales_price">¥{{item.sales_price}}</span> 12 <span class="discount" v-if="item.sales_price">¥{{item.sales_price}}</span>
@@ -37,7 +39,6 @@ @@ -37,7 +39,6 @@
37 .product-item { 39 .product-item {
38 display: inline-block; 40 display: inline-block;
39 width: 250px; 41 width: 250px;
40 - height: 330px;  
41 padding: 0; 42 padding: 0;
42 margin-right: 20px; 43 margin-right: 20px;
43 text-align: left; 44 text-align: left;
@@ -2,12 +2,11 @@ @@ -2,12 +2,11 @@
2 <div class="image-swipe"> 2 <div class="image-swipe">
3 <div class="swipe-wrap"> 3 <div class="swipe-wrap">
4 <swiper :options="swiperOption" v-ref:swiper> 4 <swiper :options="swiperOption" v-ref:swiper>
5 - <swiper-slide v-for="item in goods"> 5 + <swiper-slide v-for="(index, item) in goods">
6 <img title="{{item.title}}" 6 <img title="{{item.title}}"
7 :src="item.color_image | resize 580 770" 7 :src="item.color_image | resize 580 770"
8 width="100%" alt="" 8 width="100%" alt=""
9 - data-index="{{$index}}"  
10 - @click.prevent="showcase()"> 9 + @click="showcase(index)">
11 </swiper-slide> 10 </swiper-slide>
12 </swiper> 11 </swiper>
13 </div> 12 </div>
@@ -83,17 +82,17 @@ @@ -83,17 +82,17 @@
83 }, 82 },
84 computed: { 83 computed: {
85 swiper() { 84 swiper() {
86 - return this.$refs.swiper.swiper 85 + return this.$refs.swiper.wisper
87 } 86 }
88 }, 87 },
89 methods: { 88 methods: {
90 - showcase: function() {  
91 - alert(this.swiper.activeIndex); 89 + showcase: function(index) {
  90 + alert(index);
92 const opts = { 91 const opts = {
  92 + index,
93 images: this.goods.map((item) => { 93 images: this.goods.map((item) => {
94 return item.color_image; 94 return item.color_image;
95 }).filter(image => image), 95 }).filter(image => image),
96 - index: this.swiper.activeIndex  
97 }; 96 };
98 97
99 yoho.goImageBrowser(opts); 98 yoho.goImageBrowser(opts);