bug
This commit is contained in:
@@ -19,7 +19,8 @@
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
content: ''
|
content: '',
|
||||||
|
id: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -27,6 +28,18 @@
|
|||||||
...mapState(['user'])
|
...mapState(['user'])
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onLoad (query) {
|
||||||
|
if (query.id) {
|
||||||
|
this.id = query.id
|
||||||
|
this.$instance.post(`/api/appmerchantinfo/queryDiscountDetailById?id=${query.id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.title = res.data.title
|
||||||
|
this.content = res.data.content
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
save () {
|
save () {
|
||||||
if (!this.title) {
|
if (!this.title) {
|
||||||
@@ -42,10 +55,11 @@
|
|||||||
title: this.title,
|
title: this.title,
|
||||||
content: this.content,
|
content: this.content,
|
||||||
openId: this.user.openId,
|
openId: this.user.openId,
|
||||||
mid: this.user.merchantInfo.id
|
mid: this.user.merchantInfo.id,
|
||||||
|
id: this.id || ''
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$toast('保存成功')
|
this.$toast(this.id ? '修改成功' : '发布成功')
|
||||||
uni.$emit('updateList')
|
uni.$emit('updateList')
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -22,10 +22,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="item-bottom">
|
<div class="item-bottom">
|
||||||
<div hover-class="bg-hover" @click="$linkTo('./AddDiscounts?id=' + item.id)" v-if="item.status === '0'">修改</div>
|
<div hover-class="bg-hover" @click="$linkTo('./AddDiscounts?id=' + item.id)" v-if="item.status === '0'">修改</div>
|
||||||
<div hover-class="bg-hover">删除</div>
|
<div hover-class="bg-hover" @click="remove(item.id)">删除</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<AiEmpty v-if="!list.length"></AiEmpty>
|
<AiEmpty v-if="!list.length && isMore"></AiEmpty>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-wrapper">
|
<div class="btn-wrapper">
|
||||||
@@ -97,6 +97,26 @@
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$hideLoading()
|
this.$hideLoading()
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
remove (id) {
|
||||||
|
this.$dialog.confirm({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '确定删除该优惠信息吗?'
|
||||||
|
}).then(() => {
|
||||||
|
this.$loading()
|
||||||
|
this.$instance.post(`/api/appmerchantinfo/deleteDiscount?id=${id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.current = 1
|
||||||
|
this.isMore = false
|
||||||
|
|
||||||
|
this.getList()
|
||||||
|
this.$toast('删除成功')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user