This commit is contained in:
2024-08-26 22:56:29 +08:00
parent 3a160fabfe
commit 2cdbd5c22d
18 changed files with 4968 additions and 484 deletions

View File

@@ -1,4 +1,10 @@
// pages/details/details.js
const request = require('../../utils/request')
const ui = require('../../utils/ui')
const wxParse = require("../../wxParse/wxParse.js");
Page({
/**
@@ -6,15 +12,127 @@ Page({
*/
data: {
navTitle: "详情",
date: "",
title: "",
content: "",
aid: 0,
isDow: false,
ext_download_link: ""
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let that = this;
if (!options.aid) {
wx.navigateBack()
this.triggerEvent('onBack')
}
that.setData({
aid: options.aid
})
that.GetDetailsInfo()
console.log(options);
//
},
initContent() {
let that = this;
console.log(that.data.content);
if (that.data.content.length > 0) {
wxParse.wxParse('content', 'html', that.data.content, that, 0);
}
},
GetDetailsInfo() {
let that = this;
request.request({
method: "GET",
// https://app.19year.cn/api.php/doc/details?id=51
url: "/api.php/doc/details?id=" + that.data.aid
}).then(res => {
if (res.data.code === 1) {
that.setData({
title: res.data.data.title,
date: res.data.data.date,
content: res.data.data.content,
ext_download_link: res.data.data.ext_download_link,
})
if (res.data.data.ext_download_link.length > 0) {
that.setData({
isDow: true
})
}
that.initContent()
}
}).catch(err => {
console.log('ERROR')
});
},
downloadFileOpen() {
let that = this;
let link = that.data.ext_download_link
wx.setClipboardData({
data: link,
success: function (res) {
wx.getClipboardData({
success: function (res) {
wx.showToast({
title: '复制成功'
})
}
})
}
})
//复制到剪切板
// wx.setClipboardData({
// data: link,
// success(res) {
// console.log('copy success');
// //获取剪切板的纸
// // wx.getClipboardData({
// // success(res) {
// // console.log(res) // data
// // that.copyContent = res.data
// // }
// // })
// }
// })
// wx.showLoading({
// title: '下载中',
// })
//下载文件
// wx.downloadFile({
// url: link,
// success (res) {
// if (res.statusCode === 200) {
// const filePath = res.tempFilePath
// wx.openDocument({
// filePath: filePath,
// showMenu:true, //关键点
// success: function (res) {
// console.log('打开文档成功')
// }
// })
// }
// }
// })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

@@ -1,19 +1,24 @@
<list-nav-bar title="WeixinWeixinWeixin" background="#3c8bf6" showNavBtn="{{true}}"></list-nav-bar>
<import src="../../wxParse/wxParse.wxml"></import>
<list-nav-bar title="{{navTitle}}" background="#3c8bf6" showNavBtn="{{true}}"></list-nav-bar>
<scroll-view style="height: 100%;overflow:hidden;" scroll-y type="list">
<view class="container">
<view class="title">
<text>快速操作手册试用版</text>
<text class="date">2024.08.14 15:26</text>
<text>{{title}}</text>
<text class="date">{{date}}</text>
</view>
<view class="content">
<view class="text">
北京欧华莱菌科技有限公司自1993年创建以来在中国市场推广超声波封口焊接设备致力于传播先进技术为众多的国内大型知名企业提供高品质焊接技术成为中国企业走向世界舞台不可或缺的坚实后盾。先后为中国的制冷业汽车制造业电子元器件塑料件手机电池及汽车气囊业提供各类先进的焊接设备提供及时优质的条件保障和售后服务为客户在生产效率及成本控制上作出巨大贡献得到广大用户的认可取得客户的信任并得到广泛的应用伴随中国驰名品牌的发展而发展成长而成长。经过我们不懈的努力30多年来国内使用我公司提供的设备和技术的公司达到80多家目前有超过500台各类设备在国内的制冷及其他领域广泛使用。北京欧华莱菌科技有限公司自1993年创建以来在中国市场推广超声波封口焊接设备致力于传播先进技术为众多的国内大型知名企业提供高品质焊接技术成为中国企业走向世界舞台不可或缺的坚实后盾。先后为中国的制冷业汽车制造业电子元器件塑料件手机电池及汽车气囊业提供各类先进的焊接设备提供及时优质的条件保障和售后服务为客户在生产效率及成本控制上作出巨大贡献得到广大用户的认可取得客户的信任并得到广泛的应用伴随中国驰名品牌的发展而发展成长而成长。经过我们不懈的努力30多年来国内使用我公司提供的设备和技术的公司达到80多家目前有超过500台各类设备在国内的制冷及其他领域广泛使用。北京欧华莱菌科技有限公司自1993年创建以来在中国市场推广超声波封口焊接设备致力于传播先进技术为众多的国内大型知名企业提供高品质焊接技术成为中国企业走向世界舞台不可或缺的坚实后盾。先后为中国的制冷业汽车制造业电子元器件塑料件手机电池及汽车气囊业提供各类先进的焊接设备提供及时优质的条件保障和售后服务为客户在生产效率及成本控制上作出巨大贡献得到广大用户的认可取得客户的信任并得到广泛的应用伴随中国驰名品牌的发展而发展成长而成长。经过我们不懈的努力30多年来国内使用我公司提供的设备和技术的公司达到80多家目前有超过500台各类设备在国内的制冷及其他领域广泛使用。
<!-- {{content}} -->
<!-- <template is="wxParse" data="{{wxParseData:content}}"></template> -->
<template is="wxParse" data="{{wxParseData:content.nodes}}"/>
</view>
</view>
</view>
</scroll-view>
<view class='btn-view'>
<button style="background: #3c8bf6;;border-radius: 60rpx;width: 85%;color: #fff;font-size: 30rpx;font-weight: normal;">附件下载</button>
<view class='btn-view' wx:if="{{isDow}}">
<button bind:tap="downloadFileOpen" style="background: #3c8bf6;;border-radius: 60rpx;width: 85%;color: #fff;font-size: 30rpx;font-weight: normal;">附件下载</button>
</view>

View File

@@ -1,3 +1,4 @@
@import "../../wxParse/wxParse.wxss";
page {
height: 100vh;