Selaa lähdekoodia

海报使用前端生成,对接选择位置接口,对接订单结算信息接口

gcz 1 vuosi sitten
vanhempi
commit
951038783d
6 muutettua tiedostoa jossa 373 lisäystä ja 371 poistoa
  1. 215 0
      center/viewrecord.vue
  2. 7 303
      common/apiurl.js
  3. 22 18
      pages/bookticket.vue
  4. 44 26
      pages/chosenposition.vue
  5. 78 23
      pages/ticketlist.vue
  6. 7 1
      utils/filter.js

+ 215 - 0
center/viewrecord.vue

@@ -0,0 +1,215 @@
+<template>
+	<view class="pages">
+		<u-navbar
+			title="观看记录"
+			:placeholder="true"
+			:autoBack="false"
+			 @leftClick="leftClick"
+			 :safeAreaInsetTop="true"
+		>
+		</u-navbar>
+
+		<view class="page-wrap">
+			<mescroll-body class="" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption">
+				<!-- :down="downOption" :up="upOption" -->
+				<view class="list">
+					<view v-for="(item,index) in dataList" class="item u-flex" :class="{ show: show }" @click="itemClick(item)" :key="item.id">
+						<view class="text">
+							<view class="title u-line-1">{{ item.title }}</view>
+							<view class="con u-line-2">{{ item.centent }}</view>
+							<view class="time">{{ $u.timeFormat(item.onlineTime, 'yyyy-mm-dd') }}</view>
+						</view>
+						<image class="img" :src="item.mainImg||staticUrl+'/img/newsdetails-banner.png'" mode=""></image>
+					</view>
+				</view>
+			</mescroll-body>
+		</view>
+	</view>
+</template>
+
+<script>
+	// 引入mescroll-mixins.js
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+	export default {
+		mixins: [MescrollMixin], // 使用mixin
+		components: {
+			
+		},
+		data() {
+			return {
+				staticUrl:this.$commonConfig.staticUrl,
+				// // 下拉刷新的配置(可选, 绝大部分情况无需配置)
+				// downOption: {
+				// },
+				// // 上拉加载的配置(可选, 绝大部分情况无需配置)
+				upOption: {
+					page: {
+						size: 10 // 每页数据的数量,默认10
+					},
+					noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+					empty: {
+						tip: '暂无相关资讯,请重新搜索'
+					}
+				},
+				params:{
+					keyword:''
+				},
+				dataList:[],
+				observer: null,
+				show:false,
+				
+			}
+		},
+		onShow() {
+		},
+		onLoad() {
+			this.observer = uni.createIntersectionObserver(this,{observeAll: true});
+		},
+		onReady() {
+			this.observer.relativeToViewport().observe('.item', res => {
+			if (res.intersectionRatio > 0) {
+				console.log('resres',res);
+			  // 当元素出现在视口时执行动画
+			  // this.showAnimation(res);
+			  this.show = true;
+			}
+		  })
+		},
+		onUnload() {
+			if (this.observer) {
+				this.observer.disconnect()
+			}
+		},
+		methods: {
+			leftClick(e){
+				let pages = getCurrentPages();
+				if(pages.length==1){
+					uni.$u.route('/pages/index/index')
+				}else{
+					uni.navigateBack()
+				};
+			},
+			/*下拉刷新的回调, 重置列表为第一页 (此处可删,mixins已默认)
+			downCallback(){
+				this.mescroll.resetUpScroll();
+			},
+			/*上拉加载的回调*/
+			upCallback(page) {
+				// 此处可以继续请求其他接口
+				// if(page.num == 1){
+				// 	// 请求其他接口...
+				// }
+			
+				// 如果希望先请求其他接口,再触发upCallback,可参考以下写法
+				// if(!this.hasTypeId){
+				// 	// this.getid();
+				// 	this.mescroll.endErr();//没有接口暂时不调用
+				// 	return // 此处return,先获取xx
+				// }
+			
+				let pageNum = page.num; // 页码, 默认从1开始
+				let pageSize = page.size; // 页长, 默认每页10条
+			
+				let params = {
+					pageNum : page.num,
+					pageSize :  page.size,
+					title:this.params.keyword
+				}
+				// console.log('this.params',params);
+				this.$u.api.newsList(params).then(data => {
+					this.hasfetch = true;
+					// console.log('data',JSON.parse(JSON.stringify(data)));
+					// 接口返回的当前页数据列表 (数组)
+					let curPageData = data.data.rows;
+					// console.log('curPageData',JSON.parse(JSON.stringify(curPageData)));
+					// 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
+					let curPageLen = curPageData.length; 
+					// 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
+					// let totalPage =  data.data.data.totalPage; 
+					// 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
+					let totalSize = data.data.total; 
+					// 接口返回的是否有下一页 (true/false)
+					// let hasNext = data.xxx; 
+					// console.log('totalPage',totalPage,'curPageLen',curPageLen);
+					//设置列表数据
+					if(page.num == 1) this.dataList = []; //如果是第一页需手动置空列表
+					this.dataList = this.dataList.concat(curPageData); //追加新数据
+					// 请求成功,隐藏加载状态
+					//方法一(推荐): 后台接口有返回列表的总页数 totalPage
+					// this.mescroll.endByPage(curPageLen, totalPage); 
+					//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+					this.mescroll.endBySize(curPageLen, totalSize); 
+				}).catch(err => {
+					this.mescroll.endErr()
+					console.log(err)
+				});	
+			
+			},
+			/*若希望重新加载列表,只需调用此方法即可(内部会自动page.num=1,再主动触发up.callback)*/
+			reloadList() {
+				this.mescroll.resetUpScroll();
+			},
+			search(e){
+				this.reloadList();
+			},
+			itemClick(item){
+				// console.log('itemClick',item);
+				uni.$u.route('/pages/newsdetails', {
+					id: item.id,
+					type:'news'
+				});
+			}
+		}
+	}
+</script>
+<style>
+	page{
+		background-color: #F9FAFD;
+	}
+</style>
+<style lang="scss" scoped>
+.search-wrap{
+	padding: 20rpx 34rpx;
+}
+.list{
+	.item{
+		&.show{
+			animation: slide-top 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
+		}
+		background-color: #fff;
+		border-radius: 24rpx;
+		margin-bottom: 24rpx;
+		overflow: hidden;
+		.img{
+			border-radius: 12rpx;
+			width: 220rpx;
+			height: 200rpx;
+		}
+		.text{
+			height: 200rpx;
+			box-sizing: border-box;
+			padding:24rpx 28rpx;
+			flex: 1;
+			.title{
+				font-size: 28rpx;
+				font-weight: bold;
+				color: #333333;
+				margin-bottom: 16rpx;
+			}
+			.con{
+				font-size: 24rpx;
+				font-weight: 400;
+				color: #6B6B6B;
+				line-height: 36rpx;
+				margin-bottom: 20rpx;
+			}
+			.time{
+				font-size: 20rpx;
+				font-weight: 400;
+				color: #C0C0C0;
+				line-height: 22rpx;
+			}
+		}
+	}
+}
+</style>

