Commit ef8d07349af584673c062510f2377e9c9c3b8a89
Merge branch 'dev' into 'test'
Dev See merge request !416
Showing
5 changed files
with
615 additions
and
50 deletions
.idea/mshopweapp.iml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<module type="WEB_MODULE" version="4"> | |
| 3 | + <component name="NewModuleRootManager"> | |
| 4 | + <content url="file://$MODULE_DIR$" /> | |
| 5 | + <orderEntry type="inheritedJdk" /> | |
| 6 | + <orderEntry type="sourceFolder" forTests="false" /> | |
| 7 | + </component> | |
| 8 | +</module> | |
| 0 | 9 | \ No newline at end of file | ... | ... |
pages/goods/categoryList/categoryList.js
| 1 | 1 | var t = getApp(), e = t.request, oo = t.globalData.setting; |
| 2 | 2 | |
| 3 | +var i = function (i) { | |
| 4 | + return i && i.__esModule ? i : { | |
| 5 | + default: i | |
| 6 | + }; | |
| 7 | +}(require("../../../utils/LoadMore.js")), a = new i.default(), ut = require("../../../utils/util.js"); | |
| 8 | +//t = i,e = t | |
| 3 | 9 | Page({ |
| 4 | 10 | data: { |
| 5 | - is_date:true, | |
| 6 | - scrollHeight: 0, | |
| 7 | - currentTab:-1, | |
| 8 | - abc:0, | |
| 11 | + is_date:true, | |
| 12 | + scrollHeight: 0, | |
| 13 | + currentTab:-1, | |
| 14 | + abc:0, | |
| 9 | 15 | windowHeight:0, |
| 10 | 16 | windowWidth: 0, |
| 11 | 17 | eachLetterHeight:0, |
| ... | ... | @@ -39,14 +45,34 @@ Page({ |
| 39 | 45 | cat_id:0, |
| 40 | 46 | pl_timer: null,//只有品类的定时器 |
| 41 | 47 | is_pl_time:0, |
| 42 | - | |
| 48 | + requestData:null, //风格三的商品数据列表 分页 | |
| 49 | + stylePage:1, //商品列表分页标识 | |
| 50 | + | |
| 51 | + //风格三使用 | |
| 52 | + url: t.globalData.setting.imghost, | |
| 53 | + currentPage: 1, | |
| 54 | + requestData: null, | |
| 55 | + allData: null, | |
| 56 | + openFilterModal: !1, | |
| 57 | + baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=goods_id&orderType=desc&page=1&is_mainshow=1&isonsale=1&store_id=1&is_recommend=1", | |
| 58 | + requestUrl: "", | |
| 59 | + tabname: "goods_id", //排序的字段 | |
| 60 | + adname: "desc", //升降的字段 | |
| 61 | + is_new: 0, | |
| 62 | + is_hot: 0, | |
| 63 | + msgStatus:false, //页面显示暂无数据状态 | |
| 64 | + countDownNum: 3, | |
| 65 | + timer: '', //定时器 | |
| 66 | + lastMsg:false, | |
| 67 | + toView:"", | |
| 43 | 68 | }, |
| 44 | 69 | onLoad: function(tt) { |
| 70 | + var that = this; | |
| 71 | + clearInterval(that.data.timer); | |
| 72 | + that.setData({ countDownNum: 3, stylePage: 1 }); | |
| 73 | + | |
| 45 | 74 | const res = wx.getSystemInfoSync(), |
| 46 | 75 | letters = this.data.letters; |
| 47 | - | |
| 48 | - var that = this; | |
| 49 | - | |
| 50 | 76 | this.setData({ |
| 51 | 77 | abc: t.globalData.heigth-88-88-16, |
| 52 | 78 | windowHeight: res.windowHeight, |
| ... | ... | @@ -77,7 +103,50 @@ Page({ |
| 77 | 103 | if (this.data.is_used_share==0){ |
| 78 | 104 | this.get_nation(); |
| 79 | 105 | } |
| 80 | - | |
| 106 | + | |
| 107 | + //风格三 | |
| 108 | + //t = i,e = t | |
| 109 | + var th = this; | |
| 110 | + a.init(this, "", "requestData"); | |
| 111 | + var url = this.data.baseUrl; | |
| 112 | + this.data.is_new = i.is_new; | |
| 113 | + this.data.is_hot = i.is_hot; | |
| 114 | + if (0 != this.data.cat_id) { | |
| 115 | + url += "&cat_id=" + this.data.cat_id; | |
| 116 | + } | |
| 117 | + | |
| 118 | + // this.requestGoodsList(url); | |
| 119 | + getApp().getConfig2(function (rs) { | |
| 120 | + //计算等级价相关 | |
| 121 | + var swithc_list = rs.switch_list; | |
| 122 | + var sw_arr = JSON.parse(swithc_list); | |
| 123 | + //---如果后台又开等级卡的开关--- | |
| 124 | + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { | |
| 125 | + th.setData({ rank_switch: true }); | |
| 126 | + var user = getApp().globalData.userInfo; | |
| 127 | + var ti = setInterval(function () { | |
| 128 | + if (!user) return false; | |
| 129 | + clearInterval(ti); | |
| 130 | + //---回调卡的列表--- | |
| 131 | + th.getPlusCardType(function (ob) { | |
| 132 | + th.setData({ card_list: ob.card_list }); | |
| 133 | + if (user.card_field) { | |
| 134 | + var str = user['card_expiredate'].replace(/-/g, '/'); | |
| 135 | + var end = new Date(str); | |
| 136 | + end = Date.parse(end) / 1000; | |
| 137 | + var now = ut.gettimestamp(); | |
| 138 | + | |
| 139 | + //--- 判断是等级会员,且在有效期范围内 --- | |
| 140 | + if (user.card_field && now < end) { | |
| 141 | + var card_name = ob.name_map.get(user.card_field); | |
| 142 | + if (card_name.length > 4) card_name = card_name.substring(0, 4); | |
| 143 | + th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list }); | |
| 144 | + } | |
| 145 | + } | |
| 146 | + }) | |
| 147 | + }, 500) | |
| 148 | + } | |
| 149 | + }); | |
| 81 | 150 | }, |
| 82 | 151 | |
| 83 | 152 | onShow:function(){ |
| ... | ... | @@ -150,6 +219,7 @@ Page({ |
| 150 | 219 | that.setData({ currentTab: 0 }); |
| 151 | 220 | } |
| 152 | 221 | }) |
| 222 | + | |
| 153 | 223 | }, |
| 154 | 224 | |
| 155 | 225 | //---------------分类请求接口,数据进行拼装------------------ |
| ... | ... | @@ -180,7 +250,7 @@ Page({ |
| 180 | 250 | } |
| 181 | 251 | } |
| 182 | 252 | t.setData({ catelist: arr}); |
| 183 | - }else{ | |
| 253 | + } else if (t.data.is_used_share == 1 || t.data.is_used_share == 2){ | |
| 184 | 254 | |
| 185 | 255 | //---------新的版本---------------- |
| 186 | 256 | for (var i = 0; i < dda.length; i++) { |
| ... | ... | @@ -221,11 +291,11 @@ Page({ |
| 221 | 291 | } |
| 222 | 292 | t.setData({one_level_classify:arr}); |
| 223 | 293 | |
| 224 | - } | |
| 294 | + } | |
| 225 | 295 | } |
| 226 | 296 | }); |
| 227 | 297 | }, |
| 228 | - | |
| 298 | + | |
| 229 | 299 | requestCategories: function(t) { |
| 230 | 300 | var s = this; |
| 231 | 301 | e.get("/api/goods/goodsSecAndThirdCategoryList", { |
| ... | ... | @@ -300,6 +370,7 @@ Page({ |
| 300 | 370 | |
| 301 | 371 | //------------手指滑动------------------ |
| 302 | 372 | touchmove(e) { |
| 373 | + console.log("手指滑动") | |
| 303 | 374 | const x = e.touches[0].clientX, |
| 304 | 375 | y = e.touches[0].clientY, |
| 305 | 376 | lettersPosition = this.data.lettersPosition, |
| ... | ... | @@ -460,36 +531,46 @@ Page({ |
| 460 | 531 | }, |
| 461 | 532 | // 新的版本分类点击一级分类 |
| 462 | 533 | click_classify:function(e){ |
| 463 | - this.data.ishaf_three=0; | |
| 464 | - var indexs=e.currentTarget.dataset.index; | |
| 534 | + clearInterval(this.data.timer); | |
| 535 | + this.setData({ countDownNum: 3, stylePage: 1, scrollTop: 0}); | |
| 536 | + this.data.ishaf_three = 0; | |
| 537 | + var indexs = e.currentTarget.dataset.index; | |
| 465 | 538 | var name = e.currentTarget.dataset.name; |
| 466 | 539 | var cid = e.currentTarget.dataset.cid; |
| 467 | 540 | var pid = e.currentTarget.dataset.pid; |
| 468 | 541 | var arr = e.currentTarget.dataset.arr; |
| 469 | - | |
| 470 | - if (indexs==220){ this.get_brand();} | |
| 471 | - if (arr!="undefined" && arr!=undefined){ | |
| 472 | - if (arr.length==0){ | |
| 473 | - this.setData({ select_classify_on: indexs, index: indexs, classify_name: name,cat_id:cid, | |
| 474 | - goodslist: null,is_level_three: 0 }); | |
| 475 | - return false; | |
| 476 | - } | |
| 477 | - if (arr.length != 0){ | |
| 478 | - var is_lev_thr=0 | |
| 479 | - for(var i=0;i<arr.length;i++){ | |
| 480 | - if (arr[i].arrays.length>0) {is_lev_thr=1;break; } | |
| 481 | - } | |
| 482 | - this.setData({ is_level_three: is_lev_thr }); | |
| 483 | - | |
| 484 | - if (this.data.is_level_three!=1) { | |
| 485 | - this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, goodslist: arr }); | |
| 486 | - } else { | |
| 487 | - this.setData({ select_classify_on: indexs, index: indexs, goodslist: arr }); | |
| 488 | - } | |
| 542 | + console.log("cid:=" + cid) | |
| 543 | + if (indexs == 220) { this.get_brand(); } | |
| 544 | + //==2的时候 请求数据为商品,不为分类 | |
| 545 | + if (this.data.is_used_share == 2) { | |
| 546 | + this.style(this.data.stylePage, cid) | |
| 547 | + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid,lastMsg: false, }); | |
| 548 | + }else{ | |
| 549 | + if (arr != "undefined" && arr != undefined) { | |
| 550 | + if (arr.length == 0) { | |
| 551 | + this.setData({ | |
| 552 | + select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid, | |
| 553 | + goodslist: null, is_level_three: 0 | |
| 554 | + }); | |
| 555 | + return false; | |
| 556 | + } | |
| 557 | + if (arr.length != 0) { | |
| 558 | + var is_lev_thr = 0 | |
| 559 | + for (var i = 0; i < arr.length; i++) { | |
| 560 | + if (arr[i].arrays.length > 0) { is_lev_thr = 1; break; } | |
| 561 | + } | |
| 562 | + this.setData({ is_level_three: is_lev_thr }); | |
| 563 | + | |
| 564 | + if (this.data.is_level_three != 1) { | |
| 565 | + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, goodslist: arr }); | |
| 566 | + } else { | |
| 567 | + this.setData({ select_classify_on: indexs, index: indexs, goodslist: arr }); | |
| 568 | + } | |
| 569 | + } | |
| 489 | 570 | } |
| 571 | + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid, stylePage: 1,lastMsg: false,}); | |
| 490 | 572 | } |
| 491 | - this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid}); | |
| 492 | - | |
| 573 | + | |
| 493 | 574 | }, |
| 494 | 575 | |
| 495 | 576 | |
| ... | ... | @@ -527,4 +608,244 @@ Page({ |
| 527 | 608 | this.destroyActivityTimer(); |
| 528 | 609 | }, |
| 529 | 610 | |
| 611 | + | |
| 612 | + //风格三使用 | |
| 613 | + changeTab: function (t) { | |
| 614 | + var ord = t.currentTarget.dataset.href; | |
| 615 | + var ad = t.currentTarget.dataset.ad; | |
| 616 | + var url = this.data.requestUrl; | |
| 617 | + | |
| 618 | + if (this.data.tabname != ord) { | |
| 619 | + this.setData({ tabname: ord, adname: "desc" }); | |
| 620 | + } else { | |
| 621 | + ad = ad == "desc" ? "asc" : "desc"; | |
| 622 | + this.setData({ adname: ad }); | |
| 623 | + } | |
| 624 | + this.resetData(), this.requestGoodsList(url); | |
| 625 | + }, | |
| 626 | + | |
| 627 | + requestGoodsList: function (t) { | |
| 628 | + var that = this; | |
| 629 | + that.data.requestUrl = t; | |
| 630 | + e.get("/api/weshop/goods/page?1=1", { | |
| 631 | + data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: 1, is_recommend: 1 }, | |
| 632 | + success: function (data) { | |
| 633 | + console.log(data.data.data.pageData) | |
| 634 | + that.setData({ | |
| 635 | + requestData: data.data.data.pageData, | |
| 636 | + is_go: 1 | |
| 637 | + }); | |
| 638 | + that.setData({ is_go: 1 }); | |
| 639 | + that.data.stylePage++ , null == that.data.allData && (that.data.allData = Object.assign({}, data.data.data.pageData)), | |
| 640 | + wx.stopPullDownRefresh(); | |
| 641 | + } | |
| 642 | + }); | |
| 643 | + // //不是商品分组的,不是默认排序的 | |
| 644 | + // if (t.indexOf("group_id") == -1 || e.data.tabname != "goods_id") { | |
| 645 | + // t += "&orderField=" + e.data.tabname; | |
| 646 | + // t += "&orderType=" + e.data.adname; | |
| 647 | + // } | |
| 648 | + // + "&parent_id=0&orderField=goods_id&orderType=desc&page="+this.data.page+"&is_mainshow=1&isonsale=1&store_id=1&is_recommend=1" | |
| 649 | + // t += "&page=" + e.data.page; | |
| 650 | + // a.request(t, | |
| 651 | + // function (t) { | |
| 652 | + // e.setData({ is_go: 1 }); | |
| 653 | + // e.data.page++ , null == e.data.allData && (e.data.allData = Object.assign({}, t.data.result)), | |
| 654 | + // wx.stopPullDownRefresh(); | |
| 655 | + // }, | |
| 656 | + // null, { is_mainshow: 1, isonsale: 1, store_id: oo.stoid } | |
| 657 | + // ); | |
| 658 | + }, | |
| 659 | + | |
| 660 | + // onReachBottom: function () { | |
| 661 | + // console.log('监听上拉:=') | |
| 662 | + // var that = this; | |
| 663 | + // clearInterval(that.data.timer); | |
| 664 | + // that.setData({ | |
| 665 | + // stylePage: that.data.stylePage + 1, | |
| 666 | + // countDownNum: 3, | |
| 667 | + // lastMsg: false, | |
| 668 | + // }); | |
| 669 | + // that.style(that.data.stylePage, that.data.cat_id); | |
| 670 | + // }, | |
| 671 | + // onPullDownRefresh: function () { | |
| 672 | + // console.log('监听下拉:=' + this.data.requestUrl) | |
| 673 | + // this.resetData(), this.requestGoodsList(this.data.requestUrl); | |
| 674 | + // }, | |
| 675 | + // 左侧更新 | |
| 676 | + scrollLower: function (data) { | |
| 677 | + console.log("上拉加载更多", JSON.stringify(data)) | |
| 678 | + var that = this; | |
| 679 | + clearInterval(that.data.timer); | |
| 680 | + that.setData({ | |
| 681 | + stylePage: that.data.stylePage + 1, | |
| 682 | + countDownNum: 3, | |
| 683 | + lastMsg: false, | |
| 684 | + }); | |
| 685 | + that.style(that.data.stylePage, that.data.cat_id); | |
| 686 | + }, | |
| 687 | + | |
| 688 | + //页面版面风格三的时候请求推荐商品 返回 | |
| 689 | + style: function (page, cid) { | |
| 690 | + console.log("page:=" + page) | |
| 691 | + var s = this | |
| 692 | + e.get("/api/weshop/goods/page?1=1", { | |
| 693 | + data: { page: page, cat_id: cid, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: 1, is_recommend: 1 }, | |
| 694 | + success: function (e) { | |
| 695 | + console.log(e.data.data.pageData) | |
| 696 | + s.setData({ | |
| 697 | + dataLength: e.data.data.pageData.length, | |
| 698 | + }); | |
| 699 | + if (e.data.data.pageData.length > 0) { | |
| 700 | + s.setData({ | |
| 701 | + msgStatus: false, | |
| 702 | + }); | |
| 703 | + //如果有数据 怕断分页为第一页的时候直接渲染数据 | |
| 704 | + if (page > 1) { | |
| 705 | + //如果分页不是在第一页 那么就把返回的数据追加到原有数据后面 | |
| 706 | + var arr = s.data.requestData | |
| 707 | + console.log("arr:=" + JSON.stringify(arr)) | |
| 708 | + | |
| 709 | + for (var i = 0; i < e.data.data.pageData.length;i++){ | |
| 710 | + arr.push(e.data.data.pageData[i]); | |
| 711 | + } | |
| 712 | + console.log(arr) | |
| 713 | + s.setData({ | |
| 714 | + requestData: arr | |
| 715 | + }); | |
| 716 | + | |
| 717 | + }else{ | |
| 718 | + s.setData({ | |
| 719 | + requestData: e.data.data.pageData | |
| 720 | + }); | |
| 721 | + if (wx.pageScrollTo) { | |
| 722 | + wx.pageScrollTo({ | |
| 723 | + scrollTop: 0 | |
| 724 | + }) | |
| 725 | + } | |
| 726 | + } | |
| 727 | + | |
| 728 | + } else { | |
| 729 | + //没有数据页面显示暂无数据 | |
| 730 | + if (page != 1) { | |
| 731 | + var dataArray = s.data.one_level_classify | |
| 732 | + var index = s.data.index | |
| 733 | + console.log(dataArray[index + 1]['items']) | |
| 734 | + s.setData({ | |
| 735 | + msgStatus: true, | |
| 736 | + stylePage: 1, | |
| 737 | + index: index + 1, | |
| 738 | + select_classify_on: index + 1, | |
| 739 | + cat_id: dataArray[index + 1]['items']['id'], | |
| 740 | + classify_name: dataArray[index + 1]['items']['name'] | |
| 741 | + }); | |
| 742 | + s.style(s.data.stylePage, dataArray[index + 1]['items']['id']) | |
| 743 | + }else{ | |
| 744 | + //没有数据而且是第一页的时候 | |
| 745 | + s.setData({ | |
| 746 | + stylePage: 1, | |
| 747 | + }); | |
| 748 | + let countDownNum = 3; //获取倒计时初始值 | |
| 749 | + s.setData({ | |
| 750 | + msgStatus: true, | |
| 751 | + countDownNum: countDownNum, | |
| 752 | + requestData: [] | |
| 753 | + }); | |
| 754 | + s.setData({ | |
| 755 | + timer: setInterval(function () { | |
| 756 | + if (countDownNum == 0) { | |
| 757 | + clearInterval(s.data.timer); | |
| 758 | + //关闭定时器之后,可作其他处理 | |
| 759 | + s.setData({ | |
| 760 | + msgStatus: false, | |
| 761 | + }) | |
| 762 | + | |
| 763 | + //如果没有数据就把分页初始化成第一页 | |
| 764 | + //没有数据根据当前分类id去找到下一个分类id再次传递给服务端请求数据 | |
| 765 | + var dataArray = s.data.one_level_classify | |
| 766 | + var index = s.data.index | |
| 767 | + console.log(dataArray[index + 1]) | |
| 768 | + if (dataArray[index + 1] == undefined || dataArray[index + 1] == "undefined"){ | |
| 769 | + console.log("dataArray[index + 1] = undefined") | |
| 770 | + s.setData({ | |
| 771 | + stylePage: 1, | |
| 772 | + msgStatus: true, | |
| 773 | + lastMsg: true | |
| 774 | + }); | |
| 775 | + }else{ | |
| 776 | + s.setData({ | |
| 777 | + stylePage: 1, | |
| 778 | + index: index + 1, | |
| 779 | + select_classify_on: index + 1, | |
| 780 | + cat_id: dataArray[index + 1]['items']['id'], | |
| 781 | + classify_name: dataArray[index + 1]['items']['name'] | |
| 782 | + }); | |
| 783 | + s.style(s.data.stylePage, dataArray[index + 1]['items']['id']); | |
| 784 | + } | |
| 785 | + | |
| 786 | + } | |
| 787 | + countDownNum--; | |
| 788 | + s.setData({ | |
| 789 | + countDownNum: countDownNum | |
| 790 | + }) | |
| 791 | + }, 1000) | |
| 792 | + | |
| 793 | + }) | |
| 794 | + } | |
| 795 | + | |
| 796 | + | |
| 797 | + } | |
| 798 | + } | |
| 799 | + }); | |
| 800 | + }, | |
| 801 | + | |
| 802 | + | |
| 803 | + openFilterModal: function () { | |
| 804 | + this.setData({ | |
| 805 | + openFilterModal: !0 | |
| 806 | + }); | |
| 807 | + }, | |
| 808 | + closeFilterModal: function () { | |
| 809 | + this.setData({ | |
| 810 | + openFilterModal: !1 | |
| 811 | + }); | |
| 812 | + }, | |
| 813 | + filterGoods: function (t) { | |
| 814 | + this.resetData(), this.requestGoodsList(t.currentTarget.dataset.href), this.closeFilterModal(); | |
| 815 | + }, | |
| 816 | + resetData: function () { | |
| 817 | + a.resetConfig(), this.data.requestData = null, this.data.currentPage = 1; | |
| 818 | + }, | |
| 819 | + | |
| 820 | + //---回复最初的设置--- | |
| 821 | + restoreData: function () { | |
| 822 | + this.setData({ | |
| 823 | + requestData: null, | |
| 824 | + }); | |
| 825 | + this.data.page = 1; | |
| 826 | + }, | |
| 827 | + | |
| 828 | + //--- 获取卡类列表 --- | |
| 829 | + getPlusCardType: function (func) { | |
| 830 | + var storid = oo.stoid; | |
| 831 | + var th = this; | |
| 832 | + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { | |
| 833 | + var plusCard = res.data.data; | |
| 834 | + var arr = [1219, 2089, 3031]; | |
| 835 | + var new_arr = new Array(); | |
| 836 | + var card_name_map = new Map(); | |
| 837 | + var user = getApp().globalData.userInfo; | |
| 838 | + for (var i = 0; i < plusCard.length; i++) { | |
| 839 | + if ((user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) { | |
| 840 | + continue; | |
| 841 | + } | |
| 842 | + var name = "card" + plusCard[i].CorrPrice.toLowerCase(); | |
| 843 | + card_name_map.set(name, plusCard[i].CardName); | |
| 844 | + new_arr.push(plusCard[i]); | |
| 845 | + } | |
| 846 | + | |
| 847 | + var ob = { "card_list": new_arr, "name_map": card_name_map }; | |
| 848 | + func(ob); | |
| 849 | + }) | |
| 850 | + }, | |
| 530 | 851 | }); |
| 531 | 852 | \ No newline at end of file | ... | ... |
pages/goods/categoryList/categoryList.wxml
| 1 | +<!-- 风格1 --> | |
| 1 | 2 | <block wx:if="{{is_used_share==0}}"> |
| 2 | 3 | <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> |
| 3 | - <view class="swiper-tab" > | |
| 4 | - <view wx:if="{{is_show_pl}}" class="swiper-tab-item {{currentTab==0?'active':''}}" | |
| 5 | - data-current="0" bindtap="clickTab">分类</view> | |
| 6 | - <view wx:if="{{is_show_gb}}" class="swiper-tab-item {{currentTab==1?'active':''}}" | |
| 7 | - data-current="1" bindtap="clickTab">国家</view> | |
| 8 | - <view wx:if="{{is_show_pp}}" class="swiper-tab-item {{currentTab==2?'active':''}}" | |
| 9 | - data-current="2" bindtap="clickTab">品牌</view> | |
| 10 | - </view> | |
| 11 | -</view> | |
| 4 | + <view class="swiper-tab" > | |
| 5 | + <view wx:if="{{is_show_pl}}" class="swiper-tab-item {{currentTab==0?'active':''}}" | |
| 6 | + data-current="0" bindtap="clickTab">分类</view> | |
| 7 | + <view wx:if="{{is_show_gb}}" class="swiper-tab-item {{currentTab==1?'active':''}}" | |
| 8 | + data-current="1" bindtap="clickTab">国家</view> | |
| 9 | + <view wx:if="{{is_show_pp}}" class="swiper-tab-item {{currentTab==2?'active':''}}" | |
| 10 | + data-current="2" bindtap="clickTab">品牌</view> | |
| 11 | + </view> | |
| 12 | + </view> | |
| 12 | 13 | <view class="search-box " bindtap="goseach"> |
| 13 | 14 | <view class="search-inner"> |
| 14 | 15 | <view class="search-img"> |
| ... | ... | @@ -16,7 +17,7 @@ |
| 16 | 17 | </view> |
| 17 | 18 | <input bindfocus="goseach" class="search-cont" placeholder="寻找好口碑" type="text"></input> |
| 18 | 19 | </view> |
| 19 | -</view> | |
| 20 | + </view> | |
| 20 | 21 | <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> |
| 21 | 22 | <swiper current="{{currentTab}}" duration="300" bindanimationfinish="swiperTab" style="height:{{abc}}rpx;"> |
| 22 | 23 | <!--------分类----------> |
| ... | ... | @@ -84,16 +85,17 @@ |
| 84 | 85 | <view class="no-data-title">暂无分类</view> |
| 85 | 86 | <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> |
| 86 | 87 | </view> |
| 87 | -</block> | |
| 88 | + </block> | |
| 88 | 89 | <block wx:elif="{{is_do}}"> |
| 89 | 90 | <view class="no-data" > |
| 90 | 91 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 91 | 92 | <view class="no-data-title">商家暂未设置分类</view> |
| 92 | 93 | <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> |
| 93 | 94 | </view> |
| 95 | + </block> | |
| 94 | 96 | </block> |
| 95 | -</block> | |
| 96 | -<block wx:else> | |
| 97 | +<!-- 风格2 --> | |
| 98 | +<block wx:elif="{{is_used_share == 1}}"> | |
| 97 | 99 | <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> |
| 98 | 100 | <!-- 新版分类头部 --> |
| 99 | 101 | <view class="xc-search-box flex-center white_b"> |
| ... | ... | @@ -262,4 +264,225 @@ |
| 262 | 264 | </view> |
| 263 | 265 | </block> |
| 264 | 266 | |
| 267 | +</block> | |
| 268 | +<!-- 风格3 --> | |
| 269 | +<block wx:elif="{{is_used_share == 2}}"> | |
| 270 | + <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> | |
| 271 | + <!-- 头部 --> | |
| 272 | + <view class="xc-search-box flex-center white_b" id="navbar" style="position:fixed;top:0;z-index:99999"> | |
| 273 | + <view class="share-height t-c" bindtap="getScancode" > | |
| 274 | + <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image> | |
| 275 | + <view class="fs24"> | |
| 276 | + 扫一扫 | |
| 277 | + </view> | |
| 278 | + </view> | |
| 279 | + <view class="xc-search-inner "> | |
| 280 | + <view class="search-img left"> | |
| 281 | + <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> | |
| 282 | + </view> | |
| 283 | + <input bindfocus="goseach" class="search-cont" placeholder="搜索你想要的生活" type="text"></input> | |
| 284 | + </view> | |
| 285 | + </view> | |
| 286 | + <!-- /头部 --> | |
| 287 | + <!-- 分类项目内容 --> | |
| 288 | + <view class="flex project_height" style="margin-left:-10rpx;"> | |
| 289 | + <!-- 分类项目的类型 --> | |
| 290 | + <view class="project_type" style="height:88%;overflow-y:auto;position:fixed;left:0;z-index:999999;top:120rpx;"> | |
| 291 | + <view class="project_type-frame"> | |
| 292 | + <view wx:if="{{is_show_gb}}"> | |
| 293 | + <view bindtap="click_classify" class="share_type fs30 flex-space-between xc-letter-spacing {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}"> | |
| 294 | + <text>国</text><text>家</text> | |
| 295 | + </view> | |
| 296 | + </view> | |
| 297 | + <view wx:if="{{is_show_pp}}"> | |
| 298 | + <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} share_type fs30 flex-space-between xc-letter-spacing" wx:if="{{is_brand}}"data-index="220"data-name="品牌"> | |
| 299 | + <text>品</text><text>牌</text> | |
| 300 | + </view> | |
| 301 | + </view> | |
| 302 | + <view wx:if="{{is_show_pl}}"> | |
| 303 | + <view wx:for="{{one_level_classify}}" wx:for-item="ittms" > | |
| 304 | + <view bindtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} share_type fs30 t-c {{ittms.items.name.length==2? 'world_sn':''}} {{select_classify_on==index&&ittms.items.name.length==2?'text-indent':''}} {{select_classify_on==index&&ittms.items.name.length==3?'text3':''}}"data-index="{{index}}"data-name="{{ittms.items.name}}"> | |
| 305 | + <view class="{{ittms.items.name.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittms.items.name.length<4}}"> | |
| 306 | + <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index"> | |
| 307 | + <view> | |
| 308 | + {{name}} | |
| 309 | + </view> | |
| 310 | + </view> | |
| 311 | + </view> | |
| 312 | + <view wx:else class="sort-name ellipsis-1">{{ittms.items.name}}</view> | |
| 313 | + </view> | |
| 314 | + </view> | |
| 315 | + </view> | |
| 316 | + </view> | |
| 317 | + </view> | |
| 318 | + <!-- 分类项目的内容 --> | |
| 319 | + <view class="classify_content" style="margin-left:26%;margin-top:51px"> | |
| 320 | + <!-- 国家的样式 --> | |
| 321 | + <block wx:if="{{select_classify_on==223&&is_show_gb}}"> | |
| 322 | + <view class="classify_name fs28 flex-space-between"> | |
| 323 | + <view>{{ishaf_three==1?good_list.name:classify_name}}</view> | |
| 324 | + | |
| 325 | + </view> | |
| 326 | + <view class=" classify_content-frame flex-space-between " > | |
| 327 | + <view bindtap="go_nation" class="country_img-frame rel outer_location"wx:for="{{nationlist}}" wx:for-item="bitem" wx:for-index="pidx" data-nid="{{bitem.id}}" > | |
| 328 | + <image class="country_img" src="{{iurl}}{{bitem.logo}}"></image> | |
| 329 | + <view class='nation_box abs box'> | |
| 330 | + <view class='nt_1 t-c line-height' style="height:50rpx"> | |
| 331 | + <text class="nation_z_name ellipsis-1 nt_1_t height fs24">{{bitem.name}}</text> | |
| 332 | + </view> | |
| 333 | + <view class='nt_2 t-c line-height fs24' style="line-height: 50rpx"> | |
| 334 | + <text class="nation_y_name ellipsis-1 nt_1_t height fs24">{{bitem.enname}}</text> | |
| 335 | + </view> | |
| 336 | + </view> | |
| 337 | + <!--<view class='nation_box abs box' style="top:20rpx">--> | |
| 338 | + <!--</view>--> | |
| 339 | + </view> | |
| 340 | + </view> | |
| 341 | + </block> | |
| 342 | + <!-- 品牌 --> | |
| 343 | + <block wx:if="{{select_classify_on==220&&is_show_pp}}"> | |
| 344 | + | |
| 345 | + <view class="classify_name fs28 flex-space-between"> | |
| 346 | + <view>{{classify_name}}</view> | |
| 347 | + </view> | |
| 348 | + | |
| 349 | + <view class="classify_content-frame flex flex-wrap"> | |
| 350 | + | |
| 351 | + <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx"> | |
| 352 | + <view class="brand_img_frame "wx:for="{{brand_list.array}}"wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" > | |
| 353 | + | |
| 354 | + <view class="brand_img t-c"> | |
| 355 | + <image class=" brand_img" src="{{user.logo}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image> | |
| 356 | + <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view> | |
| 357 | + </view> | |
| 358 | + </view> | |
| 359 | + | |
| 360 | + | |
| 361 | + </block> | |
| 362 | + </view> | |
| 363 | + </block> | |
| 364 | + <!-- 品类--> | |
| 365 | + <block wx:if="{{is_show_pl}}"> | |
| 366 | + <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}"> | |
| 367 | + <view style="width:100%;height:100%;"> | |
| 368 | + <view class="classify_name fs28 flex-space-between" id="header" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more' style="position:fixed;z-index:999999;top:120rpx;width:70%;background-color:#ffffff;left:26%;padding:0 10rpx;"> | |
| 369 | + <view class="classify_title ellipsis-1">{{classify_name}}</view> | |
| 370 | + <view class="flex select_more" > | |
| 371 | + <view class="red-co fs24" >更多</view> | |
| 372 | + <view class="bg_right width_height"></view> | |
| 373 | + </view> | |
| 374 | + </view> | |
| 375 | + <!-- 显示商品列表开始 --> | |
| 376 | + <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> --> | |
| 377 | + | |
| 378 | + <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> --> | |
| 379 | + <scroll-view scroll-y scroll-top="{{scrollTop}}" bindscrolltolower='scrollLower' style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:120rpx;bottom:0;rigth:0;left:26%;width:73%;"> | |
| 380 | + <view class="null" style="width:100%;height:1px;"></view> | |
| 381 | + <!-- goodslist --> | |
| 382 | + <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}"> | |
| 383 | + <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'100px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{index}}" wx:key="{{index}}"> | |
| 384 | + <view class="img-wrap"> | |
| 385 | + <image src="{{item.original_img}}" binderror="bind_bnerr2" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image> | |
| 386 | + </view> | |
| 387 | + <view class="item-cont"> | |
| 388 | + <view class="title">{{item.goods_name}}</view> | |
| 389 | + <!-- 判断是否有活动价 --> | |
| 390 | + <block wx:if="{{item.prom_price>0}}"> | |
| 391 | + <!-- 活动价 --> | |
| 392 | + <view class="price">¥{{item.prom_price}}</view> | |
| 393 | + <view class="comment flex jc_sb"> | |
| 394 | + <view class="word-line xc-ash">¥{{item.market_price}}</view> | |
| 395 | + <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> | |
| 396 | + </view> | |
| 397 | + </block> | |
| 398 | + <block wx:else> | |
| 399 | + <!-- 商品价格,先判断下是后又等级价--> | |
| 400 | + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> | |
| 401 | + <!-- 当会员是等级卡的时候 --> | |
| 402 | + <block wx:if="{{card_field}}"> | |
| 403 | + <!-- 等级价>0 --> | |
| 404 | + <block wx:if="{{item[card_field]>0}}"> | |
| 405 | + <view class="flex ai_and"> | |
| 406 | + <view class="price">¥{{item[card_field]}}</view> | |
| 407 | + <view class="card_bg"> | |
| 408 | + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> | |
| 409 | + <view class="card_name">{{card_name}}</view> | |
| 410 | + </view> | |
| 411 | + </view> | |
| 412 | + <view class="comment flex jc_sb"> | |
| 413 | + <view class="word-line xc-ash">¥{{item.market_price}}</view> | |
| 414 | + <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> | |
| 415 | + </view> | |
| 416 | + </block> | |
| 417 | + <block wx:else> | |
| 418 | + <view class="price">¥{{item.shop_price}}</view> | |
| 419 | + <view class="comment flex jc_sb"> | |
| 420 | + <view class="word-line xc-ash">¥{{item.market_price}}</view> | |
| 421 | + <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> | |
| 422 | + </view> | |
| 423 | + </block> | |
| 424 | + </block> | |
| 425 | + <block wx:else> | |
| 426 | + <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> | |
| 427 | + <view class="flex ai-center"> | |
| 428 | + <view class="price">¥{{item.shop_price}}</view> | |
| 429 | + <view class="word-line xc-ash mk_price">¥{{item.market_price}}</view> | |
| 430 | + </view> | |
| 431 | + <view class="comment flex jc_sb"> | |
| 432 | + <view class="flex ai_and"> | |
| 433 | + <view class="">¥{{g_filter.get_card_price(item,card_list,0)}}</view> | |
| 434 | + <view class="card_bg"> | |
| 435 | + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> | |
| 436 | + {{g_filter.get_card_price(item,card_list,1)}} | |
| 437 | + </view> | |
| 438 | + </view> | |
| 439 | + <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> | |
| 440 | + </view> | |
| 441 | + </block> | |
| 442 | + <block wx:else> | |
| 443 | + <view class="price">¥{{item.shop_price}}</view> | |
| 444 | + <view class="comment flex jc_sb"> | |
| 445 | + <view class="word-line xc-ash">¥{{item.market_price}}</view> | |
| 446 | + <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> | |
| 447 | + </view> | |
| 448 | + </block> | |
| 449 | + </block> | |
| 450 | + </block> | |
| 451 | + <block wx:else> | |
| 452 | + <view class="price">¥{{item.shop_price}}</view> | |
| 453 | + <view class="comment flex jc_sb"> | |
| 454 | + <view class="word-line xc-ash">¥{{item.market_price}}</view> | |
| 455 | + <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> | |
| 456 | + </view> | |
| 457 | + </block> | |
| 458 | + </block> | |
| 459 | + </view> | |
| 460 | + </navigator> | |
| 461 | + </view> | |
| 462 | + <view class="no-data" wx:if="{{msgStatus == true}}"> | |
| 463 | + <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | |
| 464 | + | |
| 465 | + <view wx:if="{{msgStatus == true && lastMsg == false}}" class="no-data-title">该类别暂无推荐商品 {{countDownNum}} 秒后自动跳到下一个类别</view> | |
| 466 | + <view wx:elif="{{lastMsg == true && msgStatus == true}}" class="no-data-title">该类别暂无推荐商品</view> | |
| 467 | + <!-- <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> --> | |
| 468 | + </view> | |
| 469 | + | |
| 470 | + </scroll-view> | |
| 471 | + <!-- /goodslist --> | |
| 472 | + </view> | |
| 473 | + <!-- 商品列表结束 --> | |
| 474 | + | |
| 475 | + </block> | |
| 476 | + </block> | |
| 477 | + </view> | |
| 478 | + </view> | |
| 479 | + </block> | |
| 480 | + <block wx:elif="{{is_do}}"> | |
| 481 | + <view class="no-data" > | |
| 482 | + <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | |
| 483 | + <view class="no-data-title">商家暂未设置分类</view> | |
| 484 | + <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | |
| 485 | + </view> | |
| 486 | + </block> | |
| 487 | + | |
| 265 | 488 | </block> |
| 266 | 489 | \ No newline at end of file | ... | ... |
pages/goods/categoryList/categoryList.wxss
| 1 | 1 | /*---nyf 2018-9-7---*/ |
| 2 | + | |
| 2 | 3 | page{height: 100%; background: #fff;} |
| 3 | 4 | .top_view{ width: 100%;background: #fff;} |
| 5 | + | |
| 4 | 6 | .swiper-tab{ |
| 5 | 7 | width: 70%; |
| 6 | 8 | text-align: center; |
| ... | ... | @@ -400,4 +402,7 @@ margin: auto; |
| 400 | 402 | width: 80%; |
| 401 | 403 | } |
| 402 | 404 | |
| 403 | -.brand_img_name {color: #666;} | |
| 404 | 405 | \ No newline at end of file |
| 406 | +.brand_img_name {color: #666;} | |
| 407 | + | |
| 408 | +/* 风格三商品列表样式引入 */ | |
| 409 | +@import "../goodsList/goodsList.wxss"; | |
| 405 | 410 | \ No newline at end of file | ... | ... |
project.config.json
| ... | ... | @@ -31,10 +31,18 @@ |
| 31 | 31 | "current": -1, |
| 32 | 32 | "list": [] |
| 33 | 33 | }, |
| 34 | + "plugin": { | |
| 35 | + "current": -1, | |
| 36 | + "list": [] | |
| 37 | + }, | |
| 34 | 38 | "game": { |
| 35 | 39 | "currentL": -1, |
| 36 | 40 | "list": [] |
| 37 | 41 | }, |
| 42 | + "gamePlugin": { | |
| 43 | + "current": -1, | |
| 44 | + "list": [] | |
| 45 | + }, | |
| 38 | 46 | "miniprogram": { |
| 39 | 47 | "current": -1, |
| 40 | 48 | "list": [] | ... | ... |