index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="content-box">
  3. <view class="policy-item-box">
  4. <view v-for="(item, idx) in projectList" :key="idx" :class="{ active: active === idx }" class="policy-item-name" @click="changeProjectTabs(idx)">
  5. {{ item }}
  6. </view>
  7. </view>
  8. <view class="project-box">
  9. <view class="project-content display-around-column" v-for="(item, idx) in projectData" :key="idx"
  10. :class="{ borderBottom: idx == projectData.length - 1 }" @click="enterProjectDeatil(item.id)">
  11. <view class="display-between items-center pos-class">
  12. <view style="font-size: 30rpx;">{{item.title}}</view>
  13. <image src="/static/important_icon.png" mode="aspectFit" style="width:80rpx;height: 80rpx;"></image>
  14. </view>
  15. <view class="display-flex-start pos-class">
  16. <view class="left-title">业主名称</view>
  17. <view>{{item.name}}</view>
  18. </view>
  19. <view class="display-flex-start pos-class" style="margin-bottom: 20rpx;">
  20. <view class="left-title">总投资</view>
  21. <view>{{item.maxMony}}</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import md5 from "@/common/md5.js";
  29. export default {
  30. data() {
  31. return {
  32. swiperList: [],
  33. projectList: ["在库", "技改", "在谈"],
  34. active: 0,
  35. projectData: new Array(5).fill({
  36. title:"普汇中金生命科学国际合作中心",
  37. name: "普汇中金国际控股有限公司",
  38. maxMony: "160000(万元)",
  39. id:'1'
  40. }),
  41. };
  42. },
  43. onLoad(option) {
  44. this.active = Number(option.idx)
  45. this.getProjectList(this.active)
  46. },
  47. methods: {
  48. enterProjectDeatil(id) {
  49. uni.navigateTo({
  50. url:"/pages/metrics/projectPage/detail?id=" + id
  51. });
  52. },
  53. getProjectList(tabVal){
  54. let tabObj = {
  55. 0:'在库',
  56. 1:'技改',
  57. 2:'在谈'
  58. }
  59. let md5Sign = md5(
  60. "method=" +
  61. "stat" +
  62. "&timestamp=" +
  63. getApp().globalData.globalTimestamp +
  64. "&secret=" +
  65. getApp().globalData.secret
  66. );
  67. let url =
  68. getApp().globalData.shareUrl +
  69. "api/api.php" +
  70. "?method=stat&action=project_list&timestamp=" +
  71. getApp().globalData.globalTimestamp +
  72. "&sign=" +
  73. md5Sign;
  74. uni.request({
  75. url: url,
  76. method: "POST",
  77. header: {
  78. "content-type": "application/x-www-form-urlencoded",
  79. },
  80. data: {
  81. tab : tabObj[tabVal]
  82. },
  83. success: (res) => {
  84. if (res.data.code === 200) {
  85. }
  86. },
  87. fail: () => {
  88. console.log("连接失败");
  89. },
  90. });
  91. },
  92. changeProjectTabs(idx) {
  93. let that = this;
  94. that.active = idx;
  95. switch (idx) {
  96. case 0:
  97. that.getProjectList(idx);
  98. break;
  99. case 1:
  100. that.getProjectList(idx);
  101. break;
  102. case 2:
  103. that.getProjectList(idx);
  104. break;
  105. }
  106. },
  107. },
  108. };
  109. </script>
  110. <style lang="scss">
  111. .content-box {
  112. display: flex;
  113. flex-direction: column;
  114. flex: 1;
  115. }
  116. .policy-item-box {
  117. display: flex;
  118. justify-content: space-between;
  119. margin: 0 20rpx;
  120. margin-top: 20rpx;
  121. .policy-item-name {
  122. padding-bottom: 10rpx;
  123. font-size: 30rpx;
  124. width: 25%;
  125. text-align: center;
  126. }
  127. .active {
  128. font-weight: 600;
  129. border-bottom: 7rpx solid #02a7f0;
  130. }
  131. }
  132. .project-content {
  133. border-top: 1px solid #f2f2f2;
  134. }
  135. .pos-class {
  136. padding-left: 10rpx;
  137. margin-bottom: 10rpx;
  138. font-size: 28rpx;
  139. }
  140. .left-title {
  141. width: 20%;
  142. color: #7F7F7F;
  143. font-size: 26rpx;
  144. }
  145. .borderBottom {
  146. border-bottom: 1px solid #f2f2f2;
  147. }
  148. </style>