123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <!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="详情-服务中心-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- <style>
- .service-detail img{width:100%;max-width:100%;float:left;}
- .service-detail,
- .service-detail p,
- .service-detail div{overflow:hidden;}
- </style>
- </head>
- <body class="bgcfff pt0 pb0" style="padding-top:0;">
- <div id="app">
- <van-nav-bar class="user_rank_explan_title user_title_normal" left-arrow title="问题详情" @click-left="backpage" v-if="toptitleisshow">
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <div class="pt16 pb16 pl16 pr16 bb8f7f7f7 top_line" v-cloak>
- <div class="f18 c333 b">{{articleinfo.Title}}</div>
- </div>
- <div class="service-detail pl16 pr16">
- <div class="f14 c666" v-html="articleinfo.Content" @click="isOK && clickimg(0)"></div>
- </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,
- active: 0,
- articleinfo:{
- Title:'',
- Content:''
- },
- isShow: false,
- imgsrc:'',
- imgelement:[],
- isOK:true,
- };
- },
- created() {
- this.type = browsertype.versions.ios ? 'ios' : 'android';
- this.getarticledetail();
- },
- updated(){
- },
- methods: {
- //- 截取参数函数
- getUrlParam(name){
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
- var r = window.location.search.substr(1).match(reg); //匹配目标参数
- if (r != null) return unescape(r[2]);
- return null; //返回参数值
- },
- async getarticledetail(){
- const that = this;
- const Id = PublicLib.getCookieInfo('articleId') ? PublicLib.getCookieInfo('articleId') : that.getUrlParam('Id');
- const res = await getRequest('api/v1/servicecenter/detail?t='+Math.random(6),JSON.stringify({Id}));
- if(res.status !== '1') return tips('获取文章详情失败,请重试!');
- that.articleinfo = res.data;
- 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);
- },
- //- 返回上一个页面
- backpage(){
- PublicLib.GoBack({Level:1});
- },
- clickimg(index = 0){
- if(typeof(index) == 'number'){
- if(!this.imgsrc){
- return;
- };
- PublicLib.PhotoBrowser(index,this.imgsrc);
- };
- }
- }
- });
- </script>
- </body>
- </html>
|