detail.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <view class="hflex acenter jbetween box_top">
  5. <view class="title">反馈内容</view>
  6. <view class="text_style1">{{detail.create_at}}</view>
  7. </view>
  8. <view class="text">{{detail.content}}</view>
  9. <view class="hflex acenter">
  10. <block v-for="(item,index) in detail.imgs" :key="index">
  11. <image mode="aspectFill" :src="item" class="img" @click="perImgs"></image>
  12. </block>
  13. </view>
  14. </view>
  15. <view class="box" v-if="detail.reply.length !== 0">
  16. <view class="hflex acenter jbetween box_top">
  17. <view class="title">回复</view>
  18. <view class="text_style1">{{detail.reply[detail.reply.length - 1].create_at}}</view>
  19. </view>
  20. <block v-for="(item,index) in detail.reply" :key="index">
  21. <view class="text">{{item.content}}</view>
  22. </block>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import $api from '@/static/js/api.js'
  28. var that = ''
  29. export default {
  30. data() {
  31. return {
  32. id: '',
  33. detail: {}
  34. }
  35. },
  36. onLoad(options) {
  37. that = this
  38. if(options.id) {
  39. that.id = options.id
  40. that.getData(options.id)
  41. }
  42. },
  43. methods: {
  44. getData(id) {
  45. var pages = getCurrentPages()
  46. var prePage = pages[pages.length - 2]
  47. var list = prePage.$vm.pageList
  48. for(var i=0;i<list.length;i++) {
  49. if(list[i].id == id) {
  50. that.detail = list[i]
  51. }
  52. }
  53. },
  54. perImgs() {
  55. uni.previewImage({
  56. urls: that.detail.imgs,
  57. longPressActions: {
  58. itemList: ['发送给朋友', '保存图片', '收藏'],
  59. success: function(data) {
  60. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  61. },
  62. fail: function(err) {
  63. console.log(err.errMsg);
  64. }
  65. }
  66. });
  67. },
  68. },
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .content {
  73. background: #F5F5F5;
  74. padding: 0 30rpx;
  75. .box {
  76. margin-top: 20rpx;
  77. width: 100%;
  78. background: #FFFFFF;
  79. border-radius: 20rpx;
  80. box-sizing: border-box;
  81. padding: 24rpx 20rpx;
  82. .box_top {
  83. width: 100%;
  84. padding-bottom: 14rpx;
  85. border-bottom: 1rpx solid #F5F5F5;
  86. .title {
  87. font-size: 30rpx;
  88. font-weight: 500;
  89. color: #222222;
  90. }
  91. .text_style1 {
  92. font-size: 26rpx;
  93. font-weight: 400;
  94. color: #666666;
  95. }
  96. }
  97. .text {
  98. font-size: 26rpx;
  99. font-weight: 400;
  100. color: #222222;
  101. line-height: 36rpx;
  102. margin: 24rpx 0 20rpx;
  103. }
  104. .img {
  105. width: 208rpx;
  106. height: 208rpx;
  107. border-radius: 20rpx;
  108. margin: 0 14rpx 20rpx 0;
  109. }
  110. }
  111. }
  112. </style>