zhaojs
2023-07-24 d059ca35f8c0edcc850a632680c05c201420d016
no message
已添加2个文件
已修改6个文件
330 ■■■■ 文件已修改
h5/apph5/manifest.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/pages.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/pages/takeout/elm.css 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/pages/takeout/elm.vue 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/pages/takeout/mt.css 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/pages/takeout/mt.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/request/api.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/utils/ComUtils.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/manifest.json
@@ -78,7 +78,7 @@
                //配置代理服务器来解决跨域问题,uniapp不适用CORS方案和设置JSONP方案
                "/api/" : {
                    //映射域名
                    "target" : "http://appapitest.ushopvip.com", //测试环境
                    "target" : "http://dfg.shop.com", //测试环境
                    "changeOrigin" : true, //是否跨域
                    "secure" : true // æ˜¯å¦æ”¯æŒ https åè®®çš„代理
                }
h5/apph5/pages.json
@@ -12,6 +12,13 @@
                "navigationStyle":"custom",//不显示头部
                "navigationBarTitleText": "美食外卖"
            }
        },
        {
            "path": "pages/takeout/elm",
            "style": {
                "navigationStyle":"custom",//不显示头部
                "navigationBarTitleText": "美食外卖"
            }
        }
    ],
    "globalStyle": {
h5/apph5/pages/takeout/elm.css
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,124 @@
uni-page-wrapper
{
    background: #1088FE;
}
.toptxt {
    position: fixed;
    top: 0px;
    text-align: center;
    font-size: 0.3rem;
    width: 100%;
    background: #FFD100;
    padding: 10px 0;
    color: #fff;
}
.bodycont {
    background: #1088FE;
    width: 100%;
    padding-top: 95rpx;
}
.pageBac {
    width: 100%;
    height: 294rpx;
    margin-top: 20rpx;
}
.tabcont {
    display: flex;
    justify-content: center;
    align-items: center;
}
.tabcontsp {
    width: 35%;
    background: rgba(254, 254, 254, 0.3);
    border-radius: 23px;
    text-align: center;
}
.tabconttxt {
    width: 50%;
    border-radius: 23px;
    font-size: 14px;
    padding: 10rpx;
}
.getBtn-containe-uncheck {
    color: #fff;
}
.tabconttxt-check {
    color: #1088FE;
    background: #fff;
}
.code-cont {
    background: #fff;
    width: 92%;
    margin: 0 auto;
    border-radius: 0.4rem;
    padding-bottom: 1.5rem;
}
.code-flow {
    text-align: center;
    padding: 1rem;
    border-bottom: 1px dashed #1088FE;
}
.code-flow-img {
    width: 80%;
    height: 3.4rem;
}
.code-img {
    text-align: center;
    padding: 1rem 3rem;
}
.code-img-code {
    width: 9rem;
    height: 9rem;
}
.code-btn {
    width: 50%;
    margin: 0 auto;
    text-align: center;
    background: linear-gradient(0deg, #F1B641 0%, #FFCE6D 100%);
    font-size: 34rpx;
    font-weight: 500;
    color: #C03F11;
    width: 580rpx;
    height: 78rpx;
    border-radius: 39rpx;
    line-height: 78rpx;
}
.rulesContent{
    padding: 5rpx 28rpx;
    margin-top: 45rpx;
    color:#fff;
    .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;
    }
}
h5/apph5/pages/takeout/elm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,106 @@
<template style="background:#1088FE">
    <view class="bodycont">
    <!--     <view class="toptxt">
            ç¾Žå›¢å¤–卖
        </view> -->
        <view class="tabcont">
            <view class="tabcont tabcontsp">
                <span class="tabconttxt getBtn-containe-uncheck" @click="toMt()">
                    ç¾Žå›¢
                </span>
                <span class="tabconttxt tabconttxt-check">
                    é¥¿äº†ä¹ˆ
                </span>
            </view>
        </view>
        <view>
            <image class="pageBac" src="https://hxshapp.oss-cn-beijing.aliyuncs.com/weapp/elm.png"></image>
        </view>
        <view class="code-cont">
            <view class="code-flow">
                <image class="code-flow-img" src="https://hxshapp.oss-cn-beijing.aliyuncs.com/weapp/elmstep.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">
                1.红包需先领取才能在下单页面使用;</br>
                2.加餐红包和外卖红包不冲突,可以同时领取,哪个红包大用哪个;</br>
                3.无论饿了么新老用户,外卖红包和加餐红包每个手机号每天均可领一次,红包金额随机发放;</br>
            </view>
        </view>
    </view>
</template>
<script>
    import './elm.css'
    import comUtils from '../../utils/ComUtils.js'
    export default {
        data() {
            return {
                optionsCurrent:3,
                qrcode:'',
                mtInfo:{},
                optionsList: [{
                        label: "美团",
                        type: 1
                    },
                    {
                        label: "饿了么",
                        type: 3
                    }
                ]
            }
        },
        onLoad() {
            this.IntiData()
        },
        methods: {
            IntiData() {
                uni.showLoading({
                    title: '加载中',
                    mask:true
                });
                var that = this;
                this.$http.post('/api/taoke/ele_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);
                })
            },
            toMt()
            {
                uni.redirectTo({
                    url:'./mt?dfgtoken='+comUtils.getUrlPar('dfgtoken')
                })
            },
            shareClick() {
                window.location.href=this.mtInfo.h5;
            },
        }
    }
