app-index-booking.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <view class="app-index-booking">
  3. <view class="top dir-left-nowrap cross-center">
  4. <image class="box-grow-0" src="../../../static/image/icon/icon-home-booking.png"></image>
  5. <view class="box-grow-1">预约</view>
  6. <app-form-id @click="jump(`/plugins/book/index/index`)">
  7. <view class="dir-left-nowrap cross-center">
  8. <view class="box-grow-0 more">更多</view>
  9. <image class="box-grow-0 icon" src="../../../static/image/icon/arrow-right.png"></image>
  10. </view>
  11. </app-form-id>
  12. </view>
  13. <view class="dir-left-nowrap list">
  14. <block v-for="(book, key) in newData" :key="key">
  15. <app-form-id @click="router_jump(book)">
  16. <view class="box-grow-0 dir-top-nowrap item">
  17. <view class="box-grow-0 cover-pic">
  18. <view class="out-dialog" v-if="book.goods_stock == 0 && appSetting.is_show_stock == '1'">
  19. <image :src="appSetting.is_use_stock == '1' ? appImg.plugins_out : appSetting.sell_out_pic"></image>
  20. </view>
  21. <app-image :img-src="book.cover_pic" width="224rpx" height="224rpx"></app-image>
  22. </view>
  23. <view class="box-grow-0 title t-omit-two">{{book.name}}</view>
  24. <view class="box-grow-1 dir-top-nowrap main-right price">
  25. <view v-if="book.is_level == 1">
  26. <app-member-price :price="book.level_price"></app-member-price>
  27. </view>
  28. <app-sup-vip :is_vip_card_user="book.vip_card_appoint.is_vip_card_user" margin="4rpx 0 0" v-if="book.vip_card_appoint.discount > 0" :discount="book.vip_card_appoint.discount"></app-sup-vip>
  29. <view :class="theme + '-color'">{{book.price_content}}</view>
  30. </view>
  31. </view>
  32. </app-form-id>
  33. </block>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {mapState, mapGetters} from 'vuex';
  39. import appSupVip from '../app-sup-vip/app-sup-vip.vue';
  40. import appMemberPrice from "../app-member-mark/app-member-price.vue";
  41. export default {
  42. name: "app-index-booking",
  43. components: {
  44. 'app-member-price': appMemberPrice,
  45. 'app-sup-vip': appSupVip,
  46. },
  47. props: {
  48. value: {
  49. type: Array,
  50. default() {
  51. return [];
  52. }
  53. }
  54. },
  55. data() {
  56. return {
  57. newData: this.value
  58. };
  59. },
  60. computed: {
  61. ...mapState({
  62. appImg: state => state.mallConfig.__wxapp_img.mall,
  63. appSetting: state => state.mallConfig.mall.setting,
  64. theme: state => state.mallConfig.theme
  65. }),
  66. ...mapGetters('mallConfig', {
  67. getVideo: 'getVideo'
  68. }),
  69. },
  70. methods: {
  71. jump(url) {
  72. this.$jump({
  73. url: url,
  74. open_type: 'navigate'
  75. })
  76. },
  77. router_jump(data) {
  78. // #ifndef MP-BAIDU
  79. if (data.video_url && this.getVideo == 1) {
  80. uni.navigateTo({
  81. url: `/pages/goods/video?goods_id=${data.id}&sign=booking`
  82. });
  83. } else {
  84. uni.navigateTo({
  85. url: data.page_url
  86. });
  87. }
  88. // #endif
  89. // #ifdef MP-BAIDU
  90. uni.navigateTo({
  91. url: data.page_url
  92. });
  93. // #endif
  94. }
  95. }
  96. }
  97. </script>
  98. <style scoped lang="scss">
  99. .vip-price {
  100. width: #{148upx};
  101. height: #{27upx};
  102. margin-top: #{4upx};
  103. .vip-item {
  104. height: #{27upx};
  105. width: 50%;
  106. }
  107. .vip-left {
  108. border-top-left-radius: #{13upx};
  109. border-bottom-left-radius: #{13upx};
  110. background-color: #4e4040;
  111. position: relative;
  112. }
  113. .vip-right {
  114. border-top-right-radius: #{13upx};
  115. border-bottom-right-radius: #{13upx};
  116. background: linear-gradient(45deg, #edc9a8, #fdebde);
  117. font-size: #{18upx};
  118. line-height: #{27upx};
  119. text-align: center;
  120. color: #4e4040;
  121. }
  122. .vip-icon {
  123. width: #{51upx};
  124. height: #{14upx};
  125. position:absolute;
  126. top: 50%;
  127. left: 50%;
  128. transform: translate(-50%, -50%);
  129. }
  130. }
  131. .app-index-booking {
  132. padding: #{24rpx};
  133. background-color: #ffffff;
  134. .top {
  135. color: #ff8831;
  136. font-size: $uni-font-size-general-one;
  137. height: #{80rpx};
  138. margin-bottom: #{16prx};
  139. image {
  140. width: #{46rpx};
  141. height: #{46rpx};
  142. display: block;
  143. margin-right: #{16rpx};
  144. }
  145. .more {
  146. font-size: $uni-font-size-general-two;
  147. margin-right: #{12rpx};
  148. color: $uni-general-color-two;
  149. }
  150. .icon {
  151. width: #{12rpx};
  152. height: #{22rpx};
  153. display: block;
  154. }
  155. }
  156. .list {
  157. overflow-x: auto;
  158. -webkit-overflow-scrolling: touch;
  159. .item {
  160. margin-right: #{16rpx};
  161. font-size: $uni-font-size-general-one;
  162. height: 100%;
  163. .cover-pic {
  164. width: #{224rpx};
  165. height: #{224rpx};
  166. display: block;
  167. margin-bottom: #{16rpx};
  168. position: relative;
  169. .out-dialog {
  170. width: #{224rpx};
  171. height: #{224rpx};
  172. position: absolute;
  173. top: 0;
  174. left: 0;
  175. z-index: 10;
  176. background-color: rgba(0,0,0,.5);
  177. image {
  178. width: #{224rpx};
  179. height: #{224rpx};
  180. }
  181. }
  182. }
  183. .title {
  184. width: #{224rpx};
  185. color: $uni-important-color-black;
  186. }
  187. .price {
  188. margin-bottom: #{8rpx};
  189. }
  190. }
  191. }
  192. }
  193. </style>