latestGroupBuying.vue 11 KB

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