54 lines
1.2 KiB
JavaScript
54 lines
1.2 KiB
JavaScript
|
// 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()
|
||
|
},
|
||
|
}
|
||
|
})
|