user-leaderLevel-buy.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>盟主中心-储蓄金购买</title>
  6. <meta name="keywords" content="盟主中心-储蓄金购买">
  7. <meta name="description" content="盟主中心-储蓄金购买">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="盟主中心-储蓄金购买">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/crop.css">
  16. <link rel="stylesheet" href="./static/css/main.css">
  17. <style>
  18. .f36{font-size: .96rem;}
  19. .f17{font-size:.4533rem;}
  20. .m25{margin:0 .6667rem;}
  21. .mt6{margin-top: .16rem;}
  22. .mt22{margin-top: .5867rem;}
  23. .jccen{justify-content: center;}
  24. .bgcf4{background-color: #f4f4f4;width:100vw;height:.2133rem;}
  25. .artical{padding: .5333rem .4267rem;}
  26. .underline{text-decoration:underline;}
  27. .buyFunds{color:#905312;background: url('./static/images/user-buyFunds.png') no-repeat ;background-size:cover;margin: .4267rem;padding: .5333rem;border-radius: .4rem;}
  28. .negoiate{background-color: #EEF4FE;width: 100vw;height: 1.0667rem;}
  29. .van-button__content{color:#323232}
  30. .fixBottom{position: fixed;bottom: 0.3rem;}
  31. .rules{overflow-y: scroll;word-break: break-all;line-height:2;}
  32. </style>
  33. </head>
  34. <body class="nopb pt0" style="padding-top:0;">
  35. <div class="ovh" id="app" v-cloak style="height:100vh">
  36. <van-nav-bar class=" user_title_normal f16" title="储蓄金购买" @click-left="goback" v-if="toptitleisshow" left-arrow v-cloak>
  37. <template #left>
  38. <van-icon name="arrow-left" color="#333" size="20"></van-icon>
  39. </template>
  40. </van-nav-bar>
  41. <div class="buyFunds bgcfff">
  42. <div class="f17 b">储蓄金购买</div>
  43. <div class="f36 mt16">¥{{needPay.get(BuyType)}}</div>
  44. <div class="f12 mt6">购买后金额将自动增加至盟主储蓄金</div>
  45. </div>
  46. <div class="bgcf4"></div>
  47. <div class="rules ovh-x">
  48. <div v-html="rules"></div>
  49. </div>
  50. <div class="fixBottom">
  51. <div class="negoiate df aic">
  52. <van-checkbox class="ml16" v-model="isagreenment" icon-size=".426667rem" checked-color="#FFD500" style="justify-content:center;">
  53. <template #icon="props"> <img class="img-icon" :src="props.checked ? activeIcon : inactiveIcon" style="height:.4267rem;"></template>
  54. <div class="f14 c666" style="margin:0;">本人阅读并认同<span class="underline c333" @click="goservice">《创业帮盟主体系说明》</span></div>
  55. </van-checkbox>
  56. </div>
  57. <van-button class="m0a mt6" color="#FDD500" block text="购买额度" @click="toBuy" round style="width:90%" :disabled="!isagreenment"> </van-button>
  58. </div>
  59. </div>
  60. <script src="./static/js/klm-vv.min.js"></script>
  61. <script src="./static/js/appfunc.min.js"></script>
  62. <script src="./static/js/klm-axios-config.js"></script>
  63. <script src="./static/js/publicfn.js"></script>
  64. <script>
  65. PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  66. // 在 #app 标签下渲染一个按钮组件
  67. let app = new Vue({
  68. el: '#app',
  69. data() {
  70. return {
  71. toptitleisshow,
  72. isagreenment:false,
  73. activeIcon:'./static/images/checked@3x.png',
  74. inactiveIcon:'./static/images/unchecked@3x.png',
  75. rules:'',
  76. needPay:new Map([[2, 15000], [1, 60000]]),
  77. BuyType:PublicLib.getCookieInfo('BuyType')*1,
  78. };
  79. },
  80. created(){
  81. this.getRules();
  82. const LeaderLevel = PublicLib.getCookieInfo('LeaderLevel')*1
  83. if(this.BuyType === 2 && LeaderLevel === 2){
  84. this.BuyType = 1
  85. }
  86. },
  87. mounted() {
  88. setTimeout(() => {
  89. let scroll = document.getElementsByClassName('rules')[0]
  90. let select = document.getElementsByClassName('fixBottom')[0]
  91. //- scroll.style.height = `calc(100vh - ${scroll.getBoundingClientRect().top - select.getBoundingClientRect().top}px)`
  92. scroll.style.height = `calc(${select.getBoundingClientRect().top - scroll.getBoundingClientRect().top }px)`
  93. });
  94. },
  95. methods: {
  96. goback(){
  97. PublicLib.GoBack({Level:1});
  98. },
  99. goservice(){
  100. PublicLib.Goto({Url:'user-leaderLevel-rules'});
  101. },
  102. async getRules(){
  103. const res = await getRequest('api/v1/pageinfo/detail?t='+Math.random(6),JSON.stringify({Id:11}));
  104. if(res.status !== '1')return tips('规则获取失败!');
  105. this.rules = res.data.Contents
  106. },
  107. async toBuy(){
  108. const UserId = PublicLib.getCookieInfo('userId');
  109. const BuyType = PublicLib.getCookieInfo('BuyType');
  110. const TotalPrice = this.needPay.get(this.BuyType)
  111. const res = await postRequest('api/v1/orders/buyreserve?t='+Math.random(6),JSON.stringify({BuyType,TotalPrice,UserId}));
  112. if(res.status === '1'){
  113. PublicLib.putCookieInfo('mallorderId',res.data.Id);
  114. setTimeout(()=>{
  115. PublicLib.Goto({Url:'mall-deal-detail'});
  116. },200)
  117. }
  118. }
  119. }
  120. });
  121. </script>
  122. </body>
  123. </html>