latestGroupBuying.vue 11 KB

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