浏览代码

分类页面修改

wenjie 3 天之前
父节点
当前提交
359b16ce93

+ 6 - 0
app.json

@@ -103,6 +103,12 @@
         "iconPath": "images/tabbar/home.png",
         "selectedIconPath": "images/tabbar/select_home.png"
       },
+      {
+        "pagePath": "pages/category/category",
+        "text": "分类",
+        "iconPath": "images/tabbar/sort.png",
+        "selectedIconPath": "images/tabbar/select_sort.png"
+      },
       {
         "pagePath": "pages/basket/basket",
         "text": "购物车",

二进制
images/icon/car-icon.png


二进制
images/icon/more-icon.png


+ 39 - 7
pages/category/category.js

@@ -10,7 +10,10 @@ Page({
    * 页面的初始数据
    */
   data: {
+    show:false,
+    showCar:true,
     selIndex: 0,
+    subIndex:0,
     categoryList: [],
     categoryImg: '',
     subCategoryList: [],
@@ -27,6 +30,25 @@ Page({
     this.get_neighborShop()
     // this.get_categoryInfo()
   },
+  // 点击购物车内加减按钮
+  handleNum(){
+
+  },
+  handleAll(){
+    this.setData({
+      show:true
+    })
+  },
+  onClose(){
+    this.setData({
+      show:false
+    })
+  },
+  onCarClose(){
+    this.setData({
+      showCar:false
+    })
+  },
   /**
    * 获取距离最近店铺id
    * @param {*} e 
@@ -62,17 +84,17 @@ Page({
       },
       callBack: function (res) {
         let categoryName = ''
-        res.forEach(e => {
+        res.records.forEach(e => {
           categoryName = e.categoryName.split('>')
           e.categoryName = categoryName[0]
         })
         ths.setData({
-          categoryList: res,
+          categoryList: res.records,
         });
         if (!getApp().globalData.categoryId) {
-          ths.getProdList(res[0].categoryId)
+          ths.getProdList(res.records[0].categoryId)
           ths.setData({
-            categoryImg: res[0].pic,
+            categoryImg: res.records[0].pic,
           })
         }
       }
@@ -153,7 +175,8 @@ Page({
     this.getProdList(this.data.categoryList[index].categoryId);
     this.setData({
       categoryImg: this.data.categoryList[index].pic,
-      selIndex: index
+      selIndex: index,
+      subIndex:0
     });
     getApp().globalData.categoryId = ''
     getApp().globalData.index = ''
@@ -214,7 +237,7 @@ Page({
       },
       callBack: (res) => {
         let str='https://zswl-shop.oss-cn-chengdu.aliyuncs.com'
-        res.forEach(item=>{
+        res.records.forEach(item=>{
           item.categories.forEach(e=>{
             if(e.pic!=null){
               if(!e.pic.includes(str)){
@@ -224,7 +247,7 @@ Page({
           })
         })
         this.setData({
-          subCategoryList: res,
+          subCategoryList: res.records,
         });
       }
     };
@@ -238,6 +261,15 @@ Page({
       url: '/pages/locationAdd/locationAdd',
     })
   },
+  // 点击二级分类
+  onleftMenuTab(e){
+    const {
+      index
+    } = e.currentTarget.dataset
+    this.setData({
+      subIndex:index
+    })
+  },
   // 跳转子分类商品页面
   toCatePage: function (e) {
     console.log(e);

+ 94 - 4
pages/category/category.wxml

@@ -10,13 +10,61 @@
       <view class="top-search-text" bindtap="topHotSearch">搜索</view>
     </view>
   </navbar>
+
+  <!-- 全部分类弹窗 -->
+  <van-popup show="{{ show }}"  position="top" close-on-click-overlay="{{false}}" z-index="{{99999}}" round bind:close="onClose">
+    <view style="padding-top: {{pageTopHeight}}px;">
+    <!-- 搜索 -->
+        <navbar>
+          <view class="top-search-input">
+            <swiper vertical="true" circular="true" autoplay="true" interval="3000" class="top-search-swiper" bindtap="toSearchPage" bindchange="topSwiperChange">
+              <swiper-item wx:for="{{hotList}}" wx:key="index">{{item.name}}</swiper-item>
+            </swiper>
+            <view class="top-search-line">|</view>
+            <view class="top-search-text" bindtap="topHotSearch">搜索</view>
+          </view>
+      </navbar>
+      <!-- 分类 -->
+      <view class="top-box top-all-box">
+        <view wx:for='{{categoryList}}' class="type-item" wx:key='categoryId'>
+          <view class="icon"></view>
+          <view class='name {{selIndex==index?"active":""}} ' data-index="{{index}}" data-id="{{item.categoryId}}" bindtap='onMenuTab'>
+            {{item.categoryName}}
+          </view>
+        </view>
+      </view>
+
+      <view class="close-box" bind:tap="onClose">
+          点击收起
+          <image class="icon" src="../../images/icon/more-icon.png" mode=""/>
+      </view>
+    </view>
+  </van-popup>
+
+<!-- 顶部滚动分类 -->
+  <view class="top-content">
+    <scroll-view scroll-x="true"  class='top-box'>
+      <view wx:for='{{categoryList}}' class="type-item" wx:key='categoryId'>
+        <view class="icon"></view>
+        <view class='name {{selIndex==index?"active":""}} ' data-index="{{index}}" data-id="{{item.categoryId}}" bindtap='onMenuTab'>
+          {{item.categoryName}}
+        </view>
+      </view>
+    </scroll-view>
+      <view class="all" bind:tap="handleAll">全部
+        <image class="icon" src="../../images/icon/more-icon.png" mode=""/>
+      </view>
+  </view>
+
+
+
   <!-- 滚动内容区 -->
   <view class="main" wx:if="{{categoryList.length>0}}">
     <!-- 左侧菜单start -->
     <scroll-view scroll-y="true" class='leftmenu'>
       <block wx:for='{{categoryList}}' wx:key='categoryId'>
-        <view class='menu-item {{selIndex==index?"active":""}} ' data-index="{{index}}" data-id="{{item.categoryId}}" bindtap='onMenuTab'>
-          {{item.categoryName}}
+        <view class='menu-item {{subIndex==index?"active":""}} ' data-index="{{index}}" data-id="{{item.categoryId}}" bindtap='onleftMenuTab'>
+          二级{{item.categoryName}}
         </view>
       </block>
     </scroll-view>
@@ -24,11 +72,11 @@
 
     <!-- 右侧内容start -->
     <scroll-view scroll-y="true" class='rightcontent' scroll-into-view="{{toViewId}}">
-      <view class='adver-map'>
+      <!-- <view class='adver-map'>
         <view class='item-a'>
           <image src='{{categoryImg}}'></image>
         </view>
-      </view>
+      </view> -->
       <block wx:if="{{subCategoryList.length>0}}">
         <block wx:for="{{subCategoryList}}" wx:key='categoryId' wx:for-index='subCateIndex'>
           <view class='sub-category'>
@@ -63,5 +111,47 @@
     <van-empty image="search" description="附近暂无可配送门店" />
     <view class="reset-localization" bindtap="toLocationPage">定位不准确?<text style="color: rgb(40,120,255);">点击手动定位</text></view>
   </view>
+
+  <!-- 购物车弹窗 -->
+  <van-popup show="{{ showCar }}"  position="bottom" safe-area-inset-bottom="{{false}}" close-on-click-overlay="{{true}}" z-index="{{99999}}" round bind:close="onCarClose">
+  <view class="car-box">
+    <view class="item">
+    <view class="img"></view>
+    <view class="info">
+      <view class="title">1000g~1500g | 阳光玫瑰葡萄</view>
+      <view class="desc">规格:500ml+冰袋</view>
+      <view class="price-box">
+        <view class="price">
+          <view class="unit">¥</view>
+          <view class="num">13.95</view>
+        </view>
+        <view class="num-box">
+          <view class="btn" data-num="-1" bind:tap="handleNum">-</view>
+          <view class="num">1</view>
+          <view class="btn" data-num="1" bind:tap="handleNum">+</view>
+        </view>
+
+      </view>
+    </view>
+    </view>
+
+  </view>
+    <view class="bottom-box">
+      <view class="left">
+        <image class="icon" src="../../images/icon/car-icon.png" mode=""/>
+        <view class="price-box">
+          <view class="top">
+            <view class="price">¥13.95</view>
+            <view class="reduce-price">共减¥5</view>
+          </view>
+          <view class="shipping-fee">配送费¥0</view>
+        </view>
+      </view>
+
+      <view class="btn">去结算</view>
+    </view>
+
+  </van-popup>
+
 </view>
 <wxs module="wxs" src="../../wxs/number.wxs" />

+ 229 - 4
pages/category/category.wxss

@@ -5,16 +5,16 @@ page {
 }
 
 .container {
-  display: flex;
+  /* display: flex; */
   flex-direction: row;
   height: 100%;
 }
 
 .main {
-  position: fixed;
+  /* position: fixed; */
   display: flex;
   overflow: hidden;
-  margin-top: 78rpx;
+  /* margin-top: 78rpx; */
   height: calc(100% - 100rpx);
 }
 
@@ -53,6 +53,100 @@ page {
   color: #04358D;
 }
 
+
+/* 顶部分类 */
+
+.top-content{
+  position: relative;
+}
+
+.top-box{
+  white-space: nowrap;
+  align-items: center;
+  margin-top: 100rpx;
+  width: 100%;
+  padding-left: 24rpx;
+  box-sizing: border-box;
+}
+
+.top-content .all{
+position: absolute;
+top: 0;
+right: 0;
+width: 64rpx;
+height: 144rpx;
+display: flex;
+justify-content: center;
+align-items: center;
+letter-spacing: 10rpx;
+background: linear-gradient( 180deg, #FFFFFF 0%, #F8F8F8 100%);
+writing-mode: vertical-rl;
+font-weight: bold;
+font-size: 24rpx;
+color: #222222;
+}
+
+.top-content .all .icon{
+  width: 20rpx;
+  height: 20rpx;
+  margin-left: 2rpx;
+}
+
+.top-all-box {
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: space-between;
+  padding: 0 32rpx;
+}
+
+.top-all-box .type-item{
+margin-bottom: 24rpx;
+}
+
+.top-box .type-item{
+  display: inline-block;
+}
+
+.top-box .type-item .icon{
+  width: 100rpx;
+  height: 100rpx;
+  background: red;
+  margin-left: 8rpx;
+
+}
+.top-box .type-item .name{
+  font-size: 24rpx;
+  color: #222222;
+  width: 116rpx;
+  height: 36rpx;
+  line-height: 36rpx;
+  text-align: center;
+  margin-top: 12rpx;
+}
+
+.top-box .type-item .name.active{
+  background: #FFDF00;
+  border-radius: 18rpx 18rpx 18rpx 18rpx;
+}
+
+
+
+ .close-box{
+  font-size: 24rpx;
+  color: #AAAAAA;
+  width: 100%;
+  text-align: center;
+  line-height: 82rpx;
+  border-top: 1rpx solid #F0F0F0;
+}
+
+ .close-box .icon{
+  width: 20rpx;
+  height: 20rpx;
+  transform: rotateZ(180deg);
+}
+
+
 /* 左侧菜单栏 */
 
 .leftmenu {
@@ -204,4 +298,135 @@ scroll-view ::-webkit-scrollbar {
   text-align: center;
   font-size: 26rpx;
   color: #AAAAAA;
-}
+}
+
+/* 购物车 */
+
+.car-box{
+  padding: 28rpx 24rpx 0;
+}
+
+.car-box .item{
+  display: flex;
+  align-items: center;
+  padding-bottom: 30rpx;
+  border-bottom: 2rpx solid #F0F0F0;
+}
+
+.car-box .item .img{
+  width: 200rpx;
+  height: 200rpx;
+  border-radius: 16rpx;
+  background: chartreuse;
+}
+.car-box .item .info{
+  flex: 1;
+  padding-left: 20rpx;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  height: 200rpx;
+}
+.car-box .item .info .title{
+  font-weight: 800;
+  font-size: 32rpx;
+  color: #222222;
+}
+.car-box .item .info .desc{
+  font-size: 24rpx;
+  color: #AAAAAA;
+}
+
+.car-box .item .info .price-box{
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.car-box .item .info .price-box .price{
+  display: flex;
+  align-items: flex-end;
+  color: #FF4D3A;
+}
+.car-box .item .info .price-box .price .unit{
+  font-size: 20rpx;
+}
+
+.car-box .item .info .price-box .price .num{
+  font-size: 48rpx;
+}
+
+.car-box .item .info .price-box .num-box{
+  display: flex;
+  align-items: center;
+}
+
+.car-box .item .info .price-box .num-box .btn{
+  color: #AAAAAA;
+  font-size: 20rpx;
+  width: 40rpx;
+  height: 40rpx;
+  text-align: center;
+  line-height: 40rpx;
+  background: #F0F0F0;
+
+}
+
+.car-box .item .info .price-box .num-box .num{
+  width: 80rpx;
+  height: 40rpx;
+  background: #F0F0F0;
+  text-align: center;
+  line-height: 40rpx;
+  margin: 0 4rpx;
+  font-size: 24rpx ;
+  color: #222222;
+}
+
+.bottom-box{
+  display: flex;
+  justify-content: space-between;
+  padding: 20rpx 24rpx;
+  background: #FFFFFF;
+  box-shadow: 0rpx -6rpx 12rpx 2rpx rgba(0,0,0,0.05);
+  border-radius: 32rpx 32rpx 0rpx 0rpx;
+}
+.bottom-box .left{
+  display: flex;
+  
+}
+.bottom-box .icon{
+  width: 80rpx;
+  height: 80rpx;
+  margin-right: 20rpx;
+}
+.bottom-box .price-box .top{
+  display: flex;
+  align-items: center;
+}
+
+.bottom-box .price-box .top .price{
+  font-weight: 800;
+  font-size: 32rpx;
+  color: #FF4D3A;
+}
+
+.bottom-box .price-box .top .reduce-price{
+  font-size: 24rpx;
+  color: #AAAAAA
+}
+
+.bottom-box .price-box .shipping-fee{
+  font-size: 24rpx;
+  color: #AAAAAA;
+}
+.bottom-box .btn{
+  width: 342rpx;
+  height: 80rpx;
+  background: #04358D;
+  border-radius: 40rpx;
+  text-align: center;
+  line-height: 80rpx;
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #FFFFFF;
+}

+ 259 - 0
pages/category1/category.js

@@ -0,0 +1,259 @@
+// pages/category/category.js
+
+var http = require("../../utils/http.js");
+var util = require('../../utils/util.js');
+var config = require("../../utils/config.js");
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    selIndex: 0,
+    categoryList: [],
+    categoryImg: '',
+    subCategoryList: [],
+    pageTopHeight: wx.getWindowInfo().statusBarHeight,
+    hotList: [],
+    topCurrentIndex: 0,
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.getRecommended()
+    this.get_neighborShop()
+    // this.get_categoryInfo()
+  },
+  /**
+   * 获取距离最近店铺id
+   * @param {*} e 
+   */
+  get_neighborShop: function () {
+    var params = {
+      url: "/shop/neighborShop",
+      method: "GET",
+      data: {
+        lat: wx.getStorageSync('LATITUDE'),
+        lon: wx.getStorageSync('LONGITUDE'),
+      },
+      callBack: (res) => {
+        // this.get_categoryInfo(res)
+
+        if(typeof res == 'number'){
+          this.get_categoryInfo(res)
+        }else{
+          this.get_categoryInfo(res.shopId)
+        }
+      }
+    };
+    http.request(params);
+  },
+  get_categoryInfo: function (shopid) {
+    var ths = this;
+    //加载分类列表
+    var params = {
+      url: "/category/categoryInfo",
+      method: "GET",
+      data: {
+        shopId:shopid
+      },
+      callBack: function (res) {
+        let categoryName = ''
+        res.forEach(e => {
+          categoryName = e.categoryName.split('>')
+          e.categoryName = categoryName[0]
+        })
+        ths.setData({
+          categoryList: res,
+        });
+        if (!getApp().globalData.categoryId) {
+          ths.getProdList(res[0].categoryId)
+          ths.setData({
+            categoryImg: res[0].pic,
+          })
+        }
+      }
+    };
+    http.request(params);
+  },
+ /**
+   * 选择定位后更新列表
+   */
+  go_update() {
+    this.get_neighborShop()
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    if (getApp().globalData.categoryId) {
+      let categoryId = getApp().globalData.categoryId
+      let index = getApp().globalData.index
+      let pic = getApp().globalData.pic
+      this.getProdList(categoryId);
+      this.setData({
+        categoryImg: pic,
+        selIndex: index
+      });
+    }else{
+    this.get_neighborShop()
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {},
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  },
+
+  /**
+   * 分类点击事件,获取子分类
+   */
+  onMenuTab: function (e) {
+    var id = e.currentTarget.dataset.id;
+    var index = e.currentTarget.dataset.index;
+    // this.getProdList(id);
+    this.getProdList(this.data.categoryList[index].categoryId);
+    this.setData({
+      categoryImg: this.data.categoryList[index].pic,
+      selIndex: index
+    });
+    getApp().globalData.categoryId = ''
+    getApp().globalData.index = ''
+    getApp().globalData.pic = ''
+  },
+  /**
+   * 推荐词,type:1关键词,2热门搜索词,3推荐搜索词
+   */
+  getRecommended: function () {
+    var params = {
+      url: "/keyword/list",
+      method: "GET",
+      data: {
+        type: 2
+      },
+      callBack: (res) => {
+        let reslut = res.filter(item => item.status !== 2) //过滤下线词
+        let timeReslut = reslut.filter(e => util.dateToTimestamp(e.effectiveTime) < new Date().getTime()) //过滤未生效词
+        this.setData({
+          hotList: timeReslut
+        })
+      }
+    };
+    http.request(params);
+  },
+
+  /**
+   * 推荐词搜索
+   */
+  topSwiperChange: function (e) {
+    this.setData({
+      topCurrentIndex: e.detail.current // 获取当前滚动到的swiper-item的索引并更新到data中
+    })
+  },
+  topHotSearch: function () {
+    const topname = this.data.hotList[this.data.topCurrentIndex].name
+    wx.navigateTo({
+      url: '/pages/search-prod-show/search-prod-show?prodName=' + topname,
+    })
+  },
+
+  // 跳转搜索页
+  toSearchPage: function () {
+    wx.navigateTo({
+      url: '/pages/search-page/search-page',
+    })
+  },
+  getProdList(categoryId) {
+    this.setData({
+      parentId: categoryId
+    })
+    //加载子分类列表
+    var params = {
+      url: "/category/categoryInfo",
+      method: "GET",
+      data: {
+        parentId: categoryId
+      },
+      callBack: (res) => {
+        let str='https://zswl-shop.oss-cn-chengdu.aliyuncs.com'
+        res.forEach(item=>{
+          item.categories.forEach(e=>{
+            if(e.pic!=null){
+              if(!e.pic.includes(str)){
+                e.pic='https://zswl-shop.oss-cn-chengdu.aliyuncs.com/'+e.pic
+              }
+            }
+          })
+        })
+        this.setData({
+          subCategoryList: res,
+        });
+      }
+    };
+    http.request(params);
+  },
+  /**
+   * 跳转到定位页面
+   */
+  toLocationPage: function () {
+    wx.navigateTo({
+      url: '/pages/locationAdd/locationAdd',
+    })
+  },
+  // 跳转子分类商品页面
+  toCatePage: function (e) {
+    console.log(e);
+    const {
+      type,
+      parentid,
+      categoryid,
+      subcateindex
+    } = e.currentTarget.dataset
+    wx.navigateTo({
+      url: `/pages/sub-category/sub-category?parentId=${parentid}&categoryId=${type=='all'?this.data.subCategoryList[subcateindex].categoryId:categoryid}`,
+    })
+  },
+  toCategoryPage: function () {
+    wx.navigateTo({
+      url: `/pages/sub-category/sub-category?categoryId=${this.data.parentId}`,
+    })
+  }
+})

+ 5 - 0
pages/category1/category.json

@@ -0,0 +1,5 @@
+{
+  "backgroundTextStyle": "light",
+  "navigationBarTitleText": "分类商品",
+  "navigationStyle":"custom"
+}

+ 67 - 0
pages/category1/category.wxml

@@ -0,0 +1,67 @@
+<!--pages/category/category.wxml-->
+<view class="container" style="padding-top: {{pageTopHeight}}px;">
+  <!-- 头部搜索区 -->
+  <navbar>
+    <view class="top-search-input">
+      <swiper vertical="true" circular="true" autoplay="true" interval="3000" class="top-search-swiper" bindtap="toSearchPage" bindchange="topSwiperChange">
+        <swiper-item wx:for="{{hotList}}" wx:key="index">{{item.name}}</swiper-item>
+      </swiper>
+      <view class="top-search-line">|</view>
+      <view class="top-search-text" bindtap="topHotSearch">搜索</view>
+    </view>
+  </navbar>
+  <!-- 滚动内容区 -->
+  <view class="main" wx:if="{{categoryList.length>0}}">
+    <!-- 左侧菜单start -->
+    <scroll-view scroll-y="true" class='leftmenu'>
+      <block wx:for='{{categoryList}}' wx:key='categoryId'>
+        <view class='menu-item {{selIndex==index?"active":""}} ' data-index="{{index}}" data-id="{{item.categoryId}}" bindtap='onMenuTab'>
+          {{item.categoryName}}
+        </view>
+      </block>
+    </scroll-view>
+    <!-- 左侧菜单end -->
+
+    <!-- 右侧内容start -->
+    <scroll-view scroll-y="true" class='rightcontent' scroll-into-view="{{toViewId}}">
+      <view class='adver-map'>
+        <view class='item-a'>
+          <image src='{{categoryImg}}'></image>
+        </view>
+      </view>
+      <block wx:if="{{subCategoryList.length>0}}">
+        <block wx:for="{{subCategoryList}}" wx:key='categoryId' wx:for-index='subCateIndex'>
+          <view class='sub-category'>
+            <view class="sub-category-con">
+              <view class="sub-cate-title">
+                <text class="sub-cate-text">{{item.categoryName}}</text>
+                <text class="view-all" bindtap="toCatePage" data-type="all" data-subcateindex="{{subCateIndex}}" data-parentid="{{item.parentId}}" data-categoryId="{{item.categoryId}}">查看全部</text>
+                <van-icon name="arrow" color="#999999" size="14" />
+              </view>
+              <view class="th-cate-con">
+                <block wx:for="{{item.categories}}" wx:key='categoryId' wx:for-item='thCateItem'>
+                  <view class='sub-category-item' bindtap='toCatePage' data-categoryid="{{thCateItem.categoryId}}" data-parentid="{{item.categoryId}}">
+                    <image src='{{thCateItem.pic}}' mode='widthFix' class="sub-category-item-pic"></image>
+                    <text>{{thCateItem.categoryName}}</text>
+                  </view>
+                </block>
+              </view>
+            </view>
+          </view>
+        </block>
+      </block>
+      <view class="sub-cate-title not-category-data" wx:else>
+        <view class="sub-cate-text">无二级分类</view>
+        <view class="view-all" bindtap="toCategoryPage">查看全部
+          <van-icon name="arrow" color="#999999" size="14" />
+        </view>
+      </view>
+    </scroll-view>
+    <!-- 右侧内容end -->
+  </view>
+  <view class="not-data-list" wx:else>
+    <van-empty image="search" description="附近暂无可配送门店" />
+    <view class="reset-localization" bindtap="toLocationPage">定位不准确?<text style="color: rgb(40,120,255);">点击手动定位</text></view>
+  </view>
+</view>
+<wxs module="wxs" src="../../wxs/number.wxs" />

+ 207 - 0
pages/category1/category.wxss

@@ -0,0 +1,207 @@
+/* pages/category/category.wxss */
+
+page {
+  height: 100%;
+}
+
+.container {
+  display: flex;
+  flex-direction: row;
+  height: 100%;
+}
+
+.main {
+  position: fixed;
+  display: flex;
+  overflow: hidden;
+  margin-top: 78rpx;
+  height: calc(100% - 100rpx);
+}
+
+/* 搜索栏 */
+.top-search-input {
+  margin-left: 20rpx;
+  margin-top: -10rpx;
+  display: flex;
+  align-items: center;
+  width: 500rpx;
+  border: 2rpx solid #04358D;
+  border-radius: 40rpx;
+  height: 60rpx;
+}
+
+.top-search-swiper {
+  width: 440rpx;
+  height: 60rpx;
+  line-height: 60rpx;
+  margin-top: 0;
+  font-weight: normal;
+  font-size: 24rpx;
+  color: #AAAAAA;
+  margin-left: 28rpx;
+}
+
+.top-search-line {
+  color: #DEDEDE;
+  margin-right: 16rpx;
+}
+
+.top-search-text {
+  width: 100rpx;
+  font-weight: bold;
+  font-size: 28rpx;
+  color: #04358D;
+}
+
+/* 左侧菜单栏 */
+
+.leftmenu {
+  width: 200rpx;
+  height: 100%;
+  box-sizing: border-box;
+  background-color: #f5f6f7;
+  overflow: scroll;
+  z-index: 2;
+}
+scroll-view ::-webkit-scrollbar {
+  width: 0;
+  height: 0;
+  color: transparent;
+  display: none;
+}
+.menu-item {
+  line-height: 94rpx;
+  height: 94rpx;
+  text-align: center;
+  border-bottom: 2rpx silid #e3e3e3;
+  position: relative;
+  color: #666;
+  font-size: 24rpx;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+
+.menu-item.active {
+  color: #333;
+  font-size: 28rpx;
+  font-weight: bold;
+  position: relative;
+  background: #fff;
+}
+
+.menu-item.active:before {
+  position: absolute;
+  left: 0;
+  content: "";
+  width: 8rpx;
+  height: 60rpx;
+  top: 20rpx;
+  background: #04358D;
+}
+
+.menu-item text.tips-num {
+  position: absolute;
+  top: 20rpx;
+  right: 15rpx;
+  border-radius: 15rpx;
+  width: 30rpx;
+  height: 30rpx;
+  background: red;
+  color: #fff;
+  font-size: 25rpx;
+  line-height: 30rpx;
+}
+
+/* 右侧商品栏 */
+
+.rightcontent {
+  width: 550rpx;
+  height: 100%;
+  box-sizing: border-box;
+  background-color: #fff;
+  z-index: 1;
+}
+
+.rightcontent .adver-map {
+  width: auto;
+  box-sizing: border-box;
+  overflow: hidden;
+  position: relative;
+  margin: 30rpx 20rpx 0;
+}
+
+.rightcontent .adver-map .item-a {
+  display: block;
+  font-size: 0;
+  width: 100%;
+  height: 160rpx;
+}
+
+.rightcontent .adver-map .item-a image {
+  width: 100%;
+  height: 100%;
+  border-radius: 16rpx;
+}
+
+/* .rightcontent .sub-category {
+  display: flex;
+  flex-wrap: wrap;
+} */
+
+/* 二级分类 */
+.sub-category-con {
+  margin: 20rpx;
+}
+
+.sub-cate-title {
+  display: flex;
+  align-items: center;
+  font-weight: 800;
+}
+
+.view-all {
+  color: #999;
+  font-weight: normal;
+  font-size: 24rpx;
+}
+
+.sub-cate-text {
+  flex: 1;
+}
+
+.th-cate-con {
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.sub-category-item {
+  width: 33.33%;
+  display: flex;
+  flex-direction: column;
+  padding: 30rpx;
+  box-sizing: border-box;
+  align-items: center;
+}
+
+.sub-category-item .sub-category-item-pic {
+  width: 120rpx !important;
+  height: 120rpx !important;
+  border-radius: 16rpx;
+}
+
+.sub-category-item text {
+  margin-top: 10rpx;
+  font-size: 25rpx;
+}
+.not-category-data{
+  padding: 20rpx;
+}
+.not-data-list{
+  width: 100%;
+}
+.reset-localization{
+  text-align: center;
+  font-size: 26rpx;
+  color: #AAAAAA;
+}

+ 1 - 1
project.private.config.json

@@ -459,5 +459,5 @@
       ]
     }
   },
-  "libVersion": "3.7.3"
+  "libVersion": "3.8.7"
 }

+ 1 - 1
utils/http.js

@@ -218,7 +218,7 @@ function getCartCount() {
     callBack: function (res) {
       if (res > 0) {
         wx.setTabBarBadge({
-          index: 1,
+          index: 2,
           text: res + "",
         })
         var app = getApp();