| | |
| | | |
| | | if (item.selectType == "document" || item.selectType == "pdf") { |
| | | // freeFile |
| | | console.log(item); |
| | | const fileLink = item.file ? |
| | | app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.file : app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.freeFile |
| | | console.log(fileLink, "fileLink"); |
| | |
| | | // 单次下载允许的最大文件为 200MB |
| | | wx.downloadFile({ |
| | | url: fileLink, |
| | | filePath: wx.env.USER_DATA_PATH + `/${item.name}.${item.selectType}`, |
| | | success: function (res) { |
| | | console.log(res, "wx.downloadFile success res"); |
| | | if (res.statusCode != 200) { |
| | |
| | | return false; |
| | | } |
| | | var Path = res.tempFilePath; //返回的文件临时地址,用于后面打开本地预览所用 |
| | | let data = res.filePath; |
| | | wx.openDocument({ |
| | | filePath: Path, |
| | | filePath: data, |
| | | showMenu: true, |
| | | success: function (res) { |
| | | console.log("打开成功"); |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | this.bookExhibitionGet() |
| | | |
| | | this.keyProjectsGet(this.data.newPrice) |
| | | // this.setData({ |
| | | // 'product.value': '*', |
| | | // }); |
| | |
| | | }) |
| | | |
| | | |
| | | // watch.setWatcher(this); |
| | | // let that = this; |
| | | // setTimeout(function () { |
| | | // that.data.name = "测试watch变化了" |
| | | // }, 5000) |
| | | // |
| | | watch.setWatcher(this); |
| | | let that = this; |
| | | setTimeout(function () { |
| | | that.data.name = "测试watch变化了" |
| | | }, 500) |
| | | |
| | | }, |
| | | watch: { |
| | | name: function (newVal, oldVal) { |
| | |
| | | |
| | | Page({ |
| | | data: { |
| | | price: '', |
| | | loading: true, |
| | | hidden: true, |
| | | swipeOpened: false, |
| | |
| | | totalSize: res.totalSize |
| | | }) |
| | | res.datas.forEach(item => { |
| | | |
| | | this.setData({ |
| | | bookId: res.id, |
| | | bookName: res.name |
| | | bookName: res.name, |
| | | price: item.saleMethod.price.toFixed(2), |
| | | }) |
| | | item.imgUrl = getPublicImage(item.productMonWithLinkDto.product.icon, '', '160'); |
| | | // this.setData({ |
| | |
| | | <view class="textBox" wx:if="{{item.type == 'item'}}">图书服务-云学习</view> |
| | | </view> |
| | | <view wx:if="{{item.saleMethod.price != 0}}"> |
| | | ¥{{item.saleMethod.price}} |
| | | ¥{{price}} |
| | | </view> |
| | | <view wx:else class="descriptionBox"> 立即领取</view> |
| | | </view> |
| | |
| | | <view class="settlementBox"> |
| | | <view class="totalPrice">总价:<text class="totalPriceText">¥{{totalPrice}}</text></view> |
| | | <view class="buttonBox"> |
| | | <t-button class="tButtonBox" size="small" shape="round" bind:tap="goPaymentPage"> <view >去结算({{selectedCount}})</view> </t-button> |
| | | <t-button class="tButtonBox" size="small" shape="round" bind:tap="goPaymentPage"> |
| | | <view>去结算({{selectedCount}})</view> |
| | | </t-button> |
| | | </view> |
| | | </view> |
| | | </view> |