Commit 3dbe9e76734e9893999d81c0bad1614f5ec64ab1
1 parent
bbb58a95
购好物,新店铺首页,提测~
Showing
2 changed files
with
32 additions
and
57 deletions
src/pages/shopList/shopList.less
| @@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
| 61 | top: 0; | 61 | top: 0; |
| 62 | z-index: 100; | 62 | z-index: 100; |
| 63 | // border-top: 1px solid #E5E5E5; | 63 | // border-top: 1px solid #E5E5E5; |
| 64 | - border-bottom: 1px solid #E5E5E5; | 64 | + // border-bottom: 1px solid #E5E5E5; |
| 65 | &.is-open-app { | 65 | &.is-open-app { |
| 66 | top: 122px; | 66 | top: 122px; |
| 67 | } | 67 | } |
src/pages/shopList/shopList.vue
| @@ -179,10 +179,10 @@ | @@ -179,10 +179,10 @@ | ||
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | // 获取页面头部数据 | 181 | // 获取页面头部数据 |
| 182 | - this.ghIndex(); | 182 | + this.getActShopIndex(); |
| 183 | 183 | ||
| 184 | - // 工会商品列表(初始化) | ||
| 185 | - this.ghGoodsList(this.CALL_STATUS.INIT); | 184 | + // 商品列表(初始化) |
| 185 | + this.shopNewGoodsList(this.CALL_STATUS.INIT); | ||
| 186 | }, | 186 | }, |
| 187 | methods: { | 187 | methods: { |
| 188 | 188 | ||
| @@ -214,15 +214,15 @@ | @@ -214,15 +214,15 @@ | ||
| 214 | // 设置初始化页码 | 214 | // 设置初始化页码 |
| 215 | this.$set(this.tabs.list[this.tabs.active], 'page', 1); | 215 | this.$set(this.tabs.list[this.tabs.active], 'page', 1); |
| 216 | 216 | ||
| 217 | - // 工会商品列表 | ||
| 218 | - this.ghGoodsList(this.CALL_STATUS.INIT); | 217 | + // 商品列表 |
| 218 | + this.shopNewGoodsList(this.CALL_STATUS.INIT); | ||
| 219 | } else { | 219 | } else { |
| 220 | 220 | ||
| 221 | // 判断页面是数字再执行 | 221 | // 判断页面是数字再执行 |
| 222 | if (!isNaN(parseInt(this.tabs.list[this.tabs.active].page))) { | 222 | if (!isNaN(parseInt(this.tabs.list[this.tabs.active].page))) { |
| 223 | 223 | ||
| 224 | - // 工会商品列表 | ||
| 225 | - this.ghGoodsList(this.CALL_STATUS.LOAD_MORE); | 224 | + // 商品列表 |
| 225 | + this.shopNewGoodsList(this.CALL_STATUS.LOAD_MORE); | ||
| 226 | } | 226 | } |
| 227 | } | 227 | } |
| 228 | } | 228 | } |
| @@ -244,8 +244,8 @@ | @@ -244,8 +244,8 @@ | ||
| 244 | // 根据参数判断请求哪个接口,获取哪个列表 | 244 | // 根据参数判断请求哪个接口,获取哪个列表 |
| 245 | if (this.tabs.list[this.tabs.active].type == '1' && (!this.tabs.list[this.tabs.active].page || this.tabs.list[this.tabs.active].page == 1)) { | 245 | if (this.tabs.list[this.tabs.active].type == '1' && (!this.tabs.list[this.tabs.active].page || this.tabs.list[this.tabs.active].page == 1)) { |
| 246 | 246 | ||
| 247 | - // 工会商品列表(初始化) | ||
| 248 | - this.ghGoodsList(this.CALL_STATUS.INIT); | 247 | + // 商品列表(初始化) |
| 248 | + this.shopNewGoodsList(this.CALL_STATUS.INIT); | ||
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | // 回到顶部 | 251 | // 回到顶部 |
| @@ -267,19 +267,18 @@ | @@ -267,19 +267,18 @@ | ||
| 267 | /** | 267 | /** |
| 268 | * 获取页面头部数据 | 268 | * 获取页面头部数据 |
| 269 | */ | 269 | */ |
| 270 | - ghIndex() { | 270 | + getActShopIndex() { |
| 271 | 271 | ||
| 272 | // 判断必要参数 | 272 | // 判断必要参数 |
| 273 | - if (this.$route.query.ghId) { | 273 | + if (this.$route.query.shop_id) { |
| 274 | 274 | ||
| 275 | // 加载中提示 | 275 | // 加载中提示 |
| 276 | Indicator.open("加载中..."); | 276 | Indicator.open("加载中..."); |
| 277 | 277 | ||
| 278 | // 获取证书请求接口 | 278 | // 获取证书请求接口 |
| 279 | - this.http("/Api/" + (this.getApiVersion().index) + "/ghIndex", { | ||
| 280 | - id: this.$route.query.ghId, | ||
| 281 | - uid: (this.$route.query.uid || 0) | ||
| 282 | - }, this.ghIndexCallback, { | 279 | + this.http("/Api/" + (this.getApiVersion().index) + "/getActShopIndex", { |
| 280 | + id: this.$route.query.shop_id | ||
| 281 | + }, this.getActShopIndexCallback, { | ||
| 283 | method: "POST" | 282 | method: "POST" |
| 284 | }); | 283 | }); |
| 285 | } | 284 | } |
| @@ -290,7 +289,7 @@ | @@ -290,7 +289,7 @@ | ||
| 290 | * @param {Object} res [服务器返回数据] | 289 | * @param {Object} res [服务器返回数据] |
| 291 | * @param {Object} ext [扩展参数] | 290 | * @param {Object} ext [扩展参数] |
| 292 | */ | 291 | */ |
| 293 | - ghIndexCallback(res, ext) { | 292 | + getActShopIndexCallback(res, ext) { |
| 294 | 293 | ||
| 295 | // 加载完成 | 294 | // 加载完成 |
| 296 | Indicator.close(); | 295 | Indicator.close(); |
| @@ -317,35 +316,11 @@ | @@ -317,35 +316,11 @@ | ||
| 317 | } | 316 | } |
| 318 | 317 | ||
| 319 | // 获取头部swiper的banner | 318 | // 获取头部swiper的banner |
| 319 | + if (datas.banner && typeof datas.banner === 'object' && datas.banner.length) { | ||
| 320 | 320 | ||
| 321 | - | ||
| 322 | - | ||
| 323 | - // 临时,测试swiper | ||
| 324 | - this.$set(this, 'swipers', [ | ||
| 325 | - { | ||
| 326 | - id: "251", | ||
| 327 | - shop_type: "1", | ||
| 328 | - simg: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/09/05/5d70b6ec83d77.jpg", | ||
| 329 | - title: "123123321", | ||
| 330 | - to: "https://wjjshop.cnlive.com/html/vaccines/2/#/pages/main/detail/detail?id=14", | ||
| 331 | - type: "5" | ||
| 332 | - }, | ||
| 333 | - { | ||
| 334 | - id: "252", | ||
| 335 | - shop_type: "", | ||
| 336 | - simg: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/09/05/5d70b7546f20f.jpg", | ||
| 337 | - title: "达人", | ||
| 338 | - to: "daren_10455685", | ||
| 339 | - type: "11" | ||
| 340 | - } | ||
| 341 | - ]); | ||
| 342 | - | ||
| 343 | - | ||
| 344 | - | ||
| 345 | - | ||
| 346 | - | ||
| 347 | - | ||
| 348 | - | 321 | + // 设置banner |
| 322 | + this.$set(this, 'swipers', datas.banner); | ||
| 323 | + } | ||
| 349 | 324 | ||
| 350 | // 获取tabs数据 | 325 | // 获取tabs数据 |
| 351 | if (datas.list && datas.list.length) { | 326 | if (datas.list && datas.list.length) { |
| @@ -372,13 +347,13 @@ | @@ -372,13 +347,13 @@ | ||
| 372 | }, | 347 | }, |
| 373 | 348 | ||
| 374 | /** | 349 | /** |
| 375 | - * 工会商品列表 | 350 | + * 商品列表 |
| 376 | * @param {Object} CALL_STATUS [何处触发请求] | 351 | * @param {Object} CALL_STATUS [何处触发请求] |
| 377 | */ | 352 | */ |
| 378 | - ghGoodsList(CALL_STATUS = this.CALL_STATUS.LOAD_MORE) { | 353 | + shopNewGoodsList(CALL_STATUS = this.CALL_STATUS.LOAD_MORE) { |
| 379 | 354 | ||
| 380 | // 判断必要参数 | 355 | // 判断必要参数 |
| 381 | - if (this.$route.query.ghId && this.tabs.list[this.tabs.active].id >= 0) { | 356 | + if (this.$route.query.shop_id && this.tabs.list[this.tabs.active].id >= 0) { |
| 382 | 357 | ||
| 383 | // 设置开始加载 | 358 | // 设置开始加载 |
| 384 | this.$set(this.tabs.list[this.tabs.active], "loading", true); | 359 | this.$set(this.tabs.list[this.tabs.active], "loading", true); |
| @@ -387,11 +362,11 @@ | @@ -387,11 +362,11 @@ | ||
| 387 | Indicator.open('加载中...'); | 362 | Indicator.open('加载中...'); |
| 388 | 363 | ||
| 389 | // 请求接口 | 364 | // 请求接口 |
| 390 | - this.http("/Api/" + (this.getApiVersion().index) + "/ghGoodsList", { | ||
| 391 | - id: this.$route.query.ghId, | ||
| 392 | - group_id: this.tabs.list[this.tabs.active].id, | 365 | + this.http("/Api/" + (this.getApiVersion().index) + "/shopNewGoodsList", { |
| 366 | + shopId: this.$route.query.shop_id, | ||
| 367 | + groupid: this.tabs.list[this.tabs.active].id, | ||
| 393 | page: this.tabs.list[this.tabs.active].page | 368 | page: this.tabs.list[this.tabs.active].page |
| 394 | - }, this.ghGoodsListCallback, { | 369 | + }, this.shopNewGoodsListCallback, { |
| 395 | method: "POST", | 370 | method: "POST", |
| 396 | CALL_STATUS | 371 | CALL_STATUS |
| 397 | }); | 372 | }); |
| @@ -399,11 +374,11 @@ | @@ -399,11 +374,11 @@ | ||
| 399 | }, | 374 | }, |
| 400 | 375 | ||
| 401 | /** | 376 | /** |
| 402 | - * 工会商品列表回调 | 377 | + * 商品列表回调 |
| 403 | * @param {Object} res [服务器返回数据] | 378 | * @param {Object} res [服务器返回数据] |
| 404 | * @param {Object} ext [扩展参数] | 379 | * @param {Object} ext [扩展参数] |
| 405 | */ | 380 | */ |
| 406 | - ghGoodsListCallback(res, ext) { | 381 | + shopNewGoodsListCallback(res, ext) { |
| 407 | 382 | ||
| 408 | // 加载完成 | 383 | // 加载完成 |
| 409 | Indicator.close(); | 384 | Indicator.close(); |
| @@ -415,19 +390,19 @@ | @@ -415,19 +390,19 @@ | ||
| 415 | let {data: datas} = res; | 390 | let {data: datas} = res; |
| 416 | 391 | ||
| 417 | // 判断如果有数据 | 392 | // 判断如果有数据 |
| 418 | - if (datas.list && datas.list.length) { | 393 | + if (datas && datas.length) { |
| 419 | 394 | ||
| 420 | /* 设置列表数据 开始 */ | 395 | /* 设置列表数据 开始 */ |
| 421 | switch (ext.CALL_STATUS) { | 396 | switch (ext.CALL_STATUS) { |
| 422 | case this.CALL_STATUS.INIT: | 397 | case this.CALL_STATUS.INIT: |
| 423 | 398 | ||
| 424 | // 设置推荐商品列表 | 399 | // 设置推荐商品列表 |
| 425 | - this.$set(this.lists, this.tabs.active, datas.list); | 400 | + this.$set(this.lists, this.tabs.active, datas); |
| 426 | break; | 401 | break; |
| 427 | case this.CALL_STATUS.LOAD_MORE: | 402 | case this.CALL_STATUS.LOAD_MORE: |
| 428 | 403 | ||
| 429 | // 添加数据到数组 | 404 | // 添加数据到数组 |
| 430 | - this.$set(this.lists, this.tabs.active, [...this.lists[this.tabs.active], ...datas.list]); | 405 | + this.$set(this.lists, this.tabs.active, [...this.lists[this.tabs.active], ...datas]); |
| 431 | break; | 406 | break; |
| 432 | } | 407 | } |
| 433 | 408 |