123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>消息列表-消息中心-创业帮</title>
- <meta name="keywords" content="消息列表-消息中心-创业帮">
- <meta name="description" content="消息列表-消息中心-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="消息列表-消息中心-创业帮">
- <link rel="stylesheet" href="./static/css/main.css">
- <style>
- img{width:100%;}
- div{line-height:1.5}
- </style>
- </head>
- <body class="back-color pb0 pt0">
- <div id="app" v-cloak>
- <van-nav-bar class="user_rank_explan_title user_title_normal bottom_line" :title="noticetitle" v-if="toptitleisshow" @click-left="goback" left-arrow>
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <div class="pl16 pr16 top_line" v-html="noticedetail.Content" @click="isOK && clickimg(0)" @touchstart="gtouchstart" @touchend="gtouchend" @touchmove="gtouchmove"></div>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- toptitleisshow,
- noticetitle:'',
- noticedetail:'',
- imgsrc:'',
- imgelement:[],
- isOK:true,
- };
- },
- created() {
- this.getnoticelist();
- //- this.readflag();
- },
- methods: {
- async getnoticelist(){
- const that = this;
- //- PublicLib.ShowLoading({Message:''});
- const Id = PublicLib.getCookieInfo('noticeArticleDetail');
- let requestUrl = '';
- if(PublicLib.getCookieInfo('noticeType') === '个人消息'){
- requestUrl = 'api/v1/msgpersonal/detail?t='+Math.random(6);
- }else{
- requestUrl = 'api/v1/msgplacard/detail?t='+Math.random(6);
- };
- const res = await getRequest(requestUrl,JSON.stringify({Id}));
- if(res.status !== '1') return;
- //- PublicLib.HideLoading();
- this.noticedetail = res.data;
- PublicLib.SetTitle({Title:res.data.Title});
- var imgReg = /(\/|http)[^>]+\.(jpg|jpeg|png|gif)/g;
- that.imgsrc=res.data.Content.match(imgReg);
- setTimeout(()=>{
- const imgel = document.querySelectorAll('.service-detail p');
- imgel.forEach((item,index)=>{
- if(item.children.length === 1 && item.children[0].nodeName === 'IMG'){
- that.imgelement.push(item)
- };
- });
- that.imgelement.forEach((item,i)=>{
- that.isOK = false;
- item.addEventListener('click',function(){
- that.clickimg(i);
- });
- })
- },500);
- },
- gtouchstart(){
- const that = this;
- this.timeOutEvent = setTimeout(()=>{
- that.longPress()
- },500);
- },
- gtouchend(){
- clearTimeout(this.timeOutEvent);
- },
- gtouchmove(){
- clearTimeout(this.timeOutEvent);
- this.timeOutEvent = 0;
- },
- longPress(){
- this.timeOutEvent = 0;
- PublicLib.SaveToSd({PicPath:this.imgsrc[0]});
- // 下载分享图片
- },
- readflag(){
- const Id = PublicLib.getCookieInfo('noticeArticleDetail');
- let requestUrl = '';
- if(PublicLib.getCookieInfo('noticeType') === '个人消息'){
- requestUrl = 'api/v1/msgpersonal/read?t='+Math.random(6);
- }else{
- requestUrl = 'api/v1/msgplacard/read?t='+Math.random(6);
- };
- const UserId = PublicLib.getCookieInfo('userId');
- postRequest(requestUrl,JSON.stringify({Id,UserId}));
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- clickimg(index = 0){
- if(typeof(index) == 'number'){
- PublicLib.PhotoBrowser(index,this.imgsrc);
- };
- }
- }
- });
- </script>
- </body>
- </html>
|