Commit 8f1d8994 authored by 张俊's avatar 张俊

立即申请跳转登录

parent bb096006
Pipeline #75985 passed with stage
...@@ -254,47 +254,55 @@ export default { ...@@ -254,47 +254,55 @@ export default {
}, },
addToCart() { addToCart() {
// console.log("addToCart"); // console.log("addToCart");
this.$http if(this.$store.state.userInfo){
.post("/apaas/serviceapp/v3/shopcart/add", { this.$http
service_id: parseFloat(this.data.service_id), .post("/apaas/serviceapp/v3/shopcart/add", {
app_id: 0, // 0表示不是应用 service_id: parseFloat(this.data.service_id),
spec_id: this.specification.id, // 规格id app_id: 0, // 0表示不是应用
duration: this.duration, // 申请时长 spec_id: this.specification.id, // 规格id
duration_method: this.type, // 计时方式 按年 按月 duration: this.duration, // 申请时长
is_subscribe: 0, // 是否订阅 duration_method: this.type, // 计时方式 按年 按月
}) is_subscribe: 0, // 是否订阅
.then(({ data }) => { })
if (data.success == 1) { .then(({ data }) => {
if (data.success == 1) {
this.$message({
message: data.errMsg,
type: "success",
});
this.$store.commit("setMenuCartState");
} else {
this.$message({
message: data.errMsg,
type: "warning",
});
}
})
.catch((error) => {
this.$message({ this.$message({
message: data.errMsg, message: `添加申请单失败`,
type: "success",
});
this.$store.commit("setMenuCartState");
} else {
this.$message({
message: data.errMsg,
type: "warning", type: "warning",
}); });
}
})
.catch((error) => {
this.$message({
message: `添加申请单失败`,
type: "warning",
}); });
}); }else{
window.location.href = "/iam/login/#/login?ReturnUrl=" + encodeURIComponent(window.location.href);
}
}, },
applyImmediately() { applyImmediately() {
this.$router.push({ if(this.$store.state.userInfo){
path: "/shop/shop_car_apply", this.$router.push({
query: { path: "/shop/shop_car_apply",
service_id: parseFloat(this.data.service_id), query: {
spec_id: this.specification.id, service_id: parseFloat(this.data.service_id),
spcs_type: this.specification.spcs_type, spec_id: this.specification.id,
duration: this.duration, spcs_type: this.specification.spcs_type,
duration_unit: this.type, duration: this.duration,
}, duration_unit: this.type,
}); },
});
}else{
window.location.href = "/iam/login/#/login?ReturnUrl=" + encodeURIComponent(window.location.href);
}
}, },
}, },
created() { created() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment