zhaojs
2023-05-26 1659a6dc9d4e39c3270e1bf564fb419ddc2fd2cf
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
<template>
    <view class="elm-wrapper wrapperLayer"
        :style="optionsCurrent==3?'background-color:#1088FE;':'background-color:#62BC00;'">
        <view class="flexbox borderBox colCen"
            :style="optionsCurrent==3?'background-color:#1088FE;':'background-color:#62BC00;'">
            <view class="topbarbox"></view>
            <view class="leftimgbox rowCenBet" @tap="back()">
                <view class="shadow rowCenCen" style="background:rgba(0,0,0,0);">
                    <view class="iconfont" style="color: rgb(255, 255, 255);">&#xe630;
                    </view>
                </view>
                <view class="pagetitle"
                    :style="'opacity:'+ (0+scrollTop/100)+';color:' + ((scrollTop/100)>0.5?'#FFF;':'#222222;')">
                    饿了么红包
                </view>
                <view class="shadow rowCenCen" style="opacity: 0;background-color:#FFF;">
                    <view class="iconfont" style="color: rgb(255, 255, 255);">&#xe630;</view>
                </view>
            </view>
        </view>
        <view class="options-bar-content rowCenCen">
            <view class="center-container rowCenBet">
                <block v-for="(items,index) in optionsList" :key="index">
                    <view class="items-content rowCenCen"
                        :style="optionsCurrent==items.type?items.type==3?'color:#1088FE;':'color:#62BC00;':''"
                        @tap="navTap(items.type,index)">
                        <view>{{items.label}}</view>
                    </view>
                </block>
                <div class="items-active" :style="{'transform':'translateX('+activeIndex * 120 +'rpx)'}"></div>
            </view>
        </view>
 
        <image class="pageBac"
            :src="optionsCurrent==3?'https://hxshapp.oss-cn-beijing.aliyuncs.com/weapp/elm.png':'https://hxshapp.oss-cn-beijing.aliyuncs.com/weapp/elmgs3.png'"
            mode="aspectFill">
        </image>
 
        <view class="center-code-container rowCen borderBox">
            <view class="white-content colCen">
                <view class="dashed-content rowCenCen"
                    :style="optionsCurrent==3?'border-bottom: 1rpx dashed rgba(16, 136, 254, 0.6);':'border-bottom: 1rpx dashed rgba(98, 188, 0, 0.6);'">
                    <image class="stepImg"
                        :src="optionsCurrent==3?'https://hxshapp.oss-cn-beijing.aliyuncs.com/weapp/elmstep.png':'https://hxshapp.oss-cn-beijing.aliyuncs.com/weapp/greenstep.png'"
                        mode="">
                    </image>
                </view>
 
                <image class="miniCodeImg" :src="wxQrcodeUrl" mode="aspectFit"></image>
 
                <view class="getBtn-container rowCenCen" @tap="jumpMini()">
                    <view>领红包点外卖</view>
                </view>
 
            <!--     <view class="getBtn-container rowCenCen" @tap="jumpShangJinMini()">
                    <view>领加餐红包②</view>
                </view> -->
            </view>
        </view>
 
        <view class="rulesContent colCen borderBox">
            <view class="txt-title">
                规则说明:
            </view>
            <view class="richtext-content">
                1.无论用不用第一个红包,都要先领取,否则可能无返利;</br>
                2.加餐红包和外卖红包不冲突,可以同时领取,哪个红包大用哪个;</br>
                3.无论饿了么新老用户,外卖红包和加餐红包每个手机号每天均可领一次,红包金额随机发放;</br>
                4.领券下单均有返利,返利按照订单实际支付金额为准;5.必须使用从本页获得的红包码领券,领券后使用红包下单才有返利;</br>
                6.领券后在红包有效期内下单均有返利;</br>
                7.分享红包海报给好友,好友领券下单后分享人也可以获得返利;</br>
                8.饿了么绑定的手机号,需与领券登录的手机号一致;8.下单后10分钟内会有订单返现提醒;</br>
            </view>
        </view>
 
 
    </view>
