39 lines
908 B
JavaScript
39 lines
908 B
JavaScript
import { getCouponReceive } from '@/api/user'
|
|
export const themeTemplateMixins = {
|
|
props: {
|
|
topImage: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
templateProperties: {
|
|
type: Object,
|
|
default: () => {
|
|
return {}
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
topImageClick() {
|
|
if (this.templateProperties.page1CouponEnable === 1 && this.templateProperties.page1CouponId) {
|
|
getCouponReceive(this.templateProperties.page1CouponId).then(res => {
|
|
if (res.status === 200) {
|
|
uni.showToast({
|
|
title: '领取成功',
|
|
icon: 'none'
|
|
})
|
|
}
|
|
}).catch((err) => {
|
|
uni.showToast({
|
|
title: err.msg + '',
|
|
icon: 'none',
|
|
duration: 3000
|
|
})
|
|
})
|
|
}
|
|
},
|
|
itemClick(item) {
|
|
if (!item.available) return
|
|
this.$emit('view', item)
|
|
}
|
|
}
|
|
} |