Browse Source

剧场演出改版

master
jiazhipeng 1 year ago
parent
commit
d831656186
  1. 2
      app.js
  2. 12
      app.wxss
  3. 24
      pages/order/show/index.js
  4. 22
      pages/order/show/index.wxml
  5. 6
      pages/order/show/index.wxss

2
app.js

@ -21,7 +21,7 @@ App({
unique_key: "wechatxcx" unique_key: "wechatxcx"
}).then(res => { }).then(res => {
let data = JSON.parse(res.data); let data = JSON.parse(res.data);
data.isTest = data.isTest149? true : false; data.isTest = data.isTest150? true : false;
this.globalData.configJson = data this.globalData.configJson = data
}).then(() => { }).then(() => {
// 获取ui配置文件 // 获取ui配置文件

12
app.wxss

@ -2,6 +2,18 @@
@import './iconfont/iconfont.wxss'; @import './iconfont/iconfont.wxss';
@import "./utils/wxParse/wxParse.wxss"; @import "./utils/wxParse/wxParse.wxss";
/* 公祭日置灰 需手动发布 */
/* page::before{
content: "";
width: 100vw;
height: 100vh;
position: fixed;
inset: 0;
backdrop-filter: grayscale(100%);
pointer-events: none;
z-index: 99999;
} */
.container { .container {
height: 100%; height: 100%;
display: flex; display: flex;

24
pages/order/show/index.js

@ -9,6 +9,9 @@ Page({
*/ */
data: { data: {
productId: null, productId: null,
dateArrPage: [], // 页面日期
showMore: false,
initFinsih: false,
dateArr: [], dateArr: [],
times:[], times:[],
skuArr: [], skuArr: [],
@ -99,7 +102,7 @@ Page({
// 设置90天日期 // 设置90天日期
let dateArr = [] let dateArr = []
let now = new Date().getTime() let now = new Date().getTime()
for(let i=0 ;i<=90;i++) { for(let i=0 ;i<=60;i++) {
let date = now+i*24*60*60*1000 let date = now+i*24*60*60*1000
dateArr.push({date: util.formatDate(new Date(date))}) dateArr.push({date: util.formatDate(new Date(date))})
} }
@ -109,8 +112,8 @@ Page({
}) })
this.setData({dateArr: dateArr}) this.setData({dateArr: dateArr})
// 默认选中第一天 // 默认选中第一天
let param = {currentTarget: {dataset: {date: 0}}} // let param = {currentTarget: {dataset: {date: 0}}}
this.changeDate(param) // this.changeDate(param)
// console.log(dateArr) // console.log(dateArr)
setTimeout(() => { setTimeout(() => {
this.setPriceCalendar() this.setPriceCalendar()
@ -292,11 +295,24 @@ Page({
let timData = res.map(v=>v.data) let timData = res.map(v=>v.data)
_this.data.dateArr.forEach((item,i)=>{ _this.data.dateArr.forEach((item,i)=>{
item.haveStock = timData.some(x=>x[i]&&x[i].stock>0) item.haveStock = timData.some(x=>x[i]&&x[i].stock>0)
item.itemIndex = i
}) })
let dateArrPage = _this.data.dateArr.filter(v=>v.haveStock)
console.log(_this.data.dateArr) console.log(_this.data.dateArr)
_this.setData({ _this.setData({
dateArr: _this.data.dateArr dateArr: _this.data.dateArr,
dateArrPage: dateArrPage.slice(0,3),
showMore: dateArrPage.length>3,
initFinsih: true,
dateindex: dateArrPage[0]?dateArrPage[0].itemIndex:0,
}) })
// 默认选中第一天
if (dateArrPage[0]) {
let param = {currentTarget: {dataset: {date: dateArrPage[0].itemIndex}}}
_this.changeDate(param)
}
}).finally(()=>{ }).finally(()=>{
wx.hideLoading(); wx.hideLoading();
}) })

22
pages/order/show/index.wxml

@ -5,13 +5,19 @@
<view class="order-name">{{product.title}}</view> <view class="order-name">{{product.title}}</view>
</view> </view>
<view class="box"> <view class="box">
<view class="box-content"> <view class="box-content" wx:if="{{dateArrPage.length>0}}">
<view class="box-title">选择日期</view> <view class="box-title">选择日期</view>
<view class="flex-between"> <view class="date-box-page-sadsdsd">
<view class="tag {{dateindex==0?'active':''}}" bindtap="changeDate" data-date="0">今天 {{dateArr[0].short_date}}</view> <view wx:for="{{dateArrPage}}" date-item="{{item}}"
<view class="tag {{dateindex==1?'active':''}}" bindtap="changeDate" data-date="1">明天 {{dateArr[1].short_date}}</view> class="tag {{dateindex==item.itemIndex?'active':''}}" bindtap="changeDate" data-date="{{item.itemIndex}}">
<view class="tag {{dateindex==2?'active':''}}" bindtap="changeDate" data-date="2">后天 {{dateArr[2].short_date}}</view> {{dateArr[item.itemIndex].short_date}}
<view class="tag {{dateindex>2?'active':''}}" bindtap="showMoreDate">{{dateindex>2?dateArr[dateindex].short_date:'更多'}}</view> </view>
<!-- <view class="tag {{dateindex==1?'active':''}}" bindtap="changeDate" data-date="1">明天 {{dateArr[1].short_date}}</view>
<view class="tag {{dateindex==2?'active':''}}" bindtap="changeDate" data-date="2">后天 {{dateArr[2].short_date}}</view> -->
<view wx:if="{{showMore}}" class="tag {{(dateindex!=dateArrPage[0].itemIndex)&&(dateindex!=dateArrPage[1].itemIndex)&&(dateindex!=dateArrPage[2].itemIndex)?'active':''}}" bindtap="showMoreDate">
{{(dateindex!=dateArrPage[0].itemIndex)&&(dateindex!=dateArrPage[1].itemIndex)&&(dateindex!=dateArrPage[2].itemIndex)?
dateArr[dateindex].short_date:'更多'}}
</view>
</view> </view>
</view> </view>
@ -45,6 +51,10 @@
</view> </view>
<view wx:if="{{initFinsih && dateArrPage.length<=0}}">
<image class="no-data" src="https://static.ticket.sz-trip.com/uploads/20241129/894f45acb51cffcdddd5a2ddd695660b.png"></image>
<view style="text-align: center;color: #666;padding-top: 40rpx;">暂无场次</view>
</view>
<!-- <view class="number-box box-content"> <!-- <view class="number-box box-content">
<text>数量</text> <text>数量</text>

6
pages/order/show/index.wxss

@ -56,6 +56,7 @@ page {
font-size: 27rpx; font-size: 27rpx;
color: #333333; color: #333333;
margin-bottom: 17rpx; margin-bottom: 17rpx;
margin-right: 20rpx;
} }
.tag.active{ .tag.active{
@ -222,4 +223,9 @@ page {
height: 129.33rpx; height: 129.33rpx;
display: block; display: block;
margin: 198rpx auto 0; margin: 198rpx auto 0;
}
.date-box-page-sadsdsd{
display: flex;
flex-wrap: nowrap;
} }
Loading…
Cancel
Save