zhaojs
2023-08-22 c5855f5eb22d2dd1d30d32d1d4f06a566b532a98
Revert "no message"

This reverts commit 7ed6e5c827b302a7c91c5f16bcca67848a62bfd8.
已添加7个文件
已修改4个文件
802 ■■■■■ 文件已修改
application/api/controller/Activity.php 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
application/api/logic/taoke/device/Dataoke.php 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
application/common/library/Auth.php 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
application/index/controller/User.php 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
application/index/view/user/targetapp.html 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/components/items/LineItem.vue 238 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/components/setClipboard.js 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/package-lock.json 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/package.json 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/apph5/pages/wxkf/gzhAuthBack.vue 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/index/js/targetapp.js 290 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
application/api/controller/Activity.php
@@ -13,7 +13,7 @@
header("Access-Control-Allow-Origin:*");
class Activity extends Api
{
    protected $noNeedLogin = ['recordItemClick','fqb_plat_cate','run_countRecruitAct','test'];
    protected $noNeedLogin = ['UpWxImg','recordItemClick','fqb_plat_cate','run_countRecruitAct','test'];
    protected $noNeedRight = '*';
    /**
     * èŽ·å–ç–¯æŠ¢æ¦œ
@@ -308,5 +308,31 @@
        $this->success('成功',['success'=>true]);
    }
    public function UpWxImg()
    {
        $token=request()->param('token');
        $picPath=request()->param('picPath');
        //上传永久素材
        $url="https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=".$token."&type=image";
        //2、同步到微信服务器
        if(class_exists('\CURLFile')){  //7.0
            $data = ['media' => new \CURLFile($picPath)];
        }else{  //5.6以及5.6以下
            $data = array('media' => '@'.$picPath);
        }
        $ch  = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER , true);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST , false);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        $res  = curl_exec($ch);
        curl_close($ch);
        $wxrs_id_card=json_decode($res,true);
        $id_card =$wxrs_id_card['media_id'];  //得到media_id
    }
    
}
application/api/logic/taoke/device/Dataoke.php
@@ -302,7 +302,7 @@
     * @param mixed å¤§æ·˜å®¢çš„二级类目id,通过超级分类API获取。仅允许传一个二级id,当一级类目id和二级类目id同时传入时,会自动忽略二级类目id
     * @return void
     */
     public function getGoodsList($cids,$subcid,$sort=0,$page = 1,$page_size,$tchaoshi=0,$secrend_search=0,$couponPriceLowerLimit="")
     public function getGoodsList($cids,$subcid,$sort=0,$page = 1,$page_size,$tchaoshi=0,$secrend_search=0,$couponPriceLowerLimit)
    {
        $params = $this->setParams(['cids'=>$cids,'tchaoshi'=>$tchaoshi,'subcid'=>$subcid,'sort'=>$sort,'pageId'=>$page,'pageSize'=>$page_size]);
        if($secrend_search>0)
application/common/library/Auth.php
@@ -136,7 +136,7 @@
        }
        foreach ($params as $key => $value) {
            $enstrs=$enstrs.$key;
            //$pvalue=preg_replace('/^\"|\"$/','',json_encode($value,JSON_UNESCAPED_UNICODE));
            // $pvalue=preg_replace('/^\"|\"$/','',json_encode($value,JSON_UNESCAPED_UNICODE));
            $pvalue=preg_replace('/^\"|\"$/','',json_encode($value,JSON_UNESCAPED_UNICODE+JSON_UNESCAPED_SLASHES));
            $enstrs=$enstrs.$pvalue;
        }
application/index/controller/User.php
@@ -20,7 +20,7 @@
class User extends Frontend
{
    protected $layout = '';
    protected $noNeedLogin = ['login', 'registersms','register','register1', 'getInvitationInfo','phoneIsRegister'];
    protected $noNeedLogin = ['login','targetapp','registersms','register','register1', 'getInvitationInfo','phoneIsRegister'];
    protected $noNeedRight = ['*'];
    public function _initialize()
@@ -44,6 +44,16 @@
        return $this->view->fetch();
    }
      /**
     * è·³è½¬app
     */
    public function targetapp()
    {
        $this->assign('appName',config('site.name'));
        return $this->view->fetch();
    }
    /**
     * æ³¨å†Œä¼šå‘˜
     */
application/index/view/user/targetapp.html
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
<!doctype HTML>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta content="telephone=no" name="format-detection" />
        <meta name="viewport"
            content="width=device-width,initial-scale=1,maximum-scale=1.0,user-scalable=no,viewport-fit=cover" />
        <title>{$appName}</title>
        <!-- å¼•å…¥vuejs框架 -->
        <script src="__CDN__/assets/index/js/vue.js"></script>
        <script type="text/javascript" src="https://public.ffquan.cn/lib/clipboard.min.js"></script>
        <script src="__CDN__/assets/index/js/axios.min.js"></script>
        <script src="__CDN__/assets/index/js/md5.js"></script>
        <script src="__CDN__/assets/index/js/xiguazhu.js"></script>
        <script src="__CDN__/assets/index/js/xiguazhu2.js"></script>
        <link rel="stylesheet" href="__CDN__/assets/index/css/index.css">
    </head>
    <body>
    </body>
    <script>
        const apiUrl = "你的域名";
        const appName2 = "";
    </script>
    <!-- è¯·æ±‚域名如果不想直接暴露出来 -->
    <script src="__CDN__/assets/index/js/targetapp.js?v=0.0.1"></script>
</html>
h5/apph5/components/items/LineItem.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,238 @@
<template>
    <view class="item-v" @click="getShareLink(items)">
        <view class="item-img">
            <image :src="items.mainPic">
            </image>
        </view>
        <view class="item-txt">
            <view style="display: flex;">
                <image :src="items.labelImg"></image>
                <view class="item-txt-title">{{items.title}}</view>
            </view>
            <view class="item-coupon">
                <view class="cop-con">
                    <view class="cop-txt">券</view>
                    <view class="cop-money">Â¥{{items.couponPrice}}</view>
                </view>
            </view>
            <view class="item-bottom">
                <view class="item-price">
                    <view>券后价<span class="item-price-prc">Â¥{{items.actualPrice}}</span></view>
                    <view style="text-decoration: line-through;">原价:{{items.originalPrice}}</view>
                </view>
                <view class="item-copy">复制链接</view>
            </view>
        </view>
    </view>
</template>
<script>
    export default {
        props: {
            items: Object,
            isrecord: {
                type: Boolean,
                default: false,
                text: ''
            },
        },
        created() {},
        methods: {
            copyText() {
                // #ifdef H5
                this.$copyText(this.text).then(
                    res => {
                        uni.showToast({
                            title: '优惠链接已复制,现在打开手机淘宝,领取优惠券吧~',
                            icon: 'none',
                            duration: 2500
                        })
                    }
                )
                // #endif
                // #ifndef H5
                uni.setClipboardData({
                    data: this.text,
                    success: () => {
                        uni.showToast({
                            title: '优惠链接已复制,现在打开手机淘宝,领取优惠券吧~',
                            icon: 'none',
                            duration: 2500
                        })
                    }
                })
                // #endif
            },
            getShareLink(items) {
                if (this.isrecord) { //记录点击
                    this.recordClick(items.goodsId, items.sourceType, items.dtitle, items.actualPrice);
                }
                var goodsid = items.goodsId;
                var that = this;
                let postdata = {
                    goodsId: goodsid
                };
                uni.showLoading({
                    title: '复制中..',
                    mask: true
                });
                this.$http.post('/api/taoke/get_privilege_link',
                    postdata
                ).then(e => {
                    uni.hideLoading();
                    if (e.code != 0) {
                        return;
                    }
                    this.text = e.data.info.longTpwd;
                    uni.getSystemInfo({
                        success: function(res) {
                            if (res.osName == 'ios') {
                                uni.showModal({
                                    title: '提示',
                                    content: '优惠信息复制后,请打开手机淘宝领券',
                                    showCancel: false,
                                    confirmText: '复制优惠信息',
                                    success: function(res) {
                                        if (res.confirm) {
                                            that.copyText();
                                        }
                                    }
                                });
                            }
                            else{
                                that.copyText();
                            }
                        }
                    });
                    //this.oncopy(e.data.info.longTpwd);
                }).catch(function(err) {
                    console.log(err);
                })
            },
            recordClick(goodsid, plat, title, act_price) {
                let postdata = {
                    goodsid: goodsid,
                    plat: plat,
                    title: title,
                    act_price: act_price
                }
                this.$http.post('/api/activity/recordItemClick',
                    postdata
                ).then(e => {
                }).catch(function(err) {
                    console.log(err);
                })
            }
        },
    }
</script>
<style>
    .item-price-prc {
        color: #fe3a3f;
        font-size: 1rem;
        margin-right: 0.2rem;
        font-weight: 500;
    }
    .cop-txt {
        padding: 0.1rem;
    }
    .cop-money {
        display: flex;
        align-items: center;
        height: 100%;
        font-weight: 400;
        color: #ff4d42;
        background: #fff;
        padding: 0.1rem;
    }
    .cop-con {
        display: inline-flex;
        background: linear-gradient(0deg, #ff753c, #ff4b42);
        color: #fff;
        padding: 0.05rem;
        font-size: 0.7rem;
    }
    .item-v {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem;
        background: #fff;
        border-radius: 0.3rem;
        width: 92%;
        margin: 0 auto;
        margin-bottom: 0.3rem;
    }
    .item-img {
        width: 20%;
    }
    .item-img image {
        width: 6rem;
        height: 6rem;
    }
    .item-txt {
        width: 70%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    .item-txt image {
        width: 1.6rem;
        height: 0.9rem;
    }
    .item-txt-title {
        font-size: 0.7rem;
        margin-left: 0.3rem;
        text-overflow: -o-ellipsis-lastline;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        width: 90%;
    }
    .item-price {
        display: flex;
        font-size: 0.5rem;
        align-items: baseline;
        color: #8d8484;
    }
    .item-bottom {
        display: flex;
        justify-content: space-between;
    }
    .item-copy {
        width: 5.22rem;
        height: 1.66rem;
        background: linear-gradient(-90deg, #fe3a3f, #faa450);
        font-size: 0.7rem;
        font-weight: 500;
        color: #fffefd;
        line-height: 1.66rem;
        text-align: center;
        border: 0;
        outline: 0;
        float: right;
        border-radius: 1rem;
    }
</style>
h5/apph5/components/setClipboard.js
h5/apph5/package-lock.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
{
  "name": "apph5",
  "lockfileVersion": 2,
  "requires": true,
  "packages": {
    "": {
      "dependencies": {
        "vue-clipboard2": "^0.3.3"
      }
    },
    "node_modules/clipboard": {
      "version": "2.0.11",
      "resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz",
      "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
      "dependencies": {
        "good-listener": "^1.2.2",
        "select": "^1.1.2",
        "tiny-emitter": "^2.0.0"
      }
    },
    "node_modules/delegate": {
      "version": "3.2.0",
      "resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz",
      "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
    },
    "node_modules/good-listener": {
      "version": "1.2.2",
      "resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz",
      "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
      "dependencies": {
        "delegate": "^3.1.2"
      }
    },
    "node_modules/select": {
      "version": "1.1.2",
      "resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz",
      "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA=="
    },
    "node_modules/tiny-emitter": {
      "version": "2.1.0",
      "resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
      "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
    },
    "node_modules/vue-clipboard2": {
      "version": "0.3.3",
      "resolved": "https://registry.npmmirror.com/vue-clipboard2/-/vue-clipboard2-0.3.3.tgz",
      "integrity": "sha512-aNWXIL2DKgJyY/1OOeITwAQz1fHaCIGvUFHf9h8UcoQBG5a74MkdhS/xqoYe7DNZdQmZRL+TAdIbtUs9OyVjbw==",
      "dependencies": {
        "clipboard": "^2.0.0"
      }
    }
  },
  "dependencies": {
    "clipboard": {
      "version": "2.0.11",
      "resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz",
      "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
      "requires": {
        "good-listener": "^1.2.2",
        "select": "^1.1.2",
        "tiny-emitter": "^2.0.0"
      }
    },
    "delegate": {
      "version": "3.2.0",
      "resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz",
      "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
    },
    "good-listener": {
      "version": "1.2.2",
      "resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz",
      "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
      "requires": {
        "delegate": "^3.1.2"
      }
    },
    "select": {
      "version": "1.1.2",
      "resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz",
      "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA=="
    },
    "tiny-emitter": {
      "version": "2.1.0",
      "resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
      "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
    },
    "vue-clipboard2": {
      "version": "0.3.3",
      "resolved": "https://registry.npmmirror.com/vue-clipboard2/-/vue-clipboard2-0.3.3.tgz",
      "integrity": "sha512-aNWXIL2DKgJyY/1OOeITwAQz1fHaCIGvUFHf9h8UcoQBG5a74MkdhS/xqoYe7DNZdQmZRL+TAdIbtUs9OyVjbw==",
      "requires": {
        "clipboard": "^2.0.0"
      }
    }
  }
}
h5/apph5/package.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
{
  "dependencies": {
    "vue-clipboard2": "^0.3.3"
  }
}
h5/apph5/pages/wxkf/gzhAuthBack.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
<template>
    <view>
        {{txt}}
    </view>
</template>
<script>
    import comUtils from '../../utils/ComUtils.js'
    export default {
        data() {
            return {
                txt: ''
            }
        },
        onLoad(option) {
            this.wxAuth(option.code);
        },
        methods: {
            fuzhi() {
                var that = this;
                uni.setClipboardData({
                    data: that.code
                });
            },
            wxAuth(code) {
                uni.showLoading({
                    title: '授权中',
                    mask: true
                });
                var that = this;
                that.$http.post('/wxback/KfWx/GetAuthCode', {
                    code: code
                }).then(e => {
                    console.log(e);
                    uni.hideLoading();
                    if (e == true)
                    {
                        this.txt = "授权成功,请关闭此页面"
                    }
                    else{
                        this.txt =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>
public/assets/index/js/targetapp.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,290 @@
new Vue({
    el: '#app', // é€‰æ‹©å™¨
    data: {
        show: 0,
        count: '',
        timer: null,
        agreeType: true, //
        tel: "", //手机号
        verification: '', //验证码
        showType: false,
        invitationInfo: "",
        privacyAgreement:"",
        userAgreement:"",
        appName: "",
        appLogo:"",
        beian:"",
        iosUrl:"",
        androidUrl:"",
        tips: "恭喜你,注册成功~",
        tips2: "欢迎您加入,赶紧下载APP,领取您的新人免单专属福利吧~",
        goodslist: [
        {"image": "https://img.alicdn.com/i3/880734502/O1CN01eDKk7i1j7xhJ5c7jV_!!880734502.jpg_310x310.jpg_.webp",
            "title": "手撕面包2斤"
        },
        {"image": "https://img.alicdn.com/imgextra/i2/2201188731272/O1CN01sR96eg1LGcSFr2aTK_!!2201188731272.jpg_310x310.jpg_.webp",
            "title": "Unifree洗脸巾"
        },
        {"image": "https://img.alicdn.com/imgextra/i4/2479240580/O1CN01g1cwOs1G9gTFkXFGZ_!!2479240580.png_310x310.jpg_.webp",
            "title": "手持小风扇"
        },
        {"image": "https://img.alicdn.com/i4/2203738468138/O1CN01glAoIC29zFvNJAGhW_!!2203738468138.jpg_310x310.jpg_.webp",
            "title": "牛油果沐浴露"
        },
        {"image": "https://img.alicdn.com/imgextra/i4/438927567/O1CN01vaRzJN25ljmb0wxZR_!!438927567.jpg_310x310.jpg_.webp",
            "title": "无糖薄荷糖"
        },
        {"image": "https://img.alicdn.com/imgextra/i1/503512336/O1CN01wTeXWv1T7vxTSWEr2_!!503512336.jpg_310x310.jpg_.webp",
            "title": "高蛋白鸡胸肉"
        },
        {"image": "https://img.alicdn.com/imgextra/i4/441512085/O1CN017tZRxE1RGyY2vgJF2_!!441512085.jpg_310x310.jpg_.webp",
            "title": "4只鲜肉粽子"
        },
        {"image": "https://img.alicdn.com/imgextra/i1/1952819637/O1CN01rQrJu32L3nddEPV0l_!!1952819637.jpg_310x310.jpg_.webp",
            "title": "加厚无芯卷纸"
        },
        {"image": "https://img.alicdn.com/i1/54801414/O1CN01jaEMbE1MJemh7RYJK_!!54801414.jpg_310x310.jpg_.webp",
            "title": "大樱桃车厘子"
        }],
    },
    created() {
        this. judgeWeb();
        this.goDownload();
    },
    mounted() {
        //  è®¿é—®vm1 data的数据
    },
    methods: {
        getcode() {
            const times = 60; // å€’计时时间
            if (!this.timer) {
                this.count = times;
                this.show = 1;
                this.timer = setInterval(() => {
                    if (this.count > 0 && this.count <= times) {
                        this.count--;
                    } else {
                        this.show = 2;
                        clearInterval(this.timer);
                        this.timer = null;
                    }
                }, 1000)
            }
        },
        //立即下载
        download() {
            this.showType = true;
        },
        //注册即同意
        agreeCen() {
            this.agreeType = !this.agreeType
        },
        //复制
        handleClipboard() {
            var _this = this;
            var clipboardImg = new Clipboard('.yqm', {
                text: function() {
                    return _this.invitationInfo.invitation_code;
                },
            });
            clipboardImg.on('success', function(e) {
               alert("邀请码复制成功,赶快下载APP,尽享优惠吧~")
            });
            clipboardImg.on('error', function(e) {
                alert("邀请码复制失败,您可直接至APP中注册后填写此邀请码")
            });
        },
        getInvitationInfo() {
            var code = vmRequest("code");
            //alert(code);
            //以param属性的形式来传递参数
            axios({
                method: "post", //请求方式
                url: "/index/user/getInvitationInfo", //请求路径
                params: {
                    "code": code
                } //传递参数
                //使用 ç®­å¤´è¡¨è¾¾å¼=> åœ¨ä»£æ›¿åŽŸæœ‰çš„function来做回调函数
            }).then(result => {
                if (result.data.code == 1) {
                    alert(result.data.msg);
                } else {
                    this.invitationInfo = result.data.info.user;
                    this.appName = result.data.info.appName;
                    this.privacyAgreement = result.data.info.privacyAgreement;
                    this.userAgreement = result.data.info.userAgreement;
                    this.appLogo = result.data.info.logo;
                    this.beian = result.data.info.beian;
                    this.iosUrl = result.data.info.appIosDownUrl;
                    this.androidUrl = result.data.info.appAndroidDownUrl;
                }
            })
        },
        phoneIsRegister() {
            if (!this.tel) {
                alert("手机号不能为空")
                return false;
            }
            axios({
                method: "post", //请求方式
                url: "/index/user/phoneIsRegister", //请求路径
                params: {
                    "phone": this.tel
                } //传递参数
                //使用 ç®­å¤´è¡¨è¾¾å¼=> åœ¨ä»£æ›¿åŽŸæœ‰çš„function来做回调函数
            }).then(result => {
                if (result.data.code == 1) {
                    alert(result.data.msg);
                } else {
                    // å·ç æœªæ³¨å†Œ å‘送验证码请求
                    // å·ç å·²ç»æ³¨å†Œ
                    console.log(result.data)
                    if(result.data.is_registered == 1){
                        this.tips = "您的帐号已经注册";
                        this.tips2 = "欢迎您加入"+this.appName+",赶紧下载APP,赚取佣金吧~";
                        this.showType = true;
                        this.show = 1 //结束验证码
                        //alert(result.data.message);
                    }else{
                        this.sendCode();
                    }
                }
            })
        },
        // å‘送验证码
        sendCode() {
            console.log("发送验证码")
            var timerChuo = new Date().getTime()
            // æ‹¼å‡‘数据
            var sendInfo = {
                event: 'register',
                mobile: this.tel,
            };
            axios({
                method: "post", //请求方式
                url: "/api/sms/send", //请求路径
                data: sendInfo
                // headers: {
                //     'Content-Type': 'application/json;charset=UTF-8'
                // },
                //传递参数
                //使用 ç®­å¤´è¡¨è¾¾å¼=> åœ¨ä»£æ›¿åŽŸæœ‰çš„function来做回调函数
            }).then(result => {
                if (result.data.code == 1) {
                    // å·ç å·²ç»æ³¨å†Œ
                    alert( result.data.msg);
                } else {
                    // å·ç æœªæ³¨å†Œ å‘送验证码请求
                    //alert("验证码发送成功" + result.data.message);
                    this.getcode();
                }
            })
        },
        goDownload() {
                var marketUrl='dafanguan://{"url":"/pages/rankinglist/common_act","totype":"0"}';
                window.location = marketUrl;
             },
            verifyBrand()
            {//判断机子类型
                const userAgent = navigator.userAgent.toLowerCase()
                const isIphone = userAgent.match(/(iphone|ipad|ipod)/i);
                const isHuawei = userAgent.match(/huawei/i);
                const isHonor = userAgent.match(/honor/i);
                const isOppo = userAgent.match(/oppo/i);
                const isOppoR15 = userAgent.match(/PACM00/i);
                const isVivo = userAgent.match(/vivo/i);
                const isXiaomi = userAgent.match(/mi\s/i);
                const isXIAOMI = userAgent.match(/xiaomi/i);
                const isXiaomi2s = userAgent.match(/mix\s/i);
                const isRedmi = userAgent.match(/redmi/i);
                if (isIphone) {
                    return 'iphone'
                } else if (isHuawei || isHonor) {
                    return 'huawei';
                } else if (isOppo || isOppoR15) {
                    return 'oppo';
                } else if (isVivo) {
                    return 'vivo';
                } else if (isXiaomi || isRedmi || isXiaomi2s || isXIAOMI) {
                    return 'xiaomi';
                } else {
                    return 'other';
                }
            },
            judgeWeb()
            {
                var webName=this.isNeizhi();
                if(webName=='weixin')
                {
                    alert("请点击右上角,选择'在浏览器打开'~");
                }
                else if(webName=='QQ')
                {
                    alert("请点击右上角,选择'浏览器',打开本网址~");
                }
            },
            isNeizhi()
            {//判断是否内置浏览器
                var ua = navigator.userAgent.toLowerCase();
                // var browserName = "unknow";
                if (ua.match(/MicroMessenger/i) == "micromessenger") {
                    return "weixin";
                } else if (ua.match(/QQ/i) == "qq") {
                    return "QQ";
                } else if (ua.match(/Alipay/i) == "alipay" && payway == 2) {
                    return "alipay";
                }
            },
        /* ç”¨æˆ·æ³¨å†Œ */
        userRegist() {
            if (!this.tel) {
                alert("手机号不能为空")
                return false;
            }
            if (!this.verification) {
                alert("验证码不能为空")
                return false;
            }
            if (this.agreeType) {
                alert("请先阅读并同意《"+this.appName+"用户协议》《隐私政策》")
                return false;
            }
            // æ‹¼å‡‘数据
            var sendInfo = {
                mobile: this.tel,
                captcha: this.verification,
                invitation_code: this.invitationInfo.invitation_code
            };
            axios({
                method: "post", //请求方式
                url: "/api/user/register", //请求路径
                data: sendInfo,
                headers: {
                    'Content-Type': 'application/json;charset=UTF-8'
                },
                //传递参数
                //使用 ç®­å¤´è¡¨è¾¾å¼=> åœ¨ä»£æ›¿åŽŸæœ‰çš„function来做回调函数
            }).then(result => {
                if (result.data.code == 0) {
                    // æ³¨å†ŒæˆåŠŸ
                    this.tips2 = "欢迎您加入"+this.appName+",赶紧下载APP,赚取佣金吧~";
                    this.showType = true;
                } else {
                    //失败
                    alert("注册失败" + result.data.message);
                }
            })
        },
    }
})