Browse Source

购物车下单

dev
jiazhipeng 4 months ago
parent
commit
bfa3fbab01
  1. 8
      pages/cart/cart.vue
  2. 4
      pages/index/index.vue
  3. 2
      subPackages/food/order.vue
  4. 2
      subPackages/homestay/order.vue
  5. 54
      subPackages/order/cartOrder.vue
  6. 4
      subPackages/techan/order.vue
  7. 5
      subPackages/techan/selfPickUpPoint.vue
  8. 5
      subPackages/ticket/order.vue

8
pages/cart/cart.vue

@ -118,6 +118,10 @@
} }
}, },
onShow() { onShow() {
this.$store.commit("changeTechanOrderList", []);
this.$store.commit("changeTicketOrderList", []);
this.$store.commit("changeFoodOrderList", []);
this.$store.commit("changeHotelOrderList", []);
this.getList() this.getList()
}, },
methods: { methods: {
@ -156,6 +160,7 @@
x.startDay = xData.startDay x.startDay = xData.startDay
x.endDay = xData.endDay x.endDay = xData.endDay
x.differDays = xData.differDays x.differDays = xData.differDays
x.price = xData.price
} }
} }
@ -394,9 +399,10 @@
differDays: v.differDays differDays: v.differDays
} }
v.sku.buyNum = v.num v.sku.buyNum = v.num
v.sku.product_title = v.product.title
v.allSeldDate = [] v.allSeldDate = []
hotelOrderList.push({ hotelOrderList.push({
skuInfo: v.sku skuInfo: v.sku,
}) })
} }
}) })

4
pages/index/index.vue

