latestGroupBuying.vue 10 KB

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