+ 7 - 303
common/apiurl.js

@@ -59,7 +59,7 @@ const apiurl = {
 	},
 	// 添加浏览记录
 	addReadRecord: {
-		url: '/system/sysInformation/insertOrUpdate',
+		url: '/system/browseLog/insertOrUpdate',
 		type: 'post',
 	},
 	// 海报二维码
@@ -92,313 +92,17 @@ const apiurl = {
 		url: '/goods/performInfo/performerNotice',
 		type: 'get'
 	},
-	
-	
-	
-	
-	
-	//轮播图
-	swiperList: {
-		url: '/advList/pageList',
-		type: 'get'
-	},
-	//轮播图详情
-	swiperDetails: {
-		url: '/advList/selectById',
-		type: 'get'
-	},
-	// 商品分类信息
-	goodsTypeTree: {
-		url: '/goodsType/tree',
-		type: 'get'
-	},
-	// 商品分类信息列表
-	goodsTypeList: {
-		url: '/goodsType/list',
-		type: 'get'
-	},
-	// 商品列表
-	memberGoodList: {
-		url: '/goods/memberGoodList',
-		type: 'get'
-	},
-	// 商品详情
-	memberGoodDetails: {
-		url: '/goods/memberGetById',
-		type: 'get'
-	},
-	// 商品海报
-	getPoster: {
-		url: '/goods/getPoster',
-		type: 'put'
-	},
-	// 商品评价
-	commentList: {
-		url: '/goods/commentList',
-		type: 'get'
-	},
-	// 旭烁简介
-	xsGetIntro: {
-		url: '/shop/getIntro',
-		type: 'get'
-	},
-	// 提交合作加盟联系信息
-	shopContact: {
-		url: '/shopContact/insert',
-		type: 'post'
-	},
-	// 商行产品类型
-	shopGoodsType: {
-		url: '/dict/data/type/area_name',
-		type: 'get'
-	},
-	// 商行产品列表
-	shopGoods: {
-		url: '/shopGoods/pageList',
-		type: 'get'
-	},
-	// 热销商品列表
-	topGoodList: {
-		url: '/goods/selectTopGoodList',
-		type: 'get'
-	},
-	// 动态类型列表
-	shopNewsType: {
-		url: '/shopNewsType/list',
-		type: 'get'
-	},
-	// 动态列表
-	shopNewsList: {
-		url: '/shopNews/pageList',
-		type: 'get'
-	},
-	// 动态详情
-	shopNews: {
-		url: '/shopNews/selectById',
-		type: 'get'
-	},
-	// 动态详情增加浏览量
-	addViewCount: {
-		url: '/shopNews/addViewCount',
-		type: 'put'
-	},
-	// 购物车
-	// 商品加入购物车
-	addCart: {
-		url: '/goodsCart/insert',
-		type: 'post'
-	},
-	// 购物车列表
-	cartList: {
-		url: '/goodsCart/pageList',
-		type: 'get'
-	},
-	// 修改购物车商品数量
-	updateQuantity: {
-		url: '/goodsCart/updateQuantity',
-		type: 'post'
-	},
-	// 批量移除
-	deleteCarts: {
-		url: '/goodsCart/deleteByIds',
-		type: 'delete'
-	},
-	// 地址列表
-	addrList: {
-		url: '/memberAddress/pageList',
-		type: 'get'
-	},
-	// 添加地址
-	addAddr: {
-		url: '/memberAddress/insert',
-		type: 'post'
-	},
-	// 查看详情
-	getAddrById: {
-		url: '/memberAddress/selectById',
-		type: 'get'
-	},
-	// 修改地址
-	editAddr: {
-		url: '/memberAddress/update',
-		type: 'put'
-	},
-	// 删除地址
-	delAddr: {
-		url: '/memberAddress/deleteById',
-		type: 'delete'
-	},
-	// 查询登录用户订单量
-	statisticsOrder: {
-		url: '/order/statisticsOrder',
-		type: 'get'
-	},
-	// 订单列表
-	orderList: {
-		url: '/order/pageList',
-		type: 'get'
-	},
-	// 订单详情
-	orderDetails: {
-		url: '/order/selectById',
-		type: 'get'
-	},
-	// 添加商品浏览量
-	goodsAddView: {
-		url: '/goods/addViewCount',
-		type: 'put'
-	},
-	// 订单
-	// 订单提交
-	submitOrder: {
-		url: '/order/submit',
+	// 选择区域
+	selectRegion: {
+		url: '/merchant/merchantTheatreAuditorium/selectRegion',
 		type: 'post'
 	},
-	// 订单结算详情
+	// 订单结算信息
 	getSettlement: {
-		url: '/order/getSettlement',
-		type: 'post'
-	},
-	// 提交积分订单
-	submitCreditOrder: {
-		url: '/order/submitCreditOrder',
-		type: 'post'
-	},
-	// 订单退款提交
-	refundSubmit: {
-		url: '/order/refundSubmit',
-		type: 'post'
-	},
-	// 订单退款详情
-	refundInfo: {
-		url: '/order/refundInfo',
+		url: '/order/orderInfo/getSettlement',
 		type: 'post'
 	},
-	// 订单确认收货
-	confirmReceipt: {
-		url: '/order/confirm',
-		type: 'post'
-	},
-	// 评价
-	addGoodsComment: {
-		url: '/order/addGoodsComment',
-		type: 'post'
-	},
-	// 查看订单明细评价
-	getOrderDetailComment: {
-		url: '/order/getOrderDetailComment',
-		type: 'get'
-	},
-	// 订单查询物流
-	getDilevery: {
-		url: '/order/getDilevery',
-		type: 'post'
-	},
-	// 订单关闭
-	cancelOrder: {
-		url: '/order/cancel',
-		type: 'post'
-	},
-	// 订单支付
-	gotoPay: {
-		url: '/payment/gotoPay',
-		type: 'post'
-	},
-	// 支付查询
-	payQuery: {
-		url: '/payment/payQuery',
-		type: 'post'
-	},
-	// 积分规则
-	memberCreditDesc: {
-		url: '/memberCreditDesc/getByName',
-		type: 'get'
-	},
-	// 查询登录用户积分
-	memberCredit: {
-		url: '/memberCreditLog/getMemberCredit',
-		type: 'get'
-	},
-	// 查询积分明细列表
-	creditList: {
-		url: '/memberCreditLog/pageList',
-		type: 'get'
-	},
-	// 提交充值订单
-	addRechargeOrder: {
-		url: '/rechargeOrder/insert',
-		type: 'post'
-	},
-	// 充值
-	rechargePay: {
-		url: '/payment/rechargePay',
-		type: 'post'
-	},
-	// 是否存在支付密码
-	getExistPayPassword: {
-		url: '/memberInfo/getExistPayPassword',
-		type: 'get'
-	},
-	// 修改支付密码
-	updatePayPassword: {
-		url: '/memberInfo/updatePayPassword',
-		type: 'put'
-	},
-	// 忘记密码更改
-	resetPayPassword: {
-		url: '/memberInfo/resetPayPassword',
-		type: 'put'
-	},
-	// 校验支付密码
-	checkPayPassword: {
-		url: '/memberInfo/checkPayPassword',
-		type: 'post'
-	},
-	// 获取短信验证码
-	getCode: {
-		url: '/memberInfo/getCode',
-		type: 'post'
-	},
-	// 交易明细
-	selectBalanceLogList: {
-		url: '/memberInfo/selectBalanceLogList',
-		type: 'get'
-	},
-	// 注册协议
-	getRegistinfoByName: {
-		url: '/memberCreditDesc/getRegistinfoByName',
-		type: 'get'
-	},
-	// 带参小程序解码
-	uncompress: {
-		url: '/common/uncompress',
-		type: 'get'
-	},
-	// 会员权益列表
-	memberLevel: {
-		url: '/memberLevel/pageList',
-		type: 'get'
-	},
-	// 查询楼栋信息树
-	selectBrandFloorTree: {
-		url: '/brandInfo/selectBrandFloorTree',
-		type: 'get'
-	},
-	// 品牌分类
-	brandCategoryType: {
-		url: '/dict/data/type/brand_category_type',
-		type: 'get'
-	},
-	// 查询品牌信息
-	brandList: {
-		url: '/brandInfo/pageList',
-		type: 'get'
-	},
-	// 品牌详情
-	brandInfo: {
-		url: '/brandInfo/selectById',
-		type: 'get'
-	},
+	
 }
 
 

