chosenposition.vue 4.2 KB

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