b_combination.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <view :class="{borderShow:isBorader}">
  3. <view class="combination" v-if="combinationList.length">
  4. <view class="title acea-row row-between">
  5. <view class="spike-bd">
  6. <view v-if="assistUserList.length > 0" class="activity_pic">
  7. <view v-for="(item,index) in assistUserList" :key="index" class="picture"
  8. :style='index===2?"position: relative":"position: static"'>
  9. <span class="avatar" :style='"background-image: url("+item+")"'></span>
  10. <span v-if="index===2 && Number(assistUserCount) > 3" class="mengceng">
  11. <i>···</i>
  12. </span>
  13. </view>
  14. <text class="pic_count">{{assistUserCount}}人参与</text>
  15. </view>
  16. </view>
  17. <navigator url="/pages/activity/goods_combination/index" hover-class="none"
  18. class="more acea-row row-center-wrapper">GO<text class="iconfont icon-xiangyou"></text></navigator>
  19. </view>
  20. <view class="conter acea-row">
  21. <scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;"
  22. show-scrollbar="false">
  23. <view class="itemCon" v-for="(item, index) in combinationList" :key="index" @click="goDetail(item)">
  24. <view class="item">
  25. <view class="pictrue">
  26. <image :src="item.image"></image>
  27. </view>
  28. <view class="text lines1">
  29. <view class="name line1">{{item.title}}</view>
  30. <view class="money">¥<text class="num">{{item.price}}</text></view>
  31. <view class="y_money">¥{{item.otPrice}}</view>
  32. </view>
  33. </view>
  34. </view>
  35. <!-- <navigator :url="`/pages/activity/goods_combination_details/index?id=${item.id}`" hover-class="none" class="item" v-for="(item, index) in combinationList" :key="index">
  36. <view class="pictrue">
  37. <image :src="item.image"></image>
  38. </view>
  39. <view class="text lines1">
  40. <text class="money">¥<text class="num">{{item.price}}</text></text>
  41. <text class="y_money">¥{{item.otPrice}}</text>
  42. </view>
  43. </navigator> -->
  44. </scroll-view>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. let app = getApp();
  51. import {
  52. getCombinationIndexApi
  53. } from '@/api/activity.js';
  54. export default {
  55. name: 'b_combination',
  56. data() {
  57. return {
  58. combinationList: [],
  59. isBorader: false,
  60. assistUserList: [],
  61. assistUserCount: 0
  62. };
  63. },
  64. created() {
  65. this.getCombinationList();
  66. },
  67. mounted() {},
  68. methods: {
  69. // 拼团列表
  70. getCombinationList: function() {
  71. let that = this;
  72. getCombinationIndexApi().then(function(res) {
  73. that.combinationList = res.data.productList;
  74. that.assistUserList = res.data.avatarList;
  75. that.assistUserCount = res.data.totalPeople;
  76. }).catch((res) => {
  77. return that.$util.Tips({
  78. title: res
  79. });
  80. })
  81. },
  82. goDetail(item) {
  83. uni.navigateTo({
  84. url: `/pages/activity/goods_combination_details/index?id=${item.id}`
  85. })
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .mengceng {
  92. width: 38rpx;
  93. height: 38rpx;
  94. line-height: 36rpx;
  95. background: rgba(51, 51, 51, 0.6);
  96. text-align: center;
  97. border-radius: 50%;
  98. opacity: 1;
  99. position: absolute;
  100. left: 0px;
  101. top: 2rpx;
  102. color: #FFF;
  103. i{
  104. font-style: normal;
  105. font-size: 20rpx;
  106. }
  107. }
  108. .activity_pic {
  109. margin-left: 28rpx;
  110. padding-left: 20rpx;
  111. .picture {
  112. display: inline-block;
  113. }
  114. .avatar {
  115. width: 38rpx;
  116. height: 38rpx;
  117. display: inline-table;
  118. vertical-align: middle;
  119. -webkit-user-select: none;
  120. -moz-user-select: none;
  121. -ms-user-select: none;
  122. user-select: none;
  123. border-radius: 50%;
  124. background-repeat: no-repeat;
  125. background-size: cover;
  126. background-position: 0 0;
  127. margin-right: -10rpx;
  128. box-shadow: 0 0 0 1px #fff;
  129. }
  130. .pic_count {
  131. margin-left: 30rpx;
  132. color: $theme-color;
  133. font-size: 22rpx;
  134. font-weight: 500;
  135. }
  136. }
  137. .default {
  138. width: 690rpx;
  139. height: 300rpx;
  140. border-radius: 14rpx;
  141. margin: 26rpx auto 0 auto;
  142. background-color: #ccc;
  143. text-align: center;
  144. line-height: 300rpx;
  145. .iconfont {
  146. font-size: 80rpx;
  147. }
  148. }
  149. .combination {
  150. width: auto;
  151. background-color: #fff;
  152. border-radius: 14rpx;
  153. margin: 0 auto 30rpx auto;
  154. padding: 16rpx 24rpx 24rpx 24rpx;
  155. background-image: url(../../../static/images/pth.png);
  156. background-repeat: no-repeat;
  157. background-size: 100%;
  158. .title {
  159. width: 80%;
  160. margin-left: 128rpx;
  161. .sign {
  162. width: 40rpx;
  163. height: 40rpx;
  164. image {
  165. width: 100%;
  166. height: 100%;
  167. }
  168. }
  169. .name {
  170. font-size: 32rpx;
  171. color: #282828;
  172. margin-left: 12rpx;
  173. font-weight: bold;
  174. text {
  175. color: #797979;
  176. font-size: 24rpx;
  177. font-weight: 400;
  178. margin-left: 14rpx;
  179. }
  180. }
  181. .more {
  182. width: 86rpx;
  183. height: 40rpx;
  184. background: linear-gradient(142deg, #FFE9CE 0%, #FFD6A7 100%);
  185. opacity: 1;
  186. border-radius: 18px;
  187. font-size: 22rpx;
  188. color: #FE960F;
  189. padding-left: 8rpx;
  190. font-weight: 800;
  191. .iconfont {
  192. font-size: 21rpx;
  193. }
  194. }
  195. }
  196. .conter {
  197. margin-top: 24rpx;
  198. .itemCon {
  199. display: inline-block;
  200. width: 220rpx;
  201. margin-right: 24rpx;
  202. }
  203. .item {
  204. width: 100%;
  205. .pictrue {
  206. width: 100%;
  207. height: 220rpx;
  208. border-radius: 6rpx;
  209. image {
  210. width: 100%;
  211. height: 100%;
  212. border-radius: 6rpx;
  213. }
  214. }
  215. .text {
  216. margin-top: 4rpx;
  217. .y_money {
  218. font-size: 24rpx;
  219. color: #999999;
  220. text-decoration: line-through;
  221. }
  222. .name {
  223. font-size: 24rpx;
  224. color: #000;
  225. margin-top: 14rpx;
  226. }
  227. .money {
  228. color: #FD502F;
  229. font-size: 28rpx;
  230. height: 100%;
  231. font-weight: bold;
  232. margin: 10rpx 0 0rpx 0;
  233. .num {
  234. font-size: 28rpx;
  235. }
  236. }
  237. }
  238. }
  239. }
  240. }
  241. </style>