+ 22 - 18
pages/bookticket.vue

@@ -7,12 +7,12 @@
 		<view class="page-wrap">
 			<view class="base-info">
 				<view class="up u-flex">
-					<image class="img" :src="performInfo.showImg" alt="">
+					<image class="img" :src="pageContent.performImg" alt="">
 					<view class="text">
-						<view class="name text-item">{{performInfo.name}}-【成人票】</view>
-						<view class="time text-item">日期  {{pageData.day}}</view>
-						<view class="time text-item">场次  {{pageData.time}}</view>
-						<view class="num text-item">成人票 / {{pageData.positionName}}</view>
+						<view class="name text-item">{{pageContent.performName}}-{{pageContent.goodsName}}</view>
+						<view class="time text-item">日期  {{pageContent.timeDate}}({{pageContent.timeWeek}})</view>
+						<view class="time text-item">场次  {{pageContent.performTimeStart}} - {{pageContent.performTimeEnd}}</view>
+						<view class="num text-item">{{pageContent.goodsName}} / {{pageContent.seatTypeName}}</view>
 						<!-- <view class="position text-item">{{performInfo.name}}</view> -->
 					<!-- 	<view class="addr u-flex u-row-between">
 							<view class="u-line-1">地址:遵义市《伟大转折》演艺中心</view>
