|
@@ -0,0 +1,246 @@
|
|
|
+<template>
|
|
|
+ <mobile-frame>
|
|
|
+ <view class="main">
|
|
|
+ <view class="one">
|
|
|
+ <input type="text" placeholder="寻找您喜爱的商品" @tap="toCommon('pagesHome/market/search')" placeholder-class="placss">
|
|
|
+ </view>
|
|
|
+ <view class="two">
|
|
|
+ <view class="two_1">
|
|
|
+ <scroll-view scroll-y="true" class="scroll-view">
|
|
|
+ <view class="list-scroll-view">
|
|
|
+ <view class="list" :class="[active==index?'listActive':'']" v-for="(item,index) in typeList" :key="index" @tap="toChange(index,item)">
|
|
|
+ <text>{{item.name}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ <view class="two_2">
|
|
|
+ <scroll-view scroll-y="true" class="scroll-view">
|
|
|
+ <view class="list-scroll-view">
|
|
|
+ <view class="list" v-for="(item,index) in list" :key="index">
|
|
|
+ <view class="title">
|
|
|
+ {{item.name}}
|
|
|
+ </view>
|
|
|
+ <view class="market">
|
|
|
+ <view class="marketList" v-for="(tag,indexs) in item.marketList" :key="indexs">
|
|
|
+ <image class="image" :src="tag.url" mode=""></image>
|
|
|
+ <view class="name">
|
|
|
+ {{tag.name}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </mobile-frame>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ name: 'sort',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ active: '0',
|
|
|
+ typeList: [ //商品分类
|
|
|
+ {
|
|
|
+ name: '休闲食品'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '进口食品'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '粮油调味'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '酒饮冲调'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '时令水果'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '品质生鲜'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '居家用品'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '个护清洁'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '3C产品'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '母婴玩具'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '服饰配件'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '礼卡专区'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '植物饮食'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ list: [ //
|
|
|
+ {
|
|
|
+ name: '商品一',
|
|
|
+ marketList: [ //
|
|
|
+ {
|
|
|
+ url: require('@/static/test.png'),
|
|
|
+ name: '核桃'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: require('@/static/test.png'),
|
|
|
+ name: '核桃'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: require('@/static/test.png'),
|
|
|
+ name: '核桃'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: require('@/static/test.png'),
|
|
|
+ name: '核桃2'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '商品二',
|
|
|
+ marketList: [ //
|
|
|
+ {
|
|
|
+ url: require('@/static/test.png'),
|
|
|
+ name: '核桃'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: require('@/static/test.png'),
|
|
|
+ name: '核桃2'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onShow: function() {},
|
|
|
+ methods: {
|
|
|
+ toChange(index, e) {
|
|
|
+ const that = this;
|
|
|
+ that.$set(that, `active`, index)
|
|
|
+ },
|
|
|
+ // 公共跳转
|
|
|
+ toCommon(e) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/${e}`
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .main {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+
|
|
|
+ .one {
|
|
|
+ border-bottom: 1px solid var(--f85Color);
|
|
|
+ padding: 2vw;
|
|
|
+
|
|
|
+ input {
|
|
|
+ padding: 2vw;
|
|
|
+ background-color: var(--f1Color);
|
|
|
+ font-size: var(--font14Size);
|
|
|
+ border-radius: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .two {
|
|
|
+ height: 91vh;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+
|
|
|
+ .two_1 {
|
|
|
+ position: relative;
|
|
|
+ width: 25vw;
|
|
|
+ background-color: #fafafa;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ .list {
|
|
|
+ text-align: center;
|
|
|
+ padding: 2.5vw 0;
|
|
|
+ border-bottom: 1px solid var(--f1Color);
|
|
|
+
|
|
|
+ text {
|
|
|
+ font-size: var(--font14Size);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .listActive {
|
|
|
+ background-color: var(--fffColor);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .two_2 {
|
|
|
+ padding: 2vw;
|
|
|
+ flex-grow: 1;
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ .list {
|
|
|
+ margin: 0 0 2vw 0;
|
|
|
+ padding: 2vw;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ font-size: var(--font16Size);
|
|
|
+ margin: 0 0 2vw 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .market {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: wrap;
|
|
|
+
|
|
|
+ .marketList {
|
|
|
+ text-align: center;
|
|
|
+ margin: 0 2vw 2vw 0;
|
|
|
+ width: 22vw;
|
|
|
+
|
|
|
+ .image {
|
|
|
+ width: 100%;
|
|
|
+ height: 15vw;
|
|
|
+ }
|
|
|
+
|
|
|
+ .name {
|
|
|
+ font-size: var(--font14Size);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .marketList:nth-child(3n) {
|
|
|
+ margin: 0 0 2vw 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .scroll-view {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+
|
|
|
+ .list-scroll-view {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|