123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <template>
- <view class="container">
- <view class="notice-item1">
- <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y notice_content1" @scroll="scroll">
- <rich-text @click="navTo('/pages/shareQrCode/index')" class="notice_img" :nodes="description"></rich-text>
- </scroll-view>
- </view>
- </view>
- </template>
- <script>
- import { details } from '@/api/notice.js';
- import { saveUrl } from '@/utils/loginUtils.js';
- export default {
- data() {
- return {
- id:'',
- list:"",
- spread:"",
- show:false,
- scrollTop: 0,
- description:'',
- old: {
- scrollTop: 0
- }
- };
- },
- async onLoad(options) {
- this.id = options.id;
- // 判断有无邀请人
- if (options.spread) {
- uni.setStorageSync('spread', options.spread);
- }
- saveUrl();
- this.loadDate();
- },
- methods: {
- loadDate(){
- let obj = this;
- details({},obj.id).then(function(e) {
- obj.list = e.data;
- if(obj.list.content != null){
- obj.description =obj.list.content.replace(/\<img/gi,'<img class="rich-img"');
- }//小程序商品详情图超出屏幕问题
- });
- },
- //分享
- // #ifdef MP
- onShareAppMessage: function(res) {
- let userInfo = uni.getStorageSync('userInfo');
- let GetInfo = uni.getStorageSync('GetInfo');
- // 来自页面内分享按钮
- let pages = getCurrentPages();
- // 获取当前页面
- let page = pages[pages.length - 1];
- let path = '/pages/notice/poster?id='+this.id;
- // 保存邀请人
- path += '&spread=' + userInfo.uid;
- let data = {
- path: path,
- imageUrl: GetInfo.img,
- title: GetInfo.title
- };
- console.log(data)
- return data;
- },
- // #endif
- //返回顶部
- handleScrollTop(){
- window.scrollTo(0, 0);
- },
- scroll: function(e) {
- console.log(e)
- this.old.scrollTop = e.detail.scrollTop
- },
- goTop: function(e) {
- this.scrollTop = this.old.scrollTop;
- console.log(this.scrollTop)
- console.log(this.old.scrollTop)
- this.$nextTick(function() {
- this.scrollTop = 0
- });
- },
- //显示弹窗
- open(){
- this.show = true;
- },
- //随意点击隐藏弹窗
- onTap() {
- if (!this.open) return
- this.close()
- },
- close() {
- this.show = false;
- },
- //跳转接口
- navTo(url) {
- uni.navigateTo({
- url
- });
- },
- }
- };
- </script>
- <style lang="scss">
- page {
- min-height: 100%;
- background:#FFFFFF;
- }
- .notice_name {
- font-size: 35rpx !important;
- color: #303133;
- }
- .rich-img {
- width: 100% !important;
- height: auto ;
- }
- .notice-item {
- width: 100%;
- height: 100%;
- color: #666666;
- padding: 35rpx 35rpx;
- font-size: 23rpx;
- padding-bottom: 30rpx;
- }
- .notice-item1{
- width: 100%;
- }
- .notice_text {
- border-bottom: 1px solid #F0F0F0;
- padding: 30rpx 0rpx;
- }
- .notice_content {
- font-size: 28rpx;
- padding: 25rpx 0rpx;
- line-height: 45rpx;
- .image{
- width: 100%;
- height: 100rpx;
- image{
- width: 100%;
- height: 100%;
- }
- }
- }
- .notice_img{
- width: 100%;
- }
- .notice_content1{
- // background-color: #00B500;
- .image{
- width: 100%;
- height: 100rpx;
- image{
- width: 100%;
- height: 100%;
- }
- }
- }
- .share{
- text-align: center;
- background-color: #e93323!important;
- color: #FFFFFF !important;
- padding: 20rpx 0rpx;
- border-radius: 35rpx;
- margin-bottom: 20rpx;
- }
- .mask{
- z-index: 999;
- width: 750rpx;
- height: 100%;
- position: fixed;
- top: 0;
- left: 0;
- image{
- width: 100%;
- height: 100%;
- opacity: 0.8;
- }
- }
- </style>
|