| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <template>
- <view>
- <artical-deatil :model="model"></artical-deatil>
- </view>
- </template>
- <script>
- import md5 from "@/common/md5.js";
- import ArticalDeatil from "../../components/artical-deatil/index";
- export default {
- data() {
- return {
- model: {
- title: "",
- way: "",
- time: "",
- artical: "",
- },
- id: "",
- };
- },
- components: {
- ArticalDeatil,
- },
- onLoad(op) {
- this.id = op.id;
- this.getNotice();
- },
- methods: {
- getNotice() {
- let md5Sign = md5(
- "method=" +
- "common" +
- "×tamp=" +
- getApp().globalData.globalTimestamp +
- "&secret=" +
- getApp().globalData.secret
- );
- let url =
- getApp().globalData.shareUrl +
- "api/api.php" +
- "?method=common&source=notice&action=info_by_id×tamp=" +
- getApp().globalData.globalTimestamp +
- "&sign=" +
- md5Sign;
- let postData = {
- id: this.id,
- };
- //获取文章
- uni.request({
- url: url,
- method: "POST",
- header: {
- "content-type": "application/x-www-form-urlencoded",
- },
- data: postData,
- success: (res) => {
- if (res.data.code === 200) {
- let data = res.data.data;
- this.model.title = data.title;
- this.model.way = data.sponsor;
- this.model.sponsor = data.sponsor
- let time = this.$options.filters["globalTime"](data.publish_time);
- let timeSecond = this.$options.filters["globalTimeSecond"](
- data.publish_time
- );
- this.model.time = time + " " + timeSecond;
- this.getRich();
-
- }
- },
- fail: () => {
- console.log("连接失败");
- },
- });
- },
- getRich() {
- uni.request({
- url: `https://kiq.xazhima.com/content/notice/${Math.floor(
- this.id / 1000
- )}/${this.id}.html`,
- method: "GET",
- header: {
- "content-type": "application/x-www-form-urlencoded",
- },
- success: (res) => {
-
- if (res.statusCode === 200) {
- this.model.artical = res.data
- }
- },
- fail: () => {
- console.log("连接失败");
- },
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- </style>
|