完善页面8
This commit is contained in:
@@ -66,46 +66,46 @@
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script uts>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
integralLotteryId: 87,
|
||||
payLotteryId: 82,
|
||||
replyLotteryId: 86
|
||||
},
|
||||
lotteryOptions: [
|
||||
{ id: 0, name: '请选择' },
|
||||
{ id: 87, name: '积分抽奖' },
|
||||
{ id: 86, name: '评价抽奖' },
|
||||
{ id: 82, name: '订单抽奖' },
|
||||
{ id: 75, name: '积分' }
|
||||
] as any[]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getLotteryName(id: number): string {
|
||||
const found = this.lotteryOptions.find((item: any): boolean => item.id == id)
|
||||
return found != null ? (found['name'] as string) : '请选择'
|
||||
},
|
||||
onIntegralLotteryChange(e: any) {
|
||||
this.form.integralLotteryId = this.lotteryOptions[e.detail.value].id
|
||||
},
|
||||
onPayLotteryChange(e: any) {
|
||||
this.form.payLotteryId = this.lotteryOptions[e.detail.value].id
|
||||
},
|
||||
onReplyLotteryChange(e: any) {
|
||||
this.form.replyLotteryId = this.lotteryOptions[e.detail.value].id
|
||||
},
|
||||
handleSave() {
|
||||
uni.showLoading({ title: '正在保存...' })
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: '保存成功', icon: 'success' })
|
||||
}, 800)
|
||||
}
|
||||
}
|
||||
<script setup lang="uts">
|
||||
import { reactive } from 'vue'
|
||||
|
||||
const form = reactive({
|
||||
integralLotteryId: 87,
|
||||
payLotteryId: 82,
|
||||
replyLotteryId: 86
|
||||
})
|
||||
|
||||
const lotteryOptions = reactive([
|
||||
{ id: 0, name: '请选择' },
|
||||
{ id: 87, name: '积分抽奖' },
|
||||
{ id: 86, name: '评价抽奖' },
|
||||
{ id: 82, name: '订单抽奖' },
|
||||
{ id: 75, name: '积分' }
|
||||
] as any[])
|
||||
|
||||
const getLotteryName = (id: number): string => {
|
||||
const found = lotteryOptions.find((item: any): boolean => item.id == id)
|
||||
return found != null ? (found['name'] as string) : '请选择'
|
||||
}
|
||||
|
||||
const onIntegralLotteryChange = (e: any) => {
|
||||
form.integralLotteryId = lotteryOptions[e.detail.value].id
|
||||
}
|
||||
|
||||
const onPayLotteryChange = (e: any) => {
|
||||
form.payLotteryId = lotteryOptions[e.detail.value].id
|
||||
}
|
||||
|
||||
const onReplyLotteryChange = (e: any) => {
|
||||
form.replyLotteryId = lotteryOptions[e.detail.value].id
|
||||
}
|
||||
|
||||
const handleSave = () => {
|
||||
uni.showLoading({ title: '正在保存...' })
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: '保存成功', icon: 'success' })
|
||||
}, 800)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user