areaSelect.vue 2.75 KB
Newer Older
zhangcheng committed
1
<template>
张成 committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
    <view ew class="product-list">
        <div v-for="item in list" :key="item.id" @click="selectedShop(item)" class="shop_item">
            <div class="header">
                <h3>{{ item.name }}</h3>
                <span>距离 {{ item.distance }}</span>
            </div>
            <div class="dec">
                <div class="address">{{ item.address }}</div>
                <a class="xaidan">去下单</a>
            </div>
            <div class="time">
                <u-icon name="clock" color="#2979ff" size="16"></u-icon>
                <div>营业时间:{{ item.startTime }} - {{ item.endTime }}</div>
            </div>
        </div>
17
    </view>
zhangcheng committed
18 19 20
</template>

<script>
张成 committed
21 22 23 24 25 26 27 28
import { $EventBus } from '@/utils/EventBus';

export default {
    data() {
        return {
            show: true,
            columns: [],
            list: []
29
        }
张成 committed
30 31 32 33 34 35 36 37 38 39 40 41
    },
    onShow() {
        this.list = uni.getStorageSync('shops');
    },
    methods: {
        selectedShop(item) {
            uni.setStorage({ key: 'shopData', data: item });
            uni.switchTab({ url: '/pages/menu/menu' })
            $EventBus.$emit('getMenuList', item);
        }
    },
}
zhangcheng committed
42 43
</script>

44
<style lang="scss" scoped>
张成 committed
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
.shop_item {
    width: 90%;
    height: 264rpx;
    background: #FFFFFF;
    border-radius: 10rpx;
    border: 2rpx solid #006ECF;
    padding: 32rpx;
    box-sizing: border-box;
    margin: 30rpx auto;

    .header {
        display: flex;
        align-items: center;
        justify-content: space-between;

        h3 {
            font-size: 28rpx;
            font-family: PingFangSC-Medium, PingFang SC;
            font-weight: 500;
            color: #000000;
        }

        span {
            font-size: 24rpx;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #666666;
        }
    }

    .dec {
        display: flex;
        justify-content: space-between;
        margin-top: 22rpx;

        .address {
            font-size: 24rpx;
            font-family: PingFangSC-Regular, PingFa
        }

        .xaidan {
            font-size: 24rpx;
            font-family: PingFangSC-Medium, PingFang SC;
            font-weight: 500;
            color: #FFFFFF;
weijiguang committed
90 91
            width: 150rpx;
			min-width: 150rpx;
张成 committed
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
            text-align: center;
            height: 40rpx;
            line-height: 40rpx;
            background: #006ECF;
            border-radius: 6px;
            display: block;
            margin-left: 20rpx;
        }
    }

    .time {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 20rpx;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #333333;
        margin-top: 30rpx;
111
    }
张成 committed
112
}
113
</style>