collection.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <template>
  2. <view class="content">
  3. <view class="supply-box">
  4. <view class="supply-item-box">
  5. <view
  6. v-for="(item, idx) in titleList"
  7. :key="idx"
  8. :class="{ active: active === idx }"
  9. class="supply-item-name"
  10. @click="active = idx"
  11. >
  12. {{ item }}
  13. </view>
  14. </view>
  15. <view class="policy-content" v-if="active == 0">
  16. <view
  17. class="policy-content-item"
  18. v-for="(item, idx) in policyData"
  19. :key="idx"
  20. @click="enterPolicyDeatil(item.id)"
  21. >
  22. <view class="policy-content-item-left">
  23. <p class="policy-content-item-left-title" style="height: 70rpx">
  24. {{ item.title }}
  25. </p>
  26. <view class="policy-content-item-left-time">
  27. <p class="moment">{{ item.publish_time | globalTime }}</p>
  28. <p class="maxMony">{{ item.project_money }}</p>
  29. <p class="leftDay">
  30. <!-- {{ item.project_end_date | globalTime || "长期可申报" }} -->
  31. {{ "长期可申报" }}
  32. </p>
  33. </view>
  34. </view>
  35. <view class="policy-content-item-img">
  36. <image :src="item.pic_url" alt="" />
  37. </view>
  38. </view>
  39. </view>
  40. <view class="companys" v-if="active == 1">
  41. <view
  42. class="company"
  43. v-for="(company, index) in companyList"
  44. :key="index"
  45. @tap="toDetail(index)"
  46. >
  47. <view class="title">
  48. <view class="logo">
  49. <img :src="company.logo" alt="" />
  50. </view>
  51. <view class="name">
  52. {{ company.name }}
  53. </view>
  54. </view>
  55. <view class="info">
  56. <view class="view">
  57. <view class="info_t">法定代表人</view>
  58. <view class="name">
  59. {{ company.info.person }}
  60. </view>
  61. </view>
  62. <view class="line"></view>
  63. <view class="view">
  64. <view class="info_t">注册资本</view>
  65. {{ company.info.money }}
  66. </view>
  67. <view class="line"></view>
  68. <view class="view">
  69. <view class="info_t">成立日期</view>
  70. {{ company.info.time }}
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import md5 from "@/common/md5.js";
  80. export default {
  81. data() {
  82. return {
  83. titleList: ["政策", "企业"],
  84. active: 0,
  85. searchVal: "",
  86. policyData: new Array(5).fill({
  87. title:
  88. "工业金额信息化部办公厅 组织开2021念工业互联网平台创新互联网工业文化产业项目征集工作。",
  89. moment: "2021-07-12",
  90. maxMony: "最高500.00万",
  91. leftDay: "剩5天",
  92. img: "/static/policy/u388.jpg",
  93. }),
  94. companyList: new Array(5).fill({
  95. logo: "/static/enterprise/logo.png",
  96. name: "康拓科技有限责任公司",
  97. info: {
  98. person: "马须伦",
  99. money: "1,776,759.3万(元)",
  100. time: "1995-03-25",
  101. },
  102. }),
  103. };
  104. },
  105. onLoad() {
  106. // this.getCollection();
  107. },
  108. methods: {
  109. toDetail(index) {
  110. uni.navigateTo({
  111. url: "/pages/enterprise/enterprise_detail?id=" + index,
  112. });
  113. },
  114. enterPolicyDeatil(id) {
  115. uni.navigateTo({
  116. url: "/pages/policy/policy_deatil?id=" + id,
  117. });
  118. },
  119. /* getCollection() {
  120. let md5Sign = md5(
  121. "method=" +
  122. "user" +
  123. "&timestamp=" +
  124. getApp().globalData.globalTimestamp +
  125. "&secret=" +
  126. getApp().globalData.secret
  127. );
  128. let url =
  129. getApp().globalData.shareUrl +
  130. "api/api.php" +
  131. "?method=user&action=collect_list&timestamp=" +
  132. getApp().globalData.globalTimestamp +
  133. "&sign=" +
  134. md5Sign;
  135. let postData = {
  136. page: 1,
  137. page_size: 5,
  138. openId: getApp().globalData.open_id,
  139. };
  140. uni.request({
  141. url: url,
  142. method: "POST",
  143. header: {
  144. "content-type": "application/x-www-form-urlencoded",
  145. },
  146. data: postData,
  147. success: (res) => {
  148. console.log(res);
  149. if (res.data.code === 200) {
  150. }
  151. },
  152. fail: () => {
  153. console.log("连接失败");
  154. },
  155. });
  156. }, */
  157. },
  158. };
  159. </script>
  160. <style lang="scss">
  161. .content {
  162. padding: 4%;
  163. .supply-box {
  164. width: 100%;
  165. display: flex;
  166. flex-direction: column;
  167. .supply-title {
  168. width: 100%;
  169. p {
  170. background-color: #02a7f0;
  171. width: 190rpx;
  172. height: 70rpx;
  173. color: #ffffff;
  174. border-radius: 0 40rpx 40rpx 0rpx;
  175. font-size: 28rpx;
  176. display: flex;
  177. justify-content: center;
  178. align-items: center;
  179. }
  180. }
  181. .supply-item-box {
  182. display: flex;
  183. justify-content: space-evenly;
  184. margin: 0 20rpx;
  185. margin-top: 10rpx;
  186. .supply-item-name {
  187. padding-bottom: 10rpx;
  188. font-size: 27rpx;
  189. }
  190. .active {
  191. font-weight: 600;
  192. border-bottom: 7rpx solid #02a7f0;
  193. }
  194. }
  195. .supply-content {
  196. width: 100%;
  197. display: flex;
  198. box-sizing: border-box;
  199. flex-direction: column;
  200. font-size: 25rpx;
  201. .supplyCard {
  202. display: flex;
  203. width: 92%;
  204. margin: 2% 0;
  205. padding: 2% 4%;
  206. height: 5%;
  207. border-radius: 30rpx;
  208. box-shadow: rgba(100, 100, 111, 0.2) 0rpx 14rpx 50rpx 0rpx;
  209. .image_content {
  210. margin-right: 5%;
  211. image {
  212. width: 100rpx;
  213. height: 100rpx;
  214. border-radius: 20rpx;
  215. background-color: rgb(228, 228, 228);
  216. }
  217. }
  218. .state {
  219. margin-left: 100rpx;
  220. image {
  221. width: 100rpx;
  222. height: 80rpx;
  223. }
  224. }
  225. .info {
  226. display: flex;
  227. flex-flow: column;
  228. justify-content: space-around;
  229. .time {
  230. font-weight: 100;
  231. font-size: 25rpx;
  232. }
  233. }
  234. }
  235. }
  236. }
  237. .policy-content {
  238. width: 100%;
  239. display: flex;
  240. box-sizing: border-box;
  241. flex-direction: column;
  242. margin-top: 10rpx;
  243. .policy-content-item {
  244. margin: 0 20rpx;
  245. display: flex;
  246. overflow: hidden;
  247. box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
  248. border-radius: 32rpx;
  249. padding-bottom: 10rpx;
  250. margin-top: 20rpx;
  251. padding: 30rpx;
  252. justify-content: space-between;
  253. .policy-content-item-left {
  254. display: flex;
  255. flex-direction: column;
  256. width: 70%;
  257. .policy-content-item-left-title {
  258. text-overflow: -o-ellipsis-lastline;
  259. overflow: hidden;
  260. text-overflow: ellipsis;
  261. display: -webkit-box;
  262. -webkit-line-clamp: 2;
  263. line-clamp: 2;
  264. -webkit-box-orient: vertical;
  265. font-size: 25rpx;
  266. margin-bottom: 10rpx;
  267. }
  268. .policy-content-item-left-time {
  269. width: 100%;
  270. display: flex;
  271. align-items: center;
  272. .moment {
  273. color: #c1c1c1;
  274. font-size: 20rpx;
  275. margin-right: 20rpx;
  276. }
  277. .maxMony {
  278. font-size: 20rpx;
  279. color: #00bfbf;
  280. border: 1px solid #00bfbf;
  281. padding: 10rpx;
  282. margin-right: 20rpx;
  283. border-radius: 12rpx;
  284. }
  285. .leftDay {
  286. font-size: 20rpx;
  287. background: #f7bbc3;
  288. color: #e32579;
  289. padding: 10rpx;
  290. border: 1px solid #f7bbc3;
  291. border-radius: 12rpx;
  292. }
  293. }
  294. }
  295. .policy-content-item-img {
  296. image {
  297. width: 180rpx;
  298. height: 120rpx;
  299. border-radius: 12rpx;
  300. }
  301. }
  302. }
  303. }
  304. .companys {
  305. margin-top: 3%;
  306. padding: 0 4%;
  307. font-size: 30rpx;
  308. .company {
  309. border-radius: 20rpx;
  310. box-shadow: rgba(0, 0, 0, 0.35) 0rpx 5rpx 15rpx;
  311. padding: 1%;
  312. margin: 2% 0;
  313. .title {
  314. display: flex;
  315. align-items: center;
  316. .logo {
  317. image {
  318. width: 100rpx;
  319. height: 70rpx;
  320. margin-right: 30rpx;
  321. }
  322. }
  323. }
  324. .line {
  325. width: 3rpx;
  326. height: 70rpx;
  327. background: rgb(175, 186, 197);
  328. }
  329. .info {
  330. font-size: 19rpx;
  331. font-weight: 100;
  332. display: flex;
  333. text-align: center;
  334. justify-content: space-between;
  335. align-items: center;
  336. padding: 0 2%;
  337. margin-top: 1%;
  338. .view {
  339. margin-top: 2%;
  340. .name {
  341. color: #02a7f0;
  342. }
  343. .info_t {
  344. margin-bottom: 10rpx;
  345. font-size: 25rpx;
  346. }
  347. }
  348. }
  349. }
  350. }
  351. }
  352. </style>