@@ -32,10 +32,10 @@
 					<view class="name">购票人信息</view>
 					<!-- <text>用于入园身份验证</text> -->
 				</view>
-				<view class="" v-if="vuex_member_info.isAuth">
-					<view class="item">姓名:{{vuex_member_info.name}}</view>
-					<view class="item">手机号:{{vuex_member_info.mobile|hidePhoneNumber}}</view>
-					<view class="item">身份证:{{vuex_member_info.id|maskID}}</view>
+				<view class="" v-if="pageContent.purchaser.idcard">
+					<view class="item">姓名:{{pageContent.purchaser.name}}</view>
+					<view class="item">手机号:{{pageContent.purchaser.mobile|hidePhoneNumber}}</view>
+					<view class="item">身份证:{{pageContent.purchaser.idcard|maskID}}</view>
 				</view>
 				<view class="un-auth" v-else @click="$u.route('center/factorauth',{from:'bookticket'})">
 					请先<text style="color: #ED0000;">实名认证</text>
@@ -91,6 +91,9 @@
 					<text>购票须知</text>
 				</view>
 				<view class="notice-item">
+					<u-parse :content="pageContent.ticketNotice"></u-parse>
+				</view>
+				<!-- <view class="notice-item">
 					1.由于设备故障等不可抗力因素,存在少量场次取消的情况,会
 					进行退票退款
 				</view>
