Browse Source

剧场演出

master
jiazhipeng 1 year ago
parent
commit
817290aaf2
  1. 8
      pages/component/calendarTheatre/index.js
  2. 3
      pages/component/calendarTheatre/index.wxml
  3. 5
      pages/component/calendarTheatre/index.wxss
  4. 8
      pages/info/showInfo/index.wxml
  5. 13
      pages/info/showInfo/index.wxss
  6. 8
      pages/list/theatre/index.wxss
  7. 31
      pages/order/show/index.js
  8. 72
      pages/pbService/web/index.js
  9. 21
      project.private.config.json

8
pages/component/calendarTheatre/index.js

@ -80,15 +80,19 @@ Component({
dayNums = new Date(nextYear, nextMonth, 0).getDate(); dayNums = new Date(nextYear, nextMonth, 0).getDate();
} }
arrLen = startWeek + dayNums; arrLen = startWeek + dayNums;
console.log(this.data.dates)
for (let i = 0; i < arrLen; i++) { for (let i = 0; i < arrLen; i++) {
if (i >= startWeek) { if (i >= startWeek) {
num = i - startWeek + 1; num = i - startWeek + 1;
let date =util.formatDate(new Date(year +'/' + (month + 1) +'/' + num)); let date =util.formatDate(new Date(year +'/' + (month + 1) +'/' + num));
let day = this.properties.datelist.find(x=>x.date==date)
obj = { obj = {
isToday: '' + year + (month + 1) + num, isToday: '' + year + (month + 1) + num,
dateNum: num, dateNum: num,
weight: 5, weight: 5,
date:date date:date,
haveStock: day?day.haveStock:false
} }
} else { } else {
obj = {}; obj = {};
@ -101,6 +105,8 @@ Component({
this.setData({ this.setData({
dateArr: dateArr dateArr: dateArr
}) })
console.log(dateArr)
let nowDate = new Date(); let nowDate = new Date();
let nowYear = nowDate.getFullYear(); let nowYear = nowDate.getFullYear();

3
pages/component/calendarTheatre/index.wxml

@ -15,6 +15,9 @@
<view class="date-head{{dates[item.date]?'':' disable'}}" > <view class="date-head{{dates[item.date]?'':' disable'}}" >
<view>{{item.dateNum}}</view> <view>{{item.dateNum}}</view>
</view> </view>
<view class="date-dot-tip" wx:if="{{item.haveStock}}">·</view>
</view> </view>
</view> </view>
</view> </view>

5
pages/component/calendarTheatre/index.wxss

@ -72,6 +72,11 @@ padding-right: 0.6rem;
.date-head.disable { .date-head.disable {
color: #999; color: #999;
} }
.date-dot-tip{
font-size: 40rpx;
line-height: 26rpx;
color: #D62828;
}
.date-tip { .date-tip {
font-size: 24rpx; font-size: 24rpx;
line-height: 26rpx; line-height: 26rpx;

8
pages/info/showInfo/index.wxml

@ -6,11 +6,11 @@
<view wx:if="{{info}}"> <view wx:if="{{info}}">
<view class="top-info"> <view class="top-info">
<view class="product-base-info"> <view class="product-base-info">
<image class="headImg" src="{{info.headimg}}"></image> <image class="headImg" src="{{info.listimg[0]}}" mode="aspectFill"></image>
<view class="base-info"> <view class="base-info">
<view class="title textOver2">{{info.title}}</view> <view class="title textOver2">{{info.title}}</view>
<view class="tags-box textOver"> <view class="tags-box textOver">
<view class="tag textOver" wx:for="{{info.display_tags}}">{{item}}<view class="line"></view> <view class="tag textOver" wx:for="{{info.display_tags}}" wx:key="index">{{item}}<view class="line"></view>
</view> </view>
</view> </view>
<view class="subtitle">演出时间:<text>{{info.subtitle}}</text></view> <view class="subtitle">演出时间:<text>{{info.subtitle}}</text></view>
@ -82,10 +82,10 @@
<view class="info-box" id="box3"> <view class="info-box" id="box3">
<view class="info-title">推荐演出</view> <view class="info-title">推荐演出</view>
<view class="pro-list"> <view class="pro-list no-scrollbar">
<view class="proitem" wx:for="{{tjList}}" bindtap="gotoDetail" data-item="{{item}}"> <view class="proitem" wx:for="{{tjList}}" bindtap="gotoDetail" data-item="{{item}}">
<view class="item-hd"> <view class="item-hd">
<image src="{{item.headimg}}"></image> <image src="{{item.headimg}}" mode="aspectFill"></image>
</view> </view>
<view class="item-bm"> <view class="item-bm">
<view class="protitle textOver">{{item.title}}</view> <view class="protitle textOver">{{item.title}}</view>

13
pages/info/showInfo/index.wxss

@ -756,18 +756,21 @@ margin-right: 29rpx;
display: flex; display: flex;
/* justify-content: space-between; */ /* justify-content: space-between; */
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: nowrap;
width: 100%;
overflow-x: auto;
overflow-y: hidden;
} }
.proitem{ .proitem{
width: 213rpx; width: 227rpx;
margin-right: 15rpx; margin-right: 10rpx;
} }
.proitem:last-of-type{ .proitem:last-of-type{
margin-right: 0; margin-right: 0;
} }
.item-hd image{ .item-hd image{
width: 213rpx; width: 227rpx;
height: 273rpx; height: 200rpx;
background: #D1D7CB; background: #D1D7CB;
border-radius: 13rpx; border-radius: 13rpx;
} }

8
pages/list/theatre/index.wxss

@ -53,8 +53,8 @@ page{
justify-content: space-between; justify-content: space-between;
} }
.item image { .item image {
width: 187rpx; width: 227rpx;
height: 240rpx; height: 200rpx;
background: #D1D7CB; background: #D1D7CB;
border-radius: 13rpx; border-radius: 13rpx;
margin-right: 30rpx; margin-right: 30rpx;
@ -104,12 +104,12 @@ page{
font-weight: 500; font-weight: 500;
font-size: 31rpx; font-size: 31rpx;
color: #000; color: #000;
margin-bottom: 32rpx; margin-bottom: 9rpx;
} }
.info .subtitle { .info .subtitle {
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
margin-bottom: 19rpx; margin-bottom: 9rpx;
} }

31
pages/order/show/index.js

@ -95,6 +95,7 @@ Page({
}, },
// 初始化日期 // 初始化日期
initDate () { initDate () {
let _this = this
// 设置90天日期 // 设置90天日期
let dateArr = [] let dateArr = []
let now = new Date().getTime() let now = new Date().getTime()
@ -110,6 +111,10 @@ Page({
// 默认选中第一天 // 默认选中第一天
let param = {currentTarget: {dataset: {date: 0}}} let param = {currentTarget: {dataset: {date: 0}}}
this.changeDate(param) this.changeDate(param)
// console.log(dateArr)
setTimeout(() => {
this.setPriceCalendar()
}, 500);
}, },
// 选择日期 // 选择日期
@ -273,6 +278,32 @@ Page({
// }) // })
}, },
setPriceCalendar () {
let _this = this
let skus = this.data.product.sku || []
wx.showLoading()
Promise.all(skus.map(x=>commonApi.user_post("product/product_date_price", {
start_date: _this.data.dateArr[0].date,
end_date: _this.data.dateArr[this.data.dateArr.length-1].date,
sku_id: x.id
}))).then((res)=>{
let timData = res.map(v=>v.data)
_this.data.dateArr.forEach((item,i)=>{
item.haveStock = timData.some(x=>x[i].stock>0)
})
console.log(_this.data.dateArr)
_this.setData({
dateArr: _this.data.dateArr
})
}).finally(()=>{
wx.hideLoading();
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

72
pages/pbService/web/index.js

@ -1,6 +1,8 @@
// pages/pbService/web/index.js // pages/pbService/web/index.js
let app = getApp() let app = getApp()
import commonApi from "../../../utils/https/common"
import userApi from "../../../utils/https/user" import userApi from "../../../utils/https/user"
import https from "../../../utils/https.js"
Page({ Page({
/** /**
@ -16,10 +18,52 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
options.weburl = decodeURIComponent(options.weburl) let weburl = decodeURIComponent(options.weburl)
// if(options.weburl.indexOf('m.cloud.sz-trip.com')!=-1){ weburl = 'https://test.m.cloud.sz-trip.com/petYou2024?cnylCode=oK7OHccT'
console.log(weburl)
// 获取路径参数
let webParam = {}
try {
let paramStr = weburl.split('?')[1]
if (paramStr) {
paramStr.split('&').forEach((param) => {
let parts = param.split('=');
webParam[(parts[0])] = (parts[1]);
});
}
} catch(e) {
console.log(e)
}
console.log(webParam)
let lowerUrl = weburl.toLowerCase()
// 宠你有礼 市民卡授权
if (lowerUrl.indexOf('petyou2024') && webParam.cnylCode) {
commonApi._get("uservice/user/loginByCnyl", {
cnylCode: webParam.cnylCode
}).then(res => {
if(res.data && res.data.id && res.data.token) {
wx.setStorageSync("jstrip_userid", res.data.id)
wx.setStorageSync("jstrip_token", res.data.token)
wx.setStorageSync("jstrip_userInfo", res.data)
weburl += '&token='+res.data.token
}
}).finally(()=>{
this.setData({
webUrl:weburl
})
})
} else {
this.setData({
webUrl:weburl
})
}
// if(weburl.indexOf('m.cloud.sz-trip.com')!=-1){
// userApi.user_post("user/getMyInfo").then(res=>{ // userApi.user_post("user/getMyInfo").then(res=>{
// let weburl = options.weburl // let weburl = weburl
// if(weburl.indexOf('?')!=-1){ // if(weburl.indexOf('?')!=-1){
// weburl += '&token='+res.data.token; // weburl += '&token='+res.data.token;
// } // }
@ -32,10 +76,10 @@ Page({
// }) // })
// }) // })
// } // }
// else if(options.weburl.indexOf('m.jszhwlpt.com')!=-1 || options.weburl.indexOf('wechat.b2c.zj-trip.net')!=-1){ // else if(weburl.indexOf('m.jszhwlpt.com')!=-1 || weburl.indexOf('wechat.b2c.zj-trip.net')!=-1){
// // 如果是去苏心游或者镇江的话 // // 如果是去苏心游或者镇江的话
// userApi.user_post("user/getJumpThirdAppCode",{}).then(res=>{ // userApi.user_post("user/getJumpThirdAppCode",{}).then(res=>{
// let weburl = options.weburl // let weburl = weburl
// if(weburl.indexOf('?')!=-1){ // if(weburl.indexOf('?')!=-1){
// weburl += '&original_sys_name=jdsz&auth_code='+res.data; // weburl += '&original_sys_name=jdsz&auth_code='+res.data;
// } // }
@ -49,9 +93,7 @@ Page({
// }) // })
// } // }
// else { // else {
this.setData({
webUrl:options.weburl
})
// } // }
}, },
handleMessage(data) { handleMessage(data) {
@ -61,6 +103,20 @@ Page({
// }) // })
console.log('打印22222',data); console.log('打印22222',data);
}, },
loginByCode () {
// 市民卡
if(options && options.cnylCode) {
commonApi._post("uservice/user/loginByCnyl", {
cnylCode: options.cnylCode
}).then(res => {
if(res.data && res.data.id && res.data.token) {
https.set_logininfo(res);
}
})
}
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

21
project.private.config.json

@ -6,6 +6,27 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "pages/pbService/web/index",
"pathName": "pages/pbService/web/index",
"query": "weburl=https%253A%252F%252Fm.cloud.sz-trip.com%252FpetYou2024%253FcnylCode%253D123456=",
"launchMode": "default",
"scene": null
},
{
"name": "pages/pbService/web/index",
"pathName": "pages/pbService/web/index",
"query": "https%3A%2F%2Fm.cloud.sz-trip.com%2FpetYou2024%3FcnylCode%3D123456",
"launchMode": "default",
"scene": null
},
{
"name": "pages/pbService/web/index",
"pathName": "pages/pbService/web/index",
"query": "weburl=https%253A%252F%252Fm.cloud.sz-trip.com%252FaiPlay",
"launchMode": "default",
"scene": null
},
{ {
"name": "pages/info/showInfo/index", "name": "pages/info/showInfo/index",
"pathName": "pages/info/showInfo/index", "pathName": "pages/info/showInfo/index",

Loading…
Cancel
Save