</template>
 
<script>
    import titleBar from '../../components/backTitlebar.vue';
    import common from '../../utils/utils.js';
    export default {
 
        data() {
            return {
                optionsCurrent: 3,
                activeIndex: 0, // 当前选中的index
                scrollTop: 0,
                optionsList: [{
                        label: "外卖",
                        type: 3
                    },
                    {
                        label: "果蔬",
                        type: 5
                    }
                ],
                pageInfo: null,
                wxQrcodeUrl: '',
                empowerModel: false
            }
        },
        onPageScroll(e) {
            this.scrollTop = e.scrollTop
        },
        onLoad() {
            this.IntiData()
        },
        onPullDownRefresh() {
            this.IntiData()
        },
        methods: {
            IntiData() {
                var that = this;
                this.$u.api.eleAct({
                    type: this.optionsCurrent
                }).then(e => {
                    console.log(e)
                    if (e.code != 0) return that.$alert(e.msg)
                    uni.stopPullDownRefresh()
                    that.pageInfo = e.data.info;
                    that.wxQrcodeUrl = that.pageInfo.wx_qrcode_url;
                }).catch(function(err) {})
            },
            back() {
                uni.navigateBack({
                    delta: 1
                })
            },
            navTap(type, index) {
                if (this.optionsCurrent != type) {
                    this.optionsCurrent = type
                    this.activeIndex = index
                    if (this.optionsCurrent == 5) {
                        uni.setNavigationBarColor({
                            frontColor: '#ffffff',
                            backgroundColor: '#62BC00'
                        })
                    } else {
                        uni.setNavigationBarColor({
                            frontColor: '#ffffff',
                            backgroundColor: '#1088FE'
                        })
                    }
                    this.IntiData()
                }
            },
            jumpMini() {
                var isAppletJump =  getApp().globalData.appinfo.isAppletJump;
                if(isAppletJump){
                    var appId = this.pageInfo.app_id;
                    var appPath = this.pageInfo.wx_miniprogram_path;
                    plus.share.getServices(function(res) {
                        var sweixin = null;
                        for (var i = 0; i < res.length; i++) {
                            var t = res[i];
                            if (t.id == 'weixin') {
                                sweixin = t;
                            }
                        }
                        if (sweixin) {
                            sweixin.launchMiniProgram({
                                id: appId,
                                type: 0, //0 正式 1 测试 2 体验  小程序的版本
                                path: appPath //这里你要跳的路径,可以传值
                            });
                        }
                    }, function(res) {
                        console.log(JSON.stringify(res));
                    });
                }else{
                    // #ifdef APP-PLUS
                    if (plus.runtime.isApplicationExist({
                            pname: 'com.taobao.taobao',
                            action: 'taobao://'
                        })) {
                        const plug = uni.requireNativePlugin('xiguazhu-baichuan')
                        plug.detailPage({
                            url: this.pageInfo.click_url,
                            "openType": 0
                        }, result => {
                            //    console.log(result); 
                        });
                    } else {
                        uni.navigateTo({
                            url: '../webView/webView?url=' +this.pageInfo.click_url,
                        })
                    }
                    // #endif
                }
            },
 
            jumpShangJinMini() {
                var that = this;
                this.$u.api.eleShangjin({}).then(e => {
                    if(e.code != 0) return that.$alert(e.msg)
                    console.log(e)
                    uni.hideLoading()
                    uni.stopPullDownRefresh()
                    var res = e.data;
                    var appId = res.app_id;
                    var appPath = res.app_path;
                    plus.share.getServices(function(res) {
                        var sweixin = null;
                        for (var i = 0; i < res.length; i++) {
                            var t = res[i];
                            if (t.id == 'weixin') {
                                sweixin = t;
                            }
                        }
                        if (sweixin) {
                            sweixin.launchMiniProgram({
                                id: appId,
                                type: 0, //0 正式 1 测试 2 体验  小程序的版本
                                path: appPath //这里你要跳的路径,可以传值
                            });
                        }
                    }, function(res) {
                        console.log(JSON.stringify(res));
                    });
                }).catch(function (err) {
                })
                
            },
 
            closeMdl() {
                this.empowerModel = false
                this.pddempowerModel = false
            },
        }
    }