</script>
h5/apph5/pages/takeout/mt.css
@@ -9,7 +9,7 @@
    color: #fff;
}
.bodycont {
.mtbodycont {
    background: #FFD100;
    width: 100%;
    padding-top: 95rpx;
@@ -48,7 +48,7 @@
    color: #fff;
}
.tabconttxt-check {
.mttabconttxt-check {
    color: #FFD100;
    background: #fff;
}
@@ -61,7 +61,7 @@
    padding-bottom: 1.5rem;
}
.code-flow {
.mtcode-flow {
    text-align: center;
    padding: 1rem;
    border-bottom: 1px dashed #FFD100;
@@ -69,7 +69,7 @@
.code-flow-img {
    width: 80%;
    height: 3rem;
    height: 3.4rem;
}
.code-img {
@@ -98,7 +98,7 @@
.rulesContent{
    padding: 0 28rpx;
    margin-top: 45rpx;
    color: #fff;
    .txt-title {
        width: 100%;
        font-size: 32rpx;
h5/apph5/pages/takeout/mt.vue
@@ -1,34 +1,35 @@
<template>
    <view class="bodycont">
    <!--     <view class="toptxt">
    <view class="mtbodycont">
        <!--     <view class="toptxt">
            ç¾Žå›¢å¤–卖
        </view> -->
        <view class="tabcont">
            <view class="tabcont tabcontsp">
                <span class="tabconttxt tabconttxt-check">
                <span class="tabconttxt mttabconttxt-check">
                    ç¾Žå›¢
                </span>
                <span class="tabconttxt getBtn-containe-uncheck">
                <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="code-flow">
                <image class="code-flow-img" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/h5huanstep.png"></image>
            <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 class="code-btn" @click="shareClick()">
            <view v-if="qrcode" class="code-btn" @click="shareClick()">
                é¢†çº¢åŒ…点外卖
            </view>
        </view>
        <view class="rulesContent">
            <view class="txt-title">
                è§„则说明:
@@ -41,20 +42,19 @@
                é¥®å“é¢‘道使用; </br>
                (3)外卖新人首单红包限新用户(设备、手机号、 çº¢åŒ…
                å·å‡æœªåœ¨ç¾Žå›¢å¤–卖下过单)首次下单使用,且不与其他优惠(首减、满减、满赠、套餐增、折扣菜)同享;非首单红包可与上述优惠叠加使用;</br>
                (4)使用红包时下单手机号码必须与收餐人手机号码、领取红包时输入的手机号码一致:</br>
                3.订单跟单规则为您通过本活动页点击跳转至美团后只要产生有效点击即可进行跟单,点击有效期最长为7天</br>
            </view>
        </view>
    </view>
</template>
<script>
    import './mt.css'
    import comUtils from '../../utils/ComUtils.js'
    export default {
        data() {
            return {
                optionsCurrent:1,
                qrcode:'',
                mtInfo:{},
                optionsCurrent: 1,
                qrcode: '',
                mtInfo: {},
                optionsList: [{
                        label: "美团",
                        type: 1
@@ -71,19 +71,23 @@
        },
        methods: {
            IntiData() {
                uni.showLoading({
                    title: '加载中',
                    mask: true
                });
                var that = this;
                this.$http.post('/api/taoke/meituan_act', {
                    type: this.optionsCurrent
                }).then(e => {
                    if (e.code != 0)
                    {
                    uni.hideLoading();
                    if (e.code != 0) {
                        uni.showToast({
                                title:res.data.msg,
                                icon:'none'
                            title: res.data.msg,
                            icon: 'none'
                        });
                        return;
                    }
                    that.mtInfo = e.data.info;
                    that.qrcode = that.mtInfo.we_app_info.miniCode;
                    console.log(that.qrcode);
@@ -91,13 +95,22 @@
                    console.log(err);
                })
            },
            toElm() {
                uni.redirectTo({
                    url: './elm?dfgtoken=' + comUtils.getUrlPar('dfgtoken')
                })
            },
            shareClick() {
                if(this.mtInfo)
                {
                    window.location.href=this.mtInfo.deeplink;
                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>
h5/apph5/request/api.js
@@ -1,12 +1,13 @@
import Request from './index.js'
import md5 from'../utils/md5.js'
import comUtils from '../utils/ComUtils.js'
let request = new Request().http;
function get(url, data) {
    //获取token
    let header={
        dfgsessionkey:getUrlPar("dfgtoken")
        dfgsessionkey:comUtils.getUrlPar("dfgtoken")
    }
    return request({
        url: url,
@@ -28,7 +29,7 @@
            enstr+=value+ (JSON.stringify(data[value]).replace(/^\"|\"$/g,''));
        })
    }
    let userToken=getUrlPar("dfgtoken");
    let userToken=comUtils.getUrlPar("dfgtoken");
    enstr="dfg"+enstr+"apph5"+userToken;
    enstr=md5.hex_md5(enstr);
    enstr+='.'+userToken
@@ -44,13 +45,6 @@
        data: data,
        header: header,
    })
}
function getUrlPar(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}
let api = {
h5/apph5/utils/ComUtils.js
@@ -0,0 +1,10 @@
function getUrlPar(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}
module.exports = {
    getUrlPar
}