From 944a015134dc4102fd2896d036fd3753b281e722 Mon Sep 17 00:00:00 2001
From: guoxing <1369478551@qq.com>
Date: Sun, 21 Jan 2024 18:01:29 +0800
Subject: [PATCH] 123
---
common/request.api.js | 7 +-
pages/bind/bind_cloudCard.vue | 10 +-
pages/good/reservation.vue | 94 ++++++++++------
pages/home/cloudCard2.vue | 2 +-
pages/home/myCellar.vue | 173 +++++++++++------------------
pages/home/myHome.vue | 6 +-
pages/login/login.vue | 46 ++++----
pages/records/transferRecords.vue | 50 ++++-----
pages/records/transferRecords2.vue | 20 ++--
9 files changed, 199 insertions(+), 209 deletions(-)
diff --git a/common/request.api.js b/common/request.api.js
index 050050f..f86d02e 100644
--- a/common/request.api.js
+++ b/common/request.api.js
@@ -69,8 +69,11 @@ export default {
getAllGiftBag: (params = {}) => request.get("/lpkgoods/getAllGiftBag", params),
// 結算商品
createOrder: (params = {}) => request.post("/empsreservoorder/createOrder", params),
- // 预约记录
+ // 预约记录
orderListByUserSid: (params = {}) => request.post("/lpksreservoorder/orderListByUserSid", params, {}, {}, true),
+ // 转赠记录
+ transferRecordsList: (params = {}) => request.post("/transferrecords/transferRecordsList", params, {}, {}, true),
+
// 我的
// 获取头像 昵称
@@ -120,6 +123,8 @@ export default {
vegeCellarList: (params = {}) => request.post("/lpkgoods/vegeCellarList", params),
// 我的菜窖 转赠亲友
transSubmission: (params = {}) => request.post("/transferrecords/submission", params),
+ // 我的菜窖 领取/绑定转赠菜窖
+ receiveTransferGoods: (params = {}) => request.post("/vegetablecellar/receiveTransferGoods", params),
// 我的菜窖 预约提菜
getStoreBySid: (params = {}) => request.get("/customerstore/getStoreBySid/" + params, params),
// 我的菜窖 预约提菜 选择时间范围
diff --git a/pages/bind/bind_cloudCard.vue b/pages/bind/bind_cloudCard.vue
index e540761..781b4ae 100644
--- a/pages/bind/bind_cloudCard.vue
+++ b/pages/bind/bind_cloudCard.vue
@@ -127,7 +127,15 @@
// return
// }
let _this = this
- _this.$api.pickUpCardBind(this.page).then((resp) => {
+
+ var params = {
+ customerSid: this.page.customerSid,
+ transferSid: this.page.codeKey
+ }
+
+ console.log("params+++++++++++++++", params);
+
+ _this.$api.receiveTransferGoods(params).then((resp) => {
bus.$emit('order', "监听回调");
// setTimeout(() => {
// uni.$emit('order', "监听回调")
diff --git a/pages/good/reservation.vue b/pages/good/reservation.vue
index 5f9b765..f4faa77 100644
--- a/pages/good/reservation.vue
+++ b/pages/good/reservation.vue
@@ -47,11 +47,13 @@
-
+
提货时间
-
-
+
+
@@ -63,7 +65,8 @@
提菜人
-
+
{{info.name}}
@@ -72,6 +75,17 @@
+
+
+
+ 请完善
+
+
+
+
+
+
@@ -215,11 +229,11 @@
getSun() {
let _this = this
_this.$api.getExtractSaturAndSun().then((resp) => {
-
+
_this.disabledDate = resp
-
+
}).catch(e => {
-
+
})
},
address() {
@@ -245,43 +259,55 @@
console.log(e);
})
},
-
- jian(item){
- console.log("item》》》》", item)
+
+ jian(item) {
+ console.log("item》》》》", item)
const that = this
- if (Number(item.count) == 1) {
-
- wx.showModal({
- content: '确定不要了吗',
- cancelText: "再想想",
- confirmText: "删除",
- confirmColor: "#FF9900",
- success(res) {
- if (res.confirm) {
- console.log('用户点击确定')
- item.count = 0
- const index = that.pickingUpGoods.findIndex((info) => info.goodsSid === item.goodsSid)
- console.log("index》》》》", index)
- that.pickingUpGoods.splice(index, 1)
- } else if (res.cancel) {
-
+ if (Number(item.count) == 1) {
+
+ wx.showModal({
+ content: '确定不要了吗',
+ cancelText: "再想想",
+ confirmText: "删除",
+ confirmColor: "#FF9900",
+ success(res) {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ item.count = 0
+ const index = that.pickingUpGoods.findIndex((info) => info.goodsSid === item
+ .goodsSid)
+ console.log("index》》》》", index)
+ that.pickingUpGoods.splice(index, 1)
+ } else if (res.cancel) {
+
+ }
}
+ })
+
+ } else {
+ if (Number(item.count) > 0) {
+ item.count = Number(item.count) - 1
}
- })
-
- } else {
- if (Number(item.count) > 0) {
- item.count = Number(item.count) - 1
+
}
-
- }
},
- jia(item){
+ jia(item) {
+ if (item.count < item.goodsNumber)
item.count = Number(item.count) + 1
},
congirmExtract() {
let _this = this
+ if (_this.info.reserveDate == '') {
+ this.shortToast('请选择日期')
+ return
+ }
+
+ if (this.info.name == "" || this.info.phone == '') {
+ this.shortToast('请完善提菜人信息')
+ return
+ }
+
let list = []
for (var i = 0; i < this.pickingUpGoods.length; i++) {
diff --git a/pages/home/cloudCard2.vue b/pages/home/cloudCard2.vue
index 37710c5..d7c512c 100644
--- a/pages/home/cloudCard2.vue
+++ b/pages/home/cloudCard2.vue
@@ -134,7 +134,7 @@
- ,{{data.brandVos[selectIndex2].qssl}}起订,200斤以上免配送费
+ ,{{data.brandVos[selectIndex2].qssl}}起订。
diff --git a/pages/home/myCellar.vue b/pages/home/myCellar.vue
index df466fd..5858f5f 100644
--- a/pages/home/myCellar.vue
+++ b/pages/home/myCellar.vue
@@ -401,7 +401,7 @@
},
methods: {
- onKeyInput() {
+ onKeyInput(event) {
this.transferInfo.remarks = event.target.value
},
shareGift() {
@@ -467,7 +467,9 @@
this.getcount()
},
jia(item) {
- item.count = Number(item.count) + 1
+ if (item.count < item.goodsNumber)
+ item.count = Number(item.count) + 1
+
this.getcount()
this.addGoods(item)
},
@@ -509,14 +511,14 @@
},
gotoShopp() {
- // uni.switchTab({
- // url: '/pages/home/cloudCard2',
- // })
-
- uni.navigateTo({
- url: '/pages/bind/bind_cloudCard'
+ uni.switchTab({
+ url: '/pages/home/cloudCard2',
})
+ // uni.navigateTo({
+ // url: '/pages/bind/bind_cloudCard'
+ // })
+
},
transfer() {
@@ -558,115 +560,72 @@
this.showModal3 = false
},
onShareAppMessage: function(res) {
- wx.showLoading({
- title: '加载中',
- icon: 'loading',
- duration: 10000
- });
let _this = this
+ const promise = new Promise(resolve => {
+ // 模拟网络请求
+ setTimeout(() => {
+
+ var list = []
+ for (var i = 0; i < this.pickingUpGoods.length; i++) {
+ var item = this.pickingUpGoods[i]
+
+ if (item.count > 0) {
+ list.push({
+ goodsSid: item.goodsSid,
+ select: item.count
+ })
+ }
+
+ }
+
+ var params = {
+ customerSid: getApp().globalData.sid,
+ brandId: _this.brandType,
+ remarks: _this.transferInfo.remarks,
+ vos: list
+ }
+
+ console.log("=========0", params);
+
+ _this.$api.transSubmission(params).then((resp) => {
+
+ console.log("=========", resp);
+ _this.showModal3 = false
+
+ let shareData = JSON.stringify({
+ params: {
+ code: resp.transferCode,
+ codeKey: resp.sid
+ },
+ functionName: 'bindCard',
+ url: '/pages/bind/bind_cloudCard?code=' + resp
+ .transferCode + "&codeKey=" + resp.sid
+
+ // url: '/pages/home/cloudCard2?shareSid=' + getApp().globalData.sid,
+ // functionName: 'share'
+ })
+ // 转码传输
+ let value = encodeURIComponent(shareData)
- var list = []
- for (var i = 0; i < this.pickingUpGoods.length; i++) {
- var item = this.pickingUpGoods[i]
-
- if (item.count > 0) {
- list.push({
- goodsSid: item.goodsSid,
- select: item.count
- })
- }
-
- }
-
- var params = {
- customerSid: getApp().globalData.sid,
- brandId: this.brandType,
- vos: list
- }
-
- console.log("=========0", params);
-
- _this.$api.transSubmission(params).then((resp) => {
-
- console.log("=========", resp);
-
- const promise = new Promise(resolve => {
- // 模拟网络请求
- setTimeout(() => {
- wx.hideLoading()
- this.showModal3 = false
resolve({
- title: '标题',
- path: '页面'
+ title: '汇融惠享-云菜窖',
+ // ②
+ path: '/pages/login/login?data=' + value,
+ imageUrl: 'https://supervise.yxtsoft.com/lpk/image/shareAffeection.png', //自定义图片路径,显示图片长宽比是 5:4。
+
})
- }, 3000)
- })
- return {
- promise
- }
+ }).catch(e => {
+ _this.shortToast('发生错误,请稍后再试.')
+ return
+ })
- }).catch(e => {
- this.shortToast('发生错误,请稍后再试.')
- return
+ }, 0)
})
- // this.shareCard()
- // wx.showLoading({
- // title: '加载中',
- // icon: 'loading',
- // duration: 10000
- // });
- // const promise = new Promise(resolve => {
- // // 模拟网络请求
- // setTimeout(() => {
- // wx.hideLoading()
- // this.showModal3 = false
- // resolve({
- // title: '标题',
- // path: '页面'
- // })
- // }, 3000)
- // })
+ return promise
- // return {
- // promise
- // }
-
- // console.log("res", res)
- // console.log("data", res.target.dataset)
- // var data = res.target.dataset.info
-
- // // ①
- // let shareData = JSON.stringify({
- // params: {
- // code: data.code,
- // codeKey: data.codeKey,
- // customerSid: ''
- // },
- // functionName: 'bindCard',
- // url: '/pages/detail/detail_affeection?sid=' + data.sid
-
- // // url: '/pages/home/cloudCard2?shareSid=' + getApp().globalData.sid,
- // // functionName: 'share'
- // })
- // // 转码传输
- // let value = encodeURIComponent(shareData)
-
- // return {
- // title: '汇融惠享-云菜窖',
- // // ②
- // path: '/pages/login/login?data=' + value,
- // imageUrl: 'https://supervise.yxtsoft.com/lpk/image/shareAffeection.png', //自定义图片路径,显示图片长宽比是 5:4。
- // success: function(res) {
- // console.log('aaaa', "分享成功")
- // },
- // fail: function(res) {
- // // 转发失败
- // console.log('aaaa', "用户点击了取消")
- // }
- // }
},
shareCard() {
diff --git a/pages/home/myHome.vue b/pages/home/myHome.vue
index e737989..1d893c0 100644
--- a/pages/home/myHome.vue
+++ b/pages/home/myHome.vue
@@ -122,7 +122,7 @@
- 邀请新朋友后,您和您的朋友将获得“蔬菜品鉴礼包”。
+ 邀请新朋友后,您将获得“蔬菜品鉴礼包”。