b_combination.vue 5.6 KB

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