wonderful_list.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="">
  3. <view class="image" v-for="(item,index) in wonderful_list" :key='index'>
  4. <image :src="item.path" mode="aspectFill"></image>
  5. </view>
  6. <view class="empty" v-if="wonderful_list.length==0">
  7. <u-empty text="暂无精彩瞬间" mode="data"></u-empty>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. action: '',
  16. imageDate: {
  17. file_type: 'img',
  18. type: 'activity_scenes'
  19. }, //上传图片携带参数
  20. fileList: [],
  21. wonderful_list: [], //精彩瞬间列表
  22. activity_id: '', //活动id
  23. }
  24. },
  25. onLoad(options) {
  26. let id = options.id
  27. this.activity_id = id
  28. this.getWonderful(id)
  29. },
  30. methods: {
  31. //获取精彩瞬间
  32. getWonderful(id) {
  33. this.$u.get('/page/activities-scenes/' + id).then(res => {
  34. let data = res.data.data
  35. this.wonderful_list = data
  36. })
  37. },
  38. //添加精彩瞬间
  39. add() {
  40. if (this.vuex_user.role == 1 || (this.vuex_user.role == 2 && this.vuex_user.organization_id == this.content.organization.id)) {
  41. uni.navigateTo({
  42. url: './wonderful?activity_id=' + this.activity_id
  43. })
  44. } else {
  45. uni.showToast({
  46. icon: 'none',
  47. title: '暂无当前权限哦!'
  48. })
  49. }
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. page {
  56. // padding: 0 15px;
  57. }
  58. .empty {
  59. margin-top: 45%;
  60. }
  61. .image {
  62. // height: 300px;
  63. padding: 0 15px;
  64. text-align: center;
  65. image {
  66. margin-top: 5px;
  67. display: inline-block;
  68. height: 200px;
  69. width: 100%;
  70. margin: 0 auto;
  71. }
  72. }
  73. .buttom {
  74. position: fixed;
  75. bottom: 50px;
  76. right: 30px;
  77. z-index: 6666;
  78. background-color: #79573D;
  79. color: #FFFFFF;
  80. height: 50px;
  81. width: 50px;
  82. line-height: 45px;
  83. font-weight: 50;
  84. border-radius: 50%;
  85. text-align: center;
  86. font-size: 40px;
  87. }
  88. </style>