const $api = require('../../utils/api').API; Component({ options: { addGlobalClass: true }, properties: { info: { type: Object }, }, data: { }, attached: function () { }, methods: { setMark(e) { this.triggerEvent('setMark', e) }, previewImage(e) { var type = e.target.dataset.type; if (this.properties.info.transactionStatus == "toBeListed") { $api.AJAX('GET', 'applets/landToListAttachment', { fileType: type, proposedseriaId: this.properties.info.proposedseriaId, // proposedseriaId: 'CQ20210617152223' }, true).then(res => { if (res.data.length > 0) { wx.navigateTo({ url: '/pages/preview/preview?src=' + res.data[0].filePath, }) } else { wx.showToast({ title: '暂无资料可预览', icon: 'none', duration: 2000 }) } }) } else { $api.AJAX('GET', 'applets/landAttachment', { fileType: type, landListedId: this.properties.info.landListedId, // landListedId: 'CQ202106280037' }, true).then(res => { if (res.data.length > 0) { wx.navigateTo({ url: '/pages/preview/preview?src=' + res.data[0].filePath, }) } else { wx.showToast({ title: '暂无资料可预览', icon: 'none', duration: 2000 }) } }) } // for (let i = 0; i < this.data.wawa.length; i++) { // imgList.push(this.data.wawa[i].img_url); // } // wx.previewImage({ // urls: imgList//图片数组 // }) }, //导航 navigato() { // wx.getLocation({ // type: 'gcj02', //返回可以用于wx.openLocation的经纬度 // success(res) { // const latitude = res.latitude // const longitude = res.longitude // console.log(latitude); // console.log(longitude); // // wx.openLocation({ // // latitude, // // longitude, // // scale: 18 // // }) // } // }) var proposedseriaId = this.properties.info.proposedseriaId // var proposedseriaId = 'CQ20210617152223' var landListedId = this.properties.info.landListedId // var landListedId = 'CQ202106280037' if (this.properties.info.transactionStatus == 'toBeListed') { $api.AJAX('GET', 'applets/landtolistlonlat/list/' + proposedseriaId, true).then(res => { var latitude = res.data[0].landLonLat.split(';')[0].split(',')[0] var longitude = res.data[0].landLonLat.split(';')[0].split(',')[1] wx.openLocation({ latitude: Number(longitude), longitude: Number(latitude), name: res.data[0].name, scale: 28 }) }) } else { $api.AJAX('GET', 'applets/landlistedlonlat/list/' + landListedId, true).then(res => { var latitude = res.data[0].landLonLat.split(';')[0].split(',')[0] var longitude = res.data[0].landLonLat.split(';')[0].split(',')[1] wx.openLocation({ latitude: Number(longitude), longitude: Number(latitude), name: res.data[0].name, scale: 28 }) }) } } } })