Commit ee55ba8705138a270f147c55c44019862f5defd0

Authored by 王强
1 parent f4ccd178

接口对接中~

src/components/iconsCom/iconsCom.less
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 border-radius: 50%; 9 border-radius: 50%;
10 } 10 }
11 .title { 11 .title {
  12 + margin-top: 10px;
12 color: #777777; 13 color: #777777;
13 font-size: 26px; 14 font-size: 26px;
14 font-weight: 400; 15 font-weight: 400;
src/components/iconsCom/iconsCom.vue
1 <template> 1 <template>
2 - <div class="icons-com" v-if="item && item.simg && item.title" @click="jump(item)">  
3 - <img v-lazy="item.simg" class="icons-img" /> 2 + <div class="icons-com" v-if="item && item.title && item.id" @click="jump(item)">
  3 + <img v-lazy="item.logo" class="icons-img" />
4 <div class="title">{{item.title}}</div> 4 <div class="title">{{item.title}}</div>
5 </div> 5 </div>
6 </template> 6 </template>
src/main.js
@@ -63,7 +63,7 @@ import &quot;url-search-params-polyfill&quot;; @@ -63,7 +63,7 @@ import &quot;url-search-params-polyfill&quot;;
63 Vue.config.productionTip = false; 63 Vue.config.productionTip = false;
64 64
65 // 部署模式设置(开发模式:"dev",测试模式:"test",生产模式:"prod") 65 // 部署模式设置(开发模式:"dev",测试模式:"test",生产模式:"prod")
66 -Vue.prototype.mode = "test"; 66 +Vue.prototype.mode = "dev";
67 67
68 // 微信JS-SDK对象 68 // 微信JS-SDK对象
69 Vue.prototype.jweixin = { 69 Vue.prototype.jweixin = {
src/pages/common/common.vue
@@ -544,8 +544,10 @@ @@ -544,8 +544,10 @@
544 } 544 }
545 } 545 }
546 break; 546 break;
547 - case "5": // WebView页 to Url地址  
548 - case "34": 547 + case "5": // webView页 to Url地址
  548 + case "34": // WebView页跳转,根据URL的GET参数type=web判断使用一部的WebView打开
  549 + case "41": // WebView页跳转,跳转电商购物车页面
  550 + case "42": // WebView页跳转,跳转电商订单页面
549 551
550 // 跳转URL 552 // 跳转URL
551 if (item.to.trim()) { 553 if (item.to.trim()) {
src/pages/mall2/mall2.vue
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 </title-sub-title-hori-com> 29 </title-sub-title-hori-com>
30 30
31 <!-- 轮播展示店铺 --> 31 <!-- 轮播展示店铺 -->
32 - <icon-swiper-box @jump="toDetail" 32 + <icon-swiper-box @jump="toShop"
33 :icons="navs"> 33 :icons="navs">
34 </icon-swiper-box> 34 </icon-swiper-box>
35 </div> 35 </div>
@@ -37,18 +37,18 @@ @@ -37,18 +37,18 @@
37 <!-- 店铺列表 --> 37 <!-- 店铺列表 -->
38 <div class="shop-list-box" v-if="shopLists && shopLists.length"> 38 <div class="shop-list-box" v-if="shopLists && shopLists.length">
39 39
40 - <div class="section shop-list" v-for="(items, index) in shopLists" :key="index" @click="toDetail(items)"> 40 + <div class="section shop-list" v-for="(items, index) in shopLists" :key="index" @click="toShop(items)">
41 41
42 <!-- 头图 --> 42 <!-- 头图 -->
43 <div class="header-img-box"> 43 <div class="header-img-box">
44 - <img :src="items.header_img + SIGN.BIG" class="header-img" /> 44 + <img v-lazy="items.img + SIGN.BIG" class="header-img" />
45 </div> 45 </div>
46 46
47 <!-- 商品列表 --> 47 <!-- 商品列表 -->
48 <div class="list-box"> 48 <div class="list-box">
49 49
50 <!-- 商品展示样式 2 --> 50 <!-- 商品展示样式 2 -->
51 - <goods-item-2 class="item" v-for="(item, i) in items.list" :key="i" 51 + <goods-item-2 class="item" v-for="(item, i) in items.goods" :key="i"
52 :item="item" 52 :item="item"
53 pid="3"> 53 pid="3">
54 </goods-item-2> 54 </goods-item-2>
@@ -91,8 +91,11 @@ @@ -91,8 +91,11 @@
91 // 设置标题 91 // 设置标题
92 this.$set(this, 'title', '旗舰店'); 92 this.$set(this, 'title', '旗舰店');
93 93
94 - // 品质优选  
95 - this.goodQuality(); 94 + // 旗舰店swiper
  95 + this.flagship();
  96 +
  97 + // 旗舰店店铺商品
  98 + this.flagshipList();
96 99
97 // 判断是否在App内 100 // 判断是否在App内
98 if (this.isCNLive.value) { 101 if (this.isCNLive.value) {
@@ -288,27 +291,78 @@ @@ -288,27 +291,78 @@
288 methods: { 291 methods: {
289 292
290 /** 293 /**
291 - * 品质优选 294 + * 旗舰店swiper
292 */ 295 */
293 - goodQuality() { 296 + flagship() {
294 297
295 // 加载中提示 298 // 加载中提示
296 Indicator.open("加载中..."); 299 Indicator.open("加载中...");
297 300
298 // 获取证书请求接口 301 // 获取证书请求接口
299 - this.http("/Api/" + this.getApiVersion().good + "/goodQuality", {  
300 - id: 0  
301 - }, this.goodQualityCallback, { 302 + this.http("/Api/" + this.getApiVersion().good + "/flagship", {
  303 + uid: this.getStore("uid") || 0
  304 + }, this.flagshipCallback, {
302 method: "POST" 305 method: "POST"
303 }); 306 });
304 }, 307 },
305 308
306 /** 309 /**
307 - * 品质优选回调 310 + * 旗舰店swiper回调
308 * @param {Object} res [服务器返回数据] 311 * @param {Object} res [服务器返回数据]
309 * @param {Object} ext [扩展参数] 312 * @param {Object} ext [扩展参数]
310 */ 313 */
311 - goodQualityCallback(res, ext) { 314 + flagshipCallback(res, ext) {
  315 +
  316 + // 加载完成
  317 + Indicator.close();
  318 +
  319 + // 返回处理
  320 + if (res.code == 200) {
  321 +
  322 + // 解构数据
  323 + let { data: datas } = res;
  324 +
  325 + /* 获取旗舰店swiper数据 开始 */
  326 +
  327 + // 设置navs数据
  328 + this.$set(this, 'navs', datas.list);
  329 +
  330 + /* 获取旗舰店swiper数据 结束 */
  331 +
  332 + } else if (res.code == 400) {
  333 +
  334 + // 获取初始数据失败
  335 + Toast(res.message);
  336 + } else {
  337 +
  338 + // 获取初始数据失败
  339 + Toast("获取数据失败");
  340 + }
  341 + },
  342 +
  343 + /**
  344 + * 旗舰店店铺商品
  345 + */
  346 + flagshipList() {
  347 +
  348 + // 加载中提示
  349 + Indicator.open("加载中...");
  350 +
  351 + // 获取证书请求接口
  352 + this.http("/Api/" + this.getApiVersion().good + "/flagshipList", {
  353 + uid: this.getStore("uid") || 0,
  354 + page: 1
  355 + }, this.flagshipListCallback, {
  356 + method: "POST"
  357 + });
  358 + },
  359 +
  360 + /**
  361 + * 旗舰店店铺商品回调
  362 + * @param {Object} res [服务器返回数据]
  363 + * @param {Object} ext [扩展参数]
  364 + */
  365 + flagshipListCallback(res, ext) {
312 366
313 // 加载完成 367 // 加载完成
314 Indicator.close(); 368 Indicator.close();
@@ -321,7 +375,8 @@ @@ -321,7 +375,8 @@
321 375
322 /* 获取优选库精选活动数据 开始 */ 376 /* 获取优选库精选活动数据 开始 */
323 377
324 - 378 + // 设置商铺商品列表数据
  379 + this.$set(this, 'shopLists', datas.list);
325 380
326 /* 获取优选库精选活动数据 结束 */ 381 /* 获取优选库精选活动数据 结束 */
327 382
@@ -340,13 +395,20 @@ @@ -340,13 +395,20 @@
340 * 调用通用跳转(跳转店铺首页) 395 * 调用通用跳转(跳转店铺首页)
341 * @param {Object} item [通用跳转对象] 396 * @param {Object} item [通用跳转对象]
342 */ 397 */
343 - toDetail(item) { 398 + toShop(item) {
344 399
345 // 跳转封装 400 // 跳转封装
346 - if (typeof this.$parent.navBarJump === 'function') { 401 + if (typeof this.$parent.gotoDetail === 'function') {
  402 +
  403 + // 设置跳转参数
  404 + let params = {
  405 + type: '34',
  406 + to: window.location.origin + '/html/new_mall/shop?shop_id=' + item.id,
  407 + shop_type: ''
  408 + };
347 409
348 // 页面跳转 410 // 页面跳转
349 - this.$parent.navBarJump(item); 411 + this.$parent.gotoDetail(params);
350 } 412 }
351 }, 413 },
352 414