chosenposition.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="pages">
  3. <view class="" :style="{height: navHeight+'px' }"></view>
  4. <view class="navbar-box">
  5. <u-navbar title="选择区域" :safeAreaInsetTop="true" @leftClick="leftClick" :titleStyle="{color:'#fff'}" leftIconColor="#fff" bgColor="#EF1818"></u-navbar>
  6. </view>
  7. <view class="page-wrap">
  8. <view class="base-info">
  9. <view class="name">{{pageData.performName}}</view>
  10. <view class="time u-flex">
  11. <view class="title">{{pageData.day|checkDate}}</view>
  12. <text>{{pageData.performTimeStart}} - {{pageData.performTimeEnd}}</text>
  13. </view>
  14. </view>
  15. <view class="position-wrap">
  16. <!-- :style="{color:positionIndex==index?'#fff':item.seatColor,borderColor:item.seatColor,backgroundColor:positionIndex==index?item.seatColor:'#fff'}" -->
  17. <view class="item" :class="{active:positionIndex==index}" @click="positionClick(index)" v-for="(item,index) in positionArr" :key="index">
  18. <!-- <image class="icon" :src="item.icon" ></image> -->
  19. <view>{{item.seatTypeName}}</view>
  20. <text>¥ {{item.salePrice}}</text>
  21. </view>
  22. </view>
  23. <image class="position-img" :src="positionData.seatImg" mode="widthFix"></image>
  24. <view class="btn" @click="book">确定区域</view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import { systemInfo } from "@/mixin.js";
  30. export default {
  31. mixins: [systemInfo],
  32. data() {
  33. return {
  34. staticUrl:this.$commonConfig.staticUrl,
  35. params:{
  36. performId:'',
  37. },
  38. positionData:{},
  39. positionArr:[],
  40. positionIndex:0,
  41. pageData:{},
  42. }
  43. },
  44. onShow() {
  45. },
  46. onLoad(page) {
  47. // console.log('page',page);
  48. this.pageData = page;
  49. this.getSystemInfo();
  50. this.getPositionData();
  51. },
  52. methods: {
  53. leftClick(e){
  54. let pages = getCurrentPages();
  55. if(pages.length==1){
  56. uni.$u.route('/pages/index/index')
  57. }else{
  58. uni.navigateBack()
  59. };
  60. },
  61. getPositionData(){
  62. let params ={
  63. performId:this.pageData.performId,
  64. goodsId:this.pageData.goodsId,
  65. auditoriumId:this.pageData.auditoriumId,
  66. performTimeId:this.pageData.performTimeId,
  67. }
  68. this.$u.api.selectRegion(params).then(res=>{
  69. // console.log('getPositionData',res.data);
  70. this.positionData = res.data;
  71. this.positionArr = res.data.regionPriceList;
  72. }).catch(err=>{
  73. console.log('getPositionData',err);
  74. })
  75. },
  76. book(){
  77. if(this.positionArr.length<1){
  78. uni.toast('还没有座位信息')
  79. return
  80. }
  81. let seatType = this.positionArr[this.positionIndex];
  82. let params ={
  83. performId:this.pageData.performId,
  84. goodsId:this.pageData.goodsId,
  85. auditoriumId:this.pageData.auditoriumId,
  86. performTimeId:this.pageData.performTimeId,
  87. seatTypeId:seatType.seatTypeId,
  88. salePrice:seatType.salePrice
  89. }
  90. // params.price = this.positionArr[this.positionIndex].price;
  91. // params.positionName = this.positionArr[this.positionIndex].positionName;
  92. uni.$u.route('pages/bookticket',params)
  93. },
  94. positionClick(index){
  95. this.positionIndex = index;
  96. }
  97. }
  98. }
  99. </script>
  100. <style>
  101. page{
  102. background-color: #F7F7F9;
  103. }
  104. </style>
  105. <style lang="scss" scoped>
  106. .page-wrap{
  107. padding-top: 36rpx;
  108. }
  109. .base-info{
  110. background: #FFFFFF;
  111. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(221,221,221,0.4);
  112. border-radius: 16rpx;
  113. padding: 38rpx 28rpx;
  114. margin-bottom: 54rpx;
  115. .name{
  116. font-size: 28rpx;
  117. font-weight: bold;
  118. color: #2D2D2D;
  119. line-height: 42rpx;
  120. margin-bottom: 24rpx;
  121. }
  122. .time{
  123. font-size: 24rpx;
  124. font-weight: 400;
  125. color: #7F7F7F;
  126. .title{
  127. font-size: 24rpx;
  128. font-weight: 500;
  129. color: #F01414;
  130. margin-right: 26rpx;
  131. }
  132. }
  133. }
  134. .position-wrap{
  135. margin-bottom: 30rpx;
  136. display: grid;
  137. grid-template-columns: repeat(3, 1fr);
  138. gap: 14rpx;
  139. .item{
  140. // padding: 20rpx 40rpx 14rpx;
  141. padding: 20rpx 0;
  142. box-sizing: border-box;
  143. // flex: 1;
  144. border-radius: 8rpx;
  145. border: 2rpx solid #b7b7b7;
  146. // margin: 0 24rpx 24rpx;
  147. font-size: 24rpx;
  148. font-weight: 500;
  149. color: #7F7F7F;
  150. text-align: center;
  151. .icon{
  152. display: block;
  153. width: 36rpx;
  154. height: 36rpx;
  155. margin-right: 20rpx;
  156. }
  157. &.active{
  158. border-color: #EF1D1E;
  159. color: #EF1D1E;
  160. }
  161. }
  162. }
  163. .position-img{
  164. width: 100%;
  165. margin-bottom: 40rpx;
  166. }
  167. .btn{
  168. height: 92rpx;
  169. line-height: 92rpx;
  170. background: linear-gradient(90deg, #FF7878 0%, #ED0000 100%);
  171. border-radius: 46rpx;
  172. text-align: center;
  173. font-size: 28rpx;
  174. font-weight: 400;
  175. color: #FFFFFF;
  176. }
  177. </style>