123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- // components/My_SupplyAndDemandItemBox/index.js
- Component({
- options: {
- addGlobalClass: true,
- multipleSlots: true
- },
- /**
- * 组件的属性列表
- */
- properties: {
- title: {
- type: String,
- value: "标题"
- },
- time: {
- type: String
- },
- content: {
- type: String
- },
- imageList: {
- type: Array,
- value: []
- },
- stopOnShow: {
- type: Function
- },
- type: {
- type: String
- }
- },
- lifetimes: {
- attached: function () {
- // 在组件实例进入页面节点树时执行
- },
- detached: function () {
- // 在组件实例被从页面节点树移除时执行
- },
- },
- /**
- * 组件的初始数据
- */
- data: {
- urls: [],
- },
- /**
- * 组件的方法列表
- */
- methods: {
- /* 预览图片 */
- previewImage(e) {
- let imageList = this.data.imageList,
- urls = [];
- for (let i = 0; i < imageList.length; i++) {
- urls.push(imageList[i].fobsurl)
- }
- const {
- index
- } = e.currentTarget.dataset
- wx.previewImage({
- urls: urls,
- current: index
- })
- setTimeout(() => {
- this.triggerEvent('stopOnShow');
- }, 100)
- }
- }
- })
|