details.vue 2.2 KB

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