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