@ -84,6 +84,10 @@
}, },
onLoad() { onLoad() {
},
//
onHide() {
this.getLocation()
}, },
onReady() { onReady() {
this.sendRequest() this.sendRequest()

2
subPackages/food/order.vue

@ -237,7 +237,7 @@
// //
if (this.isShoppingCart) { if (this.isShoppingCart) {
this.$store.commit("changeFoodOrderList", this.orderList); this.$store.commit("changeFoodOrderList", this.orderList);
uni.setStorageSync("foodOrderList", this.orderList) // uni.setStorageSync("foodOrderList", this.orderList)
this.goCartNextPage(3) this.goCartNextPage(3)
return return
} }

2
subPackages/homestay/order.vue

@ -302,7 +302,7 @@ export default {
// //
if (this.isShoppingCart) { if (this.isShoppingCart) {
this.$store.commit("changeHotelOrderList", this.skuInfo); this.$store.commit("changeHotelOrderList", this.skuInfo);
uni.setStorageSync("hotelOrderList", this.skuInfo) // uni.setStorageSync("hotelOrderList", this.skuInfo)
this.goCartNextPage(4) this.goCartNextPage(4)
return return
} }

54
subPackages/order/cartOrder.vue

@ -6,7 +6,7 @@
<view class="sku-item"> <view class="sku-item">
<view class="sku-content"> <view class="sku-content">
<view class="title" style="font-weight: bold;font-size: 35rpx;color: #000000;"> <view class="title" style="font-weight: bold;font-size: 35rpx;color: #000000;">
{{item.sku_name}} {{item.product_title}}
</view> </view>
<view class="subtitle text-overflow" style="font-size: 26rpx;"> <view class="subtitle text-overflow" style="font-size: 26rpx;">
@ -209,10 +209,15 @@ export default {
}, },
methods: { methods: {
handleOrderGoods () { handleOrderGoods () {
//
let techanOrderList = this.$store.state.user.techanOrderList;
// let techanOrderList = JSON.parse(uni.getStorageSync("techanOrderList")) // let techanOrderList = JSON.parse(uni.getStorageSync("techanOrderList"))
// console.log(techanOrderList) // console.log(techanOrderList)
// let ticketOrderList = (uni.getStorageSync("ticketOrderList")) || []
// let foodOrderList = (uni.getStorageSync("foodOrderList")) || []
// let hotelOrderList = this.$store.state.user.hotelOrderList;
// let hotelOrderList = uni.getStorageSync("hotelOrderList")
//
let techanOrderList = this.$store.state.user.techanOrderList;
// //
this.postOrderList = techanOrderList.filter(v=>v.is_user_post == 1) this.postOrderList = techanOrderList.filter(v=>v.is_user_post == 1)
// //
@ -220,13 +225,9 @@ export default {
// //
let ticketOrderList = this.$store.state.user.ticketOrderList; let ticketOrderList = this.$store.state.user.ticketOrderList;
let foodOrderList = this.$store.state.user.foodOrderList; let foodOrderList = this.$store.state.user.foodOrderList;
// let ticketOrderList = (uni.getStorageSync("ticketOrderList")) || []
// let foodOrderList = (uni.getStorageSync("foodOrderList")) || []
console.log(ticketOrderList, foodOrderList)
this.playOrderList = ticketOrderList.concat(foodOrderList) this.playOrderList = ticketOrderList.concat(foodOrderList)
// //
// let hotelOrderList = this.$store.state.user.hotelOrderList; let hotelOrderList = this.$store.state.user.hotelOrderList;
let hotelOrderList = JSON.parse(uni.getStorageSync("hotelOrderList"))
this.hotelOrderList = hotelOrderList this.hotelOrderList = hotelOrderList
this.calPrice() this.calPrice()
}, },
@ -294,14 +295,16 @@ export default {
order() { order() {
let goods = [] let goods = []
// //
this.playOrderList.forEach(item=>{ this.hotelOrderList.forEach(item=>{
let param = { let param = {
// type: item.pInfo.type, type: 'hotel',
// product_id: item.pInfo.id, customer_name: item.roomNames.toString(),
// sku_id: item.sInfo.id, reserve_mobile: item.phone,
// product_num: item.sInfo.buyNum, product_id: item.product_id,
// phone: item.phone, sku_id: item.id,
// remark: item.remark, start_date: item.selectDate.startDay,
end_date: item.selectDate.endDay,
product_num: item.buyNum
} }
goods.push(param) goods.push(param)
}) })
@ -370,6 +373,27 @@ export default {
this.$store.commit("changeTicketOrderList", []); this.$store.commit("changeTicketOrderList", []);
this.$store.commit("changeFoodOrderList", []); this.$store.commit("changeFoodOrderList", []);
this.$store.commit("changeHotelOrderList", []); this.$store.commit("changeHotelOrderList", []);
this.Post({
order_id: res.data.order_id,
pay_platform: "miniprogram",
pay_method: 'abc'
}, '/api/order/pay').then(res => {
if (res.data) {
uni.requestPayment({
nonceStr: res.data.nonceStr,
package: res.data.package,
paySign: res.data.paySign,
signType: res.data.signType,
timeStamp: res.data.timeStamp,
complete() {
uni.navigateTo({
url: '/subPackages/order/trades'
});
}
});
}
});
} }
}) })

4
subPackages/techan/order.vue

@ -485,8 +485,8 @@ export default {
// //
if (this.isShoppingCart) { if (this.isShoppingCart) {
this.$store.commit("changeTechanOrderList", this.orderList); this.$store.commit("changeTechanOrderList", this.orderList);
uni.setStorageSync("techanOrderList", JSON.stringify(this.orderList)) // uni.setStorageSync("techanOrderList", JSON.stringify(this.orderList))
console.log(this.orderList) // console.log(this.orderList)
this.goCartNextPage(1) this.goCartNextPage(1)
return return
} }

5
subPackages/techan/selfPickUpPoint.vue

@ -59,11 +59,10 @@
return return
} }
this.pending = true this.pending = true
// this.getLocation()
let param = { let param = {
product_id: this.goodsId, product_id: this.goodsId,
lon: uni.getStorageSync('location').lon || '36', lon: uni.getStorageSync('location').lon || '120',
lat: uni.getStorageSync('location').lat || '29', lat: uni.getStorageSync('location').lat || '36',
} }
this.Post(param, "/api/product/getDeliverShop").then(res => { this.Post(param, "/api/product/getDeliverShop").then(res => {
if (res) { if (res) {

5
subPackages/ticket/order.vue

@ -415,7 +415,8 @@
/*---------------------------价格日历-----------------------------------*/ /*---------------------------价格日历-----------------------------------*/
order() { order() {
let goods = [] let goods = []
if (this.orderList.some(v=>v.allSeldDate).length<=0) { console.log(this.orderList)
if (this.orderList.some(v=>!v.showDate.date)) {
uni.showToast({title: '请选择价格日历',icon:'none'}) uni.showToast({title: '请选择价格日历',icon:'none'})
return return
} }
@ -449,7 +450,7 @@
// //
if (this.isShoppingCart) { if (this.isShoppingCart) {
this.$store.commit("changeTicketOrderList", this.orderList); this.$store.commit("changeTicketOrderList", this.orderList);
uni.setStorageSync("ticketOrderList", this.orderList) // uni.setStorageSync("ticketOrderList", this.orderList)
this.goCartNextPage(2) this.goCartNextPage(2)
return return
} }

Loading…
Cancel
Save