Rorschach 6 jaren geleden
bovenliggende
commit
6028bf694c

+ 3 - 1
app.js

@@ -1,5 +1,6 @@
 //app.js
 import {GetQueryString} from 'utils/util'
+const Towxml = require('/towxml/main'); 
 App({
   onLaunch: function (options) {
    // 判断设备是否为 iPhone X
@@ -18,5 +19,6 @@ App({
         }
       }
     })
-  }
+  },
+  towxml: new Towxml()
 })

+ 12 - 1
pages/groupPage/grade-details/grade-details.js

@@ -150,6 +150,7 @@ Page({
         share: options.share
       })
     }
+  
     // wx.setNavigationBarTitle({
     //   title: options.title
     // })
@@ -167,10 +168,20 @@ Page({
       wx.setNavigationBarTitle({
         title: bookInfo.title
       })
+      const data = app.towxml.toJson(
+        bookInfo.description,
+        'markdown',
+        this
+      )
+      // data.theme = 'light';
+      // this.setData({
+      //   article: data
+      // })
       this.setData({
         titleIcon: bookInfo.bgImg,
         title: bookInfo.title,
-        bookInfo: bookInfo.description
+        bookInfo: bookInfo.description,
+        article: data
       })
       const lessonTemp = [];
       lessonList.forEach(item => {

+ 9 - 6
pages/groupPage/grade-details/grade-details.wxml

@@ -5,8 +5,8 @@
             <image src="{{titleIcon}}"></image>
         </view>
         <view class="catalog">
-            <image class="bg2" src="../../../static/groupImg/Rectangle_9.png"></image> 
-            <text class="{{flag ? '' : 'select'}}" bindtap="tabSwitch">您需要知道</text>    
+            <image class="bg2" src="../../../static/groupImg/Rectangle_9.png"></image>
+            <text class="{{flag ? '' : 'select'}}" bindtap="tabSwitch">您需要知道</text>
             <text class="{{flag ? 'select' : ''}}" bindtap="tabSwitch">课文目录</text>
         </view>
         <view class="catalog-list" hidden="{{!flag}}">
@@ -15,12 +15,15 @@
                 <text class="right">{{item.readingNum}}朗读 ></text>
             </view>
         </view>
+        <!-- 你需要知道 -->
         <view class="know" hidden="{{flag}}">
-        </view>       
+            <import src="../../../towxml/entry.wxml" />
+            <template is="entry" data="{{...article}}" />
+        </view>
     </scroll-view>
     <view class="group-btn {{isIPX ? 'bottomx' :''}}" wx:if="{{!share}}">
         <image class="bg1" src="../../../static/groupImg/Rectangle_9.png"></image>
-        <image class="bg2" src="../../../static/groupImg/Rectangle_9.png"></image>      
+        <image class="bg2" src="../../../static/groupImg/Rectangle_9.png"></image>
         <block wx:for="{{payList}}" wx:key="{{index}}">
             <view class="Price" bindtap="pay" data-id="{{item.id}}" wx:if="{{share ? (index != 0) : true }}">
                 <text>¥{{item.price / 100}}</text>
@@ -29,14 +32,14 @@
         </block>
     </view>
     <view class="group-btn {{isIPX ? 'bottomx' :''}}" wx:if="{{share}}">
-        <image class="bg1" src="../../../static/groupImg/Rectangle_9.png" style="left: 50%"></image>   
+        <image class="bg1" src="../../../static/groupImg/Rectangle_9.png" style="left: 50%"></image>
         <block wx:for="{{payList}}" wx:key="{{index}}">
             <view class="Price" bindtap="pay" data-id="{{item.id}}" wx:if="{{share ? (index != 0) : true }}">
                 <view>继续开团 赚奖学金</view>
                 <view>
                     <text>{{item.headcount}}人团</text>
                 </view>
-            </view> 
+            </view>
         </block>
     </view>
 </view>

+ 11 - 0
pages/groupPage/grade-details/grade-details.wxss

@@ -1,4 +1,15 @@
 /* pages/grade-details/grade-details.wxss */
+/**基础风格样式**/
+@import '../../../towxml/style/main.wxss';
+
+
+/**如果页面有动态主题切换,则需要将使用到的样式全部引入**/
+
+/**主题配色(浅色样式)**/
+@import '../../../towxml/style/theme/light.wxss';
+
+/**主题配色(深色样式)**/
+@import '../../../towxml/style/theme/dark.wxss';
 .group-details {
     height: 100%;
     width: 100%;

+ 1 - 0
towxml

@@ -0,0 +1 @@
+Subproject commit 0bb70d6f7aca65b74d88c01977ceac52f3465f5d