@@ -99,7 +102,7 @@
 				</view>
 				<view class="notice-item">
 					3.取票码可以在“我的-订单页”中查看
-				</view>
+				</view> -->
 			</view>
 		</view>
 		<u-popup :show="visitorShow">
@@ -151,6 +154,8 @@
 				performId:'',
 				performInfo:{},
 				pageData:{},//上个页面传过来的数据
+				pageContent:{purchaser:{},ticketNotice:'aaa'},//页面信息
+				ticketNotice:'aaa',
 				cansubmit:true,
 				staticUrl:this.$commonConfig.staticUrl,
 				visitors:[],//游客
@@ -170,7 +175,7 @@
 			  let that = this;
 			  return this.visitors.reduce((total, item) => {
 				let price = null;
-				price = Number(that.pageData.price);
+				price = Number(that.pageData.salePrice);
 			    total += price;
 				return total;
 			  }, 0).toFixed(2);
@@ -190,7 +195,7 @@
 			this.pageData = page;
 			this.performId = page.performId;
 			this.getSystemInfo();
-			this.getPerformInfo();
+			this.getSettlement();
 		},
 		methods: {
 			leftClick(e){
@@ -201,13 +206,12 @@
 					uni.navigateBack()
 				};
 			},
-			getPerformInfo(){
-				this.$u.api.performInfo({id:this.performId}).then(res=>{
-					console.log('getPerformInfo',res.data);
-					this.performInfo =  res.data;
-					this.actorsArr = res.data.performerList;
+			getSettlement(){
+				this.$u.api.getSettlement(this.pageData).then(res=>{
+					// console.log('getSettlement',res.data);
+					this.pageContent =  res.data;
 				}).catch(err=>{
-					console.log('getPerformInfo',err);
+					console.log('getSettlement',err);
 				})
 			},
 			confirmVisitor(){

+ 44 - 26
pages/chosenposition.vue

@@ -6,19 +6,20 @@
 		</view>
 		<view class="page-wrap">
 			<view class="base-info">
-				<view class="name">{{params.performName}}</view>
+				<view class="name">{{pageData.performName}}</view>
 				<view class="time u-flex">
-					<view class="title">{{params.day|checkDate}}</view>
-					<text>{{$u.timeFormat(pageData.performTimeStart, 'hh:MM')}} - {{$u.timeFormat(pageData.performTimeEnd, 'hh:MM')}}</text>
+					<view class="title">{{pageData.day|checkDate}}</view>
+					<text>{{pageData.performTimeStart}} - {{pageData.performTimeEnd}}</text>
 				</view>
 			</view>
 			<view class="position-wrap u-flex u-row-center">
-				<view class="u-flex item" :class="{active:positionIndex==index}" @click="positionClick(index)" v-for="(item,index) in positionArr" :key="index">
-					<image class="icon" :src="item.icon" ></image>
-					<text>¥{{item.price}}</text>
+				<view class="u-flex item" :class="{active:positionIndex==index}" :style="{color:positionIndex==index?'#fff':item.seatColor,borderColor:item.seatColor,backgroundColor:positionIndex==index?item.seatColor:'#fff'}" @click="positionClick(index)" v-for="(item,index) in positionArr" :key="index">
+					<!-- <image class="icon" :src="item.icon" ></image> -->
+					<text style="margin-right: 5px;">{{item.seatTypeName}}</text>
+					<text>¥ {{item.salePrice}}</text>
 				</view>
 			</view>
-			<image class="position-img" :src="staticUrl+'/img/position-img.png'" mode="widthFix"></image>
+			<image class="position-img" :src="positionData.seatImg" mode="widthFix"></image>
 			<view class="btn" @click="book">确定区域</view>
 		</view>
 	</view>
@@ -32,33 +33,22 @@
 			return {
 				staticUrl:this.$commonConfig.staticUrl,
 				params:{
-					day:'',
-					goodsId:'',
 					performId:'',
-					performName:'',
-					time:'',
 				},
-				positionArr:[
-					{price:120,positionName:'vip区',icon:this.$commonConfig.staticUrl+'/img/position-1.png'},
-					{price:360,positionName:'vip区',icon:this.$commonConfig.staticUrl+'/img/position-2.png'},
-					{price:240,positionName:'vip区',icon:this.$commonConfig.staticUrl+'/img/position-3.png'}
-				],
+				positionData:{},
+				positionArr:[],
 				positionIndex:0,
 				pageData:{},
 			}
 		},
 		onShow() {
+			
 		},
 		onLoad(page) {
-			console.log('page',page);
+			// console.log('page',page);
 			this.pageData = page;
-			this.params.day = page.day;
-			this.params.goodsId = page.goodsId;
-			this.params.performId = page.performId;
-			this.params.performName = page.performName;
-			this.params.time = page.time;
 			this.getSystemInfo();
-
+			this.getPositionData();
 		},
 		methods: {
 			leftClick(e){
@@ -69,10 +59,38 @@
 					uni.navigateBack()
 				};
 			},
+			getPositionData(){
+				let params ={
+					performId:this.pageData.performId,
+					goodsId:this.pageData.goodsId,
+					auditoriumId:this.pageData.auditoriumId,
+					performTimeId:this.pageData.performTimeId,
+				}
+				this.$u.api.selectRegion(params).then(res=>{
+					// console.log('getPositionData',res.data);
+					this.positionData =  res.data;
+					this.positionArr = res.data.regionPriceList;
+				}).catch(err=>{
+					console.log('getPositionData',err);
+				})
+			},
 			book(){
-				this.params.price = this.positionArr[this.positionIndex].price;
-				this.params.positionName = this.positionArr[this.positionIndex].positionName;
-				uni.$u.route('pages/bookticket',this.params)
+				if(this.positionArr.length<1){
+					uni.toast('还没有座位信息')
+					return
+				}
+				let seatType = this.positionArr[this.positionIndex];
+				let params ={
+					performId:this.pageData.performId,
+					goodsId:this.pageData.goodsId,
+					auditoriumId:this.pageData.auditoriumId,
+					performTimeId:this.pageData.performTimeId,
+					seatTypeId:seatType.seatTypeId,
+					salePrice:seatType.salePrice
+				}
+				// params.price = this.positionArr[this.positionIndex].price;
+				// params.positionName = this.positionArr[this.positionIndex].positionName;
+				uni.$u.route('pages/bookticket',params)
 			},
 			positionClick(index){
 				this.positionIndex = index;

+ 78 - 23
pages/ticketlist.vue

@@ -60,7 +60,7 @@
 					<view class="title">演出场次</view>
 					<view class="session">
 						<view class="session-item" :class="{active:sessionIndex==index}" @click="sessionClick(index)" v-for="(date,index) in sessionList" :key="index">
-							{{ $u.timeFormat(date.performTimeStart, 'hh:MM') }} - {{ $u.timeFormat(date.performTimeEnd, 'hh:MM') }}
+							{{ date.performTimeStart}} - {{date.performTimeEnd}}
 						</view>
 					</view>
 					<view class="empty" v-if="auditoriumList.length>=1&&sessionList.length<1">
@@ -82,9 +82,8 @@
 								<!-- 购票须知
 								<u-icon name="arrow-right" color="#7F7F7F" size="24rpx"></u-icon> -->
 							</view>
-							<view class="btn" @click="book(item)">预定</view>
 							<view class="btn" @click="book(item)" v-if="item.quantity>0&&sessionList.length>=1">预定</view>
-							<view class="btn disabled" v-else>票</view>
+							<view class="btn disabled" v-else>无票</view>
 						</view>
 					</view>
 				</view>
@@ -155,6 +154,7 @@
 				</view>
 			</view>
 		</u-popup>
+		<canvas canvas-id="canvas" class="canvas" style="width: 670px; height: 900px;"></canvas>
 	</view>
 </template>
 
@@ -227,14 +227,14 @@
 					this.auditoriumList  = res.data.theatreList[0].auditoriumList;
 					this.ticketTypeList = res.data.goodsList;
 					this.getTimes()
-					console.log('auditoriumList',this.auditoriumList);
+					// console.log('auditoriumList',this.auditoriumList);
 				}).catch(err=>{
 					console.log('getPoster',err);
 				})
 			},
 			getPerformInfo(){
 				this.$u.api.performInfo({id:this.performId}).then(res=>{
-					console.log('getPerformInfo',res.data);
+					// console.log('getPerformInfo',res.data);
 					this.performInfo =  res.data;
 					this.actorsArr = res.data.performerList;
 				}).catch(err=>{
@@ -243,7 +243,7 @@
 			},
 			getPerformerNotice(){
 				this.$u.api.performerNotice({performId:this.performId}).then(res=>{
-					console.log('getPerformerNotice',res.data);
+					// console.log('getPerformerNotice',res.data);
 					this.formerNotice =  res.data.performNotice;
 				}).catch(err=>{
 					console.log('getPerformerNotice',err);
@@ -260,8 +260,12 @@
 				};
 				// console.log('param',param);
 				this.$u.api.getAuditoriumTimes(param).then(res=>{
-					console.log('getTimes',res.data);
-					this.sessionList = res.data.list;
+					// console.log('getTimes',res.data);
+					this.sessionList = res.data.list.map(item=>{
+						item.performTimeStart = item.performTimeStart;
+						item.performTimeEnd = item.performTimeEnd;
+						return item
+					});
 				}).catch(err=>{
 					console.log('getPoster',err);
 				})
@@ -290,30 +294,30 @@
 				this.auditoriumIndex = index;
 			},
 			confirmCalendar(e){
-				console.log('confirmCalendar',e);
+				// console.log('confirmCalendar',e);
 				this.setDate( new Date(e) );
 				this.dateIndex = 0;
-				console.log('maxDate',this.maxDate);
-				console.log('dateList',this.dateList);
+				// console.log('maxDate',this.maxDate);
+				// console.log('dateList',this.dateList);
 				this.calendarShow = false;
 			},
 			closeCalendar(){
 				this.calendarShow = false;
 			},
 			tabsClick(e){
-				console.log('tabsClick',e);
+				// console.log('tabsClick',e);
 				this.tabsIndex = e.index;
 			},
 			sessionClick(index){
 				this.sessionIndex = index;
 			},
 			book(item){
-				console.log('book',item);
-				console.log('performInfo',this.performInfo);
+				// console.log('book',item);
+				// console.log('performInfo',this.performInfo);
 				let session = this.sessionList[this.sessionIndex];
-				console.log('session',session);
-				let performTimeStart = this.$u.timeFormat(session.performTimeStart, 'hh:MM');
-				let performTimeEnd = this.$u.timeFormat(session.performTimeEnd, 'hh:MM');
+				// console.log('session',session);
+				let performTimeStart = session.performTimeStart;
+				let performTimeEnd = session.performTimeEnd;
 				let dateOBJ = this.dateList[this.dateIndex];
 				uni.$u.route('pages/chosenposition',{
 					goodsId:item.id,
@@ -322,21 +326,68 @@
 					day:`${dateOBJ.year}-${dateOBJ.month}-${dateOBJ.day}`,
 					performTimeStart:session.performTimeStart,
 					performTimeEnd:session.performTimeEnd,
+					performTimeId:session.id,
+					auditoriumId:this.auditoriumList[this.auditoriumIndex].id
 				})
 			},
 			openShare(){
 				this.shareShow = true;
+				// 前端生成海报开始
+				let that = this;
+				 const ctx = uni.createCanvasContext('canvas', this);
+				// 加载海报背景图
+				uni.getImageInfo({
+				  src: this.performInfo.posterImg,
+				  success: res1 => {
+					const img1 = res1.path;
+			
+					// 加载海报二维码
+					uni.getImageInfo({
+					  src: this.performInfo.appletQrcode,
+					  success: res2 => {
+						const img2 = res2.path;
+			
+						// 绘制海报背景图
+						ctx.drawImage(img1, 0, 0, 670, 900);
+			
+						// 绘制海报二维码
+						ctx.drawImage(img2, 468, 724, 188, 166);
+			
+						// 绘制完成后导出图片并显示
+						ctx.draw(false, () => {
+						  uni.canvasToTempFilePath({
+							canvasId: 'canvas',
+							success: res3 => {
+							  this.posterSrc = res3.tempFilePath;
+							},
+							fail: err => {
+							  console.error(err);
+							},
+						  }, this);
+						});
+					  },
+					  fail: err2 => {
+						console.error(err2);
+					  },
+					});
+				  },
+				  fail: err1 => {
+					console.error(err1);
+				  },
+				});
+				// 前端生成海报结束
 			},
 			// 海报相关开始
 			getPoster(item){
 				this.posterShow = true;
 				this.shareShow = false;
-				this.$u.api.performQrcode({performId:this.performId}).then(res=>{
-					this.posterSrc = res.data.imageUrl;
-					// console.log('getPoster',res.data);
-				}).catch(err=>{
-					console.log('getPoster',err);
-				})
+				// 后端生成海报
+				// this.$u.api.performQrcode({performId:this.performId}).then(res=>{
+				// 	this.posterSrc = res.data.imageUrl;
+				// 	// console.log('getPoster',res.data);
+				// }).catch(err=>{
+				// 	console.log('getPoster',err);
+				// })
 			},
 			saveImage() {
 				let that = this;
@@ -629,4 +680,8 @@
 		}
 	}
 }
+.canvas{
+	position: absolute;
+	left: -99999px;
+}
 </style>

+ 7 - 1
utils/filter.js

@@ -114,7 +114,13 @@ Vue.filter('checkDate', function(date) {
 	  return "明天";
 	} else {
 	  let days = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
-	  return days[date.getDay()];
+	  // return days[date.getDay()];
+	  let diffDays = Math.floor((date.getTime() - today.getTime()) / (1000 * 3600 * 24));
+	  if (diffDays > 7) {
+		return date.toLocaleDateString();
+	  } else {
+		return days[date.getDay()];
+	  }
 	}
 });