</script>
 
<style lang="scss">
    .elm-wrapper {
        width: 100%;
        min-height: 100vh;
        background-color: #1088FE;
 
        .flexbox {
            position: fixed;
            z-index: 100;
            width: 100%;
            padding: 0 32rpx;
 
            .leftimgbox {
                width: 100%;
                height: 90rpx;
 
                .shadow {
                    width: 50rpx;
                    height: 50rpx;
                    font-size: 28rpx;
                    border-radius: 50%;
                }
            }
        }
 
        .options-bar-content {
            width: 100%;
            margin-top: 168rpx;
 
            .center-container {
                position: relative;
                width: 240rpx;
                height: 58rpx;
                background: rgba(254, 254, 254, 0.3);
                border-radius: 29rpx;
 
                .items-content {
                    position: relative;
                    width: 120rpx;
                    height: 58rpx;
                    background: transparent;
                    border-radius: 29rpx;
                    font-size: 28rpx;
                    font-weight: 500;
                    z-index: 1;
                    color: rgba(255, 255, 255, 0.7);
                }
 
                .items-active {
                    position: absolute;
                    left: 0;
                    @extend .items-content;
                    background: #FEFEFE;
                    z-index: 0;
                    transition: 0.3s ease-out;
                }
 
                .green {
                    color: #62BC00;
                }
 
                .blue {
                    color: #1088FE;
                }
            }
        }
 
        .pageBac {
            width: 100%;
            height: 294rpx;
            margin-top: 20rpx;
        }
 
        .center-code-container {
            width: 100%;
            padding: 0 28rpx;
 
            .white-content {
                width: 100%;
                padding-bottom: 50rpx;
                background-color: #FFFFFF;
                border-radius: 16rpx;
 
                .dashed-content {
                    width: 100%;
                    height: 194rpx;
 
                    .stepImg {
                        width: 540rpx;
                        height: 107rpx;
                    }
                }
 
                .miniCodeImg {
                    width: 288rpx;
                    height: 288rpx;
                    margin: 70rpx 0;
                }
 
                .getBtn-container {
                    width: 580rpx;
                    height: 78rpx;
                    border-radius: 39rpx;
                    background: linear-gradient(0deg, #F1B641 0%, #FFCE6D 100%);
                    font-size: 34rpx;
                    font-weight: 500;
                    color: #C03F11;
                    margin-top: 15rpx;
                }
 
                .shareBtn-container {
 
                    border: 1rpx solid #109BFE;
                    //    border-radius: 31rpx;
                    //    font-size: 30rpx;
                    //font-weight: 400;
                    color: #0D7BE8;
                    margin-top: 30rpx;
 
 
                    width: 580rpx;
                    height: 78rpx;
                    border-radius: 39rpx;
                    //    background: linear-gradient(0deg, #F1B641 0%, #FFCE6D 100%);
                    font-size: 34rpx;
                    font-weight: 500;
                    //color: #C03F11;
                }
 
                .greenbtn {
                    color: #62BC00;
                    border-color: #62BC00;
                }
            }
        }
 
        .rulesContent {
            width: 100%;
            padding: 0 28rpx;
            margin-top: 25rpx;
 
            .txt-title {
                width: 100%;
                font-size: 32rpx;
                font-weight: 500;
                color: #FFFFFF;
                line-height: 48rpx;
                margin-bottom: 20rpx;
            }
 
            .richtext-content {
                width: 100%;
                margin-bottom: 40rpx;
                font-size: 26rpx;
                font-weight: 400;
                line-height: 48rpx;
                color: #FFFFFF;
            }
        }
    }
</style>