app-index-pintuan.vue 6.6 KB

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