min-project/component/rent-pop/rent-pop.js

54 lines
1.2 KiB
JavaScript
Raw Normal View History

2024-12-12 04:14:09 +00:00
// template/rent-pop/rent-pop.js
const util = require('../../utils/util')
const common = require('../../utils/commonMethod')
Component({
/**
* 组件的属性列表
*/
properties: {
popup: {
type: Object,
observer(res) {
if (!res) return
this.setData({
state: true,
})
}
}
},
/**
* 组件的初始数据
*/
data: {
state: false,
},
/**
* 组件的方法列表
*/
methods: {
close() {
this.setData({
state: false
})
},
skip() {
util.statistics({
name: this.data.popup.statEvent
})
if (this.data.popup.applet?.appid) {
wx.navigateToMiniProgram({
appId: this.data.popup.applet.appid,
path: this.data.popup.applet.path,
})
} else {
common.goPage("/pages/webview/webview?url=" + encodeURIComponent(this.data.popup.url || ''))
}
this.close()
},
}
})