webview 曲线救国

通过index 页面 去请求富文本详情接口 然后渲染页面数据

html模板案例

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <style>
      *{
        padding: 0;margin: 0;
      }
      #app{
        /* width: 375px; */
        /* max-width: 375px; */
        display: flex;
    flex-direction: column;
    background-color: #fff;
    /* align-items: center;  */
     width: 100%;
      }
      video{
        width: 100%;
      }
      img{
        width: 100%;
      }
    </style>
  </head>
  <body>
    <div id="app">

	</div>
  </body>
</html>
<script>
  location
  let app = document.getElementById("app");
  const paramsStr = window.location.search
const params = new URLSearchParams(paramsStr)
// list
console.log( );
  fetch("https://app.zcxrmyy.cn:5443/api/app/service/query/"+ params.get('id'))
  .then(res=>res.json())
  .then(res=>{
    console.log('res :>> ', res);
    app.innerHTML  =res.data.content
  })
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48