poster.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  6. <meta name="format-detection" content="telephone=no">
  7. <meta name="wap-font-scale" content="no">
  8. <meta name="keywords" content="海报"/>
  9. <meta name="description" content="第五创海报" />
  10. <title>海报</title>
  11. <!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script> -->
  12. <script type="text/javascript">
  13. (function() {
  14. function adapt(designWidth, rem2px){
  15. var d = window.document.createElement('div');
  16. d.style.width = '1rem';
  17. d.style.display = "none";
  18. var head = window.document.getElementsByTagName('head')[0];
  19. head.appendChild(d);
  20. var defaultFontSize = parseFloat(window.getComputedStyle(d, null).getPropertyValue('width'));
  21. d.remove();
  22. document.documentElement.style.fontSize = window.innerWidth / designWidth * rem2px / defaultFontSize * 100 + '%';
  23. var st = document.createElement('style');
  24. var portrait = "@media screen and (min-width: "+window.innerWidth+"px) {html{font-size:"+ ((window.innerWidth/(designWidth/rem2px)/defaultFontSize)*100) +"%;}}";
  25. var landscape = "@media screen and (min-width: "+window.innerHeight+"px) {html{font-size:"+ ((window.innerHeight/(designWidth/rem2px)/defaultFontSize)*100) +"%;}}"
  26. st.innerHTML = portrait + landscape;
  27. head.appendChild(st);
  28. return defaultFontSize
  29. };
  30. var defaultFontSize = adapt(750, 100);
  31. })();
  32. // var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1260943213'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s4.cnzz.com/z_stat.php%3Fid%3D1260943213' type='text/javascript'%3E%3C/script%3E"));
  33. </script>
  34. </head>
  35. <style type="text/css">
  36. html {
  37. -webkit-text-size-adjust: 100%;
  38. height: 100%;
  39. -webkit-user-select: none;
  40. }
  41. html,
  42. body,
  43. div,
  44. ul,
  45. li,
  46. p,
  47. h1,
  48. h3,
  49. h4,
  50. h5,
  51. figure,
  52. figcaption {
  53. margin: 0;
  54. padding: 0;
  55. border: 0;
  56. font-weight: normal
  57. }
  58. li {
  59. list-style: none;
  60. }
  61. a {
  62. text-decoration: none;
  63. }
  64. html{
  65. height: 100%;
  66. }
  67. body {
  68. font-family: "微软雅黑", "Microsoft Yahei";
  69. position: relative;
  70. color: #000;
  71. -webkit-font-smoothing: antialiased;
  72. height: 100%
  73. }
  74. .clear {
  75. clear: both;
  76. }
  77. .d5c-poster {
  78. width: 100%;
  79. height: 100%;
  80. margin: 0;
  81. padding: 0;
  82. }
  83. .d5c-poster__all {
  84. position: relative;
  85. width: 100%;
  86. height: 100%;
  87. font-size: 0;
  88. }
  89. .d5c-poster__img {
  90. position: absolute;
  91. top: 0;
  92. width: 100%;
  93. }
  94. .d5c-poster__img img {
  95. width: 100%;
  96. font-size: 0;
  97. z-index: 1;
  98. }
  99. .d5c-poster__content {
  100. position: absolute;
  101. top: 0.4rem;
  102. width: 100%;
  103. padding: 0 0.38rem;
  104. box-sizing: border-box;
  105. z-index: 99;
  106. }
  107. .d5c-poster__header {
  108. margin-bottom: 0.6rem;
  109. }
  110. .d5c-poster__head {
  111. float: left;
  112. width: 0.9rem;
  113. height: 0.64rem;
  114. margin-right: 0.2rem;
  115. border-radius: 0.1rem;
  116. background-color: rgba(130,130,130,0.7);
  117. }
  118. .d5c-poster__head img {
  119. float: right;
  120. width: 0.64rem;
  121. height: 0.64rem;
  122. border-radius: 0.1rem;
  123. }
  124. .d5c-poster__head p {
  125. color: #fff;
  126. font-size: 0.14rem;
  127. margin-left: 0.06rem;
  128. }
  129. .d5c-poster__nickname {
  130. float: left;
  131. color: #272727;
  132. }
  133. .d5c-poster__logo {
  134. float: right;
  135. width: 2.02rem;
  136. }
  137. .d5c-poster__logo img {
  138. width: 2.02rem;
  139. height: 0.7rem;
  140. }
  141. .d5c-poster__title {
  142. font-size: 0.6rem;
  143. color: #2b2b2b;
  144. }
  145. .d5c-poster__desc {
  146. font-size: 0.4rem;
  147. color: #2b2b2b;
  148. margin-top: 0.2rem;
  149. margin-bottom: 0.6rem;
  150. }
  151. .d5c-poster__price {
  152. font-size: 0.48rem;
  153. color: #2b2b2b;
  154. }
  155. .d5c-poster__price span {
  156. color: #e32525;
  157. font-weight: bold;
  158. }
  159. .d5c-poster__originPrice {
  160. margin-top: 0.2rem;
  161. color: #888888;
  162. font-size: 0.3rem;
  163. text-decoration:line-through
  164. }
  165. </style>
  166. <body class="d5c-poster">
  167. <div class="d5c-poster__all">
  168. <div class="d5c-poster__img">
  169. <img src="http://cdn.img.d5c360.com/static/mid_year/image/data0.jpg" />
  170. </div>
  171. <div class="d5c-poster__content">
  172. <div class="d5c-poster__header">
  173. <div class="d5c-poster__user">
  174. <div class="d5c-poster__head">
  175. <img src="http://d5c.oss-cn-shenzhen.aliyuncs.com/static/wx_green.jpg" />
  176. <div>
  177. <p>你</p>
  178. <p>的</p>
  179. <p>好</p>
  180. <p>友</p>
  181. </div>
  182. </div>
  183. <div class="d5c-poster__nickname">
  184. <p style="font-size: 0.3rem;">Sunny</p>
  185. <p style="font-size: 0.18rem;">正在领取...</p>
  186. </div>
  187. </div>
  188. <div class="d5c-poster__logo">
  189. <img src="http://d5c.oss-cn-shenzhen.aliyuncs.com/static/wx_green.jpg" />
  190. </div>
  191. <div class="clear"></div>
  192. </div>
  193. <div>
  194. <h3 class="d5c-poster__title">真功夫 滑溜溜水蛋</h3>
  195. <h4 class="d5c-poster__desc">现象滑嫰,营养丰富</h4>
  196. <h3 class="d5c-poster__price">
  197. <span>0元</span>领取
  198. </h3>
  199. <p class="d5c-poster__originPrice">原价16元</p>
  200. </div>
  201. <div style="width: 2rem;height: 2rem; float: right;margin-top: 5rem;">
  202. <img id="qrUrl" src="" style="width: 2rem;height: 2rem;" />
  203. </div>
  204. </div>
  205. </div>
  206. </body>
  207. <script type="text/javascript">
  208. (function () {
  209. function getUrlArgStr () {
  210. var q = window.location.search.substr(1);
  211. var qs = q.split('&');
  212. var argStr = '';
  213. if (qs) {
  214. for (var i = 0;i < qs.length; i++) {
  215. argStr += qs[i].substring(0,qs[i].indexOf('=')) + '=' + qs[i].substring(qs[i].indexOf('=') + 1) + '&';
  216. }
  217. }
  218. return argStr
  219. }
  220. function ajaxGet () {
  221. var xhr = new XMLHttpRequest();
  222. if (xhr.withCredentials === undefined) {
  223. return;
  224. }
  225. xhr.open("get", "http://testapi.d5c360.com/v1/activity/poster/2/146", true);
  226. // xhr.open("get", "http://testapi.d5c360.com/v1/ad/m_home/items", true);
  227. xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded;charset=UTF-8");
  228. xhr.send();
  229. xhr.onreadystatechange = function () {
  230. if (xhr.readyState !== 4) return;
  231. if (xhr.status === 200) {
  232. var data = JSON.parse(xhr.responseText);
  233. var qr = document.getElementById("qrUrl");
  234. var imgSrc = qr.setAttribute("src", data.qrcode_url);
  235. // qr.src = data[0].img;
  236. console.log(data)
  237. }
  238. }
  239. console.log('有没有执行呢2')
  240. }
  241. ajaxGet();
  242. getUrlArgStr();
  243. args = getUrlArgStr().split("&")
  244. console.log(args);
  245. // function getData () {
  246. // $.ajax({
  247. // type: "get",
  248. // url: "http://testapi.d5c360.com/v1/user/check",
  249. // dataType: "jsonp",
  250. // jsonp: "jsonpCallback",
  251. // success: function (data) {
  252. // console.log(data);
  253. // }
  254. // });
  255. // }
  256. // getData();
  257. })();
  258. </script>
  259. </html>