GET
api
//获取定金
getTbusinessCost(cemBuyId,talkId){
this.$api({
url: `/cms/tBusinessCost/getTBusinessPrice`,
params:{
cemBuyId,
talkId,
},
after: data =>{
this.$set(this.dataForm,'price',data.tBusinessCostEntity.price);
}
})
},
接收请求
public R getTBusinessPrice(@RequestParam("cemBuyId") Integer cemBuyId, @RequestParam("talkId") Integer talkId) {
var tBusinessCostEntity = tBusinessCostService.getPriceByBuyIdAndTalkId(cemBuyId, talkId);
return R.ok().put("tBusinessCostEntity", tBusinessCostEntity);
}
http
this.$http({
url: this.$http.adornUrl(`/cms/sysOss/info/${this.dataForm.id}`),
method: "get",
params: this.$http.adornParams(),
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm.url = data.sysOss.url;
this.dataForm.createDate = data.sysOss.createDate;
}
});
//补充 添加参数的方法
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key,
'id': this.dataForm.id,
}),
this.$http({
url: this.$http.adornUrl('/cms/cemBuy/reserveDelete'),
method: 'post',
data: ids
})
POST
this.$handle({
tip: `是否确认${isUse ? "禁用" : "启用"}该服务?`,
url: `/cms/cemStoneType/${isUse ? "disable" : "enable"}`,
params: { id },
after: () => {
this.$success();
this.getDataList();
},
});
接收
@PostMapping("/disable")
public R disable(Integer id){
cemStoneTypeService.disable(id);
return R.ok();
}
或者
this.$http.httpPost(`/mobile/onlineShop/updataGoodNum`, {
id: id,
name: name,
price: price,
count: count,
}).then(data => {
if (data && data.code === 0) {
this.$message.success({
type: 'success',
message: '修改成功!',
duration: 1500,
onClose: () => {
// this.$router.push({name: "reIndex"});
},
})
} else {
this.$message.error(data.msg);
}
});
http
this.$http({
url: this.$http.adornUrl('/cms/cemBuyerRetained/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDetailList(1)
}
})
} else {
this.$message.error(data.msg)
}
})
接收
@PostMapping("/delete")
@RequiresPermissions("cms:cemBuyerRetained:delete")
public R delete(@RequestBody Long[] ids){
cemBuyerRetainedService.removeRetainByIds(Arrays.asList(ids));
return R.ok();
}
或者
this.$http.httpGet(`mobile/cemBuy/list`,
{
buyerId:this.$store.state.buyerId
}).then(data =>{
if (data && data.code === 0) {
this.buyList = data.page.list;
}
});