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

立即申请跳转登录

parent bb096006
Pipeline #75985 passed with stage
......@@ -254,47 +254,55 @@ export default {
},
addToCart() {
// console.log("addToCart");
this.$http
.post("/apaas/serviceapp/v3/shopcart/add", {
service_id: parseFloat(this.data.service_id),
app_id: 0, // 0表示不是应用
spec_id: this.specification.id, // 规格id
duration: this.duration, // 申请时长
duration_method: this.type, // 计时方式 按年 按月
is_subscribe: 0, // 是否订阅
})
.then(({ data }) => {
if (data.success == 1) {
if(this.$store.state.userInfo){
this.$http
.post("/apaas/serviceapp/v3/shopcart/add", {
service_id: parseFloat(this.data.service_id),
app_id: 0, // 0表示不是应用
spec_id: this.specification.id, // 规格id
duration: this.duration, // 申请时长
duration_method: this.type, // 计时方式 按年 按月
is_subscribe: 0, // 是否订阅
})
.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({
message: data.errMsg,
type: "success",
});
this.$store.commit("setMenuCartState");
} else {
this.$message({
message: data.errMsg,
message: `添加申请单失败`,
type: "warning",
});
}
})
.catch((error) => {
this.$message({
message: `添加申请单失败`,
type: "warning",
});
});
}else{
window.location.href = "/iam/login/#/login?ReturnUrl=" + encodeURIComponent(window.location.href);
}
},
applyImmediately() {
this.$router.push({
path: "/shop/shop_car_apply",
query: {
service_id: parseFloat(this.data.service_id),
spec_id: this.specification.id,
spcs_type: this.specification.spcs_type,
duration: this.duration,
duration_unit: this.type,
},
});
if(this.$store.state.userInfo){
this.$router.push({
path: "/shop/shop_car_apply",
query: {
service_id: parseFloat(this.data.service_id),
spec_id: this.specification.id,
spcs_type: this.specification.spcs_type,
duration: this.duration,
duration_unit: this.type,
},
});
}else{
window.location.href = "/iam/login/#/login?ReturnUrl=" + encodeURIComponent(window.location.href);
}
},
},
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