| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 | // components/My_SupplyAndDemandItemBox/index.jsComponent({    options: {        addGlobalClass: true,        multipleSlots: true    },    /**     * 组件的属性列表     */    properties: {        title: {            type: String,            value: "标题"        },        time: {            type: String        },        imageList: {            type: Array,            value: []        },        stopOnShow: {            type: Function        }    },    lifetimes: {        ready: 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)        }    }})
 |