12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067 |
- <!-- 商品分类列表 -->
- <template>
- <s-layout title="分类" :bgStyle="{ color: '#fff' }">
- <view class="s-category">
- <view class="three-level-wrap ss-flex ss-col-top" :style="[{ height: pageHeight + 'px' }]">
- <!-- 商品分类(左) -->
- <scroll-view class="side-menu-wrap" scroll-y :style="[{ height: pageHeight + 'px' }]">
- <view class="menu-item ss-flex" v-for="(item, index) in state.categoryList" :key="item.id"
- :class="[{ 'menu-item-active': index === state.activeMenu }]" @tap="onMenu(index)">
- <view class="menu-title ss-line-1">
- {{ item.name }}
- </view>
- </view>
- </scroll-view>
- <!-- 商品分类(右) -->
- <scroll-view scroll-with-animation :scroll-y="goodsBoxScroll" class="right" @scroll="asideScroll"
- :scroll-top="tabScrollTop">
- <view class="goodsListBox">
- <view class="category" v-for="item in state.categoryList" :key="item.id" :id="'goodsBox'+item.id">
- <view class="s-item">{{item.name}}</view>
- <view class="list">
- <view class="box" v-for="(rowData,i) in item.children" :key="rowData.id" >
- <!-- -->
- <!-- 商品列表 -->
- <!-- <m-store-pro @touchOnGoods="touchOnGoods" :rowData="box"></m-store-pro>
- -->
- <!-- 商品列表 -->
- <view class="m-store-item" v-if="item.id == rowData.parentId">
- <view class="m-img" @click="hrefGoodsInfo(rowData.id)">
- <image style="width: 100%;height: 100%;" :src="rowData.image"
- alt="Product Image"></image>
- </view>
- <view class="m-text">
- <view class="m-title" @click="hrefGoodsInfo(rowData.id)">
- {{rowData.name}}
- </view>
- <view class="m-descripe">
- {{rowData.descripe}}
- </view>
- <template v-if="rowData.form">
- <view class="m-price-box">
- <view class="symbol">¥</view>
- <view class="m-price">{{rowData.form_child[0].price}}</view>
- <view class="m-old-price" v-if="rowData.form_child[0].oldprice">
- <span>¥{{rowData.form_child[0].oldprice}}</span>
- </view>
- </view>
- </template>
- <template v-else>
- <view class="m-price-box">
- <view class="symbol">¥</view>
- <view class="m-price">{{rowData.price}}</view>
- <view class="m-old-price" v-if="rowData.oldprice">
- <span>¥{{rowData.oldprice}}</span>
- </view>
- </view>
- </template>
- <view class="m-distance">
- <template v-if="rowData.form">
- <view class="miniBtn" @click="showForm(rowData)">
- <span>选规格</span>
- <!-- #ifdef APP-PLUS || H5 -->
- <view class="num" v-if="getCartGoodsNum(rowData)">
- {{getCartGoodsNum(rowData)}}
- </view>
- <!-- #endif -->
- </view>
- </template>
- <template v-else>
- <view :class="'addEle_' + i" class="jumpPosition"></view>
- <hx-number-box @change="addGoodsChange" :value="rowData.number"
- :rowData="rowData" :clickTime="animaTime"
- @addChange="touchOnAddGoods('.addEle_' + i,rowData)"></hx-number-box>
- </template>
- <!-- <image @click="touchOnAddGoods('.addEle_' + i,rowData)" style="width:20px;height: 20px;" src="../../static/img/icon/shop_icon_buy.png" mode="aspectFit"></image>
- -->
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- </scroll-view> -->
- <!-- <image v-if="state.categoryList[state.activeMenu].picUrl" class="banner-img"
- :src="sheep.$url.cdn(state.categoryList[state.activeMenu].picUrl)" mode="widthFix" />
- <first-one v-if="state.style === 'first_one'" :pagination="state.pagination" />
- <first-two v-if="state.style === 'first_two'" :pagination="state.pagination" />
- <second-one v-if="state.style === 'second_one'" :data="state.categoryList"
- :activeMenu="state.activeMenu" /> -->
- <uni-load-more v-if="
- (state.style === 'first_one' || state.style === 'first_two') &&
- state.pagination.total > 0
- " :status="state.loadStatus" :content-text="{
- contentdown: '点击查看更多',
- }" @tap="loadMore" />
- </scroll-view>
- </view>
- </view>
-
-
-
- <!-- 下方购物车 -->
- <view class="foot" @touchmove.stop.prevent="mpClear" :style="{height: 50}" v-if="state.showFoot">
- <view class="zz" @click="hideShoppingCar"></view>
- <view class="btn-box">
- <view class="btn-box-left" @click="contact">
- <view class="imgBox">
- <image src="../../static/store/contact.png" mode=""></image>
- </view>
- <text>联系商家</text>
- </view>
- <view class="btn-box-line"></view>
- <view class="btn-box-center" @click="showShoppingCar">
- <view class="cart" :animation="cartAnimationData">
- <view class="tag cartNum" v-if="goodsTotalNumber>0">{{goodsTotalNumber}}</view>
- <image :src="goodsTotalNumber ? '/static/store/cart.png' : '/static/store/cart2.png'" mode=""></image>
- </view>
- <view class="priceBox">
- <view class="hx-txt-18 hx-color-white" v-if="goodsTotalPrice>0">
- ¥{{goodsTotalPrice}}
- </view>
- <view class="hx-txt-10 hx-color-gray">
- 另需配送费¥{{shippingDees}}
- </view>
- </view>
- </view>
- <view class="btn-box-right">
- <view class="jiesuan" v-if="goodsTotalPrice>0 && goodsTotalPrice >= startingPrice" @click="jiesuan">
- 去结算
- </view>
- <view class="pscj hx-txt-10 hx-color-gray" v-else>
- <text v-if="startingPrice>0">差¥{{-(goodsTotalPrice-startingPrice)}}起送</text>
- </view>
-
- </view>
- </view>
- <view class="cart-box" :style="{display: showCar ? 'flex' : 'none'}">
- <view class="box-container rebate-box" v-if="showDiscount">
- <text>已享100减25</text>
- </view>
- <view class="box-container operating-box">
- <view class="operating-box_right">
-
- </view>
- <view class="operating-box_left clear" @click="clearShoppingCart">
- <i class="hxicon-delete"></i>
- <text>清空购物车</text>
- </view>
- </view>
- <view class=" goods-box">
- <view class="" style="flex: 1;">
- <scroll-view scroll-y="true" class="goods-list-scroll" :scroll-top="carGoodsScrollTop">
- <view class="goods-list">
- <view class="box" v-for="(rowData,i) in shoppCart" :key="rowData.id" >
- <!-- v-if="rowData.number>0" -->
-
- <view class="m-store-item">
- <view class="m-img">
- <image style="width: 100%;height: 100%;" :src="rowData.img" mode="aspectFit"></image>
- </view>
- <view class="m-text">
- <view class="m-title">
- {{rowData.name}}
- </view>
- <view class="m-descripe">
-
- {{rowData.current_form ? rowData.form.name + ":" + rowData.current_form.name : rowData.descripe}}
- </view>
- <view class="m-price-box" >
- <view class="symbol">¥</view>
- <view class="m-price">{{rowData.price}}</view>
- <view class="m-old-price" v-if="rowData.oldprice">
- <text>¥{{rowData.oldprice}}</text>
- </view>
- </view>
- <view class="m-distance" >
- <view :class="'addEle2_' + rowData.id" class="jumpPosition">
- </view>
- <hx-number-box @change="addGoodsChange" :value="rowData.number" :rowData="rowData" :clickTime="animaTime" @addChange="touchOnAddGoods('.addEle2_' + rowData.id,rowData)"></hx-number-box>
-
- </view>
- </view>
-
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
-
- </view>
- </view>
-
- </view>
-
- </s-layout>
- </template>
- <script setup>
- import secondOne from './components/second-one.vue';
- import firstOne from './components/first-one.vue';
- import firstTwo from './components/first-two.vue';
- import hxNumberBox from './components/uni-number-box.vue';
- import sheep from '@/sheep';
- import CategoryApi from '@/sheep/api/product/category';
- import SpuApi from '@/sheep/api/product/spu';
- import {
- onLoad,
- onLaunch,
- onReachBottom
- } from '@dcloudio/uni-app';
- import {
- computed,
- reactive,
- onMounted
- } from 'vue';
- import _ from 'lodash';
- import {
- handleTree
- } from '@/sheep/util';
-
- const state = reactive({
- style: 'second_one', // first_one(一级 - 样式一), first_two(二级 - 样式二), second_one(二级)
- categoryList: [], // 商品分类树
- goodsList:[],//分类下的商品
- activeMenu: 0, // 选中的一级菜单,在 categoryList 的下标
- pagination: {
- // 商品分页
- list: [], // 商品列表
- total: [], // 商品总数
- pageNo: 1,
- pageSize: 6,
- },
- loadStatus: '',
- //显示购物车
- showFoot:true,
- });
- // const showTabbar = ref(true);
- const {
- safeArea
- } = sheep.$platform.device;
- const pageHeight = computed(() => safeArea.height - 44 - 50);
- onMounted(() => {
- // 当组件挂载完成后隐藏底部TabBar
- uni.hideTabBar({
- animation: false, // 是否需要动画效果,默认为 false
- success: function () {
- console.log('TabBar已隐藏');
- },
- fail: function (err) {
- console.error('隐藏TabBar失败:', err);
- }
- });
- });
- // 加载商品分类
- async function getList() {
- const {
- code,
- data
- } = await CategoryApi.getCategoryList();
- if (code !== 0) {
- return;
- }
- state.categoryList = handleTree(data);
- console.log(state.categoryList,'state.categoryListstate.categoryList')
- // state.categoryList = [
- // {id: 1,name: '烧烤'},
- // {id: 2,name: '生鲜'},
- // {id: 3,name: '绿蔬'},
- // {id: 4,name: '肉类'},
- // {id: 5,name: '川味'},
- // {id: 6,name: '粤菜'},
- // {id: 7,name: '湘菜'},
- // {id: 8,name: '西餐'},
- // {id: 9,name: '饮料'},
- // {id: 10,name: '糕点'},
- // {id: 11,name: '凉菜'},
- // {id: 12,name: '火锅'},
- // {id: 13,name: '干锅'}
- // ];
-
- // state.goodsList = [{
- // id: 1,
- // type_id:1,
- // name:'白果王水果沙拉',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img:'//imgs.1op.cn/i/hxshop/goods/14.jpg',
- // price:"",
- // oldprice:"",
- // //规格
- // form: {id:1,name:"尺寸"},
- // form_child:[
- // {id:81,pid:1,name:"8寸500g", price:"46", oldprice:"100", select:true},
- // {id:82,pid:1,name:"10寸600g", price:"97", oldprice:"100",select:false},
- // {id:83,pid:1,name:"12寸800g", price:"135", oldprice:"100",select:false},
- // {id:84,pid:1,name:"四川麻辣", price:"12", oldprice:"100",select:false},
- // {id:85,pid:1,name:"香辣", price:"20", oldprice:"100",select:false},
- // {id:86,pid:1,name:"卤香", price:"90", oldprice:"100",select:false},
- // {id:87,pid:1,name:"鲜甜广味", price:"80", oldprice:"100",select:false},
- // {id:88,pid:1,name:"镇店茴香味", price:"100", oldprice:"100",select:false}
- // ]
- // },
- // {
- // id: 2,
- // type_id:2,
- // name:'精品烤山药',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/12.jpg',
- // price:"",
- // oldprice:"",
- // //规格
- // form: {id:1,name:"尺寸"},
- // form_child:[
- // {id:81,pid:1,name:"8寸500g", price:"78", oldprice:"100", select:true},
- // {id:82,pid:1,name:"10寸600g", price:"97", oldprice:"100",select:false},
- // {id:83,pid:1,name:"12寸800g", price:"135", oldprice:"100",select:false},
- // {id:84,pid:1,name:"四川麻辣", price:"12", oldprice:"100",select:false},
- // {id:85,pid:1,name:"香辣", price:"20", oldprice:"100",select:false},
- // {id:86,pid:1,name:"卤香", price:"90", oldprice:"100",select:false},
- // {id:87,pid:1,name:"鲜甜广味", price:"80", oldprice:"100",select:false},
- // {id:88,pid:1,name:"镇店茴香味", price:"100", oldprice:"100",select:false}
- // ]
- // },
- // {
- // id: 3,
- // type_id:2,
- // name:'川味毛血旺',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/11.jpg',
- // price:"4",
- // oldprice:"",
-
- // },
- // {
- // id: 4,
- // type_id:3,
- // name:'吐鲁番烤全羊',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/10.jpg',
- // price:"4",
- // oldprice:""
- // },
- // {
- // id: 5,
- // type_id:3,
- // name:'红烧肉',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/9.jpg',
- // price:"4",
- // oldprice:""
- // },
- // {
- // id: 6,
- // type_id:4,
- // name:'新疆特色辣子鸡',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/8.jpg',
- // price:"4",
- // oldprice:""
- // },
- // {
- // id: 106,
- // type_id:4,
- // name:'新疆特色羊排',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/9.jpg',
- // price:"4",
- // oldprice:""
- // },
- // {
- // id: 7,
- // type_id:5,
- // name:'绝味海鲜拼盘',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/7.jpg',
- // price:"4",
- // oldprice:""
- // },
- // {
- // id: 8,
- // type_id:5,
- // name:'金色香糯大粽子',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/6.jpg',
- // price:"4",
- // oldprice:""
- // },
- // {
- // id: 9,
- // type_id:5,
- // name:'马梓林香香鸡',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/5.jpg',
- // price:"4",
- // oldprice:""
- // },
- // {
- // id: 10,
- // type_id:6,
- // name:'草莓味莫普氏蛋糕',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/4.jpg',
- // price:"4",
- // oldprice:""
- // },
- // {
- // id: 23,
- // type_id:6,
- // name:'川味毛血旺',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/11.jpg',
- // price:"4",
- // oldprice:"",
-
- // },
- // {
- // id: 24,
- // type_id:6,
- // name:'吐鲁番烤全羊',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/10.jpg',
- // price:"4",
- // oldprice:""
- // },
- // {
- // id: 25,
- // type_id:7,
- // name:'红烧肉',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/9.jpg',
- // price:"4",
- // oldprice:""
- // },
- // {
- // id: 26,
- // type_id:7,
- // name:'新疆特色辣子鸡',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/8.jpg',
- // price:"4",
- // oldprice:""
- // },
- // {
- // id: 27,
- // type_id:7,
- // name:'绝味海鲜拼盘',
- // descripe:"脆糯营养,口感好,健康绿色",
- // img: '//imgs.1op.cn/i/hxshop/goods/7.jpg',
- // price:"4",
- // oldprice:""
- // },
- // {id: 28,type_id:8,name:'金色香糯大粽子',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/6.jpg',price:"4",oldprice:""},
- // {id: 29,type_id:8,name:'马梓林香香鸡',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/5.jpg',price:"4",oldprice:""},
- // {id: 30,type_id:8,name:'草莓味莫普氏蛋糕',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/4.jpg',price:"4",oldprice:""},
- // {id: 31,type_id:9,name:'金色香糯大粽子',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/16.jpg',price:"4",oldprice:""},
- // {id: 32,type_id:9,name:'马梓林香香鸡',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/17.jpg',price:"4",oldprice:""},
- // {id: 33,type_id:9,name:'草莓味莫普氏蛋糕',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/15.jpg',price:"4",oldprice:""},
- // {id: 46,type_id:8,name:'金色香糯大粽子',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/6.jpg',price:"4",oldprice:""},
- // {id: 34,type_id:10,name:'马梓林香香鸡',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/14.jpg',price:"4",oldprice:""},
- // {id: 35,type_id:10,name:'草莓味莫普氏蛋糕',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/13.jpg',price:"4",oldprice:""},
- // {id: 45,type_id:8,name:'金色香糯大粽子',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/6.jpg',price:"4",oldprice:""},
- // {id: 36,type_id:10,name:'马梓林香香鸡',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/12.jpg',price:"4",oldprice:""},
- // {id: 37,type_id:10,name:'草莓味莫普氏蛋糕',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/11.jpg',price:"4",oldprice:""},
- // {id: 38,type_id:11,name:'草莓味莫普氏蛋糕',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/10.jpg',price:"4",oldprice:""},
- // {id: 44,type_id:8,name:'金色香糯大粽子',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/6.jpg',price:"4",oldprice:""},
- // {id: 39,type_id:12,name:'马梓林香香鸡',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/9.jpg',price:"4",oldprice:""},
- // {id: 40,type_id:12,name:'草莓味莫普氏蛋糕',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/8.jpg',price:"4",oldprice:""},
- // {id: 13,type_id:13,name:'金色香糯大粽子',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/6.jpg',price:"4",oldprice:""},
- // {id: 41,type_id:12,name:'马梓林香香鸡',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/7.jpg',price:"4",oldprice:""},
- // {id: 42,type_id:13,name:'草莓味莫普氏蛋糕',descripe:"脆糯营养,口感好,健康绿色",img: '//imgs.1op.cn/i/hxshop/goods/1.jpg',price:"4",oldprice:""}
- // ];
-
-
- }
- // 选中菜单
- const onMenu = (val) => {
- state.activeMenu = val;
- if (state.style === 'first_one' || state.style === 'first_two') {
- state.pagination.pageNo = 1;
- state.pagination.list = [];
- state.pagination.total = 0;
- getGoodsList();
- }
- };
- // 加载商品列表
- async function getGoodsList() {
- // 加载列表
- state.loadStatus = 'loading';
- const res = await SpuApi.getSpuPage({
- categoryId: state.categoryList[state.activeMenu].id,
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize,
- });
- if (res.code !== 0) {
- return;
- }
- // 合并列表
- state.pagination.list = _.concat(state.pagination.list, res.data.list);
- state.pagination.total = res.data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
- }
- // 加载更多商品
- function loadMore() {
- if (state.loadStatus === 'noMore') {
- return;
- }
- state.pagination.pageNo++;
- getGoodsList();
- }
- onLoad(async () => {
- await getList();
- // 如果是 first 风格,需要加载商品分页
- if (state.style === 'first_one' || state.style === 'first_two') {
- onMenu(0);
- }
- });
- onLaunch(() => {
- console.log('Component is shown');
- // 隐藏原生tabBar
- uni.hideTabBar();
- });
- onReachBottom(() => {
- loadMore();
- });
- </script>
- <style lang="scss" scoped>
- //主题颜色
- $hx-theme-color: #FFC107;
- $hx-theme-color-light: #FFEB3B;
- .s-category {
- :deep() {
- .side-menu-wrap {
- width: 200rpx;
- height: 100%;
- padding-left: 12rpx;
- background-color: #f6f6f6;
- .menu-item {
- width: 100%;
- height: 88rpx;
- position: relative;
- transition: all linear 0.2s;
- .menu-title {
- line-height: 32rpx;
- font-size: 30rpx;
- font-weight: 400;
- color: #333;
- margin-left: 28rpx;
- position: relative;
- z-index: 0;
- &::before {
- content: '';
- width: 64rpx;
- height: 12rpx;
- background: linear-gradient(90deg,
- var(--ui-BG-Main-gradient),
- var(--ui-BG-Main-light)) !important;
- position: absolute;
- left: -64rpx;
- bottom: 0;
- z-index: -1;
- transition: all linear 0.2s;
- }
- }
- &.menu-item-active {
- background-color: #fff;
- border-radius: 20rpx 0 0 20rpx;
- &::before {
- content: '';
- position: absolute;
- right: 0;
- bottom: -20rpx;
- width: 20rpx;
- height: 20rpx;
- background: radial-gradient(circle at 0 100%, transparent 20rpx, #fff 0);
- }
- &::after {
- content: '';
- position: absolute;
- top: -20rpx;
- right: 0;
- width: 20rpx;
- height: 20rpx;
- background: radial-gradient(circle at 0% 0%, transparent 20rpx, #fff 0);
- }
- .menu-title {
- font-weight: 600;
- &::before {
- left: 0;
- }
- }
- }
- }
- }
- .right {
- width: 76%;
- left: 24%;
- .goodsListBox {
- padding-bottom: 100px;
- .category {
- // width: 94%;
- padding: 0 15px 10px 15px;
- .s-item {
- height: 45px;
- line-height: 45px;
- font-size: 16px;
- background: #ffffff;
- color: #555555;
- position: sticky;
- top: 0;
- z-index: 18;
- }
- .list:last-child {
- margin-bottom: 0;
- }
- .list {
- margin-bottom: 20px;
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- .box:first-child {
- .m-store-item {
- margin-top: 0;
- }
- }
- .box {
- width: 100%;
- .m-store-item {
- display: flex;
- flex-direction: row;
- width: 100%;
- justify-content: space-between;
- align-items: flex-end;
- margin-top: 15px;
- margin-bottom: 15px;
- .m-img {
- flex: 0 0 85px;
- height: 85px;
- background: #eee;
- border-radius: 4px;
- }
- .m-text {
- flex: 1;
- position: relative;
- height: 85px;
- padding: 0 6px;
- display: flex;
- align-content: space-between;
- flex-direction: column;
- .m-title {
- font-size: 16px;
- color: #555555;
- height: 21px;
- font-weight: bold;
- }
- .m-descripe {
- font-size: 12px;
- color: #999999;
- margin-top: 5px;
- height: 35px;
- }
- .m-price-box {
- height: 24px;
- font-weight: bold;
- display: flex;
- flex-direction: row;
- align-items: flex-end;
- .symbol {
- color: #ff582b;
- font-size: 12px;
- }
- .m-price {
- position: relative;
- top: 2px;
- font-size: 18px;
- color: #ff582b;
- }
- .m-old-price {
- margin-left: 3px;
- display: flex;
- flex-direction: row;
- font-size: 10px;
- color: #999999;
- margin-top: 5upx;
- text-decoration: line-through;
- font-weight: normal;
- }
- }
- .m-distance {
- position: absolute;
- right: 0;
- bottom: -4px;
- z-index: 16;
- color: #b2b2b2;
- font-size: 20upx;
- text-align: right;
- .jumpPosition {
- position: absolute;
- bottom: 23px;
- right: 0;
- z-index: 2;
- width: 28px;
- height: 28px;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- .goods-list-box {
- background-color: #fff;
- width: calc(100vw - 100px);
- padding: 10px;
- }
- .banner-img {
- width: calc(100vw - 130px);
- border-radius: 5px;
- margin-bottom: 20rpx;
- }
- }
- }
- .foot{
- position: fixed;
- display: flex;
- z-index: 999;
-
- justify-content:center;
- align-items : center;
- bottom: 0;
- height: 100%;
- width: 100%;
-
- /*width: calc(100% - 32px);*/
- .btn-box{
- position:absolute;
- display: flex;
- bottom: 15px;
- justify-content:center;
- align-items : center;
- margin:0;
- height: 50px;
- width: calc(100% - 32px);
- z-index: 9;
- &-left{
- background: #222222;
- border-top-left-radius:50px;
- border-top-right-radius:9px;
- border-bottom-left-radius:50px;
- border-bottom-right-radius:9px;
- padding-left: 6upx;
- display: flex;
- flex-direction:column;
- justify-content:center;
- align-self: center;
- width: 70px;
- height: 100%;
- color: #f6d200;
- text-align: center;
- .imgBox{
- display: flex;
- text-align: center;
- justify-content:center;
- image{
- width: 20px;
- height: 20px;
- }
- }
- text{
- font-size: 20upx;
- }
- }
- &-line{
- background: #ffffff;
- width: 2px;
- height: 100%;
- }
- &-center{
- height: 100%;
- flex: auto;
- display: flex;
- justify-content:flex-start;
- align-self: center;
- align-items: center;
- background: #222222;
- border-top-left-radius:8upx;
- border-bottom-left-radius:8upx;
- padding-left: 10upx;
- .cart{
- position: relative;
- width: 36px;
- height: 36px;
- image{
- width: 100%;
- height: 100%;
- }
- .tag{
- position: absolute;
- right: 12upx;
- top: 16upx;
- height: 18px;
- width: 18px;
- background-color: #ff4000;
- color: #ffffff;
- border-radius: 50%;
- z-index: 1;
- font-size: 10px;
- text-align: center;
- line-height: 18px;
- }
- }
- .priceBox{
- flex: auto;
- }
-
- }
- &-right{
- width: 70px;
- height: 100%;
- position: relative;
- display: flex;
- justify-content:flex-start;
- align-self: center;
- align-items: center;
-
-
- .pscj{
- width: 100%;
- height: 100%;
- border-top-right-radius:100upx;
- border-bottom-right-radius:100upx;
- background: #222222;
- text-align: center;
- display: flex;
- justify-content:center;
- align-self: center;
- align-items: center;
- }
- .jiesuan{
- width: 100%;
- height: 100%;
- font-size: 28upx;
- border-top-right-radius:100upx;
- border-bottom-right-radius:100upx;
- text-align: center;
- display: flex;
- justify-content:center;
- align-self: center;
- align-items: center;
- background: linear-gradient(45deg, $hx-theme-color-light, $hx-theme-color);
- font-weight: bold;
- color: #222222;
- }
- }
- }
- .zz{
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- // background-color: rgba(0,0,0,.7);
- z-index: 1;
- }
- .cart-box{
- display: flex;
- justify-content: flex-start;
- flex-flow: column;
- background: #ffffff;
- position: absolute;
- bottom: 0;
- z-index: 2;
- max-height: 66%;
-
- padding-bottom: 62px;
- border-top-left-radius: 16px;
- border-top-right-radius: 16px;
- overflow: hidden;
- width: 100%;
- .rebate-box{
- height: 30px;
- background: #FFC107;
- color: #FF9900;
- text-align: center;
- line-height: 30px;
- font-size: 14px;
- }
- .box-container{
- box-sizing: border-box;
- padding:0 16px;
- }
- .operating-box{
- font-size: 12px;
- line-height: 40px;
- height: 40px;
- border-bottom: 1px solid #f6f6f6;
- color: #666666;
- display: flex;
- flex-direction: row;
- &_right{
- flex: 1;
- }
- &_left{
- display: flex;
- flex-direction: row;
- }
-
- }
- .goods-box{
- height: 100%;
- overflow: hidden;
- flex: 1;
- display: flex;
- .goods-list-scroll{
- height: 100%;
-
- .goods-list{
-
- width: 100%;
- display: flex;
- flex-wrap: wrap;
-
- .box{
- width: 100%;
- border-bottom: 1px solid #f6f6f6;
- box-sizing: border-box;
- padding: 0 16px;
- .m-store-item{
- display: flex;
- flex-direction: row;
- width: 100%;
- justify-content: space-between;
- align-items: flex-end;
- padding-top: 15px;
- padding-bottom: 15px;
- .m-img{
- flex: 0 0 85px;
- height: 85px;
- background: #eee;
- border-radius: 4px;
- }
- .m-text{
- flex: 1;
- position: relative;
- height: 85px;
- padding: 0 6px;
- display: flex;
- align-content: space-between;
- flex-direction: column;
- .m-title{
- font-size: 16px;
- color:#555555;
- height: 21px;
- font-weight: bold;
- }
- .m-descripe{
- font-size: 12px;
- color:#999999;
- margin-top: 5px;
- height: 35px;
- }
- .m-price-box{
- height: 24px;
- font-weight: bold;
- display: flex;
- flex-direction: row;
- align-items: flex-end;
- .symbol{
- color:#ff582b;
- font-size: 12px;
- }
- .m-price{
- position: relative;
- top: 2px;
- font-size: 18px;
- color:#ff582b;
- }
- .m-old-price{
- margin-left: 3px;
- display: flex;
- flex-direction: row;
- font-size: 10px;
- color:#999999;
- margin-top: 5upx;
- text-decoration: line-through;
- font-weight: normal;
- }
- }
- .m-distance{
- position: absolute;
- right: 0;
- bottom: -4px;
- z-index: 16;
- color:#b2b2b2;
- font-size: 20upx;
- text-align: right;
- .jumpPosition{
- position: absolute;
- bottom: 23px;
- right: 0;
- z-index: 2;
- width: 28px;
- height: 28px;
- }
- }
-
- }
-
- }
- }
- }
- }
- }
- }
- }
-
-
- </style>
|