Commit f4376c6b68cb23420308f08002492b403b5c2c75

Authored by 王强
1 parent 0d9ad2c7

热销商品接口对接完成~

src/components/goodsItem_8/goodsItem_8.vue
... ... @@ -10,7 +10,8 @@
10 10 <div class="content-box">
11 11 <div class="top-box">
12 12 <div class="title">{{item.title}}</div>
13   - <div class="sub-title">{{item.ads}}</div>
  13 + <!-- <div class="sub-title">{{item.ads}}</div> -->
  14 + <div class="sub-title">已售出&nbsp;{{item.num}}&nbsp;件</div>
14 15 </div>
15 16 <div class="bottom-box">
16 17 <div class="price-box">
... ...
src/main.js
... ... @@ -125,6 +125,7 @@ Vue.prototype.apiVersion = {
125 125 miniapp: "Miniapp2", // 调用微信相关接口
126 126 dynamic: "Dynamic", // 达人动态相关接口
127 127 LeadGoose: "LeadGoose", // 领头雁项目
  128 + good: "Good", // 优选库
128 129 // addAddresss:"https://managemall.cnlive.com/",// 生产环境url
129 130 addAddresss: "https://wjjshop.cnlive.com/" // 测试环境url
130 131 };
... ...
src/pages/hotSaleList/hotSaleList.less
... ... @@ -27,6 +27,7 @@
27 27 .main-box {
28 28 background-repeat: no-repeat;
29 29 background-size: contain;
  30 + min-height: 480px;
30 31 .section {
31 32 margin: 0 auto;
32 33 width: 690px;
... ...
src/pages/hotSaleList/hotSaleList.vue
... ... @@ -61,9 +61,7 @@
61 61 backs: null, // 后退按钮组
62 62 headerImg: '', // 头部图片
63 63 goodsLists: null, // 商品列表
64   - flags: null, // 产品排名flag
65   -
66   -
  64 + flags: null // 产品排名flag
67 65 }
68 66 },
69 67 components: {
... ... @@ -100,19 +98,12 @@
100 98 this.$set(this.backs, 'title', '热销排行');
101 99 }
102 100  
  101 + // 优选热销排行新接口
  102 + this.saleRank();
103 103  
104   -
105   - // 优选页面接口
106   - // this.fansShopMessageList();
107   -
108   -
109   -
110   -
111   - // 临时,设置头部图片地址
  104 + // 设置头部图片地址
