海鲜阿嫂

template1.html 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta content="yes" name="apple-mobile-web-app-capable">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0"
  7. />
  8. <title>海鲜阿嫂</title>
  9. <script type="text/javascript" src="../common/jquery-2.1.0.js"></script>
  10. <script type="text/javascript">
  11. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth / 375) + "px";
  12. window.onresize = function () {
  13. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth / 375) + "px";
  14. }
  15. </script>
  16. </head>
  17. <style>
  18. body,div,ul,ol,dl,dd,h1,h2,h3,h4,h5,h6,figure,form,fieldset,legend,input,textarea,button,p,blockquote,th,td,pre,xmp{margin:0;padding:0;-webkit-overflow-scrolling: touch;}
  19. body,input,textarea,button,select,pre,xmp,tt,code,kbd,samp{line-height:1.5;font-family: -apple-system,SF UI Text,Helvetica Neue,Helvetica,Arial,sans-serif;}
  20. h1,h2,h3,h4,h5,h6{font-family:tahoma,arial,"Hiragino Sans GB","微软雅黑",simsun,sans-serif}
  21. .loading {
  22. position: fixed;
  23. top: 0;
  24. left: 0;
  25. display: none;
  26. width: 100%;
  27. height: 100vh;
  28. z-index: 99;
  29. }
  30. .loading img {
  31. position: absolute;
  32. top: 0;
  33. bottom: 0;
  34. left: 0;
  35. right: 0;
  36. margin: auto;
  37. width: 0.3rem;
  38. height: 0.3rem;
  39. }
  40. .alert-info {
  41. position: fixed;
  42. top: 1.74rem;
  43. right: 0;
  44. left: 0;
  45. bottom: 0;
  46. text-align: center;
  47. z-index: 9;
  48. }
  49. .alert-info p {
  50. display: inline-block;
  51. text-align: left;
  52. height: 0.38rem;
  53. color: #fff;
  54. font-size: 0.14rem;
  55. line-height: 0.38rem!important;
  56. padding: 0 0.10rem;
  57. background-color: rgba(0, 0, 0, 0.7);
  58. border-radius: 5px;
  59. }
  60. body{
  61. width: 100%;
  62. height: 100%;
  63. background: #ffffff;
  64. padding-top: 0.1rem;
  65. }
  66. .content{
  67. width: calc(100% - 0.2rem);
  68. margin: auto;
  69. font-size: 0.14rem;
  70. line-height: 0.2rem;
  71. letter-spacing:0.1em;
  72. padding-bottom: 0.4rem;
  73. }
  74. img{
  75. width: 100%;
  76. margin: 0.1rem 0;
  77. }
  78. p{
  79. margin: 0.1rem 0;
  80. }
  81. .content_evm{
  82. text-align: center;
  83. }
  84. .content_evm img{
  85. width: 1.64rem;
  86. display:inline-block ;
  87. vertical-align: middle;
  88. }
  89. .content_evm .evm{
  90. width: 1.4rem;
  91. }
  92. .bottom{
  93. height: 0.5rem;
  94. width: 100%;
  95. background: #06af06;
  96. color: #ffffff;
  97. font-size: 0.14rem;
  98. line-height: 0.5rem;
  99. text-align: center;
  100. position: fixed;
  101. bottom: 0;
  102. left: 0;
  103. }
  104. .elasticFrameMask{
  105. position: fixed;
  106. left: 0;
  107. top: 0;
  108. width: 100%;
  109. height: 100vh;
  110. background: rgba(0, 0, 0, 0.7);
  111. display: none;
  112. text-align: center;
  113. }
  114. .elasticFrameMask .elasticFrame{
  115. width: 3rem;
  116. height: 2rem;
  117. position: absolute;
  118. top: 0;
  119. bottom: 0;
  120. left: 0;
  121. right: 0;
  122. margin: auto;
  123. background: #fff;
  124. border-radius: 0.06rem;
  125. }
  126. .elasticFrameMask .elasticFrame .content_evm{
  127. line-height: 0;
  128. margin-top: 0.1rem;
  129. }
  130. .elasticFrameMask .elasticFrame .content_evm .evm{
  131. width: 1.1rem;
  132. margin: 0;
  133. }
  134. .elasticFrameMask .elasticFrame .content_evm img{
  135. width: 1.3rem;
  136. margin: 0;
  137. }
  138. .elasticFrameMask .elasticFrame .hint{
  139. line-height: 0.2rem;
  140. font-size: 0.16rem;
  141. margin: 0;
  142. margin-top: 0.28rem;
  143. font-weight: bold;
  144. }
  145. .elasticFrameMask .elasticFrame .close{
  146. width: 0.3rem;
  147. height: 0.3rem;
  148. position: absolute;
  149. top: 0rem;
  150. right: 0.1rem;
  151. }
  152. #wechat_icon{
  153. position: fixed;
  154. right: 0.15rem;
  155. bottom: 2rem;
  156. width: 0.6rem;
  157. height: 0.6rem;
  158. }
  159. </style>
  160. <body>
  161. <section class="content"></section>
  162. <img src="./img/wechat-icon.gif" id="wechat_icon" onclick="$('.elasticFrameMask').show()"/>
  163. <div class="bottom" onclick="$('.elasticFrameMask').show()">点击添加专人客服,享立减10元优惠!</div>
  164. <!-- 弹框 -->
  165. <div class='elasticFrameMask'>
  166. <div class="elasticFrame">
  167. <img src="../template_img/close.jpg" class="close" onClick="$('.elasticFrameMask').hide()"/>
  168. <p class="hint">长按识别二维码加微信</p>
  169. <div class="content_evm"><img class="evm LongPress elasticFrameEvm" src=""/><img class="LongPress" src="https://seafood-h5.oss-cn-beijing.aliyuncs.com/img/fingerprint.png"/></div>
  170. </div>
  171. </div>
  172. <div class="alert-info" style="display: none;">
  173. <!-- tip提示,3s后消失 -->
  174. <p>请在浏览器中打开</p>
  175. </div>
  176. <!-- loading -->
  177. <div class="loading">
  178. <img src="../common/loading.gif" />
  179. </div>
  180. </body>
  181. <script>
  182. var qs = parseQueryString(window.location.href);
  183. var qrode_data = '';//接口传过来的数据
  184. var html = '';//模版文章
  185. $().ready(function () {
  186. getQrcode();
  187. var timeOutEvent = null;
  188. $(".content_evm").on({
  189. touchstart: function (e) {
  190. timeOutEvent = setTimeout(function () {
  191. //此处为长按事件
  192. addLongLog()
  193. }, 700);
  194. },
  195. touchmove: function () {
  196. clearTimeout(timeOutEvent);
  197. },
  198. touchend: function (e) {
  199. clearTimeout(timeOutEvent);
  200. return false;
  201. }
  202. });
  203. })
  204. function getQrcode() {
  205. if(!qs.id){
  206. showMsg('模版未找到!')
  207. return false;
  208. }
  209. $(".loading").show()
  210. $.ajax({
  211. url: '/api/template/qrcode',
  212. methods: 'get',
  213. data: {
  214. t_id: qs.id
  215. },
  216. success: function (res) {
  217. $(".loading").hide()
  218. if (res && res.errno == 0) {
  219. qrode_data = res.rst;
  220. if(res.rst.is_html == 1){
  221. html = res.rst.article_html;
  222. $('.elasticFrameEvm').attr('src',res.rst.qrcode)
  223. html = html.replace(/\*\*酷炫海鲜销售二维码\*\*/g,'<div class="content_evm"><img class="evm LongPress" src="'+res.rst.qrcode+'"/><img class="LongPress" src="https://seafood-h5.oss-cn-beijing.aliyuncs.com/img/fingerprint.png"/></div>')
  224. document.getElementsByClassName('content')[0].innerHTML = html;
  225. }else{
  226. showMsg('非文章模版')
  227. }
  228. }else{
  229. showMsg(res.err)
  230. }
  231. },
  232. error: function (err) {
  233. $(".loading").hide()
  234. showMsg('服务器错误')
  235. }
  236. })
  237. }
  238. function addLongLog() {
  239. //长按
  240. $.ajax({
  241. url: '/api/template/addLongLog',
  242. methods: 'get',
  243. data: {
  244. t_id: qs.id,
  245. ip: qrode_data.ip,
  246. saler_id: qrode_data.saler_id
  247. },
  248. success: function (res) {
  249. if (res && res.errno == 0) {
  250. console.log('长按统计成功')
  251. }
  252. },
  253. error: function (err) {
  254. }
  255. })
  256. }
  257. // 展示错误提示信息
  258. function showMsg(msg) {
  259. var msgBox = document.getElementsByClassName('alert-info')[0];
  260. msgBox.getElementsByTagName("p")[0].innerHTML = msg;
  261. msgBox.style.display = "block";
  262. setTimeout(function () {
  263. msgBox.style.display = "none";
  264. }, 2000);
  265. }
  266. //获取地址栏参数
  267. function parseQueryString(url) {
  268. var urlObj = {};
  269. var reg = /([^?=&]+)=([^?=&]+)/g;
  270. url.replace(reg, function ($0, $1, $2) {
  271. urlObj[$1] = decodeURIComponent($2);
  272. })
  273. return urlObj;
  274. }
  275. </script>