latestGroupBuying.vue 11 KB

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