yiming
2024-06-06 e72f509ca0728f571fcf652e1e60d7af970518cf
数字教材跳转阅读器
5个文件已修改
4个文件已添加
132 ■■■■ 已修改文件
app.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
assets/js/config.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.js 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.json 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalTextbooks/digitalTextbooksDetails/index.js 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalTextbooks/digitalTextbooksDetails/index.wxml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalTextbooks/digitalTextbooksDetails/index.wxss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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": [
    {
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;
pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.js
New file
@@ -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() {
  }
})
pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxml-->
<web-view src="{{URL}}"></web-view>
pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxss
New file
@@ -0,0 +1 @@
/* pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index.wxss */
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
    });
  }
})
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" />
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;