From 51ed3b1bd3a47fe70b20bf63bcbaff461b8dba2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?TOP=E7=B3=AF=E7=B1=B3?= <1130395124@qq.com>
Date: Fri, 10 Mar 2023 01:36:35 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BC=81=E4=B8=9A=E5=90=88?=
=?UTF-8?q?=E4=BD=9C=E3=80=81=E5=B7=A5=E7=A8=8B=E5=AE=89=E8=A3=85=E3=80=81?=
=?UTF-8?q?=E8=81=94=E4=BF=9D=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/core/apis.js | 69 ++++++++++++------------
src/core/models/service.js | 57 +++++++++++++++++++-
src/pages/service/other/after-market.vue | 28 ++++++----
src/pages/service/other/business.vue | 20 +++++--
src/pages/service/other/project.vue | 28 ++++++++--
5 files changed, 151 insertions(+), 51 deletions(-)
diff --git a/src/core/apis.js b/src/core/apis.js
index 5c95676..20e2ecb 100644
--- a/src/core/apis.js
+++ b/src/core/apis.js
@@ -41,40 +41,6 @@ export default {
}
}
},
- project: {
- project: {
- url: "/project/applyinfo",
- },
- projectList: {
- url: "/project/alllist",
- },
- business: {
- url: "/project/applyinfob",
- },
- businessList: {
- url: "/project/alllistb",
- },
- afterMarket: {
- url: "/project/applyguarantee"
- },
- afterMarketList: {
- url: "/project/allguaranteelist"
- },
- distribution: {
- config: {
- url: "/index/getdistributionmoney"
- },
- carType: {
- url: "/index/getallcar"
- },
- submit: {
- url: "/project/distribution"
- },
- pay: {
- url: "/wxpay/payorderd"
- }
- }
- },
service: {
insurance: {
url: "/index/getyiwai",
@@ -94,6 +60,41 @@ export default {
goodsDetail: {
url: "/index/goodsinfobyid",
showLoading: true,
+ },
+ project: {
+ url: "/project/applyinfo",
+ showLoading: true,
+ },
+ business: {
+ url: "/project/applyinfob",
+ showLoading: true,
+ },
+ afterMarket: {
+ url: "/project/applyguarantee",
+ showLoading: true,
+ },
+ distribution: {
+ config: {
+ url: "/index/getdistributionmoney"
+ },
+ carType: {
+ url: "/index/getallcar"
+ },
+ submit: {
+ url: "/project/distribution"
+ },
+ pay: {
+ url: "/wxpay/payorderd"
+ }
+ },
+ projectList: {
+ url: "/project/alllist",
+ },
+ businessList: {
+ url: "/project/alllistb",
+ },
+ afterMarketList: {
+ url: "/project/allguaranteelist"
}
},
order: {
diff --git a/src/core/models/service.js b/src/core/models/service.js
index eb518ad..cde7ae8 100644
--- a/src/core/models/service.js
+++ b/src/core/models/service.js
@@ -2,6 +2,9 @@ import Vue from "vue"
let prototype = Vue.prototype;
export default {
+ /**
+ * 保险价格
+ */
getInsurancePrice() {
return new Promise((resolve, reject) => {
prototype.$request({
@@ -14,6 +17,9 @@ export default {
}).catch(e => { });
});
},
+ /**
+ * 服务详情
+ */
getServiceDetail(id) {
return new Promise((resolve, reject) => {
prototype.$request({
@@ -25,9 +31,56 @@ export default {
if (response.code == 1) {
return resolve(response.data);
}
-
return reject(response.msg);
}).catch(e => { });
})
- }
+ },
+ /**
+ * 工程提交
+ */
+ projectApply(data) {
+ return new Promise((resolve, reject) => {
+ prototype.$request({
+ api: "service.project",
+ data: data
+ }).then(response => {
+ if (response.code == 1) {
+ return resolve(response.msg)
+ }
+ return reject(response.msg);
+ }).catch(e => { });
+ });
+ },
+ /**
+ * 企业提交
+ */
+ businessApply(data) {
+ return new Promise((resolve, reject) => {
+ prototype.$request({
+ api: "service.business",
+ data: data
+ }).then(response => {
+ if (response.code == 1) {
+ return resolve(response.msg)
+ }
+ return reject(response.msg);
+ }).catch(e => { });
+ });
+ },
+ /**
+ * 联保提交
+ */
+ afterMarketApply(data) {
+ return new Promise((resolve, reject) => {
+ prototype.$request({
+ api: "service.afterMarket",
+ data: data
+ }).then(response => {
+ if (response.code == 1) {
+ return resolve(response.msg)
+ }
+ return reject(response.msg);
+ }).catch(e => { });
+ });
+ },
}
diff --git a/src/pages/service/other/after-market.vue b/src/pages/service/other/after-market.vue
index 9882c2f..70869ce 100644
--- a/src/pages/service/other/after-market.vue
+++ b/src/pages/service/other/after-market.vue
@@ -9,12 +9,7 @@
品牌
-
+
@@ -66,7 +61,7 @@
- 保存
+ 提交
@@ -94,8 +89,23 @@ export default {
onReachBottom() {},
onPullDownRefresh() {},
methods: {
- save() {
- console.log("保存");
+ submit() {
+ this.$models.service
+ .afterMarketApply({
+ brand: this.brand,
+ goods: this.projectType,
+ name: this.name,
+ mobile: this.mobile,
+ desc: this.content,
+ })
+ .then((msg) => {
+ this.$utils.toast(msg, { icon: "success" }).then(() => {
+ this.$utils.toPage("/pages/order/order", {}, "switch");
+ });
+ })
+ .catch((e) => {
+ this.$utils.toast(e);
+ });
},
},
};
diff --git a/src/pages/service/other/business.vue b/src/pages/service/other/business.vue
index b795c01..b97629c 100644
--- a/src/pages/service/other/business.vue
+++ b/src/pages/service/other/business.vue
@@ -53,7 +53,7 @@
- 保存
+ 提交
@@ -80,8 +80,22 @@ export default {
onReachBottom() {},
onPullDownRefresh() {},
methods: {
- save() {
- console.log("保存");
+ submit() {
+ this.$models.service
+ .businessApply({
+ brand: this.brand,
+ name: this.name,
+ mobile: this.mobile,
+ desc: this.content,
+ })
+ .then((msg) => {
+ this.$utils.toast(msg, { icon: "success" }).then(() => {
+ this.$utils.toPage("/pages/order/order", {}, "switch");
+ });
+ })
+ .catch((e) => {
+ this.$utils.toast(e);
+ });
},
},
};
diff --git a/src/pages/service/other/project.vue b/src/pages/service/other/project.vue
index d99d1cb..f7526e1 100644
--- a/src/pages/service/other/project.vue
+++ b/src/pages/service/other/project.vue
@@ -89,7 +89,7 @@
- 保存
+ 提交
@@ -124,8 +124,25 @@ export default {
changeNumber(e) {
this.number = e.value;
},
- save() {
- console.log("保存");
+ submit() {
+ this.$models.service
+ .projectApply({
+ types: this.projectType,
+ goods: this.productType,
+ name: this.name,
+ mobile: this.mobile,
+ count: this.number,
+ carry: this.needCarry,
+ desc: this.content,
+ })
+ .then((msg) => {
+ this.$utils.toast(msg, { icon: "success" }).then(() => {
+ this.$utils.toPage("/pages/order/order", {}, "switch");
+ });
+ })
+ .catch((e) => {
+ this.$utils.toast(e);
+ });
},
},
};
@@ -165,4 +182,9 @@ export default {
.count-style {
justify-content: space-between;
}
+.common-save-form-btn {
+ .btn {
+ background-color: #ff7551;
+ }
+}
\ No newline at end of file