jiazhipeng 4 months ago
parent
commit
b995ebada5
  1. 37
      subPackages/homestay/detail.vue
  2. 4
      subPackages/homestay/index.vue
  3. 6
      subPackages/homestay/order.vue
  4. 16
      subPackages/line/order.vue
  5. 14
      subPackages/order/orderDetail.vue
  6. 2
      subPackages/user/myAddressAdd.vue

37
subPackages/homestay/detail.vue

@ -183,6 +183,14 @@
<SelectCalendar :startDate="new Date(selectDate.startDay).Format('yyyy-MM-dd')" :endDate="new Date(selectDate.endDay).Format('yyyy-MM-dd')"></SelectCalendar>
</view>
</uni-popup>
<!-- 购物车图标 -->
<view class="add-cart-icon" @click="goCartPage()">
<uni-badge class="uni-badge-left-margin" :text="cartNum" absolute="rightTop" :offset="[-3, -3]" size="small"
:custom-style="{background:'#DC2525',color:'#ffffff'}">
<image src="https://static.ticket.sz-trip.com/uploads/20250611/f8c2078ad76754a0b0251f9b65784dc2.png"></image>
</uni-badge>
</view>
</view>
</template>
@ -214,13 +222,14 @@
calendarParam: {
stratDate:'',endDate: '', selected: []
},
cartNum: 0,
}
},
onLoad(options) {
this.id = options.id;
this.getInfo();
this.getGoodsList()
this.getCartList()
uni.$on('changeHotelDate', data => {
if(data) {
this.selectDate = data
@ -233,6 +242,12 @@
uni.$off('changeHotelDate')
},
methods: {
//
getCartList () {
this.Post({},'/api/cart/get_cart_count').then(res=>{
this.cartNum = res.data || 0
})
},
swiperChange (e) {
this.swiperCurrent = e.detail.current+1
},
@ -333,6 +348,7 @@
this.Post({sku_id: item.id,num: 1 },'/api/cart/add_sku').then(res => {
if (res.code == 1) {
uni.showToast({title: res.msg,icon: 'none'});
this.getCartList()
}
});
},
@ -770,4 +786,23 @@
}
}
.add-cart-icon{
width: 80rpx;
height: 80rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0,0,0,0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 140rpx;
right: 20rpx;
z-index: 10;
image{
width: 43.33rpx;
height: 42rpx;
}
}
</style>

4
subPackages/homestay/index.vue

@ -6,8 +6,8 @@
<image :src="item.headimg" mode="aspectFill" class="image"></image>
<view class="content flex-column">
<view class="title text-overflowRows">{{item.title}}</view>
<view class="tags" v-if="item.scene_tags">
<view class="tag" v-for="(tagItem,tagIndex) in item.scene_tags.split(',').slice(0,2)" :key="tagIndex">{{tagItem}}</view>
<view class="tags" v-if="item.display_tags">
<view class="tag" v-for="(tagItem,tagIndex) in item.display_tags.split(',').slice(0,2)" :key="tagIndex">{{tagItem}}</view>
</view>
<view class="address text-overflowRows">{{item.province_name}}{{item.city_name}}{{item.area_name}}{{item.address}}</view>
<view class="price">{{item.price / 100}}</view>

6
subPackages/homestay/order.vue

@ -372,9 +372,9 @@ export default {
end_date: sku.selectDate.endDay,
}, '/api/product/product_date_price').then(res => {
let seldDate = res.data || [];
if (seldDate.length > 1) {
seldDate.pop();
}
// if (seldDate.length > 1) {
// seldDate.pop();
// }
sku.allSeldDate = seldDate;
this.total()

16
subPackages/line/order.vue

@ -157,6 +157,7 @@
}, '/api/product/get_product_sku_price_by_date').then(res => {
const prices = this.processPriceData(res.data);
this.prices = prices;
console.log('prices',this.prices)
const {
selectDate,
selectMonth
@ -219,7 +220,7 @@
}
const info = this.getPriceInfo(selectMonth, day);
console.log(info)
if (info && info.stock !== 0) {
if (info && info.product_price !== null) {
info.selectMonth = selectMonth;
info.selectDate = day;
this.selectDate = info;
@ -321,11 +322,16 @@
let selectDate;
let selectMonth;
for (const key in prices) {
const [month, day] = key.split('-');
if (!selectDate) {
selectDate = parseInt(day);
selectMonth = parseInt(month);
if(prices[key].product_price != null) {
const [month, day] = key.split('-');
if (!selectDate) {
selectDate = parseInt(day);
selectMonth = parseInt(month);
}
break;
}
console.log(prices[key])
}
return {
selectDate,

14
subPackages/order/orderDetail.vue

@ -9,11 +9,11 @@
<view>{{info.state_text}}</view>
<!-- 待支付时会显示自动取消时间 -->
<view v-if="info.state=='WAIT_PAYMENT'" class="close-time">
<view v-if="info.state=='UNPAID'" class="close-time">
订单将在<span>{{info.close_time.slice(-8)}}</span>自动取消</view>
<!-- 待退款 -->
<view v-if="info.state=='REFUNDING'" class="close-time">系统将在1-7个工作日内原路退回您的原支付账户</view>
<view v-if="info.state=='REFUNDING' || info.state=='WAIT_REFUND'" class="close-time">系统将在1-7个工作日内原路退回您的原支付账户</view>
<!-- 退款完成 -->
<view v-if="info.state=='REFUND'" class="close-time">您的退款金额已退还到您的原支付账户</view>
@ -70,11 +70,11 @@
<image src="https://static.ticket.sz-trip.com/shiweisuzhou/images/order/rightIcon.png"
class="rightIcon"></image>
</view>
<view class="subtitle" v-if="item.use_date"><span>出行时间</span>{{item.use_date}}</view>
<view class="subtitle" v-if="item.use_date && item.is_package != 1"><span>出行时间</span>{{item.use_date}}</view>
<view class="subtitle" v-if="item.scene_detail.open_time">
<span>开放时间</span>{{item.scene_detail.open_time}}
</view>
<view class="line"></view>
<view class="lines"></view>
<view class="skutitle flex-between">
<view>{{item.sku_name}}</view>
<view>
@ -306,6 +306,9 @@
<view class="subtitle flex-between">
<span>商品总额</span>{{info.total_money / 100}}
</view>
<view class="subtitle flex-between" v-if="info.total_post_fee">
<span>邮费</span>{{info.total_post_fee / 100}}
</view>
<view class="subtitle flex-between">
<span>优惠券</span>-{{info.preference_money / 100}}
</view>
@ -683,6 +686,7 @@
font-weight: 500;
font-size: 27rpx;
color: #000000;
margin-top: 10rpx;
span {
color: #C3282E;
@ -738,7 +742,7 @@
flex-shrink: 0;
}
.line {
.lines {
width: 643rpx;
height: 1rpx;
background: #D8D8D8;

2
subPackages/user/myAddressAdd.vue

@ -309,7 +309,7 @@
district_id: this.areaId,
detail_addr: this.detailAddr,
id: this.id || null
},'/api/uservice/user/' + (this.id > 0 ? 'edit' : 'add') + 'Consignee').then(res => {
},'/api/uservice/user/' + (this.id > 0 ? 'edit' : 'addNew') + 'Consignee').then(res => {
if(res.code == 1){
uni.setStorageSync('addressNow',JSON.stringify(res.data))
uni.showModal({

Loading…
Cancel
Save