class.vue
4.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<template>
<view class="conetnt">
<view class="inputBox">
<input type="text" value="搜索" @input="bindInput" />
</view>
<view class="selectBox">
<view :class="selectIndex==0?'selectItem selectItemActive':'selectItem'" @click="selectTopClick(0)">
全部
</view>
<view :class="selectIndex==1?'selectItem selectItemActive':'selectItem'" @click="selectTopClick(1)">
价格
<image src="../../static/ic_17@2x.png" mode=""></image>
</view>
<view :class="selectIndex==2?'selectItem selectItemActive':'selectItem'" @click="selectTopClick(2)">
销量
<image src="../../static/ic_17@2x.png" mode=""></image>
</view>
</view>
<!-- 分类 -->
<view class="classBox">
<view class="leftBox">
<view :class="leftIndex==index?'leftItem leftActive':'leftItem'" v-for="(item,index) in leftList"
:key="idnex" @click="leftClick(index)">
{{item.title}}
</view>
</view>
<view class="rightBox">
<view :class="index==rightList.length-1?'rightItem lastItem':'rightItem'"
v-for="(item,index) in rightList" :key="index">
<view class="itemImg">
<image :src="item.image" mode=""></image>
</view>
<view class="itemRight">
<view class="goodName">
{{item.title}}
</view>
<view class="goodDeatil">
{{item.detail}}
</view>
<view class="goodPrice">
<view class="price">
<text style="font-size: 20rpx;">¥</text>
{{item.price}}
</view>
<view class="cartImg" @click="addCart">
<image src="../../static/ic_18@2x.png" mode=""></image>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 购物车弹框 -->
<view class="cartBox" v-if="cartShow">
<view class="cartGoodBox">
<view class="cartGoodInner">
<view class="cartImg">
<image src="../../static/ic_10@2x.png" mode="" class="cartImage"></image>
</view>
<view class="cartName">
科麦斯无油静音空吗压力麦斯无油静音空吗压
<view class="cartPrice">
<text style="font-size: 20rpx;color:#FE0E1F;margin-right: -2rpx;">¥</text>50
</view>
</view>
</view>
<view class="specificationBox" v-for="(item,index) in typeList" :key="index">
<view class="" style="font-size: 28rpx;">
{{item.title}}
</view>
<view class="" style="display: flex;flex-wrap: wrap;">
<view class="specificalItem" v-for="(items,indexs) in item.list" :key="indexs">
{{items}}
</view>
</view>
</view>
<view class="countBox">
<view class="" style="font-size: 28rpx;">
数量
</view>
<view class="" style="display: flex;">
<view class="reduceImg">
-
</view>
<view class="countNum">
6
</view>
<view class="addImg">
+
</view>
</view>
</view>
<view class="addCartBtn" @click="addCartConfrim">
加入购物车
</view>
</view>
</view>
<view class="masks" v-if="mask" @click="closeMask">
</view>
</view>
</template>
<script>
export default {
data() {
return {
cartShow: false, //购物车弹框
mask: false, //遮罩层
selectIndex: 0, //头部
leftIndex: 0, //左分类
leftList: [{
id: '1',
title: '电动工具'
}, {
id: '1',
title: '电动工具'
}, {
id: '1',
title: '电动工具'
}, {
id: '1',
title: '电动工具'
}, {
id: '1',
title: '电动工具'
}],
rightList: [{
image: '../../static/ic_10@2x.png',
title: '科麦斯无油静音空吗压 力小型气550W-8L科麦斯无油静音空吗压 力小型气550W-8L',
detail: '工业级/无油/无压',
price: '50'
}, {
image: '../../static/ic_10@2x.png',
title: '科麦斯无油静音空吗压 力小型气550W-8L科麦斯无油静音空吗压 力小型气550W-8L',
detail: '工业级/无油/无压',
price: '50'
}],
// 购物车规格
typeList: [{
title: '型号',
list: ['55W-8L经典款标配:整机', '550W-8L:黑色钢款', '1600W-30L黑金刚:8个压头', '750W-8L黑金刚款']
}]
}
},
methods: {
selectTopClick(index) {
this.selectIndex = index
console.log(index)
},
leftClick(index) {
this.leftIndex = index
},
//加入购物车弹窗
addCart() {
this.mask = true
this.cartShow = true
},
//关闭遮罩层s
closeMask() {
this.mask = false
this.cartShow = false
},
//确定加入购物车
addCartConfrim() {
this.mask = false
this.cartShow = false
},
//数量增加
addCount() {
},
//数量减少
reduce() {
}
}
}
</script>
<style>
@import url("/common/class.css");
</style>