update:模板市场新增删除模板
This commit is contained in:
parent
0352fb14c7
commit
2e368d932d
@ -81,6 +81,13 @@ export function createBlankPageApp(params){
|
||||
params:params
|
||||
})
|
||||
}
|
||||
export function deleteTemplatePage(params){
|
||||
return request({
|
||||
url: URL.shop.page.app.deletePageApp,
|
||||
method: 'delete',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function pageAppPublish(params){
|
||||
return request({
|
||||
|
||||
@ -1248,6 +1248,7 @@ let url = {
|
||||
editPageApp:api_url + '/admin/shop/shop-page-app/editPageApp',
|
||||
copyDiyByAppId:api_url + '/admin/shop/shop-page-app/copyDiyByAppId',
|
||||
createBlankPageApp:api_url + '/admin/shop/shop-page-app/createBlankPageApp',
|
||||
deletePageApp:api_url+'/admin/shop/shop-page-app/deletePageApp',
|
||||
pageAppPublish:api_url + '/admin/shop/shop-page-app/pageAppPubish',
|
||||
},
|
||||
base: {
|
||||
|
||||
@ -85,6 +85,9 @@
|
||||
<el-dropdown-item command="preview">
|
||||
{{ __('预览') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete">
|
||||
{{ __('删除') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
@ -212,7 +215,8 @@
|
||||
setThemes,
|
||||
listMarketPage,
|
||||
getBlankTpl,
|
||||
pageAppPublish
|
||||
pageAppPublish,
|
||||
deleteTemplatePage
|
||||
} from '@/api/page/app'
|
||||
import { translateTitle as __ } from '@/utils/i18n'
|
||||
import templateMenu from '@/views/page/sellerApp/TemplateMenu.vue'
|
||||
@ -416,6 +420,9 @@
|
||||
case 'preview':
|
||||
this.openPreview(page)
|
||||
break
|
||||
case 'delete':
|
||||
this.deleteTemplate(page)
|
||||
break
|
||||
}
|
||||
},
|
||||
// 上传,下架处理方法
|
||||
@ -430,6 +437,38 @@
|
||||
this.refreshAllData()
|
||||
}
|
||||
},
|
||||
async deleteTemplate(page) {
|
||||
// 弹出确认框
|
||||
this.$confirm(
|
||||
this.__('确定要删除该模板吗?删除后将无法恢复!'),
|
||||
this.__('删除确认'),
|
||||
{
|
||||
confirmButtonText: this.__('确认'),
|
||||
cancelButtonText: this.__('取消'),
|
||||
type: 'warning'
|
||||
}
|
||||
).then(async () => {
|
||||
// 用户确认删除
|
||||
const params = {
|
||||
appId: page.app_id,
|
||||
}
|
||||
try {
|
||||
let res = await deleteTemplatePage(params);
|
||||
if(res.status === 200) {
|
||||
this.$message.success(this.__('删除成功!'))
|
||||
this.refreshAllData()
|
||||
} else {
|
||||
this.$message.error(this.__('删除失败:') + (res.msg || this.__('未知错误')))
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('删除模板失败:', error)
|
||||
this.$message.error(this.__('删除失败:网络异常'))
|
||||
}
|
||||
}).catch(() => {
|
||||
// 用户取消删除
|
||||
this.$message.info(this.__('已取消删除'))
|
||||
})
|
||||
},
|
||||
//操作后的刷新数据
|
||||
async refreshAllData() {
|
||||
await this.getAppPages()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user