vip_center.html 17 KB

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