daili_2wm.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. var param = null;
  2. mui.ready(function () {
  3. var nowUrl = location.href;
  4. var productId = nowUrl.split("?")[1];
  5. param = productId;
  6. shareProxyMemberUrl();
  7. document.querySelector('.loading-bg').style.display = 'none'
  8. });
  9. function shareProxyMemberUrl() {
  10. $.ajax(base_path + '/member/shareProxyMemberUrl?' + param, {
  11. dataType: 'json',
  12. type: 'POST',
  13. timeout: 15000,
  14. xhrFields: {
  15. withCredentials: true
  16. },
  17. crossDomain: true,
  18. success: function (dt) {
  19. if (dt.isRedirect) {
  20. location.href = dt.redirectURL;
  21. } else {
  22. if (dt.status) {
  23. if (dt.data.qrcodeUrl == null) {
  24. $("#qrcode-div").html("<img src='//s.iamberry.com/watero/images/shop/bg_2wm.jpg'/>")
  25. } else {
  26. $("#qrcode-div").html("<img src='" + dt.data.qrcodeUrl + "'/>")
  27. }
  28. if (dt.data.data.userHead == null) {
  29. $("#user-head").empty().html("<img src='//s.iamberry.com/watero/images/shop/logo_head.png' />")
  30. } else {
  31. $("#user-head").empty().html("<img src='" + dt.data.data.userHead + "' />")
  32. }
  33. if (dt.data.data.userNickname == null) {
  34. $("#user-nickname").empty().html("爱贝源")
  35. } else {
  36. $("#user-nickname").empty().html(decodeURI(dt.data.data.userNickname))
  37. }
  38. window.repleFlag = true;
  39. window.wxFriend = {
  40. "appId": "",
  41. "imgUrl": '//s.iamberry.com/watero/images/shop/default_qrcode.png',
  42. "link": dt.data.shareUrl,
  43. "desc": "Watero,美国高端净水专家,4级净化,5档水温,免安装饮水一体机。",
  44. "title": "美国标准,4级净化,5档水温,废水比3:1,水质TDS智能显示。",
  45. "netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
  46. "shareTimeSuccess": "分享成功",
  47. "shareTimeCancel": "已取消分享",
  48. "shareAppSuccess": "分享成功",
  49. "shareAppCancel": "已取消分享"
  50. };
  51. getConfig()
  52. } else {
  53. mui.alert(dt.message)
  54. }
  55. }
  56. },
  57. error: function (xhr, type, errorThrown) {
  58. errorfn(xhr)
  59. }
  60. })
  61. };var mask = mui.createMask(function () {
  62. });
  63. mui('body').on('tap', '.share_wechat', function () {
  64. mask.show();
  65. });