guoxing 1 year ago
parent
commit
944a015134
  1. 7
      common/request.api.js
  2. 10
      pages/bind/bind_cloudCard.vue
  3. 94
      pages/good/reservation.vue
  4. 2
      pages/home/cloudCard2.vue
  5. 173
      pages/home/myCellar.vue
  6. 6
      pages/home/myHome.vue
  7. 46
      pages/login/login.vue
  8. 50
      pages/records/transferRecords.vue
  9. 20
      pages/records/transferRecords2.vue

7
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),
// 我的菜窖 预约提菜 选择时间范围

10
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', "")

94
pages/good/reservation.vue

@ -47,11 +47,13 @@
</view>
<view style="display: flex;flex-direction: row;align-items: center;justify-content: center;margin-top: 1;">
<view
style="display: flex;flex-direction: row;align-items: center;justify-content: center;margin-top: 1;">
<text
style="font-size: 14px;color: #000; font-weight: 600;font-family: sans-serif; flex: 1;">提货时间</text>
<uni-datetime-picker type="date" v-model="info.reserveDate":start="info.start" :end="info.end":disabledDate="disabledDate" />
<uni-datetime-picker type="date" v-model="info.reserveDate" :start="info.start"
:end="info.end" :disabledDate="disabledDate" />
</view>
@ -63,7 +65,8 @@
<text style="font-size: 14px;color: #000; font-weight: 600;font-family: sans-serif;">提菜人</text>
<view style="display: flex;flex-direction: row;align-items: center;" @click="changePer()">
<view v-if="info.name!=''" style="display: flex;flex-direction: row;align-items: center;"
@click="changePer()">
<text
style="font-size: 14px;color: #000; font-weight: 600;font-family: sans-serif;">{{info.name}}</text>
@ -72,6 +75,17 @@
<image src="../../static/right_icon.png" style="width: 15px;height: 15px;margin-left: 5px;">
</image>
</view>
<view v-if="info.name==''" style="display: flex;flex-direction: row;align-items: center;"
@click="changePer()">
<text style="font-size: 12px;color: #999; margin-left: 8px;">请完善</text>
<image src="../../static/right_icon.png" style="width: 15px;height: 15px;margin-left: 5px;">
</image>
</view>
</view>
@ -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++) {

2
pages/home/cloudCard2.vue

@ -134,7 +134,7 @@
</view>
<view style="color: #888;font-size: 10px;height: 10px;line-height: 10px;margin-top: 5px;">
{{data.brandVos[selectIndex2].qssl}}起订200斤以上免配送费</view>
{{data.brandVos[selectIndex2].qssl}}起订</view>
</view>
</view>

173
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() {

6
pages/home/myHome.vue

@ -122,7 +122,7 @@
</view>
<text style="font-size: 12px;color: #4B4B4B; margin-top: 8px;">邀请新朋友后和您的朋友将获得蔬菜品鉴礼包</text>
<text style="font-size: 12px;color: #4B4B4B; margin-top: 8px;">邀请新朋友后您将获得蔬菜品鉴礼包</text>
<!-- <view style="display: flex;flex-direction: row;align-items: center; ">
@ -287,12 +287,12 @@
break;
case "赠与我的":
uni.navigateTo({
url: '/pages/records/transferRecords',
url: '/pages/records/transferRecords2',
})
break;
case "我的转赠":
uni.navigateTo({
url: '/pages/records/transferRecords2',
url: '/pages/records/transferRecords',
})
break;
}

46
pages/login/login.vue

@ -84,6 +84,9 @@
console.log("人员sid", res.data.data.sid);
console.log("token", res.data.data.token);
console.log("middleware>>>>>>>>>>>>", _this.middleware);
if (_this.middleware != null) {
//
if ('share' == _this.middleware.functionName) {
@ -93,26 +96,29 @@
} else if ('bindCard' == _this.middleware
.functionName) {
_this.middleware.params.customerSid = res.data.data
.sid
_this.$api.pickUpCardBind(_this.middleware.params)
.then((resp) => {
uni.reLaunch({
url: _this.middleware.url
});
}).catch(e => {
uni.showModal({
title: '提示',
content: e.msg,
showCancel: false,
success: function(res) {
uni.switchTab({
url: '/pages/home/pickUpCard'
})
}
});
})
uni.reLaunch({
url: _this.middleware.url
});
// _this.middleware.params.customerSid = res.data.data
// .sid
// _this.$api.pickUpCardBind(_this.middleware.params)
// .then((resp) => {
// uni.reLaunch({
// url: _this.middleware.url
// });
// }).catch(e => {
// uni.showModal({
// title: '',
// content: e.msg,
// showCancel: false,
// success: function(res) {
// uni.switchTab({
// url: '/pages/home/pickUpCard'
// })
// }
// });
// })
} else {
uni.showModal({

50
pages/records/transferRecords.vue

@ -9,27 +9,27 @@
<view class="item">
<text class="item_left">转赠单号</text>
<text class="item_rifht">{{item.reserveCode}}</text>
<text class="item_rifht">{{item.transferCode}}</text>
</view>
<view class="item">
<text class="item_left">转赠时间</text>
<text class="item_rifht">{{item.reserveDate}}</text>
<text class="item_rifht">{{item.createTime}}</text>
</view>
<view class="item" >
<text class="item_left">转赠留言</text>
<text class="item_rifht">{{item.userPhone}}</text>
<text class="item_rifht">{{item.remarks}}</text>
</view>
<view class="item">
<text class="item_left">领取人员</text>
<text class="item_rifht">{{item.lqNick}}</text>
</view>
<view
style="display: flex;flex-direction: row;margin-top: 5px;align-items: center;justify-content: space-between;width: 100%;">
<text style="flex: 1;font-size: 12px; color: #A5A5A5; margin-right: 10px;">- {{item.goodss}}</text>
<button v-show="item.isShare=='1'" class='sharebtn' :data-info="item"
open-type="share">分享窖</button>
<button v-show="item.isShare=='2'" class='sharebtn2' :data-info="item"
open-type="share">已分享</button>
<button v-show="item.isShare=='3'" class='sharebtn3'>转赠成功</button>
<button v-show="item.state=='1'" class='sharebtn' :data-info="item"
open-type="share">分享窖</button>
<button v-show="item.state=='2'" class='sharebtn2'>转赠成功</button>
</view>
</view>
@ -54,12 +54,12 @@
//
queryList(pageNo, pageSize) {
let _this = this
_this.$api.myOrderListByUserSid({
_this.$api.transferRecordsList({
"current": pageNo,
"size": pageSize,
"params": {
"customerSid": getApp().globalData.sid,
"state": '0', //0 1
"state": '1', //1 2
}
}).then((resp) => {
@ -78,12 +78,12 @@
//
let shareData = JSON.stringify({
params: {
code: data.code,
codeKey: data.codeKey,
customerSid: ''
code: data.transferCode,
codeKey: data.sid
},
functionName: 'bindCard',
url: '/pages/detail/detail_affeection?sid=' + data.sid
url: '/pages/bind/bind_cloudCard?code=' + data
.transferCode + "&codeKey=" + data.sid
// url:'/pages/bind/bind_pickUpCard?code=' + + &codeKey=' + data.codeKey,
// FunctionName:'share!
@ -126,7 +126,7 @@
}
.sharebtn {
background: #FF4727;
background: #FE9039;
font-size: 12px;
color: #fff;
width: 30vw;
@ -139,18 +139,6 @@
}
.sharebtn2 {
background: #FF7165;
width: 30vw;
font-size: 12px;
color: #fff;
border-radius: 20px;
}
.sharebtn2::after {
border: none;
}
.sharebtn3 {
background: #CFCFCF;
width: 30vw;
font-size: 12px;
@ -158,7 +146,7 @@
border-radius: 20px;
}
.sharebtn3::after {
.sharebtn2::after {
border: none;
}

20
pages/records/transferRecords2.vue

@ -9,26 +9,24 @@
<view class="item">
<text class="item_left">转赠单号</text>
<text class="item_rifht">{{item.reserveCode}}</text>
<text class="item_rifht">{{item.transferCode}}</text>
</view>
<view class="item">
<text class="item_left">转赠时间</text>
<text class="item_rifht">{{item.reserveDate}}</text>
<text class="item_rifht">{{item.createTime}}</text>
</view>
<view class="item">
<text class="item_left">转赠人员</text>
<text class="item_rifht">{{item.fxNick}}</text>
</view>
<view class="item" >
<text class="item_left">转赠留言</text>
<text class="item_rifht">{{item.userPhone}}</text>
<text class="item_rifht">{{item.remarks}}</text>
</view>
<view
style="display: flex;flex-direction: row;margin-top: 5px;align-items: center;justify-content: space-between;width: 100%;">
<text style="flex: 1;font-size: 12px; color: #A5A5A5; margin-right: 10px;">- {{item.goodss}}</text>
<button v-show="item.isShare=='1'" class='sharebtn' :data-info="item"
open-type="share">分享窖</button>
<button v-show="item.isShare=='2'" class='sharebtn2' :data-info="item"
open-type="share">已分享</button>
<button v-show="item.isShare=='3'" class='sharebtn3'>转赠成功</button>
</view>
</view>
@ -54,12 +52,12 @@
//
queryList(pageNo, pageSize) {
let _this = this
_this.$api.myOrderListByUserSid({
_this.$api.transferRecordsList({
"current": pageNo,
"size": pageSize,
"params": {
"customerSid": getApp().globalData.sid,
"state": '0', //0 1
"state": '2', //1 2
}
}).then((resp) => {

Loading…
Cancel
Save