HuaJingwen 6 years ago
parent
commit
064aa6f62e
1 changed files with 20 additions and 3 deletions
  1. 20 3
      coupon_list/index.html

+ 20 - 3
coupon_list/index.html

@@ -208,16 +208,33 @@
208 208
         </div>
209 209
         <script src="axios.min.js" type="text/javascript" charset="utf-8"></script>
210 210
         <script type="text/javascript" charset="utf-8">
211
+            function getURLCode() {
212
+                var search = location.search.length > 0 ? location.search.substring(1) : '',
213
+                    args = {},
214
+                    items = search.length ? search.split('&') : [],
215
+                    item = null,
216
+                    name = null,
217
+                    value = null,
218
+                    i = 0,
219
+                    len = items.length,
220
+                    data = '';
221
+                for (i = 0; i < len; i++) {
222
+                  item = items[i].split('=');
223
+                  name = decodeURIComponent(item[0]);
224
+                  value = decodeURIComponent(item[1]);
225
+                  if (item.length) {args[name] = value }
226
+                }
227
+                return args;
228
+            }
211 229
             window.onload = function () {
230
+                var device_type = getURLCode()['device_type'] || 1;
212 231
                 var copy_2 = document.querySelector("copy_2"),
213 232
                       copy_1 = document.querySelector("copy_1"),
214 233
                       toast = document.getElementById("toast"),
215 234
                       btn = [],
216 235
                       listWrapper = document.querySelector('.wrapper .activity_list');
217 236
 
218
-                axios.get('/api/v2/adv/advActivity', {
219
-                    activity_id: 1
220
-                  })
237
+                axios.get('/api/v2/adv/advActivity?activity_id=1&device_type=' + device_type)
221 238
                   .then(function (response) {
222 239
                       var res = response.data, data = null, html = '';
223 240
                       if (res.errno == 0) {