zhaojs
2023-08-02 acba9f7ea0506e3df39055f3ae25283b943792fe
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
<template>
    <view>
        <view class="main-cont">
            <view class="txt-sty">
                <image class="head-img" :src="wxhead"></image>
            </view>
            <view class="txt-sty head-txt">
                微信号:{{wxtxt}}
            </view>
            <view class="txt-sty">
                <image :src="wxImg" class="ercode-img"></image>
            </view>
            <view class="txt-sty" style="font-weight: 700; margin-top: 1rem;">长按二维码,添加微信享受优惠</view>
        </view>
        <view class="item-contant" v-if="itemsdata&&itemsdata.length>0">
            <view class="item-head">
                ---- 好物推荐 ----
            </view>
            <view class="item-list">
                <view class="item-v" v-for="item in itemsdata">
                    <lineItem :isrecord="isrecord" :items="item"></lineItem>
                </view>
            </view>
            <view class="bottom-show">添加微信,享受更多优惠~</view>
        </view>
        
    </view>
</template>
 
<script>
    import lineItem from '../../components/items/LineItem.vue';
    import comUtils from '../../utils/ComUtils.js'
    export default {
        components: {
            lineItem
        },
        data() {
            return {
                wxImg: 'https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/wxhead0801.png',
                wxhead: 'https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/wxheadimg0801.jpg',
                wxtxt: '17396873080',
                itemsdata: {},
                isrecord:true
            }
        },
        onLoad() {
            /* let isshow=comUtils.getUrlPar('ishow');
            if(isshow)
            {
                
            } */
            this.getItemsInfo();
        },
        methods: {
            getItemsInfo() {
                var that = this;
                let postdata = {
                    page: 1,
                    pageSize: 20,
                    sort: 2,
                    subcid:8052,
                    couponPriceLowerLimit:10
                };
                this.$http.post('/api/taoke/tb_goods_list', 
                    postdata
                ).then(e => {
                    console.log(e);
                    uni.hideLoading();
                    if (e.code != 0) {
                        return;
                    }
                    var obj=[];
                    var newarr=[];
                    for(var i=0;i<e.data.list.length;i++)
                    {
                        if(!obj[e.data.list[i].shopName])
                        {
                            newarr.push(e.data.list[i]);
                            obj[e.data.list[i].shopName]=true;
                        }
                    }
                    this.itemsdata = newarr;
                    console.log(e);
                }).catch(function(err) {
                    console.log(err);
                })
            }
 
        },
    }
</script>
 
<style>
    .item-head {
        text-align: center;
        padding: 1rem;
        font-weight: 600;
        color: linear-gradient(-90deg, #fe3a3f, #faa450);
        color: #fe3a3f;
        background: linear-gradient(-90deg, #fe3a3f, #faa450);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
 
    .bottom-show {
        text-align: center;
        width: 100%;
        padding-bottom: 1rem;
        color: #fe3a3f;
        background: linear-gradient(-90deg, #fe3a3f, #faa450);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        font-weight: 600;
    }
 
    .txt-sty {
        text-align: center;
    }
 
    .main-cont {}
 
    .head-txt {
        margin: 0.4rem 0 2rem 0;
    }
 
    .head-img {
        width: 5rem;
        height: 5rem;
        margin-top: 4rem;
    }
 
    .ercode-img {
        width: 16rem;
        height: 16rem;
    }
</style>