card-mini/components/cuicustom/cu-custom.js

92 lines
1.6 KiB
JavaScript
Raw Normal View History

2021-06-22 16:14:04 +08:00
const app = getApp();
Component({
/**
* 组件的一些选项
*/
options: {
addGlobalClass: true,
multipleSlots: true
},
/**
* 组件的对外属性
*/
properties: {
bgColor: {
type: String,
2021-09-01 16:55:20 +08:00
default: '1'
},
isWhite: {
type: [Boolean, String],
default: false
2021-06-22 16:14:04 +08:00
},
isCustom: {
type: [Boolean, String],
default: false
},
isIndex: {
type: [Boolean, String],
default: false
},
isBack: {
type: [Boolean, String],
default: false
},
isRelaunch: {
type: [Boolean, String],
default: false
},
isClickTitle: {
type: [Boolean, String],
default: false
},
2021-06-22 16:14:04 +08:00
bgImage: {
type: String,
default: ''
},
},
/**
* 组件的初始数据
*/
data: {
StatusBar: app.globalData.StatusBar,
CustomBar: app.globalData.CustomBar,
Custom: app.globalData.Custom,
2021-09-01 16:55:20 +08:00
userIcon: wx.getStorageSync('userIcon') || '/images/ic_user_default.png'
2021-06-22 16:14:04 +08:00
},
/**
* 组件的方法列表
*/
methods: {
BackPage() {
wx.navigateBack({
delta: 1
});
},
GoHome() {
wx.navigateBack({
delta: 1,
})
},
toHome() {
wx.reLaunch({
url: '/pages/index/index',
})
},
goCenter() {
wx.switchTab({
url: '/pages/mine/index/index',
2021-06-22 16:14:04 +08:00
})
},
//刷新
refreshCart() {
let icon = app.globalData.userIcon
this.setData({
userIcon: icon
})
},
// 点击标题
showIcre() {
this.triggerEvent('show', {}, {})
2021-06-22 16:14:04 +08:00
}
}
})