caseDetail.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view class="caseDetail pt-20">
  3. <uni-menubar title="图片列表" />
  4. <view class="grid col-3 text-center">
  5. <block v-for="(item,index) in albumList" :key="index">
  6. <view class="mb-40 px-10">
  7. <view class="bg-white shadow" @click="previewImg(item)" style="border-radius: 0 0 20rpx 20rpx;">
  8. <image :src="item.path" style="width: 100%;height: 260rpx;"></image>
  9. <view>{{item.name}}</view>
  10. <view class="text-right px-10"><tm-icons class="mr-10" :size="28" name="icon-eye-fill"></tm-icons>{{item.views}}</view>
  11. </view>
  12. </view>
  13. </block>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. title: "",
  22. albumList: [],
  23. card_id: "",
  24. detailId: ""
  25. }
  26. },
  27. onLoad(option) {
  28. if (option) {
  29. this.detailId = option.id
  30. this.card_id = option.card_id
  31. this.$tm.vx.commit('card/cardId', option.card_id)
  32. this.getDetail(option.id)
  33. this.$point.point(3, this.detailId, this.card_id)
  34. }
  35. },
  36. onShareAppMessage(res) {
  37. return {
  38. title: this.info.title,
  39. path: '/pages/list/caseDetail?detailId=' + this.detailId + '&card_id=' + this.card_id,
  40. success: () => {
  41. this.$point.point(2, this.detailId, this.card_id)
  42. }
  43. }
  44. },
  45. methods: {
  46. getDetail(id) {
  47. this.$tm.request.post('album/piclist', {
  48. album_id: id
  49. }).then(res => {
  50. this.albumList = res.data
  51. if (this.card_id == '' || this.card_id != res.data[0].card_id) {
  52. this.$point.point(3, '', this.card_id)
  53. }
  54. })
  55. },
  56. previewImg(e){
  57. this.$tm.preview(e.path,this.albumList,'path')
  58. this.$tm.request.post('album/picinc', {
  59. id: e.id
  60. }).then(res => {
  61. })
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. view,
  68. scroll-view,
  69. swiper,
  70. button,
  71. input,
  72. textarea,
  73. label,
  74. navigator,
  75. image {
  76. box-sizing: border-box;
  77. }
  78. </style>