details.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="container">
  3. <!-- 供销社详情 -->
  4. <view class="cooperativeImgBox">
  5. <!--<image :src="loadImgSrc('/snbj.png')" class="cooperativeImg"></image>-->
  6. <image :src="loadImgSrcLocalhost(imgUrl)" class="cooperativeImg"></image>
  7. </view>
  8. <view class="itemBox" v-for="(item, index) in list" :key="index">
  9. <view class="item">
  10. <span>
  11. {{ item.title }}:
  12. </span>
  13. <span>
  14. {{ item.content?item.content:'' }}
  15. </span>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import { getDetails } from '@/api/highFrequencyService/cooperative/cooperative';
  22. export default {
  23. data() {
  24. return {
  25. imgUrl:'-',
  26. list: [
  27. {
  28. title: "名称",
  29. content: "-",
  30. },
  31. {
  32. title: "地址",
  33. content: "-",
  34. },
  35. {
  36. title: "负责人",
  37. content: "-",
  38. },
  39. {
  40. title: "负责人电话",
  41. content: "-",
  42. }
  43. ],
  44. cooperative: {
  45. name:"第十三号供销社",
  46. address:"十三号街区地下研究所",
  47. chargePeople:"高耀",
  48. chargePhone:"13103215236",
  49. imgUrl:"/profile/upload/2024/03/01/nacos_20240301145836A002.png"
  50. }
  51. }
  52. }
  53. /**
  54. * 生命周期函数--监听页面加载
  55. */,
  56. onLoad(options) {
  57. this.getDetails(options.id);
  58. },
  59. methods: {
  60. /** 详情 */
  61. getDetails(id) {
  62. getDetails(id).then(response => {
  63. let details = response.data;
  64. let list = [];
  65. list.push({ title:"名称", content:details.name });
  66. list.push({ title:"地址", content:details.address });
  67. list.push({ title:"负责人", content:details.chargePeople });
  68. list.push({ title:"负责人电话", content:details.chargePhone });
  69. this.list = list;
  70. this.imgUrl = details.imgUrl;
  71. });
  72. },
  73. }
  74. };
  75. </script>
  76. <style>
  77. @import './details.css';
  78. </style>