| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <template>
- <view>
- <block v-if="detail.type == 1">
- <image
- v-for="(item, index) in detail.attinfos_pic"
- :key="item.attachmentid"
- class="image"
- :src="item.attinfos[0].url"
- mode="widthFix"
- hover-class="navigator-hover"
- lazy-load="true"
- @click="onClick(item, index)"
- />
- </block>
- <u-parse v-else-if="detail.type == 3" :content="detail.content" />
- <bottomForm
- v-if="detail.sharepagecontrol.style_bottom"
- :shareuserid="shareuserid"
- :bottomType="detail.sharepagecontrol.style_bottom"
- :type="detail.sharepagecontrol.style_signup"
- ownertable="sat_sharematerial"
- :ownerid="detail.sat_sharematerialid"
- />
- <view v-else style="height: 10px" />
- </view>
- </template>
- <script>
- import { viewImage } from "../../../utils/settleFiles";
- export default {
- name: "advertisingPage",
- props: {
- shareuserid: {
- type: [String, Number],
- default: 0,
- },
- },
- data() {
- return {
- detail: {
- type: 1, //1图片 2视频 3图文
- content: "",
- },
- };
- },
- methods: {
- getDetail(id) {
- return new Promise((resolve, reject) => {
- this.$Http
- .basic({
- id: "20240408131902",
- content: {
- sat_sharematerialid: id,
- },
- })
- .then((res) => {
- console.log("获取长图文详情", res);
- if (this.cutoff(res.msg)) return;
- let tips = "";
- if (!res.data.status) {
- tips = "数据已过期";
- } else {
- if (res.data.status != "发布") tips = "敬请期待!";
- }
- if (tips) {
- uni.showModal({
- title: "提示",
- content: tips,
- showCancel: false,
- complete: (complete) => {
- uni.navigateBack();
- },
- });
- } else {
- this.detail = res.data;
- resolve(res.data);
- uni.setNavigationBarTitle({
- title: res.data.title,
- });
- }
- });
- });
- },
- onClick(item, index) {
- console.log(item, index);
- if (item.jumpurl) {
- uni.navigateTo({
- url: item.jumpurl,
- fail: (fail) => {
- viewImage(item.attinfos[0].url);
- },
- });
- } else {
- viewImage(item.attinfos[0].url);
- }
- },
- },
- };
- </script>
- <style lang="scss" >
- image,
- img {
- display: block;
- vertical-align: bottom;
- }
- .image {
- width: 100vw;
- }
- .image:first-child {
- margin-top: 0;
- }
- </style>
|