collection.vue 8.8 KB

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