liaoxujun@qq.com
2024-02-28 9f8e542b9b74fe18a6a4e0a00fef4b50e3e62581
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
<template>
    <view>
 
        <view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-tr-24 coreshop-border-radius-bl-24" 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="goServicesList()"></u-icon>
            </view>
            <view class="coreshop-divider">
                <view class="left"></view>
                <text class="dot">●</text>
                <view class="right"></view>
            </view>
 
            <view class="img-list-item coreshop-flex-direction-row coreshop-margin-bottom-10 bg-main coreshop-text-black" v-for="(item, key) in listData" :key="key" @click="goServicesDetail(item.id)">
                <view class="img-list-item-l">
                    <u--image :src="item.thumbnail" :index="item.id" width="100px" height="100px"></u--image>
                </view>
                <view class="img-list-item-r">
                    <view class="coreshop-font-14 coreshop-text-bold u-line-1 title">{{item.title}}</view>
                    <view class="coreshop-font-12 u-line-2 coreshop-margin-top-10 coreshop-margin-bottom-10">{{item.description}}</view>
                    <view class="item-c coreshop-flex coreshop-justify-between">
                        <view class="red-price coreshop-justify-between">
                            ¥{{item.money}}
                        </view>
                        <!--<u-count-down :time="item.lastTime" format="HH:mm:ss"></u-count-down>-->
                        <view class="coreshop-text-right coreshop-time-right" v-if="item.openStatus == 1 && item.lastTime > 0">
                            <u-count-down :time="item.lastTime*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
                                <view class="time coreshop-font-11">
                                    <view class="coreshop-font-12">仅剩:</view>
                                    <view class="time__custom">
                                        <text class="time__custom__item">{{ item.timeData.days }}</text>
                                    </view>
                                    <text class="time__doc">天</text>
                                    <view class="time__custom">
                                        <text class="time__custom__item">{{ item.timeData.hours>10?item.timeData.hours:'0'+item.timeData.hours}}</text>
                                    </view>
                                    <text class="time__doc">:</text>
                                    <view class="time__custom">
                                        <text class="time__custom__item">{{ item.timeData.minutes }}</text>
                                    </view>
                                    <text class="time__doc">:</text>
                                    <view class="time__custom">
                                        <text class="time__custom__item">{{ item.timeData.seconds }}</text>
                                    </view>
                                </view>
                            </u-count-down>
                        </view>
                        <view class="coreshop-text-right coreshop-time-right" v-if="item.openStatus == 2 && item.lastTime > 0">
                            <u-count-down :time="item.lastTime*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
                                <view class="time">
                                    <view class="coreshop-font-12">即将开始:</view>
                                    <view class="time__custom">
                                        <text class="time__custom__item">{{ item.timeData.days }}</text>
                                    </view>
                                    <text class="time__doc">天</text>
                                    <view class="time__custom">
                                        <text class="time__custom__item">{{ item.timeData.hours>10?item.timeData.hours:'0'+item.timeData.hours}}</text>
                                    </view>
                                    <text class="time__doc">:</text>
                                    <view class="time__custom">
                                        <text class="time__custom__item">{{ item.timeData.minutes }}</text>
                                    </view>
                                    <text class="time__doc">:</text>
                                    <view class="time__custom">
                                        <text class="time__custom__item">{{ item.timeData.seconds }}</text>
                                    </view>
                                </view>
                            </u-count-down>
                        </view>
                        <view class="coreshop-font-12 red-price" v-if="item.openStatus == 3">已结束</view>
 
                        <!--<view class="coreshop-flex coreshop-flex-direction-row coreshop-justify-between">
                            <view class="coreshop-font-12 red-price" v-if="item.status == 3">已结束</view>
                            <view class="coreshop-font-12 red-price" v-if="item.status == 2">即将开始</view>
                            <u-icon name="shopping-cart" color="#2979ff" size="25" class="btnCart"></u-icon>
                        </view>-->
                    </view>
                </view>
            </view>
 
        </view>
    </view>
 
</template>
 
<script>
    export default {
        name: "coreshopservice",
        data() {
            return {
                listData: [],
            }
        },
        props: {
            coreshopdata: {
                // type: Array,
                required: false,
            }
        },
        mounted() {
            this.listData = uni.$u.deepClone(this.coreshopdata.parameters.list);
        },
        computed: {
            count() {
                return (this.listData.length > 0)
            }
        },
        methods: {
            onChange(e, key) {
                //this.item.timeData = uni.$u.deepClone(e);
                this.$set(this.listData[key], 'timeData', e)
                //    this.$forceUpdate();
            },
        },
    }
</script>
 
<style lang="scss" scoped>
    .img-list-item { position: relative; overflow: hidden;
        .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;
            .title { line-height: 24px; }
            .item-c { width: 100%; margin-top: 0;
                .red-price { color: #FF7159 !important; }
                .btnCart { float: right; }
            }
        }
    }
 
    .time { display: flex; align-items: center;
        .time__custom { min-width: 18px; height: 18px; background-color: #3c9cff; border-radius: 4px; display: flex; justify-content: center; align-items: center;
            .time__custom__item { color: #fff; font-size: 10px; text-align: center; }
        }
    }
</style>