闫增涛
2024-09-06 ac27db4ee1ca34aad25496c688a28689f5ea983e
自定义纸质书外部网站跳转页
2个文件已修改
4个文件已添加
122 ■■■■■ 已修改文件
app.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/linkPage/index.js 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/linkPage/index.json 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/linkPage/index.wxml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/linkPage/index.wxss 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.json
@@ -77,7 +77,11 @@
        "pages/bookServices/webpage/index",
        "pages/components/webView/index",
        "pages/bookServices/detail/buyResource/index",
<<<<<<< Updated upstream
        "pages/bookServices/detail/components/learnTask/index"
=======
        "pages/bookServices/linkPage/index"
>>>>>>> Stashed changes
      ]
    }
  ],
packageBookService/pages/bookServices/detail/index.js
@@ -719,7 +719,7 @@
      link
    } = e.currentTarget.dataset;
    wx.navigateTo({
      url: `/packageBookService/pages/bookServices/webpage/index?url=${link}`,
      url: `/packageBookService/pages/bookServices/linkPage/index?path=${link}`,
    });
  },
  // tag切换
packageBookService/pages/bookServices/linkPage/index.js
New file
@@ -0,0 +1,85 @@
// packageBookService/pages/bookServices/linkPage/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    path: ""
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.setData({
      path: options.path
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  },
  copyPath() {
    wx.setClipboardData({
      data: this.data.path,
      success: () => {
        wx.showToast({
          icon: 'success',
          title: '复制成功',
        })
      },
      fail: () => {
        wx.showToast({
          icon: 'error',
          title: '请重试',
        })
      }
    })
  }
})
packageBookService/pages/bookServices/linkPage/index.json
New file
@@ -0,0 +1,5 @@
{
  "usingComponents": {
    "t-button": "tdesign-miniprogram/button/button"
  }
}
packageBookService/pages/bookServices/linkPage/index.wxml
New file
@@ -0,0 +1,7 @@
<view class="page">
  <view class="title-text"> 如需浏览,请长按网址复制后使用浏览器访问 </view>
  <view class="link"> {{path}} </view>
  <view class="bottom-btn">
    <t-button style="width: 200rpx" bind:tap="copyPath">复制</t-button>
  </view>
</view>
packageBookService/pages/bookServices/linkPage/index.wxss
New file
@@ -0,0 +1,19 @@
.page {
  padding: 200rpx 40rpx;
}
.title-text {
  text-align: center;
  font-size: 42rpx;
  color: #000;
}
.link,
.bottom-btn {
  margin-top: 50px;
  text-align: center;
}
.bottom-btn {
  /* --td-button-width: 100rpx */
}