gift_card_user_exchange.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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: 25px;}
  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,.icon-lipin:before{font-size: 19px;color: #24cae9;position: absolute;left: 0;width: 20px;height: 18px;}
  21. .try_price{color: #f1436c;}
  22. .ul_radio{width: 100%;text-align: left;}
  23. .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;}
  24. .ul_radio .active:after{position: absolute;right: 0;bottom: 0;content: "\e66f";color: #f1436c;line-height: 1;font-size: 20px;}
  25. .radio1{background: url(//s.iamberry.com/watero/images/cp-1.jpg) center center /auto 85% no-repeat;}
  26. .radio2{background: url(//s.iamberry.com/watero/images/cp-2.jpg) center center /auto 85% no-repeat;}
  27. .radio3{background: url(//s.iamberry.com/watero/images/cp-3.jpg) center center /auto 85% no-repeat;}
  28. .radio4{background: url(//s.iamberry.com/watero/images/cp-4.jpg) center center /auto 85% no-repeat;}
  29. .head-img {position: absolute;bottom: 15px;right: 13px;width: 60px;height: 60px;border-radius: 30px;border: 3px solid #E5E5E5;}
  30. .mui-table-view .mui-media .mui-media-body{height: 41px;line-height: 41px;color: #333;}
  31. .mui-table-view .mui-media .mui-media-body>span{color: #f1436c;}
  32. .my-table-view-try{border-top: .6em solid #f0f0f0;border-bottom: .6em solid #f0f0f0;padding-bottom: 10px;}
  33. .my-table-view-try .mui-table-view-cell{padding:10px 13px 10px 30px !important;font-size: 12px;}
  34. .mui-table-view-cell:after,.mui-table-view:before,.mui-table-view:after,.mui-input-group .mui-input-row:after,.mui-input-group:before,.mui-input-group:after{display: none;}
  35. .mui-table-view-cell>a:not(.mui-btn){margin: -15px -25px;}
  36. .mui-table-view-cell>a .mui-pull-right{color: #999;font-size: 14px;}
  37. #btn_submit{color: #fff;font-size: 18px;background: #24cae9;margin-bottom: 0;border: 0;}
  38. .mui-btn-block.mui-active,.btn-pull-code.mui-active{background-color: #c8c8c8 !important;}
  39. .icon-fuxuankuang.mui-active:before{color: #c8c8c8;}
  40. .mui-content-padded{margin: 10px 13px;}
  41. .mui-input-group .mui-input-row {height: 50px;padding: 5px 0;border: 1px solid rgba(0,0,0,.1);margin:10px 0;}
  42. .mui-input-row label{color: #666;width:27%;font-size: 15px;}
  43. .mui-input-row label~input{width:73%;}
  44. .mui-input-row label~input::-webkit-input-placeholder{font-size: 15px;}
  45. .triangle-down {width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;}
  46. .my-arrowright{position: absolute;right: 18px;top: 28px;color: #666;pointer-events:none;}
  47. .mui-btn-red{background-color: #e9004c;}
  48. .tips{padding-bottom: 65px;}
  49. .gift-card-title{padding-top:60px;background:url(//s.iamberry.com/watero/images/gift-card-tit-bg.jpg) top center /100% no-repeat #71d8ec;}
  50. .gift-card-title .mui-table-view-cell.mui-active{background:transparent;}
  51. .gift-card-title .mui-table-view-cell>a:not(.mui-btn){color: #fff;}
  52. .gift-card-title .mui-table-view-cell>a:not(.mui-btn).mui-active{background:transparent;}
  53. .gift-card-title .mui-navigate-right:after{color: #fff;font-size: 20px;right: 7px;}
  54. .gift-card-title .mui-table-view-cell{color: #fff;}
  55. .mui-table-view-cell.mui-collapse .mui-collapse-content{background: #71d8ec;}
  56. .accordion{float: right;margin:2px 15px 0 0;font-size: 12px;color: #fff;}
  57. .my-btn-hand{display:block;width: 100%;height: 55px;background-color: #c5c5c5;color: #fff;border: 0;border-radius: 0;}
  58. .my-btn-hand.active{background-color: #1cc9f4;}
  59. .my-div{padding:10px 0;border-bottom: 1px solid rgba(0,0,0,.1);margin-bottom:10px;}
  60. .my-div.noline{padding: 5px 0;border-bottom:0;margin-bottom: 5px;}
  61. .my-btn-exchange{background: #ddf2f8 !important;text-align: center;border: 0 !important;margin-bottom:0 !important;}
  62. .btn-pull-code{position: absolute;right: 10px;top:7px;height:34px;padding:0 6px;border-radius: 5px; line-height: 34px;font-size: 12px; color: #fff; background: #24cae9;}
  63. .btn-pull-code .active{background: #c8c8c8;}
  64. .mui-btn-block.mui-active,.btn-pull-code.mui-active{background-color: #e3ecee !important;}
  65. .mui-h5, h5 {margin-left: 30px;}
  66. .mui-h6{font-size:14px;}
  67. </style>
  68. <script>
  69. // 屏蔽分享
  70. window.hiddenAllWechatMenu = true;
  71. </script>
  72. </head>
  73. <body style="background: #fff;">
  74. <div class="loading-bg">
  75. <div class="mui-loading">
  76. <div class="mui-spinner">
  77. </div>
  78. &nbsp;&nbsp;加载中...
  79. </div>
  80. </div>
  81. <div class="mui-content" style="background: #fff;">
  82. <div class="tips">
  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">
  88. 提货产品:美国watero净饮水一体机
  89. </div>
  90. <form class="mui-input-group">
  91. <div style="display: table;width: 100%;padding: 10px 0;">
  92. <div style="display: table-cell;width: 20%;vertical-align: middle;color: #8f8f94;">选择颜色:</span></div><div style="display:table-cell;width:70%;text-align: right;">
  93. <ul class="ul_radio">
  94. <!-- <li class="radio1 active"></li>
  95. <li class="radio2"></li>
  96. <li class="radio3"></li>
  97. <li class="radio4"></li> -->
  98. </ul>
  99. </div>
  100. </div>
  101. </form>
  102. <ul class="mui-table-view" style="border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(0,0,0,.1);margin:10px 0;">
  103. <li class="mui-table-view-cell" style="padding: 15px 15px;">
  104. <a class="mui-navigate-right" id="go-gift-details" href="//w.iamberry.com/watero/wechat/product/desc?productId=34&colorId=2">
  105. 查看产品详情
  106. </a>
  107. </li>
  108. </ul>
  109. <div class="my-div">
  110. <span class="iconfont icon-lease2">收货信息</span>
  111. </div>
  112. <ul class="mui-table-view">
  113. <li class="mui-table-view-cell">
  114. <a class="mui-navigate-right" id="open-wechat-addres-a">
  115. 收货地址<span class="mui-h5">请选择收货地址</span>
  116. <!-- <ul class="ft-12" style="color: #333;">
  117. <li>收 货 人:林林</li>
  118. <li>手 机 号:15999999999</li>
  119. <li>详细地址:广东省深圳市福田区莲花街道特区报业大厦12B</li>
  120. </ul> -->
  121. </a>
  122. </li>
  123. </ul>
  124. <!-- <div style="padding:8px 0;margin-top:4px;border-top: 1px solid rgba(0,0,0,.1);">
  125. <span class="iconfont icon-daifahuo">礼品卡兑换码</span>
  126. </div>
  127. <div>
  128. <input type="text" value="" placeholder="请输入兑换密码" class="my-btn-exchange" id="ipt-exchange"/>
  129. </div> -->
  130. <!-- <form class="mui-input-group">
  131. <div class="mui-input-row">
  132. <label>手机号</label>
  133. <input type="tel" maxlength="11" class="mui-input-clear" placeholder="请输入手机号" id="ipt-phone">
  134. </div>
  135. <div class="mui-input-row">
  136. <label>验证码</label>
  137. <input type="text" maxlength="4" placeholder="请输入验证码" id="ipt-code">
  138. <span class="btn-pull-code" id="pull-code">获取验证码</span>
  139. </div>
  140. </form> -->
  141. <!-- <div class="mui-h6">
  142. 说明:成功兑换后,可再次扫描提货卡上二维码查看兑换记录!
  143. </div> -->
  144. </div>
  145. </div>
  146. </div>
  147. <div class="buy-footer">
  148. <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>
  149. </div>
  150. <script src="/js/mui.min.js"></script>
  151. <script src="/js/jquery-2.1.1.min.js"></script>
  152. <script src="/js/shop/main.js"></script>
  153. <script src="/js/shop/wechat-utils-1.0.js?v=201706001"></script>
  154. <script type="text/javascript">
  155. var check = false,alert_msg='';
  156. var mobile=/^(13|14|15|18)[0-9]{9}$/; //11位手机号码
  157. var code = /^[0-9]{4}$/; //4位数字
  158. var en_num=/^[A-Za-z0-9]{7}$/;//简体中文英文数字
  159. mui.ready(function(){
  160. mui.ajax(base_path + '/giftCard/card/product/details?dates=' + new Date().getTime(), {
  161. data: {},
  162. dataType: 'json',
  163. type: 'post',
  164. timeout: 15000,
  165. success: function(dt) {
  166. //console.log(dt);
  167. if(dt.isRedirect) {
  168. location.href = dt.redirectURL;
  169. } else {
  170. if(dt.returnCode=="200" && dt.resultCode=="200"){
  171. var table = document.body.querySelector('.ul_radio');
  172. mui(dt.returnMsg.colors).each(function(index) {
  173. var li = document.createElement('li');
  174. if(index==0){
  175. li.className ='radio'+this.colorId+' active';
  176. }else{
  177. li.className ='radio'+this.colorId;
  178. }
  179. li.setAttribute("id",this.colorId);
  180. table.appendChild(li);
  181. });
  182. //遍历产品颜色单选
  183. $(".ul_radio li").each(function() {
  184. $(this).on("tap", function() {
  185. $(this).addClass("active");
  186. $(this).siblings().removeClass("active");
  187. });
  188. });
  189. }else{
  190. mui.alert(dt.resultMsg);
  191. }
  192. }
  193. },
  194. error: function(xhr, type, errorThrown) {
  195. console.log(xhr)
  196. }
  197. });
  198. document.querySelector('.loading-bg').style.display='none';
  199. });
  200. var address='',nickname='',ads_tel='';
  201. // 获取微信共享地址
  202. mui('body').on('tap', '#open-wechat-addres-a', function() {
  203. editAddrV1(
  204. function(res) {
  205. // 用户成功拉出地址
  206. address = res.provinceName + "-" + res.cityName + "-" + res.countryName + "-" + res.detailInfo;
  207. nickname=res.userName;
  208. ads_tel= res.telNumber;
  209. wechatAddr.status = true;
  210. wechatAddr.detailInfo = address;
  211. wechatAddr.postalCode = res.postalCode;
  212. wechatAddr.userName = res.userName;
  213. wechatAddr.userTel = res.telNumber;
  214. wechatAddr.nationalCode = res.nationalCode;
  215. $("#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>');
  216. $("#btn_submit").removeClass("mui-active").removeAttr('disabled');
  217. },
  218. function() {
  219. if($('#open-wechat-addres-a').html() != null && $('#open-wechat-addres-a').html() != '') {
  220. wechatAddr.status = true;
  221. } else {
  222. wechatAddr.status = false;
  223. // 用户取消拉出地址
  224. $('#open-wechat-addres-a').html('收货地址<span class="mui-h5">请选择收货地址</span>');
  225. mui.alert("您取消了选择收货地址!");
  226. }
  227. }
  228. );
  229. });
  230. mui('body').on('tap', '#btn_submit', function() {
  231. var th=this;
  232. if(wechatAddr.status){
  233. //开始提交,改变按钮样式并锁定
  234. mui(this).button('loading');
  235. var param = {
  236. "cardPwd": getParam('cardPwd'),
  237. "userMachineColorId":$(".ul_radio .active").attr("id") ,
  238. "userMachineAddressInfo": address,
  239. "userMachineAddressName": nickname,
  240. "userMachineAddressTel":ads_tel,
  241. };
  242. $.ajax({
  243. type: 'post',
  244. url: base_path+'/giftCard/card/exchange?dates=' + new Date().getTime(),
  245. data: param,
  246. dataType: 'json',
  247. timeout: 15000,
  248. success: function(dt) {
  249. //console.log(dt);
  250. if(dt.resultCode=="200" && dt.returnCode=="200") {
  251. //成功后跳转页面
  252. mui.openWindow({url: '/watero/view/gift_card_exchange_details.html?psw='+getParam('cardPwd')})
  253. } else {
  254. //失败后还原按钮,并弹出警告
  255. mui.alert(dt.returnMsg.returnMsg);
  256. mui(th).button('reset');
  257. }
  258. },
  259. error: function(xhr, type, errorThrown) {
  260. //异常处理;还原提交按钮,并弹出警告
  261. console.log(xhr);
  262. mui.alert("请检查网络或刷新页面重试!");
  263. mui(th).button('reset');
  264. }
  265. });
  266. }else{
  267. //文本框值校验未通过,并弹出警告
  268. mui.alert('请选择地址');
  269. }
  270. });
  271. mui('body').on('tap', '#go-gift-details', function() {
  272. var th=this;
  273. mui.openWindow({url: th.getAttribute("href")})
  274. });
  275. </script>
  276. </body>
  277. </html>