app-buy-prompt.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view v-if="buy_data && buy_data.length" class="buy-prompt-box">
  3. <swiper circular vertical autoplay>
  4. <block v-for="(item,index) in buy_data" :key="index">
  5. <swiper-item @touchmove.stop.prevent catchtouchmove='catchTouchMove'>
  6. <view class="box">
  7. <view class="cross-center center dir-left-nowrap">
  8. <image class="box-grow-0 image" :src="item.avatar"></image>
  9. <view class="box-grow-0 text-a">{{item.time_str}}</view>
  10. <view class="box-grow-0 text-b">{{item.content}}</view>
  11. </view>
  12. </view>
  13. </swiper-item>
  14. </block>
  15. </swiper>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. name: "app-buy-prompt",
  21. data() {
  22. return {
  23. buy_data: null,
  24. }
  25. },
  26. created: function () {
  27. const self = this;
  28. self.$request({
  29. url: self.$api.index.buy_data,
  30. }).then(info => {
  31. if (info.code === 0) {
  32. self.buy_data = info.data;
  33. }
  34. });
  35. },
  36. methods: {
  37. catchTouchMove: function () {
  38. return false
  39. }
  40. }
  41. }
  42. </script>
  43. <style scoped lang="scss">
  44. swiper {
  45. height: #{60rpx};
  46. width: #{568rpx};
  47. }
  48. .buy-prompt-box {
  49. position: fixed;
  50. top: #{97rpx};
  51. left: #{24rpx};
  52. z-index: 1003;
  53. }
  54. .buy-prompt-box .box {
  55. display: inline-block
  56. }
  57. .buy-prompt-box .center {
  58. height: #{60rpx};
  59. background-color: rgba(0, 0, 0, 0.8);
  60. border-radius: #{30rpx};
  61. color: #fff;
  62. }
  63. .buy-prompt-box .image {
  64. height: #{60rpx};
  65. width: #{60rpx};
  66. border-radius: 50%;
  67. }
  68. .buy-prompt-box .text-a {
  69. padding-left: #{10rpx};
  70. font-size: #{24rpx};
  71. }
  72. .buy-prompt-box .text-b {
  73. padding-right: #{24rpx};
  74. font-size: #{24rpx};
  75. }
  76. </style>