app-index-advance.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="index-advance">
  3. <view class="top dir-left-nowrap cross-center">
  4. <image class="box-grow-0" src="../../../static/image/icon/advance.png"></image>
  5. <view class="box-grow-1">预售</view>
  6. <app-form-id @click="jump(`/plugins/advance/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="(advance, key) in newDate" :key="key">
  15. <view class="box-grow-0 item" @click="jump_router(advance)">
  16. <view class="cover-pic">
  17. <app-image :img-src="advance.goodsWarehouse.cover_pic" width="220rpx" height="220rpx"></app-image>
  18. <view class="out-dialog" v-if="advance.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. <view class="title t-omit-two">
  22. {{advance.name}}
  23. </view>
  24. <view class="des-price" v-if="advance.use_attr == 0">
  25. 定金¥{{Number(advance.advanceGoods.deposit)}}抵¥{{Number(advance.advanceGoods.swell_deposit)}}
  26. </view>
  27. <view class="des-price" v-else-if="advance.use_attr == 1">
  28. 定金¥{{Number(advance.advanceGoods.deposit)}}抵¥{{Number(advance.advanceGoods.swell_deposit)}}
  29. </view>
  30. </view>
  31. <view class="content dir-top-nowrap main-right">
  32. <view class="member-price" v-if="advance.is_level == 1">
  33. <app-member-price :price="advance.level_price"></app-member-price>
  34. </view>
  35. <app-sup-vip :is_vip_card_user="advance.vip_card_appoint.is_vip_card_user" margin="4rpx 0 8rpx" v-if="advance.vip_card_appoint.discount > 0" :discount="advance.vip_card_appoint.discount"></app-sup-vip>
  36. <view class="price dir-left-nowrap">
  37. <text class="text" style="font-size: 22rpx;width: 75rpx;">预售价</text>
  38. <text class="text" style="font-size: 28rpx;">¥{{advance.price}}</text>
  39. </view>
  40. <view class="old-price">
  41. ¥{{advance.goodsWarehouse.original_price}}
  42. </view>
  43. </view>
  44. </view>
  45. </block>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import {mapState, mapGetters} from 'vuex';
  51. import appMemberPrice from '../app-member-mark/app-member-price.vue';
  52. import appSupVip from '../app-sup-vip/app-sup-vip.vue';
  53. export default {
  54. name: "app-index-booking",
  55. props: {
  56. value: {
  57. type: Array,
  58. default() {
  59. return [];
  60. }
  61. }
  62. },
  63. data() {
  64. return {
  65. newData: this.value
  66. };
  67. },
  68. computed: {
  69. ...mapState({
  70. theme: state => state.mallConfig.theme,
  71. appImg: state => state.mallConfig.__wxapp_img.mall,
  72. appSetting: state => state.mallConfig.mall.setting,
  73. mall: state => state.mallConfig.mall,
  74. }),
  75. ...mapGetters('mallConfig',{
  76. vip: 'getVip'
  77. }),
  78. ...mapGetters('mallConfig', {
  79. getVideo: 'getVideo'
  80. }),
  81. newDate() {
  82. for (let i = 0; i < this.value.length; i++) {
  83. let attr = this.value[i].attr;
  84. let compare = function (obj1, obj2) {
  85. let val1 = Number(obj1.deposit);
  86. let val2 = Number(obj2.deposit);
  87. if (val1 < val2) {
  88. return -1;
  89. } else if (val1 > val2) {
  90. return 1;
  91. } else {
  92. return 0;
  93. }
  94. };
  95. this.value[i].attr = attr.sort(compare);
  96. }
  97. return this.value;
  98. },
  99. },
  100. methods: {
  101. jump(url) {
  102. this.$jump({
  103. url: url,
  104. open_type: 'navigate'
  105. })
  106. },
  107. jump_router(data) {
  108. // #ifndef MP-BAIDU
  109. if (data.goodsWarehouse.video_url && this.getVideo == 1) {
  110. uni.navigateTo({
  111. url: `/pages/goods/video?goods_id=${data.id}&sign=advance`
  112. });
  113. } else {
  114. uni.navigateTo({
  115. url: `/plugins/advance/detail/detail?id=${data.id}`
  116. })
  117. }
  118. // #endif
  119. // #ifdef MP-BAIDU
  120. uni.navigateTo({
  121. url: `/plugins/advance/detail/detail?id=${data.id}`
  122. })
  123. // #endif
  124. }
  125. },
  126. components: {
  127. 'app-member-price': appMemberPrice,
  128. 'app-sup-vip': appSupVip,
  129. }
  130. }
  131. </script>
  132. <style scoped lang="scss">
  133. .index-advance {
  134. background-color: #f7f7f7;
  135. margin-bottom: #{20upx};
  136. .top {
  137. padding: #{0 24rpx};
  138. color: #ff4544;
  139. font-size: $uni-font-size-general-one;
  140. height: #{72rpx};
  141. background-color: white;
  142. image {
  143. width: #{46rpx};
  144. height: #{46rpx};
  145. display: block;
  146. margin-right: #{8rpx};
  147. }
  148. .more {
  149. font-size: $uni-font-size-general-two;
  150. margin-right: #{12rpx};
  151. color: $uni-general-color-two;
  152. }
  153. .icon {
  154. width: #{12rpx};
  155. height: #{22rpx};
  156. display: block;
  157. }
  158. }
  159. .list {
  160. overflow-x: auto;
  161. -webkit-overflow-scrolling: touch;
  162. background-color: #f7f7f7;
  163. margin-top: #{4rpx};
  164. .item {
  165. margin-right: #{4rpx};
  166. font-size: $uni-font-size-general-one;
  167. width: #{260rpx};
  168. padding: #{0 20rpx 20upx 20rpx};
  169. background-color: white;
  170. overflow: hidden;
  171. .cover-pic {
  172. width: #{220rpx};
  173. height: #{331upx};
  174. display: block;
  175. margin-top: #{20rpx};
  176. position: relative;
  177. .out-dialog {
  178. width: #{220rpx};
  179. height: #{220rpx};
  180. position: absolute;
  181. top: 0;
  182. left: 0;
  183. z-index: 10;
  184. will-change: transform;
  185. background-color: rgba(0,0,0,.5);
  186. image {
  187. width: #{220rpx};
  188. height: #{220rpx};
  189. }
  190. }
  191. }
  192. .title {
  193. width: #{224rpx};
  194. height: #{64rpx};
  195. font-size: #{25rpx};
  196. line-height: #{32upx};
  197. margin-top: #{10upx};
  198. color: $uni-important-color-black;
  199. }
  200. .content {
  201. height: calc(100% - #{331upx});
  202. }
  203. .member-price {
  204. height: #{28upx};
  205. margin-bottom: #{8upx};
  206. margin-top: #{4upx};
  207. }
  208. .price {
  209. color: #ff4544;
  210. .text {
  211. text-overflow: ellipsis;
  212. -webkit-box-orient: vertical;
  213. -webkit-line-clamp: 1;
  214. overflow: hidden;
  215. line-height: 1;
  216. vertical-align: sub;
  217. }
  218. }
  219. .old-price {
  220. font-size: #{21upx};
  221. line-height: 1;
  222. color: #999999;
  223. text-decoration:line-through;
  224. margin: #{5upx 0 20upx 0};
  225. }
  226. .des-price {
  227. display: inline-block;
  228. font-size: #{19rpx};
  229. color: #ffffff;
  230. line-height: 1;
  231. background-color: #ff4544;
  232. border-radius: #{7rpx};
  233. padding: #{5rpx 5rpx};
  234. word-break: break-all;
  235. text-overflow: ellipsis;
  236. -webkit-box-orient: vertical;
  237. -webkit-line-clamp: 1;
  238. overflow: hidden;
  239. margin: #{4upx 0};
  240. }
  241. }
  242. }
  243. }
  244. </style>