gift_card_get_give.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>领取赠品</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <link rel="stylesheet" type="text/css" href="/css/mui.min.css">
  10. <link rel="stylesheet" type="text/css" href="/css/iconfont.css" />
  11. <link rel="stylesheet" type="text/css" href="/css/style.css" />
  12. <style>
  13. .head {height: 60px;}
  14. #head {line-height: 60px;}
  15. h3 {margin-top: 5px;margin-bottom: 0;}
  16. .icon-fuxuankuang a {color: #24cae9;text-decoration: underline;}
  17. .icon-daifahuo, .icon-lease2, .icon-jiage, .icon-lipin {font-size: 15px;padding-left: 22px;}
  18. .icon-fuxuankuang {font-size: 12px;padding: 5px 5px 5px 22px;}
  19. .icon-fuxuankuang:before {font-size: 14px;margin-top: 5px;margin-right: 3px;}
  20. .icon-daifahuo:before, .icon-lease2:before, .icon-jiage:before,
  21. .icon-lipin:before {font-size: 19px;color: #24cae9;position: absolute;left: 0;width: 20px;height: 18px;}
  22. .try_price {color: #f1436c;}
  23. .ul_radio {width: 100%;}
  24. .ul_radio li {width: 21%;height: 55px;margin: 0 1%;border: 1px solid rgba(0, 0, 0, .1);border-radius: 5px;display: inline-block;position: relative;font-family: "iconfont" !important;font-style: normal;-webkit-font-smoothing: antialiased;}
  25. .ul_radio .active:after {position: absolute;right: 0;bottom: 0;content: "\e66f";color: #f1436c;line-height: 1;font-size: 20px;}
  26. .radio1 {background: url(//s.iamberry.com/watero/images/cp-1.jpg)center center/auto 85% no-repeat;}
  27. .radio2 {background: url(//s.iamberry.com/watero/images/cp-2.jpg)center center/auto 85% no-repeat;}
  28. .radio3 {background: url(//s.iamberry.com/watero/images/cp-3.jpg)center center/auto 85% no-repeat;}
  29. .radio4 {background: url(//s.iamberry.com/watero/images/cp-4.jpg)center center/auto 85% no-repeat;}
  30. .head-img {position: absolute;bottom: 15px;right: 13px;width: 60px;height: 60px;border-radius: 30px;border: 3px solid #E5E5E5;}
  31. .mui-table-view .mui-media .mui-media-body {height: 41px;line-height: 41px;color: #333;}
  32. .mui-table-view .mui-media .mui-media-body>span {color: #f1436c;}
  33. .my-table-view-try {border-top: .6em solid #f0f0f0;border-bottom: .6em solid #f0f0f0;padding-bottom: 10px;}
  34. .my-table-view-try .mui-table-view-cell {padding: 10px 13px 10px 30px !important;font-size: 12px;}
  35. .mui-table-view-cell:after, .mui-table-view:before, .mui-table-view:after,
  36. .mui-input-group .mui-input-row:after, .mui-input-group:before,
  37. .mui-input-group:after {display: none;}
  38. .mui-table-view-cell>a:not (.mui-btn ){margin: -15px -15px;}
  39. .mui-table-view-cell>a .mui-pull-right {color: #999;font-size: 14px;}
  40. #btn_submit {color: #fff;font-size: 18px;background: #24cae9;margin-bottom: 0;border: 0;}
  41. .mui-btn-block.mui-active, .btn-pull-code.mui-active {background-color: #c8c8c8 !important;}
  42. .icon-fuxuankuang.mui-active:before {color: #c8c8c8;}
  43. .mui-content-padded {margin: 10px 13px;}
  44. .mui-input-group .mui-input-row {height: 50px;padding: 5px 0;border: 1px solid rgba(0, 0, 0, .1);margin: 10px 0;}
  45. .mui-input-row label {color: #666;width: 27%;font-size: 15px;}
  46. .mui-input-row label ~input{width: 73%;}
  47. .mui-input-row label ~input::-webkit-input-placeholder {font-size: 15px;}
  48. .triangle-down {width: 0;height: 0;border-left: 7px solid transparent;border-right: 7px solid transparent;border-top: 7px solid #ccc;}
  49. .my-arrowright {position: absolute;right: 18px;top: 28px;color: #666;pointer-events: none;}
  50. .mui-btn-red {background-color: #e9004c;}
  51. .tips {padding-bottom: 65px;}
  52. .gift-card-title {padding-top: 70px;background: url(//s.iamberry.com/watero/images/shop/gift-card-tit-bg2.png) top center/100% no-repeat #71d8ec;}
  53. .gift-card-title .mui-table-view-cell.mui-active {background: transparent;}
  54. .gift-card-title .mui-table-view-cell>a:not (.mui-btn ){color: #fff;}
  55. .gift-card-title .mui-table-view-cell>a:not (.mui-btn ).mui-active {background: transparent;}
  56. .gift-card-title .mui-navigate-right:after {color: #fff;font-size: 20px;right: 7px;}
  57. .gift-card-title .mui-table-view-cell {color: #fff;}
  58. .mui-table-view-cell.mui-collapse .mui-collapse-content {background: #71d8ec;}
  59. .accordion {float: right;margin: 2px 15px 0 0;font-size: 12px;color: #fff;}
  60. .my-btn-hand {display: block;width: 100%;height: 55px;background-color: #c5c5c5;color: #fff;border: 0;border-radius: 0;}
  61. .my-btn-hand.active {background-color: #1cc9f4;}
  62. .my-div {padding: 5px 0;border-bottom: 1px solid rgba(0, 0, 0, .1);margin-bottom: 5px;}
  63. .mui-h5, h5 { margin-left: 30px;}
  64. </style>
  65. <script>
  66. // 屏蔽分享
  67. window.hiddenAllWechatMenu = true;
  68. </script>
  69. </head>
  70. <body style="background: #fff;">
  71. <div class="loading-bg">
  72. <div class="mui-loading">
  73. <div class="mui-spinner"></div>
  74. &nbsp;&nbsp;加载中...
  75. </div>
  76. </div>
  77. <div class="mui-content" style="background: #fff;">
  78. <div class="tips">
  79. <ul class="mui-table-view gift-card-title">
  80. <li class="mui-table-view-cell mui-text-center">您已成功推荐一位代理商,获赠价值¥3680水机一台</li>
  81. <li class="mui-table-view-cell mui-text-left mui-collapse"></li>
  82. </ul>
  83. <div class="mui-content-padded">
  84. <div class="my-div">
  85. <span class="iconfont icon-lipin">选择赠品</span>
  86. </div>
  87. <div class="mui-h6">产品名称:美国watero净饮水一体机</div>
  88. <div class="mui-h6">产品数量:1台</div>
  89. <form class="mui-input-group">
  90. <div style="display: table; width: 100%; padding: 10px 0;">
  91. <div
  92. style="display: table-cell; width: 20%; vertical-align: middle;">
  93. 选择颜色:</span>
  94. </div>
  95. <div style="display: table-cell; width: 70%; text-align: right;">
  96. <ul class="ul_radio">
  97. <!-- <li class="radio1 active"></li>
  98. <li class="radio2"></li>
  99. <li class="radio3"></li>
  100. <li class="radio4"></li> -->
  101. </ul>
  102. </div>
  103. </div>
  104. </form>
  105. </div>
  106. <div class="my-div">
  107. <span class="iconfont icon-lease2">收货信息</span>
  108. </div>
  109. <ul class="mui-table-view">
  110. <li class="mui-table-view-cell">
  111. <a class="mui-navigate-right" id="open-wechat-addres-a">
  112. 收货地址<span class="mui-h5">请选择收货地址</span>
  113. <!-- <ul class="ft-12" style="color: #333;">
  114. <li>收 货 人:林林</li>
  115. <li>手 机 号:15999999999</li>
  116. <li>详细地址:广东省深圳市福田区莲花街道特区报业大厦12B</li>
  117. </ul> -->
  118. </a>
  119. </li>
  120. </ul>
  121. </div>
  122. </div>
  123. <div class="buy-footer">
  124. <button type="button" data-loading-icon="mui-spinner mui-spinner-custom" data-loading-text="提交中" class="mui-btn mui-btn-block mui-btn-outlined mui-active" id="btn_submit" disabled="disabled">确认领取</button>
  125. </div>
  126. <script src="/js/mui.min.js"></script>
  127. <script src="/js/jquery-2.1.1.min.js"></script>
  128. <script src="/js/shop/main.js"></script>
  129. <script src="/js/shop/wechat-utils-1.0.js?v=201706001"></script>
  130. <script type="text/javascript">
  131. var check = false, alert_msg = '';
  132. var agentMachineId =getParam("agentMachineId");
  133. mui.ready(function(){
  134. mui.ajax(base_path + '/giftCard/card/product/details?dates=' + new Date().getTime(), {
  135. data: {"agentMachineId":agentMachineId},
  136. dataType: 'json',
  137. type: 'post',
  138. timeout: 15000,
  139. success: function(dt) {
  140. //console.log(dt);
  141. if(dt.isRedirect) {
  142. location.href = dt.redirectURL;
  143. } else {
  144. if(dt.returnCode=="200" && dt.resultCode=="200"){
  145. if (typeof(dt.returnMsg.msg) != "undefined"){
  146. if(dt.returnMsg.msg==2){
  147. mui.alert("已经领取过,请在赠品订单列表查看",'',function(){
  148. mui.openWindow({url: '/watero/view/gift_card_give_order_list.html'})
  149. });
  150. }
  151. }
  152. var table = document.body.querySelector('.ul_radio');
  153. mui(dt.returnMsg.colors).each(function(index) {
  154. var li = document.createElement('li');
  155. if(index==0){
  156. li.className ='radio'+this.colorId+' active';
  157. }else{
  158. li.className ='radio'+this.colorId;
  159. }
  160. li.setAttribute("id",this.colorId);
  161. table.appendChild(li);
  162. });
  163. $(".ul_radio li").each(function() {
  164. $(this).on("click", function() {
  165. $(this).addClass("active");
  166. $(this).siblings().removeClass("active");
  167. });
  168. });
  169. document.querySelector('.loading-bg').style.display='none';
  170. }else{
  171. mui.alert(dt.resultMsg);
  172. }
  173. }
  174. },
  175. error: function(xhr, type, errorThrown) {
  176. console.log(xhr)
  177. }
  178. });
  179. });
  180. var address='',nickname='',ads_tel='';
  181. // 获取微信共享地址
  182. mui('body').on('tap', '#open-wechat-addres-a', function() {
  183. editAddrV1(
  184. function(res) {
  185. // 用户成功拉出地址
  186. address = res.provinceName + "-" + res.cityName + "-" + res.countryName + "-" + res.detailInfo;
  187. nickname=res.userName;
  188. ads_tel= res.telNumber;
  189. wechatAddr.status = true;
  190. wechatAddr.detailInfo = address;
  191. wechatAddr.postalCode = res.postalCode;
  192. wechatAddr.userName = res.userName;
  193. wechatAddr.userTel = res.telNumber;
  194. wechatAddr.nationalCode = res.nationalCode;
  195. $("#open-wechat-addres-a").empty().append('<ul class="ft-12" style="color: #333;"><li>收 货 人:'+ wechatAddr.userName +'</li><li>手 机 号:' + wechatAddr.userTel + '</li><li>详细地址:'+ wechatAddr.detailInfo+'</li></ul>');
  196. $("#btn_submit").removeClass("mui-active").removeAttr("disabled");
  197. },
  198. function() {
  199. if($('#open-wechat-addres-a').html() != null && $('#open-wechat-addres-a').html() != '') {
  200. wechatAddr.status = true;
  201. $("#btn_submit").removeClass("mui-active").removeAttr("disabled");
  202. } else {
  203. wechatAddr.status = false;
  204. // 用户取消拉出地址
  205. $('#open-wechat-addres-a').html('收货地址<span class="mui-h5">请选择收货地址</span>');
  206. mui.alert("您没有选择收货地址!");
  207. }
  208. }
  209. );
  210. });
  211. mui('body').on('tap','#btn_submit',function() {
  212. if(wechatAddr.status){
  213. mui(this).button('loading');
  214. var param = {
  215. "agentMachineColorId":$(".ul_radio .active").attr("id"),
  216. "agentMachineId": agentMachineId,
  217. "agentMachineAddressInfo": address,
  218. "agentMachineAddressName":nickname,
  219. "agentMachineAddressTel":ads_tel ,
  220. };
  221. $.ajax({
  222. type: 'post',
  223. url: base_path+'/giftCard/card/updateAgentMachine?dates=' + new Date().getTime(),
  224. data:param,
  225. dataType: 'json',
  226. timeout: 15000,
  227. success: function(dt) {
  228. //console.log(dt);
  229. if(dt.resultCode=="200" && dt.returnCode=="200") {
  230. mui.openWindow({url: '/watero/view/gift_card_give_order_list.html'})
  231. } else {
  232. mui(th).button('reset');
  233. mui.alert(dt.returnMsg);
  234. }
  235. },
  236. error: function(xhr, type, errorThrown) {
  237. //异常处理;
  238. console.log(xhr);
  239. mui.alert("请检查网络或刷新页面重试!");
  240. mui(th).button('reset');
  241. }
  242. });
  243. }else{
  244. mui.alert("请选择收货信息");
  245. }
  246. });
  247. </script>
  248. </body>
  249. </html>