market-active.html 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. </head>
  17. <body class="bgc-back">
  18. <div id="app" v-cloak>
  19. <van-nav-bar class="user_rank_explan_title mall_title user_title_normal" title="市场活动" @click-left="goback" v-if="toptitleisshow">
  20. <template #left> <img src="./static/images/left.png" alt=""></template>
  21. </van-nav-bar>
  22. <div class="active_list ml16 mr16">
  23. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="banner.length === 0 ? 'isnodata':''">
  24. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  25. <div class="box mt16 ovh rel" v-for="item,index in banner" :key="item.Id" @click="goactivedetail(item.Id)"><img class="db" :src="PublicLib.CachePicture({picUrl:item.ActBanner,domid:'activeimg' + index})" :id="'activeimg' + index" style="width:100%;">
  26. <div class="abs bgcfff cm">{{item.Status}}</div>
  27. </div>
  28. </van-pull-refresh>
  29. </div>
  30. </div>
  31. <script src="./static/js/klm-vv.min.js"></script>
  32. <script src="./static/js/klm-axios-config.js"></script>
  33. <script>
  34. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  35. // 可以通过下面的方式手动注册
  36. Vue.use(vant.Lazyload);
  37. PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  38. // 在 #app 标签下渲染一个按钮组件
  39. let app = new Vue({
  40. el: '#app',
  41. data() {
  42. return {
  43. isnodata:false,
  44. toptitleisshow:false,
  45. banner: [],
  46. refreshing:false,
  47. };
  48. },
  49. created() {
  50. this.toptitleisshow = toptitleisshow;
  51. this.getactivelist();
  52. },
  53. methods: {
  54. onLoad() {
  55. if (this.refreshing) {
  56. this.banner = [];
  57. this.refreshing = false;
  58. }
  59. this.getactivelist();
  60. },
  61. onRefresh() {
  62. // 清空列表数据
  63. this.finished = false;
  64. // 重新加载数据
  65. // 将 loading 设置为 true,表示处于加载状态
  66. this.loading = true;
  67. this.onLoad();
  68. },
  69. async getactivelist(){
  70. PublicLib.ShowLoading({Message:''});
  71. const res = await getRequest('/api/v1/activityinfo/list?t='+Math.random(6),JSON.stringify({PageSize:20,PageNum:1}));
  72. if(res.status === 1) {
  73. PublicLib.HideLoading();
  74. this.banner = res.data;
  75. if(this.banner.length === 0) {this.isnodata = true}else{this.isnodata = false};
  76. };
  77. },
  78. goactivedetail(id){
  79. PublicLib.putCookieInfo('marketactiveId', id);
  80. PublicLib.Goto({Url:'market-active-detail'});
  81. },
  82. goback(){
  83. PublicLib.GoBack({Level:1});
  84. }
  85. }
  86. });
  87. </script>
  88. </body>
  89. </html>