index.html 8.63 KB
Newer Older
1 2 3 4
<!DOCTYPE html>
<html>

<head>
5 6 7 8
    <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>
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
    <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;
        }
28 29
        .main>.titles {
            /*border: 2px solid cyan;*/
30
            width: 100%;
31 32 33 34 35 36 37 38
            height: 8rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        .main>.titles>.title {
            font-size: 3rem;
39 40 41
            color: white;
            text-align: center;
        }
42 43 44 45
        .main>.cards {
            /*border: 2px solid red;*/
            /*background-color: whitesmoke;*/
            width: 76%;
46
            height: auto;
47

48
            /*padding: 0 2rem;*/
49 50 51 52 53 54 55

            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
        }
        .main>.cards>.card {
56
            /*border: 2px solid orange;*/
57 58
            /*background-color: white;*/
            width: 100%;
59
            /*padding: 4rem 2rem;*/
60 61 62
        }
        .main>.cards>.card01 {
            /*border-radius: 1rem 1rem 0 0;*/
63 64
            border-top-left-radius: 1rem;
            border-top-right-radius: 1rem;
65
            background: white;
66 67 68 69 70 71 72 73 74 75 76
            background:
                    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;
            background-size: 50% 50%;
            background-repeat: no-repeat;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
77 78
        }
        .main>.cards>.card01>.titles {
79 80
            margin: 4rem 2rem 0 2rem;

81 82 83 84 85 86 87
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        .main>.cards>.card01>.titles>.title {
            font-size: 3rem;
88
            margin-bottom: 2rem;
89 90
        }
        .main>.cards>.card01>.titles>.discount {
91 92 93 94 95 96 97 98 99
            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;
100 101 102
            font-size: 4rem;
        }
        .main>.cards>.card01>.titles>.description {
103 104 105 106 107 108
            /*font-size: 2rem;*/
            font-size: 1rem;
            color: grey;
        }
        .main>.cards>.card01>.rules {
            margin: 2rem 2rem 4rem 2rem;
109 110 111 112 113
        }

        .main>.cards>.card01>.rules>.rule {
            font-size: 2rem;
        }
114 115 116 117 118
        .main>.cards>.line {
            background-color: white;
            width: 90%;
            border-bottom: 4px dotted rgba(15, 106, 184, 0.99);
        }
119 120
        .main>.cards>.card02 {
            /*border-radius: 0 0 1rem 1rem;*/
121 122
            border-bottom-left-radius: 1rem;
            border-bottom-right-radius: 1rem;
123
            background: white;
124 125 126 127 128 129 130
            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;
131 132
        }

133 134 135
        .main>.cards>.card02>.tips {
            margin: 4rem 2rem;
        }
136 137 138 139 140 141 142
        .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;
143
        }
144 145 146 147 148 149
        .main>.cards>.card02>.tips>.qrcodes {
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
        }
150
        .main>.cards>.card02>.tips>.qrcodes>.qrcode {
151 152
            width: 50%;
        }
153
        .main>.cards>.card02>.tips>.qrcodes>.qrcodeTip {
154 155
            font-size: 1rem;
            color: grey;
156
        }
157 158 159 160 161
    </style>
</head>

<body>
<div class="main">
162
    <div class="titles">
163
        <!--<div class="title">优惠券详情</div>-->
164
    </div>
165 166 167
    <div class="cards">
        <div class="card card01" id="card01">
            <div class="titles">
168 169 170
                <div class="title">惊喜满减券</div>
                <div class="discount"><div class="number"> 20 </div></div>
                <div class="description">满 50 元可用</div>
171 172
            </div>
            <ul class="rules">
173
                <li class="rule">满 50 元可用</li>
174 175 176
                <li class="rule">有效期 2019-10-15 04:00:00 至 2019-10-15 04:01:00</li>
            </ul>
        </div>
177
            <div class="line"></div>
178 179 180 181
        <div class="card card02" id="card02">
            <div class="tips">
                <div class="tip">使用说明</div>
                <ul class="rules">
182
                    <li class="rule">单次结算时候仅能使用一张优惠券折扣</li>
183 184 185 186
                    <li class="rule">单张优惠券不可叠加、找零、续用、残缺</li>
                    <li class="rule">该优惠券有效时间为 2019-10-15 04:00:00 至 2019-10-15 04:01:00 ,过期/提前均不可使用</li>
                </ul>
                <div class="qrcodes">
187 188 189 190
                    <!--<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>
191 192 193 194 195 196
                </div>

            </div>
        </div>
    </div>
</div>
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

<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)
xd's avatar
xd committed
237
                // $('#image').attr('src', 'http://oysales.oywanhao.com/qrCode/1584512690487.jpeg')
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
            },
            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>
254 255
</body>

256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
</html>