index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="common_contant" :style="{padding: isBig ? '' : '24rpx'}">
  3. <tui-skeleton
  4. v-if="skeletonShow"
  5. backgroundColor="#fafafa"
  6. borderRadius="10rpx"
  7. :isLoading="true"
  8. :loadingType="5"
  9. ></tui-skeleton>
  10. <view class="" v-else>
  11. <view class="img_big" v-if="isBig">
  12. <image src="" mode="aspectFill"></image>
  13. </view>
  14. <view class="special_all" v-else>
  15. <SpecialItem v-for='item in 3' :key="item"/>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import SpecialItem from './components/special.vue'
  22. export default {
  23. components: {
  24. SpecialItem
  25. },
  26. data() {
  27. return {
  28. isBig: false,
  29. skeletonShow: true,
  30. specialList: [], // 活动数据
  31. }
  32. },
  33. mounted() {},
  34. onLoad(options) {
  35. this.network().SpecialService(options)
  36. },
  37. methods: {
  38. // 网络请求
  39. network() {
  40. return {
  41. SpecialService: async (options) => {
  42. try {
  43. const data = await this.SpecialService.specialInfo(options)
  44. if (data.code === 0) {
  45. this.specialList = data.data
  46. this.skeletonShow = false
  47. }
  48. } catch(e) {
  49. }
  50. }
  51. }
  52. }
  53. }
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .common_contant {
  58. background-color: #FFFFFF;
  59. padding: 24rpx;
  60. }
  61. </style>