jiazhipeng 4 months ago
parent
commit
9be0a837fd
  1. 2
      pages/cart/cart.vue
  2. 12
      static/js/CommonFunction.js
  3. 45
      subPackages/techan/cartOrder.vue
  4. 49
      subPackages/techan/cartOrder1.vue

2
pages/cart/cart.vue

@ -418,7 +418,7 @@
this.$store.commit("changeFoodOrderList", foodOrderList);
this.$store.commit("changeHotelOrderList", hotelOrderList);
uni.setStorageSync('hotelOrderInfo', JSON.stringify(hotelOrderList))
uni.setStorageSync('techanOrderList', techanOrderList)
// uni.setStorageSync('techanOrderList', techanOrderList)
// > > >
this.goCartNextPage(0)

12
static/js/CommonFunction.js

@ -303,15 +303,23 @@ Vue.prototype.goCartNextPage= function(currentPageIndex){
{path: '/subPackages/homestay/order',length: hotelOrderList.length}
]
let nextPage = orderPage.find((v,index)=>v.length>0&&index>=currentPageIndex)
// 强行变更
console.log(nextPage,currentPageIndex, techanOrderList)
if (currentPageIndex==0.5 && techanOrderList.some(v=>v.sInfo.use_type!==0)) {
uni.navigateTo({
url: '/subPackages/techan/cartOrder1?isShoppingCart=1'
})
return
}
if (nextPage) {
console.log(nextPage)
uni.navigateTo({
url: nextPage.path+'?isShoppingCart=1'
})
} else {
console.log(orderPage, nextPage, '结束')
// todo 最后下单页面
uni.reLaunch({
uni.navigateTo({
url: '/subPackages/order/cartOrder'
})

45
subPackages/techan/cartOrder.vue

@ -265,7 +265,7 @@ export default {
handleOrderGoods () {
let orderList = this.$store.state.user.techanOrderList;
orderList = uni.getStorageSync("techanOrderList")
// orderList = uni.getStorageSync("techanOrderList")
if (!Array.isArray(orderList) || orderList.length<=0) {
uni.navigateBack();
return
@ -295,7 +295,7 @@ export default {
this.step = 1
this.getContacts()
} else {
this.order()
this.handleOrder()
}
console.log(this.orderList)
},
@ -465,7 +465,23 @@ export default {
}
},
handleOrder () {
let tempOrderList = []
this.allOrderList.forEach(v=>{
if (v.is_post != 1) {
tempOrderList.push(v)
}
})
console.log(tempOrderList)
if (tempOrderList.length>0) {
this.orderList = tempOrderList
this.step = 2
//
this.setAddress()
}
},
//
total() {
@ -503,8 +519,6 @@ export default {
},
//
order() {
let goods = [];
for(let info of this.orderList) {
let param = {
@ -539,31 +553,12 @@ export default {
goods.push(param)
}
let flag = false
if (this.step == 1) {
let tempOrderList = []
this.allOrderList.forEach(v=>{
if (v.is_post != 1) {
tempOrderList.push(v)
}
})
console.log(tempOrderList)
if (tempOrderList.length>0) {
this.orderList = tempOrderList
this.step = 2
//
this.setAddress()
flag = true
}
}
if (flag) return
//
if (this.isShoppingCart) {
this.$store.commit("changeTechanOrderList", this.allOrderList);
// uni.setStorageSync("techanOrderList", JSON.stringify(this.orderList))
uni.setStorageSync("techanOrderList", JSON.stringify(this.orderList))
// console.log(this.orderList)
this.goCartNextPage(1)
this.goCartNextPage(0.5)
return
}

49
subPackages/techan/cartOrder1.vue

@ -264,8 +264,7 @@ export default {
// /
handleOrderGoods () {
let orderList = this.$store.state.user.techanOrderList;
orderList = uni.getStorageSync("techanOrderList")
if (!Array.isArray(orderList) || orderList.length<=0) {
uni.navigateBack();
return
@ -274,11 +273,11 @@ export default {
// use_type 0 1 3
// is_post 1 2 1
orderList.forEach(v=>{
v.is_post = v.sInfo.use_type==3?3:v.sInfo.use_type==1?2:1 //
v.is_user_post = v.sInfo.use_type==1?2:1 //
v.is_post = v.is_post; //
v.is_user_post = v.is_user_post; //
v.pickupAddress = v.pickupAddress || null //
v.contacts = v.contacts || null //
v.post = v.post || null //
v.contacts = v.contacts//
v.post = v.post//
v.remark = v.remark||""
})
let contactsData = orderList.find(v=>v.contacts && v.is_post==1)
@ -288,7 +287,7 @@ export default {
this.allOrderList = orderList;
this.order()
this.handleOrder()
console.log(this.orderList)
},
@ -389,6 +388,7 @@ export default {
this.orderList.forEach(v=>{
v.contacts = JSON.parse(JSON.stringify(this.contacts))
})
this.getPost()
} else {
this.getContacts()
}
@ -458,7 +458,23 @@ export default {
}
},
handleOrder () {
let tempOrderList = []
this.allOrderList.forEach(v=>{
if (v.is_post != 1) {
tempOrderList.push(v)
}
})
console.log(tempOrderList)
if (tempOrderList.length>0) {
this.orderList = tempOrderList
this.step = 2
//
this.setAddress()
}
},
//
total() {
@ -532,25 +548,6 @@ export default {
goods.push(param)
}
let flag = false
if (this.step == 1) {
let tempOrderList = []
this.allOrderList.forEach(v=>{
if (v.is_post != 1) {
tempOrderList.push(v)
}
})
console.log(tempOrderList)
if (tempOrderList.length>0) {
this.orderList = tempOrderList
this.step = 2
//
this.setAddress()
flag = true
}
}
if (flag) return
//
if (this.isShoppingCart) {
this.$store.commit("changeTechanOrderList", this.allOrderList);

Loading…
Cancel
Save