c_bargain.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view :class="{borderShow:isBorader}">
  3. <view class="combination" v-if="bargList.length">
  4. <view class="title acea-row row-between">
  5. <view class="acea-row row-column">
  6. <image src="../../../static/images/kanjia.png" class="pic"></image>
  7. </view>
  8. <navigator url="/pages/activity/goods_bargain/index" hover-class="none" class="more acea-row row-center-wrapper">GO<text class="iconfont icon-xiangyou"></text></navigator>
  9. </view>
  10. <view class="conter acea-row">
  11. <scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;" show-scrollbar="false">
  12. <view class="itemCon" v-for="(item, index) in bargList" :key="index" @click="bargDetail(item)">
  13. <view class="item">
  14. <view class="pictrue">
  15. <image :src="item.picUrl"></image>
  16. </view>
  17. <view class="text lines1">
  18. <view class="name line1">{{ item.name }}</view>
  19. <view class="money">
  20. ¥<text class="num">{{ fen2yuan(item.bargainMinPrice) }}</text>
  21. </view>
  22. <view class="btn">参与砍价</view>
  23. </view>
  24. </view>
  25. </view>
  26. </scroll-view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. let app = getApp();
  33. import * as BargainApi from '@/api/promotion/bargain.js';
  34. import * as Util from '@/utils/util.js';
  35. import { mapGetters } from 'vuex';
  36. export default {
  37. name: 'c_bargain',
  38. computed: mapGetters({'uid': 'uid'}),
  39. data() {
  40. return {
  41. bargList: [],
  42. isBorader: false
  43. };
  44. },
  45. created() {
  46. this.getBargainList();
  47. },
  48. methods: {
  49. /**
  50. * 砍价列表
  51. */
  52. getBargainList() {
  53. BargainApi.getBargainActivityList().then(res => {
  54. this.bargList = res.data ? res.data : [];
  55. })
  56. },
  57. bargDetail(item){
  58. uni.navigateTo({
  59. url: `/pages/activity/goods_bargain_details/index?id=${item.id}&startBargainUid=${this.uid}`
  60. });
  61. },
  62. fen2yuan(price) {
  63. return Util.fen2yuan(price)
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .pic{
  70. width: 130rpx;
  71. height: 30rpx;
  72. }
  73. .default{
  74. width: 690rpx;
  75. height: 300rpx;
  76. border-radius: 14rpx;
  77. margin: 26rpx auto 0 auto;
  78. background-color: #ccc;
  79. text-align: center;
  80. line-height: 300rpx;
  81. .iconfont{
  82. font-size: 80rpx;
  83. }
  84. }
  85. .combination{
  86. width: auto;
  87. background-image: url(../../../static/images/kjbj.png);
  88. background-repeat: no-repeat;
  89. background-size: 100%;
  90. background-color: #fff;
  91. border-radius: 14rpx;
  92. margin: 30rpx auto 0 auto;
  93. padding: 25rpx 20rpx 25rpx 20rpx;
  94. .title {
  95. .sign {
  96. font-size: 32rpx;
  97. color: $theme-color;
  98. margin-bottom: 2rpx;
  99. font-weight: bold;
  100. margin-bottom: 10rpx;
  101. }
  102. .name {
  103. text {
  104. color: #333333;
  105. font-size: 26rpx;
  106. font-weight: 400;
  107. }
  108. }
  109. .more {
  110. width: 86rpx;
  111. height: 40rpx;
  112. background: linear-gradient(142deg, #FFE9CE 0%, #FFD6A7 100%);
  113. opacity: 1;
  114. border-radius: 18px;
  115. font-size: 22rpx;
  116. color: #FE960F;
  117. padding-left: 8rpx;
  118. font-weight: 800;
  119. .iconfont {
  120. font-size: 21rpx;
  121. }
  122. }
  123. }
  124. .conter{
  125. margin-top: 28rpx;
  126. .itemCon {
  127. display: inline-block;
  128. width: 220rpx;
  129. margin-right: 24rpx;
  130. }
  131. .item{
  132. width:100%;
  133. .pictrue{
  134. width: 100%;
  135. height: 220rpx;
  136. border-radius: 6rpx;
  137. image{
  138. width: 100%;
  139. height: 100%;
  140. border-radius: 6rpx;
  141. }
  142. }
  143. .text{
  144. margin-top: 4rpx;
  145. .y_money {
  146. font-size: 24rpx;
  147. color: #999999;
  148. text-decoration: line-through;
  149. }
  150. .name {
  151. font-size: 24rpx;
  152. color: #000;
  153. margin-top: 14rpx;
  154. }
  155. .money {
  156. color: #FD502F;
  157. font-size: 28rpx;
  158. height: 100%;
  159. font-weight: bold;
  160. margin: 10rpx 0;
  161. .num {
  162. font-size: 28rpx;
  163. }
  164. }
  165. .btn{
  166. width: 220rpx;
  167. height: 48rpx;
  168. line-height: 48rpx;
  169. text-align: center;
  170. background: linear-gradient(129deg, #FF5555 0%, #FF0000 100%);
  171. opacity: 1;
  172. border-radius: 0px 0px 14rpx 14rpx;
  173. color: #FFFFFF;
  174. font-size: 26rpx;
  175. margin-top: 6rpx;
  176. }
  177. }
  178. }
  179. }
  180. }
  181. </style>