app-product-list.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view class="goods-list dir-top-nowrap">
  3. <!-- <view v-if="goodsList.length > 0" class="row dir-left-nowrap main-between box-grow-1" v-for="(item, key) in goodsList" :key="key" >
  4. <view class="item box-grow-0" v-for="(good, index) in item" :key="index" @click="route_go(good)">
  5. <view class="image-name dir-top-nowrap main-left">
  6. <view class="out-dialog" v-if="good.goods_stock == 0 && appSetting.is_show_stock == '1'">
  7. <image :src="appSetting.is_use_stock == '1' ? appImg.plugins_out : appSetting.sell_out_pic"></image>
  8. </view>
  9. <image :lazy-load="true" class="cover_pic" :src="good.cover_pic"></image>
  10. <view class="name t-omit">{{good.name}}</view>
  11. </view>
  12. <view class="content dir-top-nowrap main-right">
  13. <view class="price-bottom" v-if="good.is_level == 1">
  14. <app-member-price :price="good.level_price"></app-member-price>
  15. </view>
  16. <view v-if="good.discount > 0">
  17. <app-sup-vip :is_vip_card_user="good.is_vip_card_user" :discount="good.discount"></app-sup-vip>
  18. </view>
  19. <view class="price-btn dir-left-nowrap main-between cross-center">
  20. <view class="price">{{good.price_str}}</view>
  21. <view v-if="good.goods_stock != 0" class="btn">预约</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view> -->
  26. <view class="row" v-for="(item, key) in goodsList" :key="key" >
  27. <view class="good-item dir-left-nowrap" v-for="(good, index) in item" :key="index" @click="route_go(good)">
  28. <view class="box-grow-0 cover-pic">
  29. <!-- <view class="out-dialog" v-if="good.goods_stock == 0 && appSetting.is_show_stock == '1'">
  30. <image :src="appSetting.is_use_stock == '1' ? appImg.plugins_out : appSetting.sell_out_pic"></image>
  31. </view> -->
  32. <image :lazy-load="true" class="cover_pic" :src="good.cover_pic"></image>
  33. </view>
  34. <view class="box-grow-1 dir-top-nowrap main-betweens">
  35. <view class="box-grow-0 name t-omit t-omit-two">{{good.name}}</view>
  36. <view class="price-bottom" v-if="good.is_level == 1">
  37. <app-member-price :price="good.level_price"></app-member-price>
  38. </view>
  39. <view v-if="good.discount > 0">
  40. <app-sup-vip :is_vip_card_user="good.is_vip_card_user" :discount="good.discount"></app-sup-vip>
  41. </view>
  42. <view class="price-btn dir-left-nowrap main-between cross-center">
  43. <view class="price">{{good.price_str}}</view>
  44. <view v-if="good.goods_stock != 0" class="btn">预约</view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import {mapState, mapGetters} from 'vuex';
  53. import appButton from '../components/app-button.vue';
  54. import appMemberPrice from "../../../components/page-component/app-member-mark/app-member-price.vue";
  55. import appSupVip from "../../../components/page-component/app-sup-vip/app-sup-vip.vue";
  56. export default {
  57. name: "app-product-list",
  58. components: {
  59. 'app-button': appButton,
  60. 'app-member-price': appMemberPrice,
  61. 'app-sup-vip': appSupVip,
  62. },
  63. computed: {
  64. ...mapState({
  65. appImg: state => state.mallConfig.__wxapp_img.mall,
  66. appSetting: state => state.mallConfig.mall.setting,
  67. }),
  68. ...mapGetters('mallConfig', {
  69. getVideo: 'getVideo'
  70. }),
  71. },
  72. props: [`goodsList`],
  73. methods: {
  74. route_go(data) {
  75. console.log(data);
  76. // #ifndef MP-BAIDU
  77. if (data.video_url && this.getVideo == 1) {
  78. uni.navigateTo({
  79. url: `/pages/goods/video?goods_id=${data.goods_id}&sign=booking`
  80. });
  81. } else {
  82. uni.navigateTo({
  83. url: `/plugins/book/goods/goods?goods_id=${data.goods_id}`,
  84. });
  85. }
  86. // #endif
  87. // #ifdef MP-BAIDU
  88. uni.navigateTo({
  89. url: `/plugins/book/goods/goods?goods_id=${data.goods_id}`,
  90. });
  91. // #endif
  92. }
  93. },
  94. }
  95. </script>
  96. <style scoped lang="scss">
  97. .goods-list {
  98. width: calc(100% - #{32upx});
  99. background-color: #f7f7f7;
  100. margin: #{0 16upx};
  101. }
  102. .row {
  103. margin-bottom: #{16upx};
  104. font-size: 28rpx;
  105. color: #353535;
  106. }
  107. .item {
  108. width: #{350upx};
  109. border-radius: #{15upx};
  110. background-color: #ffffff;
  111. }
  112. .image-name {
  113. height: #{396upx};
  114. margin-bottom: #{10upx};
  115. position: relative;
  116. .out-dialog {
  117. width: #{350upx};
  118. height: #{350upx};
  119. position: absolute;
  120. top: 0;
  121. left: 0;
  122. background-color: rgba(0,0,0,.5);
  123. image {
  124. width: #{350upx};
  125. height: #{350upx};
  126. }
  127. }
  128. }
  129. .content {
  130. margin: #{0 20upx};
  131. width: #{310upx};
  132. height: calc(100% - #{405upx});
  133. }
  134. .cover_pic {
  135. width: #{100%};
  136. height: #{100%};
  137. // width: #{350upx};
  138. // height: #{350upx};
  139. margin-bottom: #{20upx};
  140. border-top-right-radius: #{15upx};
  141. border-top-left-radius: #{15upx};
  142. }
  143. .name {
  144. // width: #{310upx};
  145. // margin: #{0 20upx};
  146. // font-size: #{28upx};
  147. // line-height: 1;
  148. // color: #353535;
  149. font-size: 34rpx;
  150. font-family: Source Han Sans CN;
  151. font-weight: 500;
  152. color: #3d3d3d;
  153. overflow: hidden;
  154. text-overflow: ellipsis;
  155. white-space: nowrap;
  156. }
  157. .btn {
  158. width: #{110upx};
  159. height: #{45upx};
  160. border-radius: #{22.5upx};
  161. border: #{1upx} solid #ff4544;
  162. font-size: #{26upx};
  163. color: #ff4544;
  164. line-height: 1;
  165. padding: #{9upx 0};
  166. text-align: center;
  167. background-color: #fff5f5;
  168. }
  169. .price-bottom {
  170. margin-bottom: #{10upx};
  171. }
  172. .price {
  173. // font-size: #{25upx};
  174. // color: #ff4544;
  175. font-size: 34rpx;
  176. font-family: Source Han Sans CN;
  177. font-weight: 500;
  178. color: #FF4800;
  179. }
  180. .price-btn {
  181. margin-top: #{10upx};
  182. margin-bottom: #{16upx};
  183. }
  184. .good-item{
  185. padding: 16rpx 24rpx;
  186. background-color: #ffffff;
  187. border-top: 1rpx solid #e2e2e2;
  188. }
  189. .cover-pic{
  190. width: 138px;
  191. height: 110px;
  192. margin-right: 24rpx;
  193. }
  194. .main-between{
  195. display: flex;
  196. align-items: center;
  197. justify-content: space-between;
  198. }
  199. .main-betweens{
  200. display: flex;
  201. flex-direction: column;
  202. justify-content: space-between;
  203. }
  204. </style>