移动系统liao
2024-05-15 d7c7a6e9d05eec7b38b41b8ae39f373f650ca891
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
<template>
    <view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="listData && count">
        <view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30">
            <view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{coreshopData.parameters.title}}</view>
            <u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @tap="goSeckillList()"></u-icon>
        </view>
        <view class="coreshop-divider">
            <view class="complete"></view>
        </view>
        <view class="coreshop-flex-direction coreshop-margin-bottom-10 coreshop-text-black" v-for="(item, key) in listData" :key="key">
            <view class="coreshop-flex">
                <view>
                    <u--image :src="item.goodThumbnail" mode="widthFix" width="96px" height="96px" radius="8"></u--image>
                </view>
                <view class="coreshop-flex coreshop-flex-direction coreshop-padding-left-10 coreshop-percent-100">
                    <view class="coreshop-font-15 u-line-2 coreshop-text-black">{{ item.name }}</view>
                    <view class="coreshop-font-11 coreshop-padding-top-5 coreshop-padding-bottom-3 u-line-2 coreshop-text-brown">{{ item.goodName }}</view>
                    <view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-min-height-30" v-if="(item.startStatus == 1) && item.timestamp">
                        <view class="coreshop-font-12">仅剩:</view><u-count-down :time="item.timestamp*1000" format="DD天HH时mm分ss秒" autoStart></u-count-down>
                    </view>
                    <view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-min-height-30" v-if="(item.startStatus == 0) && item.timestamp">
                        <view class="coreshop-font-12">即将开始:</view><u-count-down :time="item.timestamp*1000" format="DD天HH时mm分ss秒" autoStart></u-count-down>
                    </view>
                    <view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-min-height-30" v-if="(item.startStatus == 2) && item.timestamp">
                        <view class="coreshop-font-12">已结束:</view><u-count-down :time="item.timestamp*1000" format="DD天HH时mm分ss秒" autoStart></u-count-down>
                    </view>
                    <view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center">
                        <view class="coreshop-flex coreshop-align-center">
                            <view class="coreshop-font-14 coreshop-text-red">¥{{item.price}}</view>
                            <view class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5">{{item.mktPrice}}元</view>
                        </view>
                        <view class="coreshop-seckill-btn" v-if="item.startStatus == 1" @click="goSeckillDetail(item.id)">马上秒</view>
                        <view class="coreshop-solitaire-btn" v-if="item.startStatus == 0">即将开始</view>
                        <view class="coreshop-buy-btn-disabled" v-if="item.startStatus == 2">已结束</view>
                    </view>
                </view>
            </view>
            <view v-if="key+1 < listData.length">
                <view class="coreshop-divider">
                    <view class="seckill"></view>
                    <view class="dot">●</view>
                    <view class="seckill"></view>
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        name: "coreshopGroupPurchase",
        props: {
            coreshopData: {
                // type: Array,
                required: false,
            }
        },
        data() {
            return {
                listData: [],
            }
        },
        mounted() {
            this.listData = uni.$u.deepClone(this.coreshopData.parameters.list);
        },
        computed: {
            count() {
                if (!this.coreshopData) {
                    return false;
                }
                if (!this.coreshopData.parameters) {
                    return false;
                }
                if (!this.coreshopData.parameters.list) {
                    return false;
                }
                return (this.coreshopData.parameters.list.length > 0)
            }
        },
        methods: {
            end(index) {
                let _that = this;
                _that.list.splice(index, 1)
            },
            onChange(e, key) {
                this.$set(this.listData[key], 'timeData', e)
            },
        },
    }
</script>
 
<style lang="scss" scoped>
    .u-count-down__text { font-size: 12px; }
 
    .img-list-item { border-radius: 8px; margin: 2.5px 2.5px 10px 2.5px; background-color: #ffffff; padding: 5px; position: relative; overflow: hidden; flex-direction: row;
        .img-list-item-l { width: 100px; height: 100px; display: inline-block; float: left; }
        .img-list-item-r { width: calc(100% - 120px); display: inline-block; margin-left: 7.5px; float: left; position: relative;
            .description { font-size: 12px; color: #929292; }
            .item-c { width: 100%; margin-top: 0;
                .btnCart { float: right; }
            }
        }
    }
 
    .u-count-down__text { font-size: 12px; }
</style>