zhaojs
2023-07-31 49edf3b5b18597aacc3c05529712fbbe9720a805
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
<template>
    <view class="mtbodycont">
        <!--     <view class="toptxt">
            美团外卖
        </view> -->
        <view class="tabcont">
            <view class="tabcont tabcontsp">
                <span class="tabconttxt mttabconttxt-check">
                    美团
                </span>
                <span class="tabconttxt getBtn-containe-uncheck" @click="toElm()">
                    饿了么
                </span>
            </view>
 
        </view>
        <view>
            <image class="pageBac" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/h5mt1.png"></image>
        </view>
        <view class="code-cont">
            <view class="mtcode-flow">
                <image class="code-flow-img"
                    src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/h5huanstep.png"></image>
            </view>
            <view class="code-img">
                <image class="code-img-code" :src="qrcode"></image>
            </view>
            <view v-if="qrcode" class="code-btn" @click="shareClick()">
                领红包点外卖
            </view>
            
        </view>
 
        <view class="rulesContent">
            <view class="txt-title">
                规则说明:
            </view>
            <view class="richtext-content">
                <view>1.此活动为部分区域有效,以活动页面实际展示为准;红包发放数量及红包金额具有随机性;具体红包使用有效期及红包金额以实际收到为准</view>
                <view>2.红包使用规则:</view>
                <view>(1)红包使用门槛、使用期限及使用规则等以红包券面展示信息为准;</view>
                <view>(2)红包可在美团或美团外卖最新版客户端、美团外卖小程序下单且选择在线支付时使用;且红包仅限非到店自取外卖订单,下午茶、夜宵、美食、蛋糕、团餐频道、甜点
                饮品频道使用;</view>
                <view>(3)外卖新人首单红包限新用户(设备、手机号、红包、号均未在美团外卖下过单)首次下单使用,且不与其他优惠(首减、满减、满赠、套餐增、折扣菜)同享;非首单红包可与上述优惠叠加使用;</view>
            </view>
        </view>
    </view>
</template>
<script>
    import './mt.css'
    import api from '@/common/tk_api.js'
    export default {
        data() {
            return {
                optionsCurrent: 1,
                qrcode: '',
                api,
                mtInfo: {},
                optionsList: [{
                        label: "美团",
                        type: 1
                    },
                    {
                        label: "饿了么",
                        type: 2
                    }
                ]
            }
        },
        onLoad() {
            this.IntiData()
        },
        onShareAppMessage: function() {
            return {
                title: '美团红包',
                path: '/pages/takeout/mt',
                // promise
            }
        },
        onShareTimeline() {
            return {
                title: '美团红包',
                path: '/pages/takeout/mt',
            }
        },
        methods: {
            IntiData() {
                uni.showLoading({
                    title: '加载中',
                    mask: true
                });
                var that = this;
                this.api.post('/api/taoke/meituan_act', {
                    type: this.optionsCurrent
                }).then(e => {
                    uni.hideLoading();
                    if (e.code != 0) {
                        uni.showToast({
                            title: res.data.msg,
                            icon: 'none'
                        });
                        return;
                    }
 
                    that.mtInfo = e.data.info;
                    that.qrcode = that.mtInfo.we_app_info.miniCode;
                    console.log(that.qrcode);
                }).catch(function(err) {
                    console.log(err);
                })
            },
            toElm() {
                uni.switchTab({
                    url: './elm'
                })
            },
            shareClick() {
                /* uni.navigateTo({
                    url:'/pages/wxkf/kfweb'
                });
                return; */
                uni.navigateToMiniProgram({
                  appId: this.mtInfo.we_app_info.app_id,
                  path: this.mtInfo.we_app_info.page_path,
                  success(res) {
                    // 打开成功
                  }
                })
            /*     
                var that=this;
                var ua = navigator.userAgent.toLowerCase();
                if (ua.match(/MicroMessenger/i) == "micromessenger") {
                    window.location.href = this.mtInfo.h5;
                }
                else{
                    window.location.href = this.mtInfo.deeplink;
                } */
            },
 
        }
    }
</script>