From ca314defadc02f49f6343fcdb10e4ba5c7f7628b Mon Sep 17 00:00:00 2001 From: guoxing <1369478551@qq.com> Date: Sun, 21 Jan 2024 20:02:46 +0800 Subject: [PATCH] 11111111 --- common/request.api.js | 3 + pages/bind/bind_pickUpCard.vue | 8 +- pages/bind/bind_pickUpCard2.vue | 8 +- pages/good/shoppCart.vue | 156 +++++++++++++++++++++----------- pages/home/cloudCard2.vue | 74 ++++++++++++--- pages/home/myHome.vue | 2 +- 6 files changed, 175 insertions(+), 76 deletions(-) diff --git a/common/request.api.js b/common/request.api.js index f86d02e..b3c5a64 100644 --- a/common/request.api.js +++ b/common/request.api.js @@ -114,6 +114,9 @@ export default { shoppingCartList: (params = {}) => request.post("/shoppingcart/shoppingCartList", params, {}, {}, true), // 结算 跳过支付 saveGoods: (params = {}) => request.post("/vegetablecellar/saveGoods", params), + // 正式结算 支付 + createVegeOrder: (params = {}) => request.post("/empsreservoorder/createVegeOrder", params), + // 我的菜窖 新人礼包列表 newUserQuota: (params = {}) => request.post("/appletgiftbag/newUserQuota", params), diff --git a/pages/bind/bind_pickUpCard.vue b/pages/bind/bind_pickUpCard.vue index 1def8d9..c12a6ab 100644 --- a/pages/bind/bind_pickUpCard.vue +++ b/pages/bind/bind_pickUpCard.vue @@ -52,17 +52,17 @@ - + - 提货密码 + - + - 提货密码 + - - 温馨提示:已定制了 - {{page.weight}}斤 - ,满200斤可定制云菜窖 + + + 温馨提示:已订 + + {{page.weight}}斤 + + + + ,{{page.qssl}}起订。 + + + 起订协议 + + >> + + style="border: 1px #FF5006 solid;margin-left: 5px;margin-right: 5px;padding: 5px 40px 5px 15px; flex: 1; + display: flex;flex-direction: row;align-items: center;border-top-left-radius: 25px; border-bottom-left-radius: 25px;"> + style="height: 20px;width: 20px;flex-shrink: 0;"> - ¥{{page.price}} - 共减:¥{{page.reduce}} + + ¥{{page.price}} + {{page.remarks}} + + + + + + @@ -97,11 +117,14 @@ export default { data() { return { + dialogBeforeClose: false, page: { affiliation: '', weight: "0", price: "0", - reduce: "0" + reduce: "0", + remarks: "", + qssl: "" }, data: [ @@ -110,10 +133,20 @@ }, onLoad(options) { this.page.affiliation = options.affiliation + this.page.qssl = options.weight console.log(" options", options); this.request() }, methods: { + showPop() { + + this.$refs.inputDialog.open() + + }, + + dialogInputConfirm() { + this.dialogBeforeClose = true + }, request() { let _this = this @@ -126,12 +159,10 @@ console.log("resp", resp); _this.data = resp - _this.getallPrice() - _this.getweight() + // _this.getallPrice() + // _this.getweight() + _this.getAllPriceOrWeight() - _this.$nextTick(() => { - _this.$refs.pageView.setLoadState(2) - }) // 无数据 if (_this.data.length == 0) { _this.$nextTick(() => { @@ -169,8 +200,8 @@ const index = that.data.findIndex((info) => info.goodsSid === item.goodsSid) console.log("index》》》》", index) that.data.splice(index, 1) - that.getallPrice() - that.getweight() + // that.getallPrice() + // that.getweight() that.upDateShoppCart(item) } else if (res.cancel) { @@ -184,8 +215,8 @@ } item.totalPrice = Number(item.goodsNumber) * Number(item.price) - that.getallPrice() - that.getweight() + // that.getallPrice() + // that.getweight() that.upDateShoppCart(item) } @@ -195,12 +226,42 @@ item.goodsNumber = Number(item.goodsNumber) + 1 item.totalPrice = Number(item.goodsNumber) * Number(item.price) - this.getallPrice() - this.getweight() + // this.getallPrice() + // this.getweight() this.upDateShoppCart(item) }, + getAllPriceOrWeight() { + let _this = this + + var params = { + customerSid: getApp().globalData.sid, + brandId: this.page.affiliation, + } + + _this.$api.getGoodsWeight(params).then((resp) => { + console.log("getGoodsWeight", resp); + + _this.page.price = resp.totalPrice + _this.page.weight = resp.totalWeight + _this.page.remarks = resp.remarks + + _this.initPrice = resp.totalPrice + _this.initWeight = resp.totalWeight + + _this.$nextTick(() => { + _this.$refs.pageView.setLoadState(2) + }) + + }).catch(e => { + _this.$nextTick(() => { + _this.$refs.pageView.setLoadState(1) + }) + }) + }, + + getallPrice() { let num = 0; @@ -236,54 +297,39 @@ let _this = this _this.$api.addShoppingCart(good).then((resp) => { - - }).catch(e => {}) + _this.getAllPriceOrWeight() + }).catch(e => { + _this.$nextTick(() => { + _this.$refs.pageView.setLoadState(1) + }) + }) }, settlement() { // 支付 - if (this.page.weight < 200) { - this.shortToast('满200斤才可定制云菜窖哦,请继续选菜吧。') - return - } - - - let list = [] - - for (var i = 0; i < this.goods.length; i++) { - var item = this.data[i] - if (item.goodsNumber > 0) - list.push({ - goodsSid: item.goodsSid, - goodsName: item.name, - partNumber: item.goodsNumber, - numofPart: item.weight, - priceUnit: item.jprice, - pricePart: item.mefenPrice, - }) - } - // console.log("ddd", list); - - if (list.length == 0) { - this.shortToast('请添加商品') + if (this.page.weight < parseInt(this.page.qssl)) { + this.shortToast('满' + this.page.qssl + '斤才可定制云菜窖哦,请继续选菜吧。') return } var params = { customerSid: getApp().globalData.sid, - cardNumber: 1, + // cardNumber: 1, + brandId: this.page.affiliation, totalTee: this.page.price, - ordOrderDetailsVoList: list + + // ordOrderDetailsVoList: list } - // console.log("params", params); + console.log("params", params); let _this = this - _this.$api.createOrder(params).then((resp) => { + // _this.$api.createVegeOrder(params).then((resp) => { - // console.log("resp", resp); - this.$pay(resp) - }).catch(e => {}) + // // console.log("resp", resp); + // this.$pay(resp) + // }).catch(e => { + // }) }, diff --git a/pages/home/cloudCard2.vue b/pages/home/cloudCard2.vue index d7c512c..f7a915a 100644 --- a/pages/home/cloudCard2.vue +++ b/pages/home/cloudCard2.vue @@ -110,8 +110,8 @@ - - + + @@ -135,6 +135,16 @@ ,{{data.brandVos[selectIndex2].qssl}}起订。 + + + + 起订协议 + + >> + + @@ -152,7 +162,7 @@ ¥{{page.price}} 配送费:¥{{page.reduce}} + style="font-size: 10px;color: #666;margin-left: 10px; height: 10px;line-height: 10px;margin-bottom: 5px;">{{page.remarks}} @@ -176,6 +186,12 @@ :content="data.brandVos[selectIndex2].dgxy" :confirm-text="confirmText"> + + + + @@ -187,6 +203,7 @@ dialogContent: "这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容,这里是协议内容这里是协议内容,这里是协议内容", confirmText: "我知道了(5s)", dialogBeforeClose: false, + dialogBeforeClose2: false, countdown: 5, searchInfo: { sid: "0", @@ -212,6 +229,7 @@ reduce: "0", weight: "0", count: "0", + remarks: "", startHeight: 0, endHeight: 0 }, @@ -312,6 +330,7 @@ _this.page.price = resp.totalPrice _this.page.weight = resp.totalWeight + _this.page.remarks = resp.remarks _this.initPrice = resp.totalPrice _this.initWeight = resp.totalWeight @@ -474,19 +493,43 @@ }, + dialogInputConfirm2(val) { + this.dialogBeforeClose2 = true + }, + saveGoods() { + // var params = { + // customerSid: getApp().globalData.sid, + // brandId: this.data.brandVos[this.selectIndex2].id + // } + // // console.log("params", params); + + // let _this = this + // _this.$api.saveGoods(params).then((resp) => { + + // _this.request() + // }).catch(e => {}) + + var params = { customerSid: getApp().globalData.sid, - brandId: this.data.brandVos[this.selectIndex2].id + // cardNumber: 1, + brandId:this.data.brandVos[this.selectIndex2].id, + totalTee: this.page.price, + + // ordOrderDetailsVoList: list } - // console.log("params", params); - + console.log("params", params); + let _this = this - _this.$api.saveGoods(params).then((resp) => { - - _this.request() - }).catch(e => {}) + // _this.$api.createVegeOrder(params).then((resp) => { + + // // console.log("resp", resp); + // this.$pay(resp) + // }).catch(e => { + // }) + }, itemClick(goodsSid) { @@ -496,9 +539,16 @@ }, gotoCart() { uni.navigateTo({ - url: '/pages/good/shoppCart?affiliation=' + this.data.brandVos[this.selectIndex2].id + url: '/pages/good/shoppCart?affiliation=' + this.data.brandVos[this.selectIndex2].id + + "&weight=" + this.data.brandVos[this.selectIndex2].qssl }) }, + showPop2() { + + this.$refs.inputDialog2.open() + + }, + onShareAppMessage: function(res) { console.log("res", res) console.log("data", res.target.dataset) diff --git a/pages/home/myHome.vue b/pages/home/myHome.vue index 1d893c0..9b96388 100644 --- a/pages/home/myHome.vue +++ b/pages/home/myHome.vue @@ -185,7 +185,7 @@ } this.getUserInfo() - this.myRecommend() + // this.myRecommend() }, onLoad(options) { // this.request()