From e72f509ca0728f571fcf652e1e60d7af970518cf Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期四, 06 六月 2024 17:49:57 +0800
Subject: [PATCH] 数字教材跳转阅读器

---
 app.json                                                                     |    3 
 pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.js   |   74 ++++++++++++++++++++++++
 pages/digitalTextbooks/digitalTextbooksDetails/index.wxml                    |   14 +++-
 pages/digitalTextbooks/digitalTextbooksDetails/index.wxss                    |    4 
 pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxss |    1 
 pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxml |    2 
 assets/js/config.js                                                          |    3 
 pages/digitalTextbooks/digitalTextbooksDetails/index.js                      |   28 +++++----
 pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.json |    3 +
 9 files changed, 110 insertions(+), 22 deletions(-)

diff --git a/app.json b/app.json
index 9411650..565fc52 100644
--- a/app.json
+++ b/app.json
@@ -17,7 +17,8 @@
     "pages/bindInfo/index",
     "pages/bookExhibitionList/select/select",
     "pages/digitalTextbooks/index",
-    "pages/digitalTextbooks/digitalTextbooksDetails/index"
+    "pages/digitalTextbooks/digitalTextbooksDetails/index",
+    "pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index"
   ],
   "subPackages": [
     {
diff --git a/assets/js/config.js b/assets/js/config.js
index 458bd1a..870c6e7 100644
--- a/assets/js/config.js
+++ b/assets/js/config.js
@@ -16,7 +16,7 @@
 export const digitalTextbooks = "jsek_digitalTextbooks"; //鏁板瓧鏁欐潗
 export const seminar = "jsek_seminar"; //涓撻鐮旇
 export const digitalRead = "jsek_digitalReading"; //鏁板瓧闃呰
-
+export const textReaderUrl = "http://182.92.203.7:3007/testBookReader/#/home"; //鏁板瓧鏁欐潗闃呰鍣�
 // export const seminar ="jsek_seminar";//涔﹀睍
 
 export const reg_tel =
@@ -39,5 +39,6 @@
   epubUrl,
   pdfUrl,
   appId,
+  textReaderUrl
 };
 export default config;
\ No newline at end of file
diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.js b/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.js
new file mode 100644
index 0000000..6592ea1
--- /dev/null
+++ b/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.js
@@ -0,0 +1,74 @@
+// pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.js
+const app = getApp()
+Page({
+
+  /**
+   * 椤甸潰鐨勫垵濮嬫暟鎹�
+   */
+  data: {
+    URL: ''
+  },
+
+  /**
+   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
+   */
+  onLoad(options) {
+    console.log(options);
+
+    let token = wx.getStorageSync(app.config.tokenKey)
+    this.setData({
+      URL: app.config.textReaderUrl + '?bookId=' + options.refCode + "&tryPageCount=" + options.probationPage + "&token=" + token
+    })
+    console.log(this.data.URL);
+
+  },
+
+  /**
+   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
+   */
+  onShareAppMessage() {
+
+  }
+})
\ No newline at end of file
diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.json b/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.json
@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxml b/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxml
new file mode 100644
index 0000000..d3776d2
--- /dev/null
+++ b/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxml
@@ -0,0 +1,2 @@
+<!--pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxml-->
+<web-view src="{{URL}}"></web-view>
\ No newline at end of file
diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxss b/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxss
new file mode 100644
index 0000000..d46f93e
--- /dev/null
+++ b/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxss
@@ -0,0 +1 @@
+/* pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxss */
\ No newline at end of file
diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/index.js b/pages/digitalTextbooks/digitalTextbooksDetails/index.js
index b31a042..bf850f1 100644
--- a/pages/digitalTextbooks/digitalTextbooksDetails/index.js
+++ b/pages/digitalTextbooks/digitalTextbooksDetails/index.js
@@ -12,7 +12,7 @@
     isFavourite: true,
     richStyle: 'font-size: 28rpx;color: #333; line-height: 48rpx;text-align: justify;margin: 20rpx; ',
     briefIconClick: {
-      name: "/static/images/bookService/detail/tushujianjie-click.png",
+      name: "/static/images/bookService/detail/tushujianjie-g.png",
     },
     relatedBookData: [],
     publicationDate: '',
@@ -404,20 +404,22 @@
         duration: 1000,
       });
     }