112 105 this.$set(this, 'headerImg', 'static/img/header_hot.png');
113 106  
114   -
115   -
116 107 // 设置产品排名flag对象
117 108 this.$set(this, 'flags', {
118 109 icon: [
... ... @@ -125,251 +116,31 @@
125 116 left: 20
126 117 }
127 118 });
128   -
129   -
130   -
131   -
132   - // 临时,初始化列表数据
133   - this.$set(this, 'goodsLists', [
134   - {
135   - ads: "专区特供超值商品",
136   - id: "9524815",
137   - price: "50.00",
138   - prices: "300.00",
139   - shop: {
140   - id: "57",
141   - logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png",
142   - shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57",
143   - title: "李宁旗舰店",
144   - titles: "专区特供超值商品"
145   - },
146   - shop_type: "1",
147   - shopid: "57",
148   - simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg",
149   - title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐"
150   - },
151   - {
152   - ads: "专区特供超值商品",
153   - id: "9524815",
154   - price: "50.00",
155   - prices: "20.00",
156   - shop: {
157   - id: "57",
158   - logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png",
159   - shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57",
160   - title: "李宁旗舰店",
161   - titles: "专区特供超值商品"
162   - },
163   - shop_type: "1",
164   - shopid: "57",
165   - simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg",
166   - title: "传统汉堡焗套餐"
167   - },
168   - {
169   - ads: "专区特供超值商品",
170   - id: "9524815",
171   - price: "50.00",
172   - prices: "300.00",
173   - shop: {
174   - id: "57",
175   - logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png",
176   - shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57",
177   - title: "李宁旗舰店",
178   - titles: "专区特供超值商品"
179   - },
180   - shop_type: "1",
181   - shopid: "57",
182   - simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg",
183   - title: "传统汉堡焗套餐"
184   - },
185   - {
186   - ads: "专区特供超值商品",
187   - id: "9524815",
188   - price: "50.00",
189   - prices: "20.00",
190   - shop: {
191   - id: "57",
192   - logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png",
193   - shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57",
194   - title: "李宁旗舰店",
195   - titles: "专区特供超值商品"
196   - },
197   - shop_type: "1",
198   - shopid: "57",
199   - simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg",
200   - title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐"
201   - },
202   - {
203   - ads: "专区特供超值商品",
204   - id: "9524815",
205   - price: "50.00",
206   - prices: "300.00",
207   - shop: {
208   - id: "57",
209   - logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png",
210   - shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57",
211   - title: "李宁旗舰店",
212   - titles: "专区特供超值商品"
213   - },
214   - shop_type: "1",
215   - shopid: "57",
216   - simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg",
217   - title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐"
218   - },
219   - {
220   - ads: "专区特供超值商品",
221   - id: "9524815",
222   - price: "50.00",
223   - prices: "300.00",
224   - shop: {
225   - id: "57",
226   - logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png",
227   - shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57",
228   - title: "李宁旗舰店",
229   - titles: "专区特供超值商品"
230   - },
231   - shop_type: "1",
232   - shopid: "57",
233   - simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg",
234   - title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐"
235   - },
236   - {
237   - ads: "专区特供超值商品",
238   - id: "9524815",
239   - price: "50.00",
240   - prices: "300.00",
241   - shop: {
242   - id: "57",
243   - logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png",
244   - shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57",
245   - title: "李宁旗舰店",
246   - titles: "专区特供超值商品"
247   - },
248   - shop_type: "1",
249   - shopid: "57",
250   - simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg",
251   - title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐"
252   - },
253   - {
254   - ads: "专区特供超值商品",
255   - id: "9524815",
256   - price: "50.00",
257   - prices: "300.00",
258   - shop: {
259   - id: "57",
260   - logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png",
261   - shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57",
262   - title: "李宁旗舰店",
263   - titles: "专区特供超值商品"
264   - },
265   - shop_type: "1",
266   - shopid: "57",
267   - simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg",
268   - title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐"
269   - },
270   - {
271   - ads: "专区特供超值商品",
272   - id: "9524815",
273   - price: "50.00",
274   - prices: "300.00",
275   - shop: {
276   - id: "57",
277   - logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png",
278   - shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57",
279   - title: "李宁旗舰店",
280   - titles: "专区特供超值商品"
281   - },
282   - shop_type: "1",
283   - shopid: "57",
284   - simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg",
285   - title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐"
286   - },
287   - {
288   - ads: "专区特供超值商品",
289   - id: "9524815",
290   - price: "50.00",
291   - prices: "300.00",
292   - shop: {
293   - id: "57",
294   - logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png",
295   - shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57",
296   - title: "李宁旗舰店",
297   - titles: "专区特供超值商品"
298   - },
299   - shop_type: "1",
300   - shopid: "57",
301   - simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg",
302   - title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐"
303   - },
304   - {
305   - ads: "专区特供超值商品",
306   - id: "9524815",
307   - price: "50.00",
308   - prices: "300.00",
309   - shop: {
310   - id: "57",
311   - logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png",
312   - shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57",
313   - title: "李宁旗舰店",
314   - titles: "专区特供超值商品"
315   - },
316   - shop_type: "1",
317   - shopid: "57",
318   - simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg",
319   - title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐"
320   - },
321   - {
322   - ads: "专区特供超值商品",
323   - id: "9524815",
324   - price: "50.00",
325   - prices: "300.00",
326   - shop: {
327   - id: "57",
328   - logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png",
329   - shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57",
330   - title: "李宁旗舰店",
331   - titles: "专区特供超值商品"
332   - },
333   - shop_type: "1",
334   - shopid: "57",
335   - simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg",
336   - title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐"
337   - }
338   - ]);
339   -
340   -
341   -
342   -
343   -
344 119 },
345 120 methods: {
346 121  
347 122 /**
348   - * 优选页面接口
  123 + * 优选热销排行新接口
349 124 */
350   - fansShopMessageList() {
351   -
352   - // 校验登录
353   - if (this.$parent.checkLogin()) {
354   -
355   - // 加载中提示
356   - Indicator.open("加载中...");
357   -
358   - // 获取证书请求接口
359   - this.http("/Api/" + this.getApiVersion().dynamic + "/fansShopMessageList", {
360   - uid: this.getStore("uid")
361   - }, this.fansShopMessageListCallback, {
362   - method: "POST"
363   - });
364   - }
  125 + saleRank() {
  126 +
  127 + // 加载中提示
  128 + Indicator.open("加载中...");
  129 +
  130 + // 获取证书请求接口
  131 + this.http("/Api/" + this.getApiVersion().good + "/saleRank", {
  132 + uid: this.getStore("uid")
  133 + }, this.saleRankCallback, {
  134 + method: "POST"
  135 + });
365 136 },
366 137  
367 138 /**
368   - * 优选页面接口回调
  139 + * 优选热销排行新接口回调
369 140 * @param {Object} res [服务器返回数据]
370 141 * @param {Object} ext [扩展参数]
371 142 */
372   - fansShopMessageListCallback(res, ext) {
  143 + saleRankCallback(res, ext) {
373 144  
374 145 // 加载完成
375 146 Indicator.close();
... ... @@ -382,7 +153,7 @@
382 153  
383 154 /* 获取优选库“优选”数据 开始 */
384 155  
385   -
  156 + this.$set(this, 'goodsLists', datas.list);
386 157  
387 158 /* 获取优选库“优选”数据 结束 */
388 159  
... ... @@ -393,135 +164,11 @@
393 164 } else {
394 165  
395 166 // 获取优选失败
396   - Toast("获取优选失败");
397   - }
398   - },
399   -
400   - /**
401   - * 商品列表
402   - * @param {Int} groupId [平台分类id]
403   - * @param {Int} page [页码]
404   - * @param {String} CALL_STATUS [何处触发请求]
405   - */
406   - shopGoodsList(groupId, page) {
407   -
408   - // 校验必填参数
409   - if (groupId && page) {
410   -
411   - // 加载中
412   - this.$set(this.paging, "loading", true);
413   -
414   - // 获取证书请求接口
415   - this.http("/Api/" + this.getApiVersion().index + "/shopNewGoodsList", {
416   - groupid: groupId,
417   - page: page
418   - }, this.shopGoodsListCallback, {
419   - method: "POST"
420   - }
421   - );
422   - }
423   - },
424   -
425   - /**
426   - * 商品列表回调
427   - * @param {Object} res [服务器返回数据]
428   - * @param {Object} ext [扩展参数]
429   - */
430   - shopGoodsListCallback(res, ext) {
431   -
432   - // 下拉刷新结束
433   - this.$set(this, "isLoading", false);
434   -
435   - // 返回处理
436   - if (res.code == 200) {
437   -
438   - // 解构数据
439   - let { data: datas } = res;
440   -
441   - /* 获取商品列表数据 开始 */
442   -
443   -
444   -
445   - /* 获取商品列表数据 结束 */
446   -
447   - } else if (res.code == 400) {
448   -
449   - // 获取最新上架列表失败
450   - Toast(res.message);
451   - } else {
452   -
453   - // 获取最新上架列表失败
454   - Toast("获取最新上架列表失败");
  167 + Toast("获取数据失败");
455 168 }
456 169 },
457 170  
458 171 /**
459   - * 跳转折扣专区列表
460   - * @param {Object} item [通用跳转对象]
461   - */
462   - toDiscountList(item) {
463   -
464   - // 跳转封装
465   - if (typeof this.$parent.navBarJump === 'function') {
466   -
467   - // 设置跳转参数
468   - let params = {
469   -
470   - };
471   -
472   - // 页面跳转
473   - this.$parent.navBarJump(params);
474   - }
475   - },
476   -
477   - /**
478   - * 锚点定位
479   - * @param {Object} item [数据对象]
480   - */
481   - anchor(item) {
482   -
483   - },
484   -
485   - /**
486   - * 跳转品质优选列表
487   - * @param {Object} item [通用跳转对象]
488   - */
489   - toOptimizationList(item) {
490   -
491   - // 跳转封装
492   - if (typeof this.$parent.navBarJump === 'function') {
493   -
494   - // 设置跳转参数
495   - let params = {
496   -
497   - };
498   -
499   - // 页面跳转
500   - this.$parent.navBarJump(params);
501   - }
502   - },
503   -
504   - /**
505   - * 查看更多积分
506   - * @param {Object} item [数据对象]
507   - */
508   - pointsMore(item) {
509   -
510   - console.log('pointsMore', item);
511   -
512   - },
513   -
514   - /**
515   - * 换一租
516   - * @param {Object} item [数据对象]
517   - */
518   - changeGoods(item) {
519   -
520   - console.log('changeGoods', item);
521   -
522   - },
523   -
524   - /**
525 172 * 跳转商品详情
526 173 * @param {Object} item [数据对象]
527 174 */
... ... @@ -530,27 +177,28 @@
530 177 // 判断通用跳转函数是否存在
531 178 if (typeof this.$parent.gotoDetail === 'function') {
532 179  
533   -
534   - console.log('toDetail', item);
535   -
  180 + // 跳转参数
  181 + let params = {
  182 + type: '2',
  183 + to: item.id,
  184 + shop_type: item.shop_type
  185 + };
536 186  
537 187 // 通用跳转
538   - this.$parent.gotoDetail(item);
  188 + this.$parent.gotoDetail(params);
539 189 }
540 190 },
  191 +
541 192 /**
542   - * 列表加号按钮事件
  193 + * 项目按钮事件
543 194 * @param {Object} item [数据对象]
544 195 */
545 196 primary(item) {
  197 +
  198 + // 跳转商品详情
546 199 this.toDetail(item);
547 200 },
548 201  
549   -
550   -
551   -
552   -
553   -
554 202 /**
555 203 * 分享
556 204 */
... ...