edidGoods.vue
1.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
<template>
<view class="edit_goods">
<!-- 商品展示 -->
<MallSelect :showTitle="false" :scrollHeight="scrollHeight" />
<!-- 底部模块 -->
<view class="footer">
<view v-for="(item, index) in footerList" :key="index" class="btn" :class="{active: current === index}" @click="changeBtn(index)">
<image style="width: 28rpx;" :src="current === index ? item.iconActive : item.icon" mode="widthFix"></image>
<text class="f-w-500 f-28 l-h-38 m-l-10">{{ item.title }}</text>
</view>
</view>
</view>
</template>
<script>
import addShop from '../static/addShop.png'
import sortShop from '../static/sortShop.png'
import sortShopActive from '../static/sortShop_active.png'
import MallSelect from '../components/MySelect.vue'
import { rpx2px } from '@/utils/util.js'
export default {
components: { MallSelect },
data() {
return {
footerList: [
{ title: '新建商品', icon: addShop, iconActive: addShop },
{ title: '商品排序', icon: sortShop, iconActive: sortShopActive }
],
current: 9
};
},
computed:{
// 计算可使用高度
scrollHeight() {
const { windowHeight } = uni.getSystemInfoSync()
return windowHeight - rpx2px(100)
}
},
methods: {
// 切换按钮
changeBtn(index){
this.current = index
}
}
}
</script>
<style lang="scss" scoped>
.footer{
position: fixed;
left: 0;
bottom: 0;
display: flex;
align-items: center;
height: 100rpx;
width: 100%;
box-sizing: border-box;
background-color: #fff;
box-shadow: rgba(0, 0, 0, 0.15) 0px 2px 8px;
.btn{
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: 100%;
color: #3d3d3d;
&.active{
background-color: #FFB336;
color: #fff;
}
}
}
</style>