latestGroupBuying.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. <template>
  2. <view class="index-product-wrapper" v-show="!isSortType">
  3. <!-- 拼团列表 -->
  4. <view class="list-box animated" v-for="(e, index) in grouponData" :key="index">
  5. <productConSwiperGroupbuying class="skeleton-rect" :imgUrls="e.slideshow" :videoline="e.video_link"
  6. @videoPause="videoPause"></productConSwiperGroupbuying>
  7. <view class="content">
  8. <view class="home">
  9. <view class="count">共{{ e.goodsTotal }}个</view>
  10. <scroll-view scroll-x class="navscroll"> <!-- 设置滚动条方向为横向 -->
  11. <view
  12. style="width: 108rpx;height: 108rpx; margin-right: 20rpx; padding: 0; display: inline-block;"
  13. class="item" v-for="item in e.goodsImage">
  14. <!-- 通过for循环生成view -->
  15. <image style="width: 108rpx;height: 108rpx;" :src="item" mode="scaleToFill" />
  16. </view>
  17. </scroll-view>
  18. </view>
  19. </view>
  20. <view class="wrapper">
  21. <view class="price">
  22. <view>
  23. ¥{{ e.minPrice || 0.00 }} ~ ¥ {{ e.maxPrice || 0.00 }}
  24. </view>
  25. </view>
  26. <view class="introduce" @click="goToDetail(e)">
  27. <view>
  28. {{ e.mainTitle || '测试名字' }}
  29. </view>
  30. <image src="http://www.gzzzyd.com/groupon/home_slices/进入箭头2小@2x.png" mode="scaleToFill" />
  31. </view>
  32. <view class="countdown flex-row">
  33. <view class="countdown-l" hover-class="none" hover-stop-propagation="false">
  34. <block v-for="(item, index) in e.grouponUsers" :key="index">
  35. <image v-if="index < 3" class="avatar-group_1" referrerpolicy="no-referrer"
  36. :src="item.userAvatar || `http://wine.gzzzyd.com/test/static/img/bg.a82f9752.jpg`" />
  37. </block>
  38. <text class="red">{{ e.grouponUserTotal }}人</text>
  39. <text class="yellow" v-if="currentId == 0">正在参团中</text>
  40. <text class="yellow" v-if="currentId == 1">已参团</text>
  41. </view>
  42. <view class="countdown-r" v-if="currentId == 0">
  43. <image src="http://www.gzzzyd.com/groupon/home_slices/倒计时@2x.png" mode="scaleToFill" />
  44. <text class="yellow">截止倒计时</text>
  45. <!-- <text class="red2">02时25分19秒</text> -->
  46. <!-- <uni-countdown :show-day="false" :hour="e.h" :minute="e.m" :second="e.s"></uni-countdown> -->
  47. <u-count-down :time="e.seconds * 1000" format="HH:mm:ss"></u-count-down>
  48. </view>
  49. </view>
  50. <view class="self-pickup-point">
  51. <view class="a-t">
  52. 最近的自提网点:
  53. </view>
  54. <view class="a-m">
  55. <view class="am1">
  56. <view class="am1-1">{{ e.selfTake.name }}
  57. </view>
  58. <view class="am1-2">
  59. 距您{{ e.selfTake.distanceDesc }}
  60. <image src="http://www.gzzzyd.com/groupon/order_details/距离@2x.png" mode="scaleToFill" />
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <view class='info-area'>
  66. <view class='time '>
  67. <image src="http://www.gzzzyd.com/groupon/home_slices/编辑@2x.png" mode="scaleToFill" />
  68. 发布于:
  69. <text class="imp_info">
  70. {{ e.publishTimeDesc }}
  71. </text>
  72. </view>
  73. <view class='view-count '>
  74. {{ e.views }}人浏览过
  75. <image src="http://www.gzzzyd.com/groupon/home_slices/浏览@2x.png" mode="scaleToFill" />
  76. </view>
  77. </view>
  78. </view>
  79. <view class="btn-area" v-if="currentId == 0">
  80. <button class="share" open-type="share" :data-groupon="e">
  81. <image src="http://www.gzzzyd.com/groupon/home_slices/分享@2x.png" mode="scaleToFill" />
  82. <text>分享有礼</text>
  83. </button>
  84. <button class="now" @click="goToDetail(e)">
  85. <image src="http://www.gzzzyd.com/groupon/home_slices/购物@2x.png" mode="scaleToFill" />
  86. <text>立即下单</text>
  87. </button>
  88. </view>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. const app = getApp();
  94. import productConSwiperGroupbuying from "@/components/productConSwiperGroupbuying";
  95. import { latestGroupon, historyGroupon, detailGroupon, goodsDetail } from '@/api/groupon.js'
  96. export default {
  97. components: {
  98. productConSwiperGroupbuying
  99. },
  100. name: 'promotionList',
  101. props: {
  102. grouponData: {
  103. type: Array,
  104. default() {
  105. return []
  106. }
  107. },
  108. dataConfig: {
  109. type: Object,
  110. default: () => { }
  111. },
  112. positionInfo: {
  113. type: Object,
  114. default: () => { }
  115. },
  116. tempArr: {
  117. type: Array,
  118. default: []
  119. },
  120. iSshowH: {
  121. type: Boolean,
  122. default: false
  123. },
  124. isSortType: {
  125. type: String | Number,
  126. default: 0
  127. },
  128. currentId: {
  129. type: String | Number,
  130. default() {
  131. return 0
  132. }
  133. }
  134. },
  135. watch: {
  136. },
  137. data() {
  138. return {
  139. timestamp: 86400,
  140. navigationList2: [],
  141. ProductNavindex: 0,
  142. numConfig: 9,
  143. // imgStyle: this.dataConfig.imgStyle.type,
  144. mbConfig: 0,
  145. themeColor: "rgba(29,176,252,1)",
  146. titleShow: true, //标题是否显示
  147. opriceShow: true, //原价是否显示
  148. priceShow: true, //价格是否显示
  149. couponShow: true,//优惠券标签是否显示
  150. titleConfig: 2, //标题位置
  151. fontColor: "rgba(253,80,47,1)",
  152. labelColor: "rgba(29,176,252,1)",
  153. typeId: '',
  154. loading: false, //是否加载中
  155. loadend: false, //是否加载完毕
  156. loadTitle: this.$t(`加载更多`), //提示语
  157. };
  158. },
  159. created() {
  160. },
  161. methods: {
  162. goToDetail(item) {
  163. uni.navigateTo({
  164. url: `/pages/groupbuying_details/index?id=${item.id}&selfTakeId=${item.selfTake.id}&organizerUserId=${item.organizerUserId}`
  165. })
  166. },
  167. }
  168. }
  169. </script>
  170. <style lang="scss">
  171. .list-box {
  172. background: white;
  173. padding-bottom: 20px;
  174. }
  175. .index-product-wrapper {
  176. &.on {
  177. min-height: 1050rpx;
  178. }
  179. .nav-bd {
  180. display: flex;
  181. align-items: center;
  182. margin-top: 30rpx;
  183. .item {
  184. display: flex;
  185. flex-direction: column;
  186. align-items: center;
  187. justify-content: center;
  188. width: 25%;
  189. &.on {
  190. border-radius: 0;
  191. }
  192. .txt {
  193. font-size: 32rpx;
  194. color: #282828;
  195. }
  196. .label {
  197. display: flex;
  198. align-items: center;
  199. justify-content: center;
  200. width: 124rpx;
  201. height: 32rpx;
  202. margin-top: 5rpx;
  203. font-size: 24rpx;
  204. color: #999;
  205. border-radius: 16rpx;
  206. }
  207. }
  208. }
  209. }
  210. .content {
  211. width: 100%;
  212. height: 108rpx;
  213. margin-top: 10rpx;
  214. .home {
  215. display: flex;
  216. width: 100%;
  217. height: 100%;
  218. position: relative;
  219. left: 0;
  220. margin-top: 10rpx;
  221. .count {
  222. text-align: center;
  223. width: 150rpx !important;
  224. position: relative;
  225. height: 108rpx;
  226. line-height: 108rpx;
  227. z-index: 999;
  228. background-size: 100% 100%;
  229. background: linear-gradient(90deg, #FFE9E9 0%, #FAFAFA 100%);
  230. }
  231. .navscroll {
  232. width: calc(100% - 150rpx);
  233. }
  234. }
  235. }
  236. .info-area {
  237. margin: 23rpx 30rpx 0 30rpx;
  238. justify-content: space-between;
  239. display: flex;
  240. width: 100%;
  241. height: 44rpx;
  242. font-size: 24rpx;
  243. font-weight: 400;
  244. color: #333333;
  245. line-height: 44rpx;
  246. image {
  247. width: 40rpx;
  248. height: 40rpx;
  249. margin: 0 10rpx;
  250. vertical-align: middle;
  251. }
  252. .time {
  253. font-size: 24rpx;
  254. font-weight: 400;
  255. color: #999999;
  256. .imp_info {
  257. font-size: 24rpx;
  258. font-weight: 400;
  259. color: #333333;
  260. }
  261. }
  262. .view-count {
  263. font-size: 24rpx;
  264. font-weight: 400;
  265. color: #999999;
  266. margin-right: 60rpx;
  267. }
  268. }
  269. .countdown {
  270. margin: 23rpx 30rpx 0 30rpx;
  271. box-sizing: border-box;
  272. background-color: rgba(255, 247, 248, 1.000000);
  273. border-radius: 12rpx;
  274. height: 100rpx;
  275. padding: 20rpx;
  276. line-height: 100rpx;
  277. align-self: center;
  278. display: flex;
  279. border: 1px solid dashed;
  280. display: flex;
  281. justify-content: space-between;
  282. .countdown-l {
  283. flex: 1;
  284. display: flex;
  285. align-items: center;
  286. }
  287. .countdown-r {
  288. flex: 1;
  289. display: flex;
  290. align-items: center;
  291. }
  292. .red {
  293. height: 34rpx;
  294. font-size: 24rpx;
  295. font-weight: 600;
  296. line-height: 34rpx;
  297. color: #B22338;
  298. vertical-align: super;
  299. margin-left: 20rpx;
  300. }
  301. .red2 {
  302. height: 40rpx;
  303. font-size: 28rpx;
  304. font-weight: 600;
  305. color: #B22338;
  306. line-height: 40rpx;
  307. vertical-align: super;
  308. }
  309. /deep/.yellow,
  310. .u-count-down {
  311. font-size: 24rpx;
  312. font-weight: 400;
  313. color: #FF9600;
  314. line-height: 80rpx;
  315. margin: 0 10rpx;
  316. vertical-align: super;
  317. }
  318. image {
  319. width: 40rpx;
  320. height: 40rpx;
  321. border: 2rpx solid #FFFFFF;
  322. }
  323. }
  324. .price {
  325. padding: 0 30rpx;
  326. height: 48rpx;
  327. font-size: 36rpx;
  328. font-weight: bolder;
  329. color: #B22338;
  330. line-height: 48rpx;
  331. margin: 20rpx 0;
  332. }
  333. .introduce {
  334. padding: 0 30rpx;
  335. min-height: 44rpx;
  336. font-size: 36rpx;
  337. font-weight: bolder;
  338. color: #111111;
  339. line-height: 44rpx;
  340. margin: 20rpx 0;
  341. display: flex;
  342. justify-content: space-between;
  343. image {
  344. width: 36rpx;
  345. height: 36rpx;
  346. vertical-align: middle;
  347. }
  348. }
  349. .wrapper {}
  350. .a-t {
  351. padding: 0 30rpx;
  352. display: flex;
  353. justify-content: space-between;
  354. height: 44rpx;
  355. margin-bottom: 20rpx;
  356. }
  357. .a-m {
  358. padding: 0 30rpx;
  359. padding-bottom: 20rpx;
  360. min-height: 60rpx;
  361. .am1 {
  362. display: flex;
  363. justify-content: space-between;
  364. margin-bottom: 20rpx;
  365. .am1-1 {
  366. min-height: 40rpx;
  367. font-size: 28rpx;
  368. font-weight: 400;
  369. color: #B22338;
  370. line-height: 40rpx;
  371. }
  372. .am1-2 {
  373. height: 36rpx;
  374. font-size: 20rpx;
  375. font-weight: 400;
  376. color: #666666;
  377. line-height: 36rpx;
  378. image {
  379. margin-left: 30rpx;
  380. vertical-align: middle;
  381. height: 34rpx;
  382. width: 34rpx;
  383. }
  384. }
  385. }
  386. .am2 {
  387. margin-bottom: 20rpx;
  388. height: 34rpx;
  389. font-size: 24rpx;
  390. font-weight: 400;
  391. color: #999999;
  392. line-height: 34rpx;
  393. }
  394. }
  395. .a-b {
  396. padding: 0 30rpx;
  397. width: 100%;
  398. background: #FFF7F8;
  399. border: 1px solid dashed #333333;
  400. height: 60rpx;
  401. line-height: 60rpx;
  402. display: flex;
  403. justify-content: space-between;
  404. .a-b1 {
  405. font-size: 20rpx;
  406. font-weight: 400;
  407. color: #666666;
  408. .red {
  409. font-size: 20rpx;
  410. font-weight: 500;
  411. color: #B22338;
  412. }
  413. }
  414. .a-b2 {
  415. image {
  416. vertical-align: middle;
  417. margin-right: 30rpx;
  418. margin-left: 30rpx;
  419. height: 34rpx;
  420. width: 34rpx;
  421. }
  422. }
  423. }
  424. .self-pickup-point {
  425. background: #FFF7F8;
  426. padding-top: 20rpx;
  427. margin: 0 30rpx;
  428. margin-top: 20rpx;
  429. }
  430. .btn-area {
  431. padding: 30rpx;
  432. display: flex;
  433. justify-content: center;
  434. height: 80rpx;
  435. image {
  436. width: 28rpx;
  437. height: 28rpx;
  438. margin-right: 10rpx;
  439. }
  440. button {
  441. flex: 1;
  442. text-align: center;
  443. margin: auto;
  444. height: 64rpx;
  445. border-radius: 8rpx;
  446. line-height: 64rpx;
  447. }
  448. .share {
  449. margin-right: 20rpx;
  450. background: #F1F8E5;
  451. font-size: 24rpx;
  452. font-weight: 400;
  453. color: #75BE00;
  454. }
  455. .now {
  456. background: #F7E9EB;
  457. font-size: 24rpx;
  458. font-weight: 400;
  459. color: #B22338;
  460. }
  461. }</style>