index.html 8.62 KB
Newer Older
xd's avatar
xd committed
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
<!DOCTYPE html>
<html>

<head>
    <meta lang="zh-cn">
    <title>优惠券详情</title>
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <script src='https://code.jquery.com/jquery-3.2.1.min.js'></script>
    <style>
        body {
            background-color: rgba(15, 106, 184, 0.99);
            font-size: 10px;
            margin: 0;
            padding: 0;
        }
        .main {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;

            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
            overflow: hidden;
        }
        .main>.titles {
            /*border: 2px solid cyan;*/
            width: 100%;
            height: 8rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        .main>.titles>.title {
            font-size: 3rem;
            color: white;
            text-align: center;
        }
        .main>.cards {
            /*border: 2px solid red;*/
            /*background-color: whitesmoke;*/
            width: 76%;
            height: auto;

            /*padding: 0 2rem;*/

            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
        }
        .main>.cards>.card {
            /*border: 2px solid orange;*/
            /*background-color: white;*/
            width: 100%;
            /*padding: 4rem 2rem;*/
        }
        .main>.cards>.card01 {
            /*border-radius: 1rem 1rem 0 0;*/
            border-top-left-radius: 1rem;
            border-top-right-radius: 1rem;
            background: white;
            background:
xd's avatar
xd committed
67 68 69 70
                linear-gradient(135deg, transparent 0, white 0) top left,
                linear-gradient(-135deg, transparent 0, white 0) top right,
                radial-gradient(circle at bottom right, transparent 2rem, white 0) bottom right,
                radial-gradient(circle at bottom left, transparent 2rem, white 0) bottom left;
xd's avatar
xd committed
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
            background-size: 50% 50%;
            background-repeat: no-repeat;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
        }
        .main>.cards>.card01>.titles {
            margin: 4rem 2rem 0 2rem;

            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        .main>.cards>.card01>.titles>.title {
            font-size: 3rem;
            margin-bottom: 2rem;
        }
        .main>.cards>.card01>.titles>.discount {
            font-size: 3rem;
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
        }
        .main>.cards>.card01>.titles>.discount>.number {
            margin-right: 1rem;
            color: orangered;
            font-size: 4rem;
        }
        .main>.cards>.card01>.titles>.description {
            /*font-size: 2rem;*/
            font-size: 1rem;
            color: grey;
        }
        .main>.cards>.card01>.rules {
            margin: 2rem 2rem 4rem 2rem;
        }

        .main>.cards>.card01>.rules>.rule {
            font-size: 2rem;
        }
        .main>.cards>.line {
            background-color: white;
            width: 90%;
            border-bottom: 4px dotted rgba(15, 106, 184, 0.99);
        }
        .main>.cards>.card02 {
            /*border-radius: 0 0 1rem 1rem;*/
            border-bottom-left-radius: 1rem;
            border-bottom-right-radius: 1rem;
            background: white;
            background:
                    radial-gradient(circle at top left, transparent 2rem, white 0) top left,
                    radial-gradient(circle at top right, transparent 2rem, white 0) top right,
                    linear-gradient(45deg, transparent 1px, white 0) bottom right,
                    linear-gradient(-45deg, transparent 1px, white 0) bottom left;
            background-size: 50% 50%;
            background-repeat: no-repeat;
        }

        .main>.cards>.card02>.tips {
            margin: 4rem 2rem;
        }
        .main>.cards>.card02>.tips>.tip {
            font-size: 2rem;
            font-weight: bold;
        }
        .main>.cards>.card02>.tips>.rules {}
        .main>.cards>.card02>.tips>.rules>.rule {
            font-size: 2rem;
        }
        .main>.cards>.card02>.tips>.qrcodes {
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
        }
        .main>.cards>.card02>.tips>.qrcodes>.qrcode {
            width: 50%;
        }
        .main>.cards>.card02>.tips>.qrcodes>.qrcodeTip {
            font-size: 1rem;
            color: grey;
        }
    </style>
</head>

<body>
<div class="main">
    <div class="titles">
        <!--<div class="title">优惠券详情</div>-->
    </div>
    <div class="cards">
        <div class="card card01" id="card01">
            <div class="titles">
                <div class="title">惊喜满减券</div>
                <div class="discount"><div class="number"> 20 </div></div>
                <div class="description">满 50 元可用</div>
            </div>
            <ul class="rules">
                <li class="rule">满 50 元可用</li>
                <li class="rule">有效期 2019-10-15 04:00:00 至 2019-10-15 04:01:00</li>
            </ul>
        </div>
            <div class="line"></div>
        <div class="card card02" id="card02">
            <div class="tips">
                <div class="tip">使用说明</div>
                <ul class="rules">
                    <li class="rule">单次结算时候仅能使用一张优惠券折扣</li>
                    <li class="rule">单张优惠券不可叠加、找零、续用、残缺</li>
                    <li class="rule">该优惠券有效时间为 2019-10-15 04:00:00 至 2019-10-15 04:01:00 ,过期/提前均不可使用</li>
                </ul>
                <div class="qrcodes">
                    <!--<img class="qrcode" src="qrcodeBuy.png" alt />-->
                    <!--<img class="qrcode" id="image" src="QRCodeOY.png" alt />-->
                    <img class="qrcode" id="image" src="" alt />
                    <div class="qrcodeTip">长按识别二维码</div>
                </div>

            </div>
        </div>
    </div>
</div>

<script>
    const cleanUrlAndPostQRInfo = () => {
        // alert(`--->qrCode: cleanUrlAndPostQRInfo: IN.`)

        let nowUrl = ''
        let id = ''
        let actionid = ''
        let activeId = ''
        let voucherId = ''
        let unionId = ''

        nowUrl = document.location.toString().slice(42);
        // alert(`--->nowUrl =${nowUrl}`)
        id = String(nowUrl.split("?")[1].slice(3).split("&")[0]);
        actionid = String(nowUrl.split("?")[1].slice(3).split("&")[1].split("=")[1]);
        activeId = String(nowUrl.split("?")[1].slice(3).split("&")[2].split("=")[1]);
        voucherId = String(nowUrl.split("?")[1].slice(3).split("&")[3].split("=")[1]);
        unionId = String(nowUrl.split("?")[1].slice(3).split("&")[4].split("=")[1]);

        // let pageUri = `${nowUrl}&detailid=${voucherId}&actionid=${activeId}&unionid=${unionId}`;
        let pageUri = `${nowUrl}`;
        pageUri = pageUri.split('&').slice(0, 5).join('&')
        let pageUrl = `http://139.155.48.151:8085/workWx/auth/oauth2/wxMiniQrCode?pageUri=${pageUri}`;
        // document.getElementById('uri').innerHTML = 'Uri=' + String(pageUri)


        // alert(`--->qrCode: Ajax: POST: pageUrl = ${pageUrl}`)
        // document.location = pageUri

        $.ajax({
            type: "POST",
            url: pageUrl,
            // data: JSON.stringify({ path: "pages/signIn/signIn" }),
            data: {},
            success: function (res) {
                // alert(`--->qrCode: ajax: res.`)
                // alert(`--->qrCode: ajax: res: res =${JSON.stringify(res)}`)
                console.log(res)
                $('#image').attr('src', res.data)
                // $('#image').attr('src', 'http://qywx2.100smartdata.com/qrCode/1584512690487.jpeg')
            },
            error: function (data) {
                alert(`--->qrCode: ajax: err.`)
                alert(`--->qrCode: ajax: err: err =${JSON.stringify(err)}`)
                alert('error' + JSON.stringify(data))
                console.log(data);
            }
        });
    }

    const __main = () => {
        cleanUrlAndPostQRInfo()
    }

    __main()
</script>
</body>

</html>