Browse Source

页面优化

master
jiazhipeng 8 months ago
parent
commit
c3e8765008
  1. 9
      pages/info/sceneProductInfo/index.js
  2. 5
      pages/info/sceneProductInfo/index.wxml
  3. 4
      pages/info/sceneProductInfo/index.wxss
  4. 17
      pages/order/components/date/index.js
  5. 4
      pages/order/components/date/index.wxml

9
pages/info/sceneProductInfo/index.js

@ -857,6 +857,15 @@ Page({
}) })
}else { }else {
// 如果是预定须知
if (showSkuIndex == 1) {
this.setData({
bookingInfo: e.currentTarget.dataset.sku.sku_model,
bookingInfoTitle: e.currentTarget.dataset.sku.sku_name
})
return
}
let skuIndex = this.data.skuList.findIndex(v=>v.id == sku.sku.id) let skuIndex = this.data.skuList.findIndex(v=>v.id == sku.sku.id)
this.setData({ this.setData({

5
pages/info/sceneProductInfo/index.wxml

@ -42,8 +42,8 @@
<view class="tab-info-container" wx:if="{{info}}"> <view class="tab-info-container" wx:if="{{info}}">
<view class="tab-item {{showTabIndex==0?'active':''}}" bind:tap="changeTabIndex" data-value="0">预订</view> <view class="tab-item {{showTabIndex==0?'active':''}}" bind:tap="changeTabIndex" data-value="0">预订</view>
<view class="tab-item {{showTabIndex==1?'active':''}}" bind:tap="changeTabIndex" data-value="1">评价/问答</view>
<view class="tab-item {{showTabIndex==2?'active':''}}" bind:tap="changeTabIndex" data-value="2">详情/政策</view> <view class="tab-item {{showTabIndex==2?'active':''}}" bind:tap="changeTabIndex" data-value="2">详情/政策</view>
<view class="tab-item {{showTabIndex==1?'active':''}}" bind:tap="changeTabIndex" data-value="1">评价/问答</view>
</view> </view>
<view class="sku-type-container" wx:if="{{info&&showTabIndex==0}}"> <view class="sku-type-container" wx:if="{{info&&showTabIndex==0}}">
@ -154,13 +154,14 @@
<view class="mask" wx:if="{{showDate}}"> <view class="mask" wx:if="{{showDate}}">
<view class="mask-bg" bindtap="hideDate"></view> <view class="mask-bg" bindtap="hideDate"></view>
<view class="mask-content1"> <view class="mask-content1">
<view class="iconfont icon-close" bindtap="hideDate"></view>
<view class="mask-top-menu"> <view class="mask-top-menu">
<view class="{{skuShowIndex==0?'active':''}}" bind:tap="changeSimpleVal" data-keyname="skuShowIndex" data-val="0">预订选择</view> <view class="{{skuShowIndex==0?'active':''}}" bind:tap="changeSimpleVal" data-keyname="skuShowIndex" data-val="0">预订选择</view>
<view class="{{skuShowIndex==1?'active':''}}" bind:tap="changeSimpleVal" data-keyname="skuShowIndex" data-val="1">预订须知</view> <view class="{{skuShowIndex==1?'active':''}}" bind:tap="changeSimpleVal" data-keyname="skuShowIndex" data-val="1">预订须知</view>
</view> </view>
<scroll-view class="mask-scroll-content" scroll-y scroll-into-view="{{skuShowDomId}}" scroll-with-animation> <scroll-view class="mask-scroll-content" scroll-y scroll-into-view="{{skuShowDomId}}" scroll-with-animation>
<!-- <view class="iconfont icon-close" bindtap="hideDate"></view> -->
<date id="sku-show-0" wx:if="{{showDate2}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime" <date id="sku-show-0" wx:if="{{showDate2}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime"
product="{{product}}" datePrice="{{skuPriceDate}}" endDays="{{30}}"></date> product="{{product}}" datePrice="{{skuPriceDate}}" endDays="{{30}}"></date>

4
pages/info/sceneProductInfo/index.wxss

@ -934,8 +934,8 @@ line-height: 40rpx;
} }
.icon-close { .icon-close {
position: absolute; position: absolute;
top: 30rpx; top: 24rpx;
right: 30rpx; right: 24rpx;
} }

17
pages/order/components/date/index.js

@ -169,9 +169,10 @@ Component({
} }
}) })
} }
leftIndex = (leftIndex-1)>=0?(leftIndex-1):0;
this.setData({ this.setData({
scrollLeft: 70*leftIndex // scrollLeft: 70*leftIndex
scrollLeft: "scroll-item-"+leftIndex
}) })
setTimeout(() => { setTimeout(() => {
this.changeDate(seldDate) this.changeDate(seldDate)
@ -211,13 +212,16 @@ Component({
}, },
changeDate: function (e) { changeDate: function (e) {
let date = e.currentTarget ? e.currentTarget.dataset.date : e let date = e.currentTarget ? e.currentTarget.dataset.date : e
let index = e.currentTarget.dataset.index;
if (date.stock <= 0) return; if (date.stock <= 0) return;
if (date.stock == null) return; if (date.stock == null) return;
if (date.price == null) return; if (date.price == null) return;
index = (index-1)>=0?(index-1):0;
this.setData({ this.setData({
activeDate: date, activeDate: date,
moreFlag: true, moreFlag: true,
date_price:date.price date_price:date.price,
scrollLeft: "scroll-item-"+index
}) })
this.triggerEvent("onChangeDate", this.data.activeDate) this.triggerEvent("onChangeDate", this.data.activeDate)
this.getTimeStock() this.getTimeStock()
@ -225,17 +229,20 @@ Component({
// 修改日期 // 修改日期
onTapDay: function (e) { onTapDay: function (e) {
let threeDays = this.data.threeDays, flag = false; let threeDays = this.data.threeDays, flag = false;
threeDays.map(item => { threeDays.map((item,i) => {
if (item.date == e.detail.date) { if (item.date == e.detail.date) {
flag = true flag = true
} }
}) })
let index = this.data.datelist.findIndex(v=>v.date == e.detail.date)
e.detail.short_date = e.detail.date.substr(5, 5); e.detail.short_date = e.detail.date.substr(5, 5);
e.detail.date_price = this.data.activeDate.price; e.detail.date_price = this.data.activeDate.price;
index = (index-1)>=0?(index-1):0;
this.setData({ this.setData({
activeDate: e.detail, activeDate: e.detail,
showMoreDateFlag: false, showMoreDateFlag: false,
moreFlag: flag moreFlag: flag,
scrollLeft: "scroll-item-"+index
}) })
app.globalData.product.price = this.data.activeDate.price app.globalData.product.price = this.data.activeDate.price
this.triggerEvent("onChangeDate", this.data.activeDate) this.triggerEvent("onChangeDate", this.data.activeDate)

4
pages/order/components/date/index.wxml

@ -28,9 +28,9 @@
使用日期 使用日期
</view> </view>
<view class="dates-boxes"> <view class="dates-boxes">
<scroll-view scroll-x enable-flex scroll-left="{{scrollLeft}}" <scroll-view scroll-x enable-flex scroll-into-view="{{scrollLeft}}" scroll-with-animation
style="height: 133rpx;width: 580rpx;display: flex;overflow-x: scroll;flex-direction: row;"> style="height: 133rpx;width: 580rpx;display: flex;overflow-x: scroll;flex-direction: row;">
<view bindtap="changeDate" data-date="{{item}}" class="date-item{{activeDate.date==item.date?' active':''}}{{(item.stock<=0 || item.stock==null || item.price==null)?' disable':''}}" wx:for-index="index" wx:for="{{monthList}}"> <view id="scroll-item-{{index}}" bindtap="changeDate" data-date="{{item}}" data-index="{{index}}" class="date-item{{activeDate.date==item.date?' active':''}}{{(item.stock<=0 || item.stock==null || item.price==null)?' disable':''}}" wx:for-index="index" wx:for="{{monthList}}">
<!-- <view>{{tool.showAllSeldDate(item.date,index,today,tomorrow,afterTom)}}</view> --> <!-- <view>{{tool.showAllSeldDate(item.date,index,today,tomorrow,afterTom)}}</view> -->
<view>{{item.week}}</view> <view>{{item.week}}</view>
<view class="short-date">{{item.short_date}}</view> <view class="short-date">{{item.short_date}}</view>

Loading…
Cancel
Save