latestGroupBuying.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  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':index===0 }" referrerpolicy="no-referrer"
  36. :src="item.userAvatar || `/static/images/one.png`" />
  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. white-space: nowrap;
  233. width: 580rpx;
  234. }
  235. }
  236. }
  237. .info-area {
  238. margin: 23rpx 30rpx 0 30rpx;
  239. justify-content: space-between;
  240. display: flex;
  241. width: 100%;
  242. height: 44rpx;
  243. font-size: 24rpx;
  244. font-weight: 400;
  245. color: #333333;
  246. line-height: 44rpx;
  247. image {
  248. width: 40rpx;
  249. height: 40rpx;
  250. margin: 0 10rpx;
  251. vertical-align: middle;
  252. }
  253. .time {
  254. font-size: 24rpx;
  255. font-weight: 400;
  256. color: #999999;
  257. .imp_info {
  258. font-size: 24rpx;
  259. font-weight: 400;
  260. color: #333333;
  261. }
  262. }
  263. .view-count {
  264. font-size: 24rpx;
  265. font-weight: 400;
  266. color: #999999;
  267. margin-right: 60rpx;
  268. }
  269. }
  270. .countdown {
  271. margin: 23rpx 30rpx 0 30rpx;
  272. box-sizing: border-box;
  273. background-color: rgba(255, 247, 248, 1.000000);
  274. border-radius: 12rpx;
  275. height: 100rpx;
  276. padding: 20rpx;
  277. line-height: 100rpx;
  278. align-self: center;
  279. display: flex;
  280. border: 1px solid dashed;
  281. display: flex;
  282. justify-content: space-between;
  283. .countdown-l {
  284. flex: 1;
  285. display: flex;
  286. align-items: center;
  287. }
  288. .countdown-r {
  289. flex: 1;
  290. display: flex;
  291. align-items: center;
  292. }
  293. .red {
  294. height: 34rpx;
  295. font-size: 24rpx;
  296. font-weight: 600;
  297. line-height: 34rpx;
  298. color: #B22338;
  299. vertical-align: super;
  300. margin-left: 20rpx;
  301. }
  302. .red2 {
  303. height: 40rpx;
  304. font-size: 28rpx;
  305. font-weight: 600;
  306. color: #B22338;
  307. line-height: 40rpx;
  308. vertical-align: super;
  309. }
  310. /deep/.yellow,
  311. .u-count-down {
  312. font-size: 24rpx;
  313. font-weight: 400;
  314. color: #FF9600;
  315. line-height: 80rpx;
  316. margin: 0 10rpx;
  317. vertical-align: super;
  318. }
  319. image {
  320. width: 40rpx;
  321. height: 40rpx;
  322. border-radius: 20rpx;
  323. margin-left: -20rpx;
  324. border: 2rpx solid #FFFFFF;
  325. }
  326. .avatar-group_1{
  327. margin-left: 0rpx;
  328. }
  329. }
  330. .price {
  331. padding: 0 30rpx;
  332. height: 48rpx;
  333. font-size: 36rpx;
  334. font-weight: bolder;
  335. color: #B22338;
  336. line-height: 48rpx;
  337. margin: 20rpx 0;
  338. }
  339. .introduce {
  340. padding: 0 30rpx;
  341. min-height: 44rpx;
  342. font-size: 36rpx;
  343. font-weight: bolder;
  344. color: #111111;
  345. line-height: 44rpx;
  346. margin: 20rpx 0;
  347. display: flex;
  348. justify-content: space-between;
  349. image {
  350. width: 36rpx;
  351. height: 36rpx;
  352. vertical-align: middle;
  353. }
  354. }
  355. .wrapper {}
  356. .a-t {
  357. padding: 0 30rpx;
  358. display: flex;
  359. justify-content: space-between;
  360. height: 44rpx;
  361. margin-bottom: 20rpx;
  362. }
  363. .a-m {
  364. padding: 0 30rpx;
  365. padding-bottom: 20rpx;
  366. min-height: 60rpx;
  367. .am1 {
  368. display: flex;
  369. justify-content: space-between;
  370. margin-bottom: 20rpx;
  371. .am1-1 {
  372. min-height: 40rpx;
  373. font-size: 28rpx;
  374. font-weight: 400;
  375. color: #B22338;
  376. line-height: 40rpx;
  377. }
  378. .am1-2 {
  379. height: 36rpx;
  380. font-size: 20rpx;
  381. font-weight: 400;
  382. color: #666666;
  383. line-height: 36rpx;
  384. image {
  385. margin-left: 30rpx;
  386. vertical-align: middle;
  387. height: 34rpx;
  388. width: 34rpx;
  389. }
  390. }
  391. }
  392. .am2 {
  393. margin-bottom: 20rpx;
  394. height: 34rpx;
  395. font-size: 24rpx;
  396. font-weight: 400;
  397. color: #999999;
  398. line-height: 34rpx;
  399. }
  400. }
  401. .a-b {
  402. padding: 0 30rpx;
  403. width: 100%;
  404. background: #FFF7F8;
  405. border: 1px solid dashed #333333;
  406. height: 60rpx;
  407. line-height: 60rpx;
  408. display: flex;
  409. justify-content: space-between;
  410. .a-b1 {
  411. font-size: 20rpx;
  412. font-weight: 400;
  413. color: #666666;
  414. .red {
  415. font-size: 20rpx;
  416. font-weight: 500;
  417. color: #B22338;
  418. }
  419. }
  420. .a-b2 {
  421. image {
  422. vertical-align: middle;
  423. margin-right: 30rpx;
  424. margin-left: 30rpx;
  425. height: 34rpx;
  426. width: 34rpx;
  427. }
  428. }
  429. }
  430. .self-pickup-point {
  431. background: #FFF7F8;
  432. padding-top: 20rpx;
  433. margin: 0 30rpx;
  434. margin-top: 20rpx;
  435. }
  436. .btn-area {
  437. padding: 30rpx;
  438. display: flex;
  439. justify-content: center;
  440. height: 80rpx;
  441. image {
  442. width: 28rpx;
  443. height: 28rpx;
  444. margin-right: 10rpx;
  445. }
  446. button {
  447. flex: 1;
  448. text-align: center;
  449. margin: auto;
  450. height: 64rpx;
  451. border-radius: 8rpx;
  452. line-height: 64rpx;
  453. }
  454. .share {
  455. margin-right: 20rpx;
  456. background: #F1F8E5;
  457. font-size: 24rpx;
  458. font-weight: 400;
  459. color: #75BE00;
  460. }
  461. .now {
  462. background: #F7E9EB;
  463. font-size: 24rpx;
  464. font-weight: 400;
  465. color: #B22338;
  466. }
  467. }</style>