latestGroupBuying.vue 11 KB

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