From 4eb8d3f5c8967fa890a18a2ba44994ac0b10e809 Mon Sep 17 00:00:00 2001
From: zhaojs <349234519@qq.com>
Date: 星期二, 22 八月 2023 14:36:09 +0800
Subject: [PATCH] no message

---
 public/assets/index/js/targetapp.js |  290 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 290 insertions(+), 0 deletions(-)

diff --git a/public/assets/index/js/targetapp.js b/public/assets/index/js/targetapp.js
new file mode 100644
index 0000000..232d9f6
--- /dev/null
+++ b/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("閭�璇风爜澶嶅埗鎴愬姛锛岃刀蹇笅杞紸PP锛屽敖浜紭鎯犲惂~")
+            });
+
+            clipboardImg.on('error', function(e) {
+                alert("閭�璇风爜澶嶅埗澶辫触锛屾偍鍙洿鎺ヨ嚦APP涓敞鍐屽悗濉啓姝ら個璇风爜")
+            });
+        },
+        getInvitationInfo() {
+            var code = vmRequest("code");
+            //alert(code);
+            //浠aram灞炴�х殑褰㈠紡鏉ヤ紶閫掑弬鏁�
+            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+"锛岃刀绱т笅杞紸PP锛岃禋鍙栦剑閲戝惂~";
+                        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://pages/mine/mine";
+                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+"锛岃刀绱т笅杞紸PP锛岃禋鍙栦剑閲戝惂~";
+                    this.showType = true;
+                } else {
+                    //澶辫触
+                    alert("娉ㄥ唽澶辫触" + result.data.message);
+
+                }
+            })
+
+        },
+    }
+
+})
\ No newline at end of file

--
Gitblit v1.9.3