// pages/patentDetails/patentDetails.js const api = require('../../api/index') const app = getApp() const showImage = require('../../utils/showImage') Page({ /** * 页面的初始数据 */ data: { imgHttp:app.globalData.imghttp, labelPosition:'left', labelWidth:250, customStyle:" --padding:5rpx;font-weight:bold", patentNo:'', patent:{}, isSame:false }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.setData( { patentNo:options.patentNo } ) this.selectPatentInfoByPatentNo() }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 页面功能 */ //查看图片 previewImage(e) { console.log(e) var { current,imglist } = e.currentTarget.dataset var imgs = [] for(var i =0;i ({ image: n, remark: n })), indicatorDots: true, indicatorColor: '#fff', indicatorActiveColor: '#04BE02', showDelete:false } ) }, //获取专利详情 selectPatentInfoByPatentNo(){ if(!this.data.patentNo){ return false } var params = { patentNo:this.data.patentNo } api.selectPatentInfoByPatentNo(params).then(res=>{ if(res.code == 200){ var isSame = false if(JSON.stringify(res.data.applicant) == JSON.stringify(res.data.rightHolder)){ isSame = true } var classification = [] if(res.data.ipc){ for(var i = 0;i0){ var abstractStr = res.data.abstractStr[0].text_content if(abstractStr){ var arr = [ "a", "abbr", "address", "article", "aside", "b", "bdi", "bdodir", "big", "blockquote", "br", "caption", "center", "cite", "code", "col", "colgroup", "dd", "del", "div", "dl", "dt", "em", "fieldset", "font", "footer", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hr", "i", "img", "ins", "label", "legend", "li", "mark", "nav", "ol", "p", "pre", "q", "rt", "ruby", "s", "section", "small", "span", "strong", "sub", "sup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "tt", "u", "ul" ] var str = '' for(var i = 0;i`,'g') abstractStr = abstractStr.replace(regx,'') res.data.abstractStr[0].text_content = abstractStr } } this.setData( { patent:res.data, isSame:isSame } ) var appNo = res.data.appNo if(appNo){ this.getPictureByNo(appNo) } } }) }, //根据专利号获取相关图片 getPictureByNo(appNo){ var params = { appNo:appNo } api.getPictureByNo(params).then(res=>{ if(res.code == 200){ this.setData( { ["patent.imageList"]:res.data } ) } }) }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })