policy_deatil.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. <template>
  2. <div class="content">
  3. <div class="title-box">
  4. <div class="title">{{ infoObj.title }}</div>
  5. <div class="title-time">
  6. <p class="time">{{ infoObj.publish_time | globalTime }}</p>
  7. <p class="read-count">
  8. 阅读量
  9. {{
  10. Number(infoObj.base_read_count) + Number(infoObj.real_read_count)
  11. }}
  12. </p>
  13. </div>
  14. </div>
  15. <div class="video-box" v-if="infoObj.video_url">
  16. <video
  17. :src="infoObj.video_url"
  18. id="myVideo"
  19. controls="true"
  20. ></video>
  21. </div>
  22. <!-- 企业研发投入补贴 -->
  23. <div class="card-input-content">
  24. <div class="card-input">
  25. <div class="card-title">{{ infoObj.project_name }}</div>
  26. <div class="table">
  27. <p class="table-item">
  28. <span>项目金额:</span>
  29. <span>{{ infoObj.project_money }}</span>
  30. </p>
  31. <p class="table-item">
  32. <span>申报时间:</span>
  33. <span
  34. >{{ infoObj.project_start_date }} 至
  35. {{ infoObj.project_end_date }}</span
  36. >
  37. </p>
  38. <p class="table-item">
  39. <span>申报状态:</span>
  40. <span>剩5天</span>
  41. </p>
  42. </div>
  43. </div>
  44. </div>
  45. <!-- 项目概况 -->
  46. <div class="card-situation" v-if="infoObj.project_desc">
  47. <div class="card-title">项目概况</div>
  48. <p>
  49. {{ infoObj.project_desc }}
  50. </p>
  51. </div>
  52. <!-- <div class="card-group" v-for="(item, idx) in model" :key="idx">
  53. <policy-deatil-card :model="item" :isMar="idx == model.length - 1"></policy-deatil-card>
  54. </div> -->
  55. <div class="card-group">
  56. <div class="content-basic">
  57. <div class="card-title">基本信息</div>
  58. <div class="item-list">
  59. <div class="term">
  60. <div class="term-name">项目名称:</div>
  61. <div class="term-value-group">
  62. <p class="term-value-item">{{ infoObj.project_name }}</p>
  63. </div>
  64. </div>
  65. <div class="term">
  66. <div class="term-name">受理部门:</div>
  67. <div class="term-value-group">
  68. <p class="term-value-item">{{ infoObj.sponsor_name }}</p>
  69. </div>
  70. </div>
  71. <div class="term">
  72. <div class="term-name">政策层级:</div>
  73. <div class="term-value-group">
  74. <p class="term-value-item">{{ infoObj.level }}</p>
  75. </div>
  76. </div>
  77. <div class="term">
  78. <div class="term-name">信息提供日期:</div>
  79. <div class="term-value-group">
  80. <p class="term-value-item">
  81. {{ infoObj.publish_time | globalTime }}
  82. </p>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="card-group">
  89. <div class="content-basic">
  90. <div class="card-title">支持力度</div>
  91. <div class="item-list">
  92. <div class="term">
  93. <div class="term-name">支持金额:</div>
  94. <div class="term-value-group">
  95. <p class="term-value-item">{{ infoObj.project_money }}</p>
  96. </div>
  97. </div>
  98. <div class="term">
  99. <div class="term-name">资助标准:</div>
  100. <div class="term-value-group">
  101. <p class="term-value-item" v-html="infoObj.lidu"></p>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="content-rich" :class="{ 'margin-bottom-80': true }">
  108. <div class="card-title">{{ textModel1.title }}</div>
  109. <div class="item-list">
  110. <div class="term">
  111. <div class="term-value-group">
  112. <p class="term-value-item" v-html="textModel1.text"></p>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="content-rich" :class="{ 'margin-bottom-80': true }">
  118. <div class="card-title">{{ textModel2.title }}</div>
  119. <div class="item-list">
  120. <div class="term">
  121. <div class="term-value-group">
  122. <p class="term-value-item" v-html="textModel2.text"></p>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. <div class="content-rich" :class="{ 'margin-bottom-80': true }">
  128. <div class="card-title">{{ textModel3.title }}</div>
  129. <div class="item-list">
  130. <div class="term">
  131. <div class="term-value-group">
  132. <p class="term-value-item" v-html="textModel3.text"></p>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="content-rich" :class="{ 'margin-bottom-80': true }">
  138. <div class="card-title">联系方式</div>
  139. <div class="item-list">
  140. <div class="term">
  141. <div class="term-value-group">
  142. <p class="term-value-item">{{infoObj.contact}}</p>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. <div style="width: 100%">
  148. <footer-share
  149. style="width: 100%"
  150. :isCollection="true"
  151. :isCollectedIcon="infoObj.if_collect"
  152. @collectionPages="collectionPage"
  153. @sharePages="sharePage"
  154. ></footer-share>
  155. </div>
  156. </div>
  157. </template>
  158. <script>
  159. import policy_deatil_card from "./policy_deatil_card";
  160. import policy_rich_card from "./policy_rich_card";
  161. import md5 from "@/common/md5.js";
  162. export default {
  163. components: {
  164. policyDeatilCard: policy_deatil_card,
  165. policyRichCard: policy_rich_card,
  166. },
  167. data() {
  168. return {
  169. model: [],
  170. levelList: {
  171. 1: "省级政策",
  172. 2: "市级政策",
  173. 3: "区级政策",
  174. 4: "新城政策",
  175. },
  176. id: "",
  177. textModel1: {
  178. title: "申报条件",
  179. text: "",
  180. },
  181. textModel2: {
  182. title: "申报材料",
  183. text: "",
  184. },
  185. textModel3: {
  186. title: "申报途径",
  187. text: "",
  188. },
  189. // textModel4: {
  190. // title: "联系方式",
  191. // text: "",
  192. // },
  193. scrollTop: 0,
  194. infoObj: {},
  195. };
  196. },
  197. onLoad(option) {
  198. let id = option.id;
  199. this.getDetailInfo(id);
  200. },
  201. methods: {
  202. getDetailInfo(ids) {
  203. let md5Sign = md5(
  204. "method=" +
  205. "common" +
  206. "&timestamp=" +
  207. getApp().globalData.globalTimestamp +
  208. "&secret=" +
  209. getApp().globalData.secret
  210. );
  211. let url =
  212. getApp().globalData.shareUrl +
  213. "api/api.php" +
  214. "?method=common&source=policy&action=info_by_id&timestamp=" +
  215. getApp().globalData.globalTimestamp +
  216. "&sign=" +
  217. md5Sign;
  218. uni.request({
  219. url: url,
  220. method: "POST",
  221. header: {
  222. "content-type": "application/x-www-form-urlencoded",
  223. },
  224. data: {
  225. id: ids,
  226. openId:getApp().globalData.open_id
  227. },
  228. success: (res) => {
  229. if (res.data.code === 200) {
  230. if(res.data.data.video_url){ res.data.data.video_url = getApp().globalData.shareUrl + res.data.data.video_url;}
  231. res.data.data.level = this.levelList[res.data.data.level];
  232. this.infoObj = res.data.data;
  233. this.getRich1(ids);
  234. this.getRich2(ids);
  235. this.getRich3(ids);
  236. this.getRich4(ids);
  237. }
  238. },
  239. fail: () => {
  240. console.log("连接失败");
  241. },
  242. });
  243. },
  244. getRich1(ids) {
  245. uni.request({
  246. url: `https://kiq.xazhima.com/content/policy/${Math.floor(
  247. ids / 1000
  248. )}/${ids}_1.html`,
  249. method: "GET",
  250. header: {
  251. "content-type": "application/x-www-form-urlencoded",
  252. },
  253. success: (res) => {
  254. if (res.statusCode === 200) {
  255. this.$set(this.infoObj, "lidu", res.data);
  256. }
  257. },
  258. fail: () => {
  259. console.log("连接失败");
  260. },
  261. });
  262. },
  263. getRich2(ids) {
  264. uni.request({
  265. url: `https://kiq.xazhima.com/content/policy/${Math.floor(
  266. ids / 1000
  267. )}/${ids}_2.html`,
  268. method: "GET",
  269. header: {
  270. "content-type": "application/x-www-form-urlencoded",
  271. },
  272. success: (res) => {
  273. if (res.statusCode === 200) {
  274. this.$set(this.textModel1, "text", res.data);
  275. }
  276. },
  277. fail: () => {
  278. console.log("连接失败");
  279. },
  280. });
  281. },
  282. getRich3(ids) {
  283. uni.request({
  284. url: `https://kiq.xazhima.com/content/policy/${Math.floor(
  285. ids / 1000
  286. )}/${ids}_3.html`,
  287. method: "GET",
  288. header: {
  289. "content-type": "application/x-www-form-urlencoded",
  290. },
  291. success: (res) => {
  292. if (res.statusCode === 200) {
  293. this.$set(this.textModel2, "text", res.data);
  294. }
  295. },
  296. fail: () => {
  297. console.log("连接失败");
  298. },
  299. });
  300. },
  301. getRich4(ids) {
  302. uni.request({
  303. url: `https://kiq.xazhima.com/content/policy/${Math.floor(
  304. ids / 1000
  305. )}/${ids}_4.html`,
  306. method: "GET",
  307. header: {
  308. "content-type": "application/x-www-form-urlencoded",
  309. },
  310. success: (res) => {
  311. if (res.statusCode === 200) {
  312. this.$set(this.textModel3, "text", res.data);
  313. }
  314. },
  315. fail: () => {
  316. console.log("连接失败");
  317. },
  318. });
  319. },
  320. collectionPage() {
  321. let md5Sign = md5(
  322. "method=" +
  323. "user" +
  324. "&timestamp=" +
  325. getApp().globalData.globalTimestamp +
  326. "&secret=" +
  327. getApp().globalData.secret
  328. );
  329. let url =
  330. getApp().globalData.shareUrl +
  331. "api/api.php" +
  332. "?method=user&source=policy&action=collect_add&timestamp=" +
  333. getApp().globalData.globalTimestamp +
  334. "&sign=" +
  335. md5Sign;
  336. uni.request({
  337. url: url,
  338. method: "POST",
  339. header: {
  340. "content-type": "application/x-www-form-urlencoded",
  341. },
  342. data: {
  343. openId :getApp().globalData.open_id,
  344. source :'policy',
  345. source_name :'政策',
  346. source_id :this.infoObj.id,
  347. source_title :this.infoObj.title
  348. },
  349. success: (res) => {
  350. if (res.data.code === 200) {
  351. res.data.data ? this.infoObj.if_collect = true : this.infoObj.if_collect = false;
  352. this.$forceUpdate();
  353. uni.showToast({
  354. duration:3000,
  355. title:res.data.msg,
  356. icon:'none'
  357. })
  358. }
  359. },
  360. fail: () => {
  361. console.log("连接失败");
  362. },
  363. });
  364. },
  365. shareRequest(){
  366. let md5Sign = md5(
  367. "method=" +
  368. "user" +
  369. "&timestamp=" +
  370. getApp().globalData.globalTimestamp +
  371. "&secret=" +
  372. getApp().globalData.secret
  373. );
  374. let url =
  375. getApp().globalData.shareUrl +
  376. "api/api.php" +
  377. "?method=user&source=policy&action=repost&timestamp=" +
  378. getApp().globalData.globalTimestamp +
  379. "&sign=" +
  380. md5Sign;
  381. uni.request({
  382. url: url,
  383. method: "POST",
  384. header: {
  385. "content-type": "application/x-www-form-urlencoded",
  386. },
  387. data: {
  388. openId :getApp().globalData.open_id,
  389. source_id :this.infoObj.id,
  390. source :'policy',
  391. },
  392. success: (res) => {
  393. if (res.data.code === 200) {
  394. console.log(res)
  395. }
  396. },
  397. fail: () => {
  398. console.log("连接失败");
  399. },
  400. });
  401. },
  402. sharePage() {
  403. let that = this;
  404. uni.showShareMenu({
  405. title: that.infoObj.title,
  406. path: "pages/policy/policy_detail?id="+that.infoObj.id,
  407. success(res) {
  408. that.shareRequest();
  409. },
  410. });
  411. },
  412. changeScroll(height) {
  413. //点的时候触发这个函数 height 是之前的高度
  414. uni.pageScrollTo({
  415. scrollTop: this.scrollTop,
  416. duration: 0,
  417. });
  418. },
  419. },
  420. onPageScroll(e) {
  421. this.scrollTop = e.scrollTop;
  422. },
  423. };
  424. </script>
  425. <style lang="scss" scoped>
  426. * {
  427. box-sizing: border-box;
  428. }
  429. .footer-share-box {
  430. margin-left: -20rpx;
  431. }
  432. .content {
  433. margin-top: 20rpx;
  434. display: flex;
  435. flex-direction: column;
  436. align-items: center;
  437. justify-content: center;
  438. padding: 20rpx;
  439. height: auto;
  440. .title-box {
  441. width: 100%;
  442. display: flex;
  443. flex-direction: column;
  444. padding-bottom: 10rpx;
  445. margin-left: 30rpx;
  446. .title {
  447. letter-spacing: 5rpx;
  448. font-size: 35rpx;
  449. font-weight: 500;
  450. }
  451. .title-time {
  452. display: flex;
  453. font-size: 20rpx;
  454. color: $uni-text-color-grey;
  455. margin-top: 20rpx;
  456. .time {
  457. margin-right: 100rpx;
  458. }
  459. }
  460. }
  461. .video-box {
  462. width: 100%;
  463. // image {
  464. // width: 100%;
  465. // height: 400rpx;
  466. // border-radius: 32rpx;
  467. // }
  468. }
  469. #myVideo {
  470. width: 100%;
  471. border-radius: 10rpx;
  472. }
  473. .card-input-content {
  474. width: 100%;
  475. margin-top: 20rpx;
  476. .card-input {
  477. padding: 30rpx 30rpx;
  478. box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
  479. border-radius: 32rpx;
  480. .card-title {
  481. font-weight: 600;
  482. padding: 20rpx 20rpx 0rpx 20rpx;
  483. }
  484. .table {
  485. border-radius: 32rpx;
  486. background-color: #f2f2f2;
  487. margin-top: 20rpx;
  488. display: flex;
  489. padding: 0 20rpx;
  490. flex-direction: column;
  491. .table-item {
  492. box-sizing: border-box;
  493. width: 100%;
  494. margin: 20rpx 0;
  495. font-size: 27rpx;
  496. font-weight: 300;
  497. display: flex;
  498. justify-content: space-between;
  499. }
  500. }
  501. }
  502. }
  503. .card-situation {
  504. margin-top: 20rpx;
  505. padding: 20rpx;
  506. border-top: 8rpx solid #f2f2f2;
  507. box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
  508. border-radius: 32rpx;
  509. .card-title {
  510. font-weight: 600;
  511. padding: 20rpx 20rpx 0rpx 20rpx;
  512. }
  513. p {
  514. padding: 20rpx;
  515. margin-top: 20rpx;
  516. font-size: 27rpx;
  517. letter-spacing: 1rpx;
  518. line-height: 50rpx;
  519. }
  520. }
  521. .card-group {
  522. width: 100%;
  523. }
  524. .share-collection {
  525. background-color: #ffffff;
  526. position: fixed;
  527. bottom: 0;
  528. width: 100%;
  529. height: 80rpx;
  530. display: flex;
  531. align-items: center;
  532. justify-content: space-between;
  533. .share,
  534. .collection {
  535. width: 50%;
  536. display: flex;
  537. justify-content: center;
  538. align-items: center;
  539. height: 100%;
  540. }
  541. .share {
  542. border-right: 1px solid $uni-border-color;
  543. }
  544. image {
  545. width: 50rpx;
  546. height: 50rpx;
  547. margin-left: 40rpx;
  548. }
  549. }
  550. .content-basic {
  551. box-sizing: border-box;
  552. margin-top: 20rpx;
  553. padding: 20rpx;
  554. box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
  555. border-radius: 32rpx;
  556. width: 100%;
  557. display: flex;
  558. flex-direction: column;
  559. // margin-bottom: 80rpx;
  560. .card-title {
  561. padding: 20rpx 20rpx 0rpx 20rpx;
  562. font-weight: 600;
  563. }
  564. .item-list {
  565. margin-left: 20rpx;
  566. display: flex;
  567. flex-direction: column;
  568. .term {
  569. display: flex;
  570. padding: 20rpx;
  571. .term-name {
  572. font-size: 27rpx;
  573. width: 30%;
  574. display: flex;
  575. margin: 20rpx;
  576. color: #7f7f7f;
  577. }
  578. .term-value-group {
  579. flex: 1;
  580. display: flex;
  581. flex-direction: column;
  582. font-size: 27rpx;
  583. .term-value-item {
  584. margin: 20rpx;
  585. }
  586. }
  587. }
  588. }
  589. }
  590. .content-rich {
  591. box-sizing: border-box;
  592. margin-top: 20rpx;
  593. padding: 20rpx;
  594. box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
  595. border-radius: 32rpx;
  596. width: 100%;
  597. display: flex;
  598. flex-direction: column;
  599. // margin-bottom: 80rpx;
  600. .card-title {
  601. padding: 20rpx 20rpx 0rpx 20rpx;
  602. font-weight: 600;
  603. }
  604. .item-list {
  605. margin-left: 20rpx;
  606. display: flex;
  607. flex-direction: column;
  608. .term {
  609. display: flex;
  610. padding: 20rpx;
  611. .term-name {
  612. font-size: 27rpx;
  613. width: 30%;
  614. display: flex;
  615. margin: 20rpx;
  616. color: #7f7f7f;
  617. }
  618. .term-value-group {
  619. flex: 1;
  620. display: flex;
  621. flex-direction: column;
  622. font-size: 27rpx;
  623. .term-value-item {
  624. margin: 20rpx;
  625. }
  626. }
  627. }
  628. }
  629. }
  630. .margin-bottom-80 {
  631. margin-bottom: 80rpx;
  632. }
  633. }
  634. </style>