+  },
+
+  // console.log(item, app.config.textReaderUrl);
+  // console.log(token);
+  goRead() {
+
+    const item = this.data.digitalsData
+
+    let token = wx.getStorageSync(app.config.tokenKey)
+    console.log();
+    const URL = app.config.textReaderUrl + '?bookId=' + item.refCode + "&tryPageCount=" + item.probationPage + "&token=" + token
 
 
-
-
-
-
-
-
-
-
-
-
-
-
+    wx.navigateTo({
+      url: '/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index?refCode=' + item.refCode + "&tryPageCount=" + item.probationPage
+    });
 
   }
 })
\ No newline at end of file
diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/index.wxml b/pages/digitalTextbooks/digitalTextbooksDetails/index.wxml
index 2d8ebfa..f22d311 100644
--- a/pages/digitalTextbooks/digitalTextbooksDetails/index.wxml
+++ b/pages/digitalTextbooks/digitalTextbooksDetails/index.wxml
@@ -72,7 +72,7 @@
             </view>
             <view class="basic"> 鍩烘湰淇℃伅</view>
           </view>
-          <view style="margin: 30rpx;">
+          <view style="margin: 30rpx; margin-bottom: 130rpx;">
             <rich-text nodes="{{digitalsData.content}}" style="{{richStyle}}"></rich-text>
           </view>
 
@@ -84,7 +84,7 @@
             </view>
             <view class="basic"> 浣滆�呬俊鎭�</view>
           </view>
-          <view style="margin: 30rpx;">
+          <view style="margin: 30rpx; margin-bottom: 130rpx;">
             <rich-text nodes="{{digitalsData.authorIntroduction}}" style="{{richStyle}}"></rich-text>
           </view>
 
@@ -99,7 +99,7 @@
             <view class="basic"> 鐩綍</view>
           </view>
 
-          <view style="margin: 30rpx;">
+          <view style="margin: 30rpx; margin-bottom: 130rpx;">
 
 
             <rich-text nodes="{{digitalsData.catalogue}}" style="{{richStyle}}"></rich-text>
@@ -130,7 +130,7 @@
 
     </view>
     <view class="box-bottom">
-      <view class="trialReading" bind:tap="goRead">
+      <view class="trialReading" bind:tap="goRead" wx:if="{{!isBuy}}">
         <view>
           <t-image src="/static/images/bookService/detail/shidu.png"></t-image>
         </view>
@@ -139,8 +139,12 @@
       <view class="shopCarColor" bind:tap="addBookShopcCar" wx:if="{{!isBuy}}">鍔犲叆璐墿杞�</view>
       <view class="buyColor" bind:tap="buyBtn" wx:if="{{!isBuy}}">绔嬪嵆璐拱</view>
       <!-- <view class="buyColor" bind:tap="buyBtn" wx:if="{{digitalsData.price == 0}} ">鍏嶈垂棰嗗彇</view> -->
-      <view class="buyColor" bind:tap="goRead" wx:if="{{isBuy}}">绔嬪嵆闃呰</view>
+      <view class="buyColor" bind:tap="goRead" wx:if="{{isBuy}}">
+        绔嬪嵆闃呰
+      </view>
     </view>
   </view>
 </view>
+
+
 <t-toast id="t-toast" />
\ No newline at end of file
diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/index.wxss b/pages/digitalTextbooks/digitalTextbooksDetails/index.wxss
index dd8edb7..df3f1b0 100644
--- a/pages/digitalTextbooks/digitalTextbooksDetails/index.wxss
+++ b/pages/digitalTextbooks/digitalTextbooksDetails/index.wxss
@@ -112,7 +112,7 @@
 
 .t-tabs__item-inner {
   flex-direction: column;
-  color: #ff6c00;
+  /* color: #ff6c00; */
 }
 
 .t-tabs__item--active {
@@ -250,7 +250,7 @@
 }
 
 .buyColor {
-  width: 50%;
+  width: 100%;
   height: 110rpx;
   border-right: 1px solid #DDD;
   color: #fff;

--
Gitblit v1.9.1