details.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="ht-box">
  3. <view class="ht-details">
  4. <view class="d-title">{{ getdata.title }}</view>
  5. <view class="d-content">{{ getdata.content }}</view>
  6. <view class="d-pic">
  7. <view class="pic-list" v-for="(item, index) in getdata.picUrl" :key="index">
  8. <image alt="" class="img" mode="widthFix" :src="item.url" srcset=""></image>
  9. <view class="pic_title">{{ item.pic_title }}</view>
  10. </view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. getdata: {
  20. title: '',
  21. content: '',
  22. picUrl: []
  23. },
  24. show: false
  25. };
  26. },
  27. onLoad: function (t) {
  28. this.getData(t.id);
  29. },
  30. onShareAppMessage: function () {},
  31. methods: {
  32. getData: function (t) {
  33. uni.showLoading({
  34. title: '加载中'
  35. });
  36. var that = this;
  37. uni.request({
  38. url: 'https://v.juhe.cn/todayOnhistory/queryDetail.php?key=8525e2cd6ff71f07f54d3c7432f71685&e_id=' + t,
  39. data: {},
  40. header: {
  41. 'content-type': 'application/json'
  42. },
  43. success: function (t) {
  44. uni.hideLoading();
  45. if ('success' == t.data.reason) {
  46. that.show=true;
  47. that.getdata=t.data.result[0];
  48. } else {
  49. uni.showModal({
  50. title: '提示',
  51. content: '查询失败',
  52. success: function (t) {
  53. that.show=false;
  54. }
  55. });
  56. }
  57. }
  58. });
  59. }
  60. }
  61. };
  62. </script>
  63. <style>
  64. @import './details.css';
  65. </style>