+
游玩
-
+
+
+
+
+
+ {{item.pInfo.title}}
+ ¥{{item.sInfo.price/100}}
+
+
+ {{item.sInfo.sku_name}}
+ x{{item.sInfo.buyNum}}
+
+
+
+
+
+ 使用日期:
+
+ {{item.showDate.date}}
+
+ {{item.showDate.startTime}} 至 {{item.showDate.endTime}}
+
+
+
+
+ 出行人信息:
+ {{item.phone}}
+
+
+
+
+ 小计: {{priceParam.playPrice/100}}
+
-
-
优惠券
@@ -100,13 +132,13 @@
-
+
合计:
- {{ total() }}
+ {{ calAllPrice() }}
提交订单
@@ -121,23 +153,30 @@ export default {
data() {
return {
- orderList: [],
+ hotelOrderList: [], // 酒店
postOrderList: [], // 邮寄
pickupOrderList: [], // 自提
-
+ playOrderList: [], // 游玩
+
coupon: "",
- allprice: 0,
+ allprice: 0, // 总价不包含优惠券
+ skuIds: [],
+ priceParam: {
+ hotelPrice: 0,
+ postPrice: 0,
+ pickupPrice: 0,
+ playPrice: 0,
+ },
};
},
onLoad(options) {
-
this.$store.commit("choseCoupon", "");
this.handleOrderGoods()
},
onShow() {
- if (!this.isShoppingCart) {
- this.coupon = this.$store.state.user.coupon
- }
+ this.coupon = this.$store.state.user.coupon
+ // 不要删输出
+ console.log(this.coupon, this.$store.state.user.coupon)
},
onReady () {
@@ -147,40 +186,150 @@ export default {
handleOrderGoods () {
// 特产处理
// let techanOrderList = this.$store.state.user.techanOrderList;
- let techanOrderList = JSON.parse(uni.getStorageSync("techanOrderList"))
- console.log(techanOrderList)
+ let techanOrderList = JSON.parse(uni.getStorageSync("techanOrderList"))
+ // console.log(techanOrderList)
// 邮寄
this.postOrderList = techanOrderList.filter(v=>v.is_user_post == 1)
// 自提
this.pickupOrderList = techanOrderList.filter(v=>v.is_user_post == 2)
+ // 游玩处理 采摘 农家烟火
+ // let ticketOrderList = this.$store.state.user.ticketOrderList;
+ // 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)
+ // 酒店
+ // let hotelOrderList = this.$store.state.user.hotelOrderList;
- let ticketOrderList = this.$store.state.user.ticketOrderList;
- let foodOrderList = this.$store.state.user.foodOrderList;
- let hotelOrderList = this.$store.state.user.hotelOrderList;
+ this.calPrice()
+ },
+
+ calPrice () {
+ let price1 = 0, price2 = 0, price3 =0 , price4 = 0;
+ let skuIds = []
+ this.postOrderList.forEach(v=>{
+ price1+= v.sInfo.price * v.sInfo.buyNum + v.post
+ skuIds.push(v.sInfo.id)
+ })
+ this.pickupOrderList.forEach(v=>{
+ price2+= v.sInfo.price * v.sInfo.buyNum
+ skuIds.push(v.sInfo.id)
+ })
+ this.playOrderList.forEach(v=>{
+ price3+= v.sInfo.price * v.sInfo.buyNum
+ skuIds.push(v.sInfo.id)
+ })
+ this.hotelOrderList.forEach(v=>{
+ // price4+= v.sInfo.price * v.sInfo.buyNum
+ })
+ this.skuIds = skuIds
+ this.priceParam = {
+ hotelPrice: price4,
+ postPrice: price1,
+ pickupPrice: price2,
+ playPrice: price3,
+ }
+ this.allprice = price1+price2+price3+price4
+ // this.calAllPrice()
+ this.getMaxCouponData()
+ },
+ calAllPrice () {
+ let price = 0
+ let allPrice = this.allprice
+ if (this.coupon) {
+ if (this.coupon.activity.fold == 0) {
+ if (this.coupon.activity.money>allPrice) {
+ price =0
+ }else{
+ price = allPrice - (this.coupon.activity.money)
+ }
+
+ } else{
+ price = allPrice - allPrice * (this.coupon.activity.fold*10/100)
+ }
+ } else {
+ price = allPrice
+ }
+ return price < 0 ? 0 : (price/100).toFixed(2)
},
goOrderCoupon () {
- let allPrice = 0
- let skuIds= []
- this.orderList.forEach(v=>{
- allPrice+= v.sInfo.price*v.sInfo.buyNum
- if (v.sInfo.buyNum>0) {
- skuIds.push(v.sInfo.id)
- }
- })
+
uni.navigateTo({
- url: `/subPackages/order/orderCoupon?allprice=${allPrice}&sku_ids=${skuIds.join(',')}`
+ url: `/subPackages/order/orderCoupon?allprice=${this.allPrice}&sku_ids=${this.skuIds.join(',')}`
})
},
- // 总价
- total() {
-
- },
- // 预定
+ // 下单
order() {
+ let goods = []
+ // 邮寄
+ this.postOrderList.forEach(item=>{
+ let param = {
+ type: item.pInfo.type,
+ product_id: item.pInfo.id,
+ sku_id: item.sInfo.id,
+ product_num: item.sInfo.buyNum,
+ remark: item.remark,
+ use_type:1,
+ post: item.contacts.id
+ }
+ goods.push(param)
+ })
+ // 自提
+ this.pickupOrderList.forEach(item=>{
+ let param = {
+ type: item.pInfo.type,
+ product_id: item.pInfo.id,
+ sku_id: item.sInfo.id,
+ product_num: item.sInfo.buyNum,
+ remark: item.remark,
+ use_type:2,
+ pickup_shop_id : item.pickupAddress.id,
+ pickup_shop_info : item.pickupAddress,
+ }
+ goods.push(param)
+ })
+ // 游玩
+ this.playOrderList.forEach(item=>{
+ let param = {
+ type: item.pInfo.type,
+ product_id: item.pInfo.id,
+ sku_id: item.sInfo.id,
+ product_num: item.sInfo.buyNum,
+ phone: item.phone,
+ remark: item.remark,
+ }
+ if (item.showDate) {
+ param.use_date= item.showDate.date ||'';
+ param.start_time = item.showDate.start_time || '';
+ param.end_time = item.showDate.end_time || '';
+ }
+ goods.push(param)
+ })
+
+ let data = {
+ product_list: goods,
+ coupon_id: this.coupon ? this.coupon.id : null,
+ }
+
+ this.Post({
+ method: 'POST',
+ data: JSON.stringify(data)
+ }, '/api/order/create').then(res => {
+ if (res.code == 1) {
+ console.log(res.data.order_id);
+ let order_id = res.data.order_id
+ this.$store.commit("choseCoupon", "");
+ this.$store.commit("changeTechanOrderList", []);
+ this.$store.commit("changeTicketOrderList", []);
+ this.$store.commit("changeFoodOrderList", []);
+ this.$store.commit("changeHotelOrderList", []);
+ }
+ })
},
@@ -188,16 +337,7 @@ export default {
// 获取最大优惠券
async getMaxCouponData () {
let allPrice =0
- let skuIds = []
- if (this.info && Array.isArray(this.info.goods)) {
- this.info.goods.forEach(v=>{
- allPrice += v.skuInfo.money*v.skuInfo.buyNum
- if (v.skuInfo.buyNum>0) {
- skuIds.push(v.skuInfo.id)
- }
- })
- }
- let param = {money:allPrice,sku_ids:skuIds.join(',')}
+ let param = {money:this.allprice,sku_ids:this.skuIds.join(',')}
let res = await this.getMaxCoupon(param)
if (res.id) {
this.coupon = res
@@ -305,6 +445,24 @@ view {
}
}
+
+.ticket-item{
+ margin-bottom: 26rpx;
+ border-bottom: 1px solid #D8D8D8;
+ .other-info{
+ font-weight: 500;
+ font-size: 28rpx;
+ color: #333333;
+ &>view{
+ padding: 20rpx 0 0;
+ &:last-child{
+ padding-bottom: 20rpx;
+ }
+ }
+
+ }
+}
+
.cal-price{
font-weight: 500;
font-size: 28rpx;
diff --git a/subPackages/search/index.vue b/subPackages/search/index.vue
index 3c173cb..06714f3 100644
--- a/subPackages/search/index.vue
+++ b/subPackages/search/index.vue
@@ -74,7 +74,7 @@
let url = '/subPackages/search/result'
if (this.type == 'techan') { url = '/subPackages/search/techanResult' }
uni.navigateTo({
- url: url+`?keywords=${this.keywords}`
+ url: url+`?keywords=${name}`
})
this.pushHis(name)
},
diff --git a/subPackages/search/result.vue b/subPackages/search/result.vue
index 4f5ec7a..41a62ce 100644
--- a/subPackages/search/result.vue
+++ b/subPackages/search/result.vue
@@ -17,25 +17,26 @@
-
+
{{item.ext.title}}
-
-
- {{item.ext.address}}
- {{item.ext.scene_address}}
-
-
-
-
-
- {{item.ext.price/100}}
+
+
+
+ {{item.ext.address}}
+ {{item.ext.scene_address}}
+
+
+
+ {{item.ext.price/100}}
+
+
@@ -55,11 +56,10 @@
return {
typeList: [
{name: '全部', type: ''},
- {name: '门票', type: 'ticket'},
- {name: '酒店', type: 'hotel'},
- {name: '特产', type: 'post'},
+ {name: '游玩', type: 'ticket'},
+ {name: '民宿', type: 'hotel'},
{name: '线路', type: 'line'},
- {name: '美食', type: 'food'},
+ {name: '农产品', type: 'post'},
],
typeIndex: 0,
showMore: true,
@@ -170,8 +170,8 @@
}
.search-list {
- padding: 0 30rpx;
- padding-bottom: 30rpx;
+ padding: 26rpx 30rpx;
+ background: #F7F7F7;
}
.search-item {
@@ -180,7 +180,7 @@
background: #FFFFFF;
border-radius: 13rpx;
display: flex;
- margin: 26rpx 0rpx;
+ margin-bottom: 26rpx;
.img {
width: 200rpx;
height: 200rpx;
@@ -206,7 +206,7 @@
.distance {
font-family: PingFang SC;
font-weight: 500;
- font-size: 27rpx;
+ font-size: 24rpx;
color: #666666;
display: flex;
align-items: center;
@@ -215,6 +215,8 @@
padding-right: 10rpx;
image{
+ width: 26rpx;
+ height: 26rpx;
flex-shrink: 0;
}
text{
@@ -223,6 +225,8 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
+ height: 26rpx;
+ line-height: 26rpx;
}
}
@@ -230,7 +234,7 @@
font-family: PingFang SC;
font-weight: 500;
font-size: 33.33rpx;
- color: #D90F00;
+ color: #C3282E;
display: flex;
align-items: baseline;
}
@@ -241,10 +245,7 @@
.ticlet-price::after{
content: '起';
font-size: 24rpx;
- }
- .food-price::after{
- content: '/人';
- font-size: 24rpx;
+ color: #999999;
}
}
@@ -273,6 +274,7 @@
overflow-y: hidden;
padding: 0;
display: flex;
+ justify-content: space-between;
}
.common-types::-webkit-scrollbar {
@@ -282,12 +284,12 @@
}
.common-type {
- flex-shrink: 0;
margin: 0 26rpx;
line-height: 90rpx;
height: 90rpx;
position: relative;
color: #000000;
+ flex-shrink: 0;
}
.common-type.active {
diff --git a/subPackages/techan/detail.vue b/subPackages/techan/detail.vue
index c9d740e..74c97ed 100644
--- a/subPackages/techan/detail.vue
+++ b/subPackages/techan/detail.vue
@@ -275,8 +275,8 @@
},
// 购物车
getCartList () {
- this.Post({},'/api/cart/get_list').then(res=>{
- this.cartNum = (res.data || []).length
+ this.Post({},'/api/cart/get_cart_count').then(res=>{
+ this.cartNum = res.data || 0
})
},
diff --git a/subPackages/ticket/detail.vue b/subPackages/ticket/detail.vue
index 3b66823..dd5da20 100644
--- a/subPackages/ticket/detail.vue
+++ b/subPackages/ticket/detail.vue
@@ -97,12 +97,14 @@
+
加入购物车
@@ -515,8 +517,8 @@
// 购物车
getCartList () {
- this.Post({},'/api/cart/get_list').then(res=>{
- this.cartNum = (res.data || []).length
+ this.Post({},'/api/cart/get_cart_count').then(res=>{
+ this.cartNum = res.data || 0
})
},
@@ -1294,5 +1296,16 @@
}
}
+ button {
+ margin: 0;
+ padding: 0;
+ outline: none;
+ border-radius: 0;
+ background-color: transparent;
+ line-height: inherit;
+ }
+ button::after {
+ border: none;
+ }
diff --git a/subPackages/ticket/order.vue b/subPackages/ticket/order.vue
index 7c1760a..ee4139f 100644
--- a/subPackages/ticket/order.vue
+++ b/subPackages/ticket/order.vue
@@ -324,9 +324,10 @@
if (this.singleOrder.seldDateIndex<0) {
this.singleOrder.seldDateIndex = this.singleOrder.allSeldDate.findIndex(item => item.stock > 0)
}
- if (this.singleOrder.seldDateIndex) {
+ if (this.singleOrder.seldDateIndex<0) {
uni.showToast({
- title: '暂无库存'
+ title: '暂无库存',
+ icon: 'none',
})
return
}
@@ -424,7 +425,9 @@
}
// 设置参数
- this.orderList.filter(v=>v.sInfo.buyNum>0).forEach(item=>{
+ this.orderList.forEach(item=>{
+ item.phone = this.phone
+
let sku = item.sInfo
let use_date = item.allSeldDate[item.seldDateIndex].date
let start_time =(item.timesArr[item.seldTimeIndex]||{}).start_time