welcome-double.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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/main.css">
  16. <link rel="stylesheet" href="./static/css/double.css">
  17. <style>
  18. .screenroll::-webkit-scrollbar { display: none;}
  19. .screenroll{height:100vh !important;}
  20. .bg2{background-image:linear-gradient(to bottom,#b51e1c,#bb3325) !important;}
  21. .loadingfalseheight{height:1.33333rem}
  22. </style>
  23. </head>
  24. <body class="pb0 ovh pt0">
  25. <div class="rel double" id="app" v-cloak>
  26. <van-sticky>
  27. <van-nav-bar class="camp_title user_title_normal" title="详情" @click-left="backbtn" left-arrow v-if="toptitleisshow">
  28. <template #left>
  29. <van-icon name="arrow-left" color="#000" size="20"></van-icon>
  30. </template>
  31. </van-nav-bar>
  32. </van-sticky>
  33. <div>
  34. <div class="screenroll rel">
  35. <div class="bg1 rel"><img class="BG1 rel" src="./static/images/active/double/bg1.png" alt="背景图1" style="z-index:1;">
  36. <canvas class="canvas abs pagcanvas" id="pag" style="z-index:999;bottom:0;"></canvas>
  37. </div><img class="rmb888 abs" src="./static/images/active/double/888.png" alt="888.88" style="z-index:2;">
  38. <div class="bg2 rel">
  39. <div class="loadingfalseheight" v-if="!isloading"></div>
  40. <div v-else>
  41. <div v-if="!!initInfo.IsBuy">
  42. <van-progress :percentage="percentage" track-color="#ED785A" stroke-width=".24rem" color="linear-gradient(to right,#FBDF47, #FFA666)" :show-pivot="false" style="width:85vw;margin:0 auto"></van-progress>
  43. <div class="f12 cfff article tc"><span>达标进度:</span><span class="b f20">{{dabiao}}</span><span>万元 / </span><span class="b f20">{{mubiao}}</span><span>万元 </span></div><img class="bonus abs" src="./static/images/active/double/bonus.png" alt="红包" ref="bonus">
  44. <button class="btn">已报名</button>
  45. </div>
  46. <button class="registBtn" v-if="!initInfo.IsBuy &amp;&amp; canJoin" @click="regist">报名参与</button>
  47. <button class="btn" v-if="!initInfo.IsBuy &amp;&amp; !canJoin">本月报名已结束</button>
  48. </div>
  49. </div>
  50. <div class="bg3"><img class="BG3" src="./static/images/active/double/BG3.png" alt="背景3"></div>
  51. </div>
  52. </div>
  53. </div>
  54. <script src="./static/js/klm-vv.min.js"></script>
  55. <script src="./static/js/appfunc.min.js"></script>
  56. <script src="./static/js/klm-axios-config.js"></script>
  57. <script src="./static/js/publicfn.js"></script>
  58. <script src="./static/js/libpag.js"></script>
  59. <script>
  60. //- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  61. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  62. // 可以通过下面的方式手动注册
  63. Vue.use(vant.Lazyload);
  64. // 在 #app 标签下渲染一个按钮组件
  65. let app = new Vue({
  66. el: '#app',
  67. data() {
  68. return {
  69. toptitleisshow:false,
  70. percentage:0,
  71. canJoin:true,
  72. initInfo:{
  73. TotalTrade:1000,
  74. SelfTrade:10,
  75. IsBuy:false,
  76. },
  77. isloading:false,
  78. //- articleinfo:{
  79. //- Title: '',
  80. //- Contents:''
  81. //- },
  82. //- isId:true,
  83. //- imgsrc:[],
  84. //- type:'',
  85. };
  86. },
  87. watch:{
  88. percentage:function(value){
  89. console.log(value)
  90. if(value > 100){
  91. value = 100
  92. }
  93. this.$nextTick(()=>{
  94. this.$refs.bonus.style.left = `${value * .85 + 5}%`
  95. })
  96. },
  97. ['initInfo.SelfTrade']:function(){
  98. let res = this.initInfo.SelfTrade / this.initInfo.TotalTrade * 100
  99. if(res > 100){
  100. res = 100
  101. }
  102. this.percentage = res
  103. },
  104. deep:true,
  105. immediate: true
  106. },
  107. computed:{
  108. dabiao:function(){
  109. return (this.initInfo.SelfTrade/10000).toFixed(2)
  110. },
  111. mubiao:function(){
  112. return (this.initInfo.TotalTrade/10000).toFixed(2)
  113. }
  114. },
  115. created() {
  116. //- setInterval(()=>{this.initInfo.SelfTrade+=100},1000)
  117. this.pageffect('./static/pag/active-double-particle.pag')
  118. this.getprecent()
  119. this.judgeTime()
  120. },
  121. methods: {
  122. //- 获取数据
  123. pageffect(url = '') {
  124. const that = this;
  125. window.libpag.PAGInit().then(async (PAG) => {
  126. axios({url,responseType: "blob"}).then(async (response) =>{return response.request.response}).then(async (blob) => {
  127. let file = new window.File([blob], url.replace(/(.*\/)*([^.]+)/i, '$2'));
  128. const pagFile = await PAG.PAGFile.load(file);
  129. document.getElementById('pag').width = document.documentElement.clientWidth;
  130. document.getElementById('pag').height = document.documentElement.clientWidth;
  131. const pagView = await PAG.PAGView.init(pagFile, '#pag',{ useCanvas2D: false,useScale: true,firstFrame:true });
  132. pagView.setRepeatCount(0);
  133. await pagView.play();
  134. this.pagView = pagView;
  135. });
  136. });
  137. },
  138. //- judgeOK(res){
  139. //- function isOK (obj) {return Boolean( obj.this >= 2000000 && obj.last * 2 > obj.this)}
  140. //- if( isOK(res) ){
  141. //- obj.children.forEach((item,index)=>{
  142. //- if(isOK(item)){
  143. //- obj.this - item.this
  144. //- }else{
  145. //- this.judgeOK(item)
  146. //- }
  147. //- })
  148. //- }else{
  149. //- return
  150. //- }
  151. //- },
  152. judgeTime(){
  153. let time = new Date().getDate()
  154. if(time < 16){
  155. this.canJoin = true
  156. }else{
  157. this.canJoin = false
  158. }
  159. },
  160. async getprecent(){
  161. const UserId = PublicLib.getCookieInfo('userId');
  162. const res = await getRequest('api/v1/ActivityProgressBar/List?t='+Math.random(6),JSON.stringify({UserId}));
  163. if(res.status !== '1') return tips('获取数据失败');
  164. this.initInfo = res.data;
  165. if(this.initInfo.TotalTrade < 2000000){
  166. this.initInfo.TotalTrade = 2000000
  167. };
  168. this.isloading = true;
  169. },
  170. regist(){
  171. PublicLib.putCookieInfo('malldetailId', 15);
  172. PublicLib.Goto({Url:'mall-detail'});
  173. },
  174. backbtn(){
  175. PublicLib.GoBack({Level:1});
  176. },
  177. clickimg(index = 0){
  178. if(typeof(index) == 'number'){
  179. PublicLib.PhotoBrowser(1,['./static/images/active/double/BG3.png']);
  180. };
  181. },
  182. }
  183. });
  184. </script>
  185. </body>
  186. </html>