vip_center.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  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. <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
  10. <meta http-equiv="Pragma" content="no-cache" />
  11. <meta http-equiv="Expires" content="0" />
  12. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  13. <meta http-equiv="X-UA-Compatible" content="IE=8">
  14. <meta http-equiv="Cache" content="no-cache">
  15. <link rel="stylesheet" type="text/css" href="css/mui.min.css" />
  16. <link rel="stylesheet" type="text/css" href="css/iconfont.css" />
  17. <link rel="stylesheet" type="text/css" href="css/style.css" />
  18. <link rel="stylesheet" type="text/css" href="css/vip_center.css" />
  19. <script>
  20. // 屏蔽分享
  21. window.hiddenAllWechatMenu = true;
  22. </script>
  23. </head>
  24. <body>
  25. <div class="loading-bg">
  26. <div class="mui-loading">
  27. <div class="mui-spinner">
  28. </div>
  29. &nbsp;&nbsp;加载中...
  30. </div>
  31. </div>
  32. <nav class="mui-bar mui-bar-tab" id="footer-bar">
  33. <a class="mui-tab-item">
  34. <div class="iconfont icon-shouye"></div>
  35. <span class="mui-tab-label">首页</span>
  36. </a>
  37. <a class="mui-tab-item">
  38. <div class="iconfont icon-gouwuche"><span class="mui-badge">0</span></div>
  39. <span class="mui-tab-label">购物车</span>
  40. </a>
  41. <a class="mui-tab-item">
  42. <div class="iconfont icon-dingdan"></div>
  43. <span class="mui-tab-label">订单</span>
  44. </a>
  45. <a class="mui-tab-item mui-active">
  46. <div class="iconfont icon-wode"></div>
  47. <span class="mui-tab-label">我的</span>
  48. </a>
  49. </nav>
  50. <div class="mui-content">
  51. <div class="center-header">
  52. <div class="wecat-head">
  53. <img style="display: block;width: 100%; " src="images/vip-center-bg.jpg" />
  54. <div class="user-head">
  55. <img id="headDiv" class="img_head" src="images/tx-1.jpg" />
  56. </div>
  57. <div id="userNickname">微信用户</div>
  58. <!--<div class="mui-table" style="padding-top: 15px;">
  59. <div class="mui-table-cell amount-div">
  60. <h5 style="font-size: 14px;padding-bottom: 10px;">待入帐</h5>
  61. <div class="cl-red" style="font-size: 20px;">¥<span id="await-amount">0</span></div>
  62. </div>
  63. <div class="mui-table-cell amount-div">
  64. <h5 style="font-size: 14px;padding-bottom: 10px;">可提现</h5>
  65. <div class="cl-red" style="font-size: 20px;">¥<span id="uables-amount">0</span></div>
  66. <div style="width: 1px;height: 30px;background: #ccc;-webkit-transform: scaleX(.3);position: absolute;right: 0;bottom: 5px;"></div>
  67. </div>
  68. </div>-->
  69. </div>
  70. <div class="bottom-vip">
  71. <div class="mui-table">
  72. <div class="mui-table-cell">
  73. <span class="vip-title">WaterO</span> 会员
  74. <div class="vip-line"></div>
  75. <img class="vip-arrow" src="images/v.png" />
  76. </div>
  77. <div class="mui-table-cell join-vip mui-text-right">
  78. <span class="vip-l">
  79. <span class="vip-note" type="1">成为会员</span>
  80. <i class="mui-icon mui-icon-arrowright" style="font-size: 17px;margin-left: 5px;"></i>
  81. </span>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="center-content">
  87. <div class="mui-table mui-text-center my-count">
  88. <div class="mui-table-cell go-integral-center">
  89. <strong class="user-integeal">0</strong>
  90. <p>积分</p>
  91. </div>
  92. <div class="mui-table-cell go-coupon-bag" >
  93. <strong class="user-count">0</strong>
  94. <p>券包</p>
  95. </div>
  96. <div class="mui-table-cell go-coupon-bag-2">
  97. <strong class="user-vip-count">0</strong>
  98. <p>会员专享</p>
  99. </div>
  100. </div>
  101. <div class="order-box">
  102. <ul class="mui-table-view">
  103. <li class="mui-table-view-cell" style="padding: 11px 15px 5px 15px;">
  104. 我的订单
  105. <!--<a class="mui-navigate-right">
  106. <span class="mui-badge">查看全部</span> 我的订单
  107. </a>-->
  108. </li>
  109. </ul>
  110. <div>
  111. <div id="menu-order" class="mui-segmented-control">
  112. <a class="mui-control-item go_pay_count">
  113. <div class="iconfont icon-daifukuan"></div>
  114. 待付款
  115. </a>
  116. <!--<a class="mui-control-item go_pay_ping">
  117. <div class="iconfont icon-pindan"></div>
  118. 拼单中
  119. </a>-->
  120. <a class="mui-control-item go_deliver_count">
  121. <div class="iconfont icon-daifahuo"></div>
  122. 待发货
  123. </a>
  124. <a class="mui-control-item go_delivered_count">
  125. <div class="iconfont icon-yifahuo"></div>
  126. 已发货
  127. </a>
  128. <a class="mui-control-item go_all_count">
  129. <div class="iconfont icon-dingdan1"></div>
  130. 全部
  131. </a>
  132. </div>
  133. </div>
  134. </div>
  135. <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed my-center-no" id="center-menu">
  136. <li class="mui-table-view-cell" href="vip-info.html">
  137. <div class="mui-table">
  138. <div class="mui-table-cell mui-col-xs-5 table-middle">
  139. 个人信息
  140. </div>
  141. <div class="mui-table-cell mui-col-xs-5 mui-text-right">
  142. <span class="mui-icon mui-icon-arrowright"></span>
  143. </div>
  144. </div>
  145. </li>
  146. <li class="mui-table-view-cell" href="faq.html">
  147. <div class="mui-table">
  148. <div class="mui-table-cell mui-col-xs-5">
  149. 常见问答
  150. </div>
  151. <div class="mui-table-cell mui-col-xs-5 mui-text-right">
  152. <span class="mui-icon mui-icon-arrowright"></span>
  153. </div>
  154. </div>
  155. </li>
  156. <li class="mui-table-view-cell" href="after_service_watero.html">
  157. <div class="mui-table">
  158. <div class="mui-table-cell mui-col-xs-5">
  159. 售后服务
  160. </div>
  161. <div class="mui-table-cell mui-col-xs-5 mui-text-right">
  162. <span class="mui-icon mui-icon-arrowright"></span>
  163. </div>
  164. </div>
  165. </li>
  166. <li class="mui-table-view-cell" href="tel:400-8006692">
  167. <div class="mui-table">
  168. <div class="mui-table-cell mui-col-xs-5">
  169. 客服电话
  170. </div>
  171. <div class="mui-table-cell mui-col-xs-5 mui-text-right">
  172. <a class="tel" href="tel:400-8006692">400-8006692</a> <span class="mui-icon mui-icon-arrowright"></span>
  173. </div>
  174. </div>
  175. </li>
  176. <!--<li class="mui-table-view-cell" href="coupon_dec.html" id="coupon-sys">
  177. <div class="mui-table">
  178. <div class="mui-table-cell mui-col-xs-5">
  179. 滤芯兑换券
  180. </div>
  181. <div class="mui-table-cell mui-col-xs-5 mui-text-right">
  182. <span class="mui-h5" style="position: absolute;width: 100px;right: 25px;top: 3px;">使用说明</span><span class="mui-icon mui-icon-arrowright"></span>
  183. </div>
  184. </div>
  185. </li>-->
  186. </ul>
  187. </div>
  188. </div>
  189. <div class="dalog">
  190. <div>
  191. <div class="tp-box">
  192. <ul>
  193. <li><strong>积分也能当钱花</strong></li>
  194. <li>
  195. <ol>
  196. <li>·注册会员即可获得100积分</li>
  197. <li>·会员专享折扣</li>
  198. <li>·购买产品,享受积分抵扣现金优惠</li>
  199. <li>·积分换购特惠商品权益</li>
  200. <li>·会员专享生日大礼包</li>
  201. </ol>
  202. </li>
  203. <li><button type="button" class="mui-btn btn-see-integral">成为会员</button></li>
  204. </ul>
  205. </div>
  206. <br />
  207. <div class="mui-text-center">
  208. <i class="iconfont icon-guanbi"></i>
  209. </div>
  210. </div>
  211. </div>
  212. <script src="js/mui.min.js"></script>
  213. <script src="js/jquery-2.1.1.min.js"></script>
  214. <script src="js/main.js"></script>
  215. <script src="js/page/wechat-utils-1.0.js"></script>
  216. <script>
  217. mui.ready(function() {
  218. marquee_Show();
  219. getCartNum();
  220. $.ajax(base_path + '/user/member?dates=' + new Date().getTime(), {
  221. dataType: 'json',
  222. type: 'post',
  223. timeout: 15000,
  224. xhrFields: {
  225. withCredentials: true
  226. },
  227. crossDomain: true,
  228. success: function(dt) {
  229. if(dt.isRedirect) {
  230. location.href = dt.redirectURL;
  231. } else {
  232. var data = dt.data;
  233. if(dt.status) {
  234. if(data.userHead != null && typeof(data.userHead) != "undefined" && data.userHead != '') {
  235. // var imgObj = $("<img src='" + data.userHead + "?" + new Date().getTime() + "'/>");
  236. // $("#headDiv").empty().append(imgObj)
  237. $(".img_head").attr("src",data.userHead)
  238. }
  239. if(data.userNickname != null && typeof(data.userNickname) != "undefined" && data.userNickname != '') {
  240. $("#userNickname").html(decodeURI(data.userNickname))
  241. }
  242. $(".user-integeal").text(data.userSurplusIntegral);
  243. $(".user-count").text(data.couponCount);
  244. if(data.couponVipCount == null || data.couponVipCount == ""){
  245. $(".user-vip-count").text(1);
  246. }else{
  247. $(".user-vip-count").text(data.couponVipCount+1);
  248. }
  249. // var userNickname = $("#userNickname").html();
  250. // if(data.userIsVip == 2) {
  251. // //$("#2WM").show();
  252. // if(userNickname != "") {
  253. // $("#userNickname").html(userNickname)
  254. // $("#vipName").html('<img style="width: 12px;" src="images/s-vip.png" /><span class="mui-h6">VIP用户</span>');
  255. // }
  256. // $(".vip-show,#coupon-sys").show();
  257. // } else {
  258. // if(userNickname != "") {
  259. // $("#userNickname").html(userNickname)
  260. // $("#vipName").html('<span class="mui-h6">普通用户</span>');
  261. // $(".see-rights").hide();
  262. // }
  263. // }
  264. if(data.userIsVip == 1){ //是否为vip :1:非vip 2:vip
  265. $('.vip-note').text('注册会员')
  266. $(".vip-note").attr('type',1); //1:成为会员 2:完善信息 3:会员权益
  267. }else{
  268. if(data.userArrange == 1){//是否已完善信息 1:已完善 2:未完善
  269. $('.vip-note').text('会员权益')
  270. $(".vip-note").attr('type',3);
  271. }else{
  272. $('.vip-note').text('完善信息')
  273. $(".vip-note").attr('type',2);
  274. }
  275. }
  276. $.ajax({
  277. type: 'post',
  278. url: base_path + '/probationOrder/membersProbationOrder',
  279. data: {},
  280. dataType: 'json',
  281. timeout: 15000,
  282. xhrFields: {
  283. withCredentials: true
  284. },
  285. crossDomain: true,
  286. success: function(dts) {
  287. if(dt.isRedirect) {
  288. location.href = dt.redirectURL;
  289. } else {
  290. if(dts.status) {
  291. var str = '';
  292. if(dts.data.probationOrderDtoList.length == 0) {
  293. $("#try_order_list").hide()
  294. }
  295. mui(dts.data.probationOrderDtoList).each(function(index) {
  296. switch(this.probationStatus) {
  297. case 1:
  298. str = "待派送";
  299. break;
  300. case 2:
  301. str = "派送中";
  302. break;
  303. case 3:
  304. str = "待支付";
  305. break;
  306. case 4:
  307. str = "暂停试用";
  308. break;
  309. case 5:
  310. str = "支付完成";
  311. break;
  312. default:
  313. str = "订单关闭";
  314. break
  315. }
  316. var str1 = '',
  317. str2 = '';
  318. if(str == "待支付") {
  319. str1 = '<a data-loading-icon="mui-spinner mui-spinner-custom" data-loading-text="正在支付" class="mui-btn try-btn-pay mui-pull-right" style="margin-right: 12px;" proid="' + this.probationOrderid + '">立即支付</a>';
  320. str2 = '<div>试用剩余时间:<span id="time_out' + (index + 1) + '"></span></div>'
  321. }
  322. $("#try_order_list").append('<li class="mui-table-view-cell mui-media"><a class="go_try_order" proid="' + this.probationOrderid + '" style="margin-left: -20px;"><span class="mui-media-object mui-pull-left wh-80"><img src="' + this.productIntroduceImg + '"></span><div class="mui-media-body center-middle"><div>' + str + '</div><div>订单号:' + this.probationOrderid + '</div>' + str2 + '</div></a><div class="btn-box">' + str1 + '</div></li>');
  323. if(str == "待支付") {
  324. addTimer('time_out' + (index + 1), this.probationRemainingTime / 1000)
  325. }
  326. })
  327. } else {
  328. mui.alert(dts.data.message)
  329. }
  330. }
  331. },
  332. error: function(xhr, type, errorThrown) {
  333. console.log(xhr);
  334. mui.alert("请检查网络或刷新页面重试!")
  335. }
  336. });
  337. document.querySelector('.loading-bg').style.display = 'none'
  338. } else {
  339. var btnArray = ['否', '是'];
  340. mui.confirm(dt.message, '提示', btnArray, function(e) {
  341. if(e.index == 1) {
  342. location.reload(true)
  343. }
  344. })
  345. }
  346. }
  347. },
  348. error: function(xhr, type, errorThrown) {
  349. console.log(xhr)
  350. }
  351. });
  352. if(marquee != '') {
  353. $('body').append('<div class="marquee-show"><div></div></div>')
  354. }
  355. });
  356. var isPay = true;
  357. mui('body').on('tap', '.try-btn-pay', function() {
  358. var th = this;
  359. if(isPay) {
  360. mui(this).button('loading');
  361. isPay = false;
  362. $.ajax({
  363. type: 'post',
  364. url: base_path + '/probation/pay',
  365. data: {
  366. "orderId": th.getAttribute("proid")
  367. },
  368. dataType: 'json',
  369. timeout: 15000,
  370. xhrFields: {
  371. withCredentials: true
  372. },
  373. crossDomain: true,
  374. success: function(dt) {
  375. if(dt.isRedirect) {
  376. location.href = dt.redirectURL;
  377. } else {
  378. if(dt.status) {
  379. var obj = JSON.parse("{" + dt.data.info + "}");
  380. WeixinJSBridge.invoke('getBrandWCPayRequest', obj, function(res) {
  381. if(res.err_msg == 'get_brand_wcpay_request:ok') {
  382. $.ajax({
  383. type: 'post',
  384. url: base_path + '/probation/check_probation_pay_success',
  385. data: {
  386. "orderId": th.getAttribute("proid")
  387. },
  388. dataType: 'json',
  389. timeout: 15000,
  390. xhrFields: {
  391. withCredentials: true
  392. },
  393. crossDomain: true,
  394. success: function(data) {
  395. if(dt.isRedirect) {
  396. location.href = dt.redirectURL;
  397. } else {
  398. if(data.status) {
  399. if(data.data == 5) {
  400. mui.alert("支付成功", '', function() {
  401. mui.openWindow({
  402. url: base_path + '/probation/try_order?orderId=' + th.getAttribute("proid")
  403. })
  404. })
  405. } else {
  406. mui.alert(data.message, '', function() {
  407. mui(th).button('reset')
  408. })
  409. }
  410. } else {
  411. mui(th).button('reset');
  412. mui.alert(data.message)
  413. }
  414. }
  415. },
  416. error: function(xhr, type, errorThrown) {
  417. isPay = true;
  418. console.log(xhr);
  419. mui(th).button('reset');
  420. mui.alert("请检查网络或刷新页面重试!")
  421. }
  422. })
  423. } else {
  424. isPay = true;
  425. mui(th).button('reset');
  426. mui.alert("对不起,支付失败!请稍后重试!")
  427. }
  428. })
  429. } else {
  430. mui(th).button('reset');
  431. mui.alert(dt.message)
  432. }
  433. }
  434. },
  435. error: function(xhr, type, errorThrown) {
  436. isPay = true;
  437. console.log(xhr);
  438. mui(th).button('reset');
  439. mui.alert("请检查网络或刷新页面重试!")
  440. }
  441. })
  442. } else {
  443. mui.alert("正在请求支付中~~请稍后!");
  444. return
  445. }
  446. });
  447. var addTimer = function() {
  448. var list = [],
  449. interval;
  450. return function(id, time) {
  451. if(!interval) {
  452. interval = setInterval(go, 1000)
  453. }
  454. list.push({
  455. ele: document.getElementById(id),
  456. time: time
  457. })
  458. };
  459. function go() {
  460. for(var i = 0; i < list.length; i += 1) {
  461. list[i].ele.innerHTML = getTimerString(list[i].time ? list[i].time -= 1 : 0);
  462. if(!list[i].time) {
  463. list.splice(i--, 1)
  464. }
  465. }
  466. }
  467. function getTimerString(time) {
  468. d = Math.floor(time / 86400), h = Math.floor((time % 86400) / 3600), m = Math.floor(((time % 86400) % 3600) / 60), s = Math.floor(((time % 86400) % 3600) % 60);
  469. if(time > 0) {
  470. return d + "天" + h + "时" + m + "分" + s + "秒"
  471. } else {
  472. return "试用已结束"
  473. }
  474. }
  475. }();
  476. $(document).on('tap', '#center-menu>li', function() {
  477. var href = $(this).attr("href");
  478. location.href = href;
  479. });
  480. $(document).on('tap', '.see-rights', function() {
  481. location.href = 'member_benefits.html';
  482. });
  483. // 弹窗
  484. $(document).on('tap', '.join-vip', function() {
  485. var type = $(".vip-note").attr('type');//1:成为会员 2:完善信息 3:会员权益
  486. if(type == 1 || type == 2){
  487. $('.dalog').show();
  488. }else{
  489. location.href='vip-equity.html';
  490. }
  491. });
  492. // 关闭弹窗
  493. $(document).on('tap', '.icon-guanbi', function() {
  494. $('.dalog').hide();
  495. });
  496. // 成为会员
  497. $(document).on('tap', '.btn-see-integral', function() {
  498. var type = $(".vip-note").attr('type');
  499. if(type == 1 || type == 2){
  500. location.href='register-vip.html';
  501. }
  502. });
  503. // 积分
  504. $(document).on('tap', '.go-integral-center', function() {
  505. location.href='integral-center.html';
  506. });
  507. // 券包
  508. $(document).on('tap', '.go-coupon-bag', function() {
  509. location.href='coupon_bag1.html?type=1';
  510. });
  511. // 券包
  512. $(document).on('tap', '.go-coupon-bag-2', function() {
  513. location.href='coupon_bag1.html?type=2';
  514. });
  515. </script>
  516. </body>
  517. </html>