pinGroupList.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  1. <template>
  2. <!-- 拼团 查看更多 start 拼单-->
  3. <view>
  4. <div class="goods-detail-team teams" v-if="pinTeam.length>0">
  5. <view class="make_group">
  6. <text class="make_group_num"><text class="pin_title">拼团</text>{{joinedNum}}{{$L("人正在拼单,可直接参与")}}</text>
  7. <view class="make_groip_more" @tap="make_group_more_fun">
  8. <text>{{$L("查看更多")}}></text>
  9. </view>
  10. </view>
  11. <block v-for="(pin_team_item, i) in pinTeam" :key="i">
  12. <block>
  13. <view v-if="i<=1" class="make_group_content">
  14. <view class="make_group_content_left">
  15. <view class="make_group_content_left">
  16. <image :src="pin_team_item.avatar" class="make_group_avator"></image>
  17. <view :data-id="pin_team_item.id" class="make_group_name">{{pin_team_item.member_name}}</view>
  18. </view>
  19. </view>
  20. <view class="make_group_right">
  21. <view class="make_group_right1">
  22. <div class="make_group_right1">
  23. <span class="make_group_missing">{{$L('还差')}}<text>{{pin_team_item.missingNum}}</text>人</span>
  24. <view class="make_group_end">{{$L('距结束')}}<text>{{pin_team_item.distanceEndTime}}</text></view>
  25. </div>
  26. </view>
  27. <view class="make_group_right2" v-if="pin_team_item.isSelf" @tap="handleJoinGroup" :data-teamid="pin_team_item.spellTeamId"
  28. :data-isown="pin_team_item.isSelf ? true : false">{{$L("我的团")}}</view>
  29. <view class="make_group_right2" v-else @tap="handleJoinGroup" :data-isown="pin_team_item.isSelf? true : false" :data-teamid="pin_team_item.spellTeamId">去参团</view>
  30. </view>
  31. </view>
  32. </block>
  33. <!-- <block v-else>
  34. <view :data-time="pin_team_item.endd" v-if="i<=1" class="make_group_content" :tid="pin_team_item.id">
  35. <view class="make_group_content_left">
  36. <image :src="pin_team_item.avatar" :data-id="pin_team_item.id" class="make_group_avator"></image>
  37. <view :data-id="pin_team_item.id" class="make_group_name">{{pin_team_item.member_name}}</view>
  38. </view>
  39. <view class="make_group_right">
  40. <view class="make_group_right1" :data-id="pin_team_item.id">
  41. <span class="make_group_missing">还差<text>{{pin_team_item.sheng}}</text>人</span>
  42. <view class="make_group_end">距结束<text>{{pin_team_item.end_time}}</text></view>
  43. </view>
  44. <view class="make_group_right2" v-if="pin_team_item.is_own" @tap="handleJoinGroup" :data-teamid="pin_team_item.id"
  45. :data-isown="pin_team_item.is_own ? true : false">我的团</view>
  46. <view class="make_group_right2" v-else @tap="handleJoinGroup" :data-teamid="pin_team_item.id" :data-isown="pin_team_item.is_own ? true : false">去参团</view>
  47. </view>
  48. </view>
  49. </block> -->
  50. </block>
  51. </div>
  52. <!-- 拼团 查看更多 end -->
  53. <view class="join_group" v-if="join_group" @touchmove.stop.prevent="moveHandle">
  54. <view class="join_group_title">
  55. <text>{{$L("参与")}}{{pinDetail.leaderMemberName}}拼单</text>
  56. <image :src="imgUrl + 'close2.png'" @tap="hidden_mask"></image>
  57. </view>
  58. <view class="join_group_content">
  59. <view class="join_group_des">
  60. <view class="group_des_title">{{$L("参与")}}{{pinDetail.leaderMemberName}}{{$L("的拼单")}}</view>
  61. <view class="group_des_miss">还差<text>{{pinDetail.missingNum}}</text>人</view>
  62. </view>
  63. <view class="join_group_time">
  64. <text>{{$L("距离结束")}}</text>
  65. <text>{{pinDetail.distanceEndTime}}</text>
  66. </view>
  67. <view class="join_group_pro">
  68. <view v-for="(item, index) in pinDetail.memberList" :key="index" class="join_group_pre" v-if="index < 1">
  69. <image :src="item.memberAvatar"></image>
  70. <text v-if="item.isLeader == 1">{{$L("团长")}}</text>
  71. </view>
  72. <view class="add_group">
  73. <image :src="imgUrl + 'pinGroup/add_group.png'"></image>
  74. </view>
  75. </view>
  76. <image class="handleAddGroup" v-if="!pinDetail.isSelf" :data-id="pinDetail.id" @tap="switchSpecifications" data-type="join_group"
  77. :src="imgUrl + 'pinGroup/join_group.png'"></image>
  78. </view>
  79. </view>
  80. <view class="make_order_more" v-if="make_group_more" @touchmove.stop.prevent="moveHandle">
  81. <view class="make_order_title">
  82. <text>{{$L("正在拼单")}}</text>
  83. <image :src="imgUrl + 'close2.png'" @tap="hidden_mask"></image>
  84. </view>
  85. <scroll-view class="make_order_content" scroll-y>
  86. <view v-for="(pin_team_item, index) in pinTeam" :key="index" class="make_order_pre">
  87. <view class="make_order_pre_left">
  88. <image class="make_order_image" :src="pin_team_item.avatar"></image>
  89. <view class="make_order_des">
  90. <view class="make_order_des_top">
  91. <text>{{pin_team_item.member_name}}</text>
  92. <text>{{$L("还差")}}{{pin_team_item.missingNum}}{{$L("人")}}</text>
  93. </view>
  94. <view class="make_order_des_bot">
  95. {{$L("剩余")}} <text id="make_order_des_pre">{{pin_team_item.distanceEndTime}}</text>
  96. </view>
  97. </view>
  98. </view>
  99. <view class="my_group" v-if="pin_team_item.isSelf" @tap="handleJoinGroup"
  100. :data-teamid="pin_team_item.spellTeamId" :data-isown="pin_team_item.is_own ? true : false">{{$L("我的团")}}</view>
  101. <view class="my_group" v-else @tap="handleJoinGroup" :data-teamid="pin_team_item.spellTeamId"
  102. :data-isown="pin_team_item.isSelf ? true : false">{{$L("去参团")}}</view>
  103. </view>
  104. </scroll-view>
  105. </view>
  106. </view>
  107. </template>
  108. <script>
  109. export default{
  110. props:['goodsId','spellId'],
  111. data(){
  112. return{
  113. imgUrl:getApp().globalData.imgUrl,
  114. pinTeam:[],
  115. pinDetail:{},
  116. join_group:false,
  117. make_group_more:false,
  118. joinedNum:''
  119. }
  120. },
  121. created() {
  122. this.getPinTeam()
  123. },
  124. methods:{
  125. getPinTeam(){
  126. let {goodsId,spellId} = this
  127. let params = {
  128. url:'v3/promotion/front/spell/teamList',
  129. method:'GET',
  130. data:{
  131. goodsId,
  132. spellId
  133. }
  134. }
  135. this.$request(params).then(res=>{
  136. if(res.state==200){
  137. this.pinTeam = res.data.list
  138. if(res.data.list[0]){
  139. this.joinedNum=res.data.list[0].joinedNum;
  140. }
  141. this.pinTeam.map(i=>{
  142. i.avatar = i.memberList[0].memberAvatar
  143. i.member_name = i.memberList[0].memberName
  144. })
  145. this.calTime(this.pinTeam)
  146. }
  147. })
  148. },
  149. calTime(zbcp) {
  150. zbcp.map(item => {
  151. let counttime = item.distanceEndTime;
  152. let days = 0
  153. let hours = 0
  154. let minutes = 0
  155. let seconds = 0
  156. this.secInterval = setInterval(() => {
  157. if (counttime == 0) {
  158. clearInterval(this.secInterval);
  159. } else {
  160. counttime--;
  161. days = parseInt(counttime / 60 / 60 / 24)>0?parseInt(counttime / 60 / 60 / 24):0;
  162. hours = parseInt(counttime / 60 / 60 % 24)>0?parseInt(counttime / 60 / 60 % 24):0;
  163. minutes = parseInt(counttime / 60 % 60)>0?parseInt(counttime / 60 % 60):0;
  164. seconds = parseInt(counttime % 60)>0?parseInt(counttime % 60):0;
  165. let arr = [days,hours,minutes,seconds].map(i=>
  166. i.toString().length>1?i:'0'+i
  167. )
  168. item.distanceEndTime = arr.join(':')
  169. }
  170. }, 1000)
  171. })
  172. },
  173. switchSpecifications(){
  174. this.$emit('handleJoinGroup',{pinState:3})
  175. this.join_group = false
  176. this.make_group_more = false
  177. },
  178. hidden_mask(){
  179. this.$emit('handleJoinGroup',{pinState:2})
  180. this.join_group = false
  181. this.make_group_more = false
  182. },
  183. handleJoinGroup(e) {
  184. let spellTeamId = e.currentTarget.dataset.teamid
  185. this.$emit('handleJoinGroup',{pinState:1,spellTeamId})
  186. this.join_group = true
  187. this.make_group_more = false
  188. this.pinDetail = this.pinTeam.find(i=>i.spellTeamId == spellTeamId)
  189. this.$forceUpdate()
  190. },
  191. make_group_more_fun() {
  192. this.$emit('make_group_more_fun')
  193. this.make_group_more = true
  194. },
  195. }
  196. }
  197. </script>
  198. <style lang="scss">
  199. .goods-detail-team {
  200. background: #fff;
  201. margin-top: 17.94rpx;
  202. padding: 20rpx 20rpx 0;
  203. box-sizing: border-box;
  204. }
  205. .goods-detail-team>.teams_h4 {
  206. font-size: 27.6rpx;
  207. color: #333;
  208. }
  209. .goods-detail-team .teams_a {
  210. display: block;
  211. border: 1px #ee1b21 solid;
  212. border-radius: 100px;
  213. height: 49px;
  214. width: 100%;
  215. overflow: hidden;
  216. margin-top: 15px;
  217. }
  218. .pin_title{
  219. font-size: 28rpx;
  220. font-family: PingFang SC;
  221. font-weight: 500;
  222. color: #666666;
  223. margin-right: 36rpx;
  224. }
  225. .goods-detail-team b {
  226. width: 100%;
  227. display: block;
  228. width: 100%;
  229. text-align: center;
  230. font-size: 25.3rpx;
  231. color: #888;
  232. font-weight: normal;
  233. margin-top: 10px;
  234. }
  235. .goods-detail-team .teams_a image {
  236. float: left;
  237. width: 45px;
  238. height: 45px;
  239. margin: 2px;
  240. border-radius: 92rpx;
  241. }
  242. .goods-detail-team .teams_a .team_item_h2,
  243. .goods-detail-team .teams_a .team_item_h4 {
  244. font-size: 27.6rpx;
  245. line-height: 15px;
  246. display: block;
  247. }
  248. .goods-detail-team .teams_a .team_item_h3,
  249. .goods-detail-team .teams_a .team_item_h5 {
  250. font-size: 24rpx;
  251. font-family: PingFang SC;
  252. font-weight: 500;
  253. color: #333333;
  254. line-height: 36rpx;
  255. }
  256. .make_group_end {
  257. font-size: 24rpx;
  258. font-family: PingFang SC;
  259. font-weight: 500;
  260. color: #333333;
  261. line-height: 36rpx;
  262. }
  263. .make_group_end text {
  264. color: #999999;
  265. }
  266. .goods-detail-team .teams_a .team_item_h3 {
  267. width: 100%;
  268. overflow: hidden;
  269. text-overflow: ellipsis;
  270. white-space: nowrap;
  271. line-height: 19px;
  272. }
  273. .goods-detail-team .teams_a .fl {
  274. float: left;
  275. width: 21%;
  276. padding: 5px 0 5px 4px;
  277. }
  278. .goods-detail-team .teams_a .team_item_h6,
  279. .goods-detail-team .teams_a .fr {
  280. float: right;
  281. }
  282. .goods-detail-team .teams_a .fr {
  283. text-align: right;
  284. padding: 12rpx 10rpx 12rpx 0;
  285. height: 49px;
  286. line-height: 49px;
  287. display: flex;
  288. flex-direction: column;
  289. justify-content: space-between;
  290. box-sizing: border-box;
  291. }
  292. .goods-detail-team .teams_a .team_item_h6 {
  293. line-height: 49px;
  294. background: #ee1b21;
  295. color: #fff;
  296. display: block;
  297. padding: 0 15px;
  298. font-size: 32.2rpx;
  299. }
  300. .goods-detail-team .teams_a .team_item_h6:before {
  301. content: '去参团';
  302. display: inline-block;
  303. }
  304. .goods-detail-team .teams_a .team_item_h6:after {
  305. display: inline-block;
  306. margin-left: 10px;
  307. width: 5px;
  308. content: ' ';
  309. height: 5px;
  310. border-left: 1px #fff solid;
  311. border-top: 1px #fff solid;
  312. transform: rotate(135deg);
  313. vertical-align: middle;
  314. }
  315. .goods-detail-team .teams_a.on .team_item_h6:before {
  316. content: '已选择';
  317. }
  318. .goods-detail-team .teams_a .team_item_h6.own:before {
  319. content: '我的团';
  320. }
  321. .goods-detail-team .teams_a .team_item_h6.oth:before {
  322. content: '其他团';
  323. }
  324. .goods-detail-team .teams_a .team_item_h4 {
  325. color: #ee1b21;
  326. }
  327. .goods-detail-team .teams_a .team_item_h5 {
  328. line-height: 12px;
  329. }
  330. .make_group {
  331. display: flex;
  332. align-items: center;
  333. width: 100%;
  334. justify-content: space-between;
  335. }
  336. .make_group_num {
  337. font-size: 26rpx;
  338. font-family: PingFang SC;
  339. font-weight: 500;
  340. color: rgba(45, 45, 45, 1);
  341. line-height: 45rpx;
  342. }
  343. .make_groip_more {
  344. display: flex;
  345. align-items: center;
  346. }
  347. .make_groip_more text {
  348. font-size: 24rpx;
  349. font-family: PingFang SC;
  350. font-weight: 500;
  351. color: rgba(251, 27, 27, 1);
  352. }
  353. .make_groip_more image {
  354. width: 12rpx;
  355. height: 20rpx;
  356. }
  357. .make_group_content {
  358. display: flex;
  359. align-items: center;
  360. justify-content: space-between;
  361. width: 100%;
  362. height: 125rpx;
  363. border-bottom: 1rpx solid #E5E5E5;
  364. }
  365. .make_group_content:nth-last-of-type(1) {
  366. border-bottom: 0;
  367. }
  368. .make_group_content_left {
  369. display: flex;
  370. align-items: center;
  371. }
  372. .make_group_avator {
  373. width: 64rpx;
  374. height: 64rpx;
  375. background: rgba(208, 208, 208, 1);
  376. border-radius: 50%;
  377. }
  378. .make_group_name {
  379. font-size: 32rpx;
  380. font-family: PingFang SC;
  381. font-weight: 500;
  382. color: rgba(45, 45, 45, 1);
  383. line-height: 45rpx;
  384. margin-left: 20rpx;
  385. }
  386. .make_group_missing {
  387. font-size: 24rpx;
  388. font-family: PingFang SC;
  389. font-weight: 500;
  390. color: rgba(51, 51, 51, 1);
  391. line-height: 36rpx;
  392. }
  393. .make_group_missing text {
  394. color: #FC1C1C;
  395. }
  396. .make_group_right {
  397. display: flex;
  398. align-items: center;
  399. }
  400. .make_group_right1 {
  401. display: flex;
  402. flex-direction: column;
  403. align-items: flex-end;
  404. margin-right: 20rpx;
  405. }
  406. .make_group_right2 {
  407. width: 120rpx;
  408. height: 50rpx;
  409. background: rgba(252, 28, 28, 1);
  410. border-radius: 25rpx;
  411. font-size: 24rpx;
  412. font-family: PingFang SC;
  413. font-weight: 500;
  414. color: rgba(255, 255, 255, 1);
  415. line-height: 50rpx;
  416. text-align: center;
  417. }
  418. .make_rroup_time {
  419. font-size: 24rpx;
  420. font-family: PingFang SC;
  421. font-weight: 500;
  422. color: rgba(51, 51, 51, 1);
  423. line-height: 36rpx;
  424. }
  425. .make_rroup_time text {
  426. color: #999999;
  427. }
  428. .join_group {
  429. width: 580rpx;
  430. height: 415rpx;
  431. background: rgba(255, 255, 255, 1);
  432. border-radius: 15rpx;
  433. position: fixed;
  434. z-index: 100;
  435. left: 50%;
  436. top: 50%;
  437. margin-left: -290rpx;
  438. margin-top: -207rpx;
  439. }
  440. .join_group_title {
  441. display: flex;
  442. justify-content: space-between;
  443. align-items: center;
  444. padding: 0 30rpx;
  445. box-sizing: border-box;
  446. height: 80rpx;
  447. border-bottom: 1rpx solid #F7F7F7;
  448. }
  449. .join_group_title text {
  450. font-size: 32rpx;
  451. font-family: PingFang SC;
  452. font-weight: 500;
  453. color: rgba(45, 45, 45, 1);
  454. line-height: 45rpx;
  455. }
  456. .join_group_title image {
  457. width: 22rpx;
  458. height: 22rpx;
  459. }
  460. .join_group_content {
  461. padding-top: 38rpx;
  462. box-sizing: border-box;
  463. display: flex;
  464. flex-direction: column;
  465. align-items: center;
  466. }
  467. .join_group_des {
  468. display: flex;
  469. align-items: center;
  470. }
  471. .group_des_title {
  472. font-size: 28rpx;
  473. font-family: PingFang SC;
  474. font-weight: 500;
  475. color: rgba(45, 45, 45, 1);
  476. line-height: 45rpx;
  477. margin-right: 30rpx;
  478. }
  479. .group_des_miss {
  480. font-size: 28rpx;
  481. font-family: PingFang SC;
  482. font-weight: 500;
  483. color: #999;
  484. line-height: 45rpx;
  485. }
  486. .group_des_miss text {
  487. color: #FC1D1B;
  488. }
  489. .join_group_time {
  490. display: flex;
  491. align-items: center;
  492. margin-top: 19rpx;
  493. }
  494. .join_group_time text:nth-child(1) {
  495. font-size: 24rpx;
  496. font-family: PingFang SC;
  497. font-weight: 500;
  498. color: rgba(148, 148, 148, 1);
  499. line-height: 45rpx;
  500. }
  501. .join_group_time text:nth-child(2) {
  502. font-size: 24rpx;
  503. font-family: PingFang SC;
  504. font-weight: 500;
  505. color: #FF0000;
  506. line-height: 45rpx;
  507. margin-left: 20rpx;
  508. }
  509. .join_group_pro {
  510. display: flex;
  511. align-items: center;
  512. margin: 25rpx 0 20rpx;
  513. }
  514. .join_group_pre {
  515. position: relative;
  516. }
  517. .join_group_pre image {
  518. width: 80rpx;
  519. height: 80rpx;
  520. border-radius: 50%;
  521. }
  522. .join_group_pre text {
  523. position: absolute;
  524. bottom: 13rpx;
  525. left: 10rpx;
  526. width: 54rpx;
  527. height: 26rpx;
  528. background: rgba(255, 0, 0, 1);
  529. border-radius: 13rpx;
  530. font-size: 20rpx;
  531. font-family: PingFang SC;
  532. font-weight: 500;
  533. color: rgba(255, 255, 255, 1);
  534. display: flex;
  535. align-items: center;
  536. justify-content: center;
  537. }
  538. .add_group,
  539. .add_group image {
  540. width: 80rpx;
  541. height: 80rpx;
  542. }
  543. .handleAddGroup {
  544. width: 240rpx;
  545. height: 50rpx;
  546. }
  547. .make_order_more {
  548. width: 580rpx;
  549. height: 773rpx;
  550. background: rgba(255, 255, 255, 1);
  551. border-radius: 15rpx;
  552. position: fixed;
  553. z-index: 100;
  554. left: 50%;
  555. top: 50%;
  556. margin-left: -290rpx;
  557. margin-top: -386rpx;
  558. }
  559. .make_order_title {
  560. width: 100%;
  561. height: 80rpx;
  562. display: flex;
  563. justify-content: space-between;
  564. align-items: center;
  565. padding: 0 30rpx;
  566. box-sizing: border-box;
  567. border-bottom: 1rpx solid #F7F7F7;
  568. }
  569. .make_order_title text {
  570. font-size: 32rpx;
  571. font-family: PingFang SC;
  572. font-weight: 500;
  573. color: rgba(45, 45, 45, 1);
  574. line-height: 45rpx;
  575. }
  576. .make_order_title image {
  577. width: 22rpx;
  578. height: 22rpx;
  579. }
  580. .make_order_content {
  581. width: 100%;
  582. height: 630rpx;
  583. }
  584. .make_order_pre {
  585. width: 100%;
  586. height: 95rpx;
  587. display: flex;
  588. align-items: center;
  589. justify-content: space-between;
  590. padding: 0 30rpx;
  591. box-sizing: border-box;
  592. border-bottom: 1rpx solid #F5F5F5;
  593. }
  594. .make_order_image {
  595. width: 64rpx;
  596. height: 64rpx;
  597. border-radius: 50%;
  598. margin-right: 19rpx;
  599. }
  600. .make_order_des {
  601. display: flex;
  602. flex-direction: column;
  603. }
  604. .make_order_des_top {
  605. display: flex;
  606. }
  607. .make_order_des_top text:nth-child(1) {
  608. font-size: 28rpx;
  609. font-family: PingFang SC;
  610. font-weight: 500;
  611. color: rgba(45, 45, 45, 1);
  612. line-height: 45rpx;
  613. }
  614. .make_order_des_top text:nth-child(2) {
  615. font-size: 24rpx;
  616. font-family: PingFang SC;
  617. font-weight: 500;
  618. color: #999999;
  619. line-height: 45rpx;
  620. margin-left: 10rpx;
  621. }
  622. .make_order_des_bot {
  623. font-size: 22rpx;
  624. font-family: PingFang SC;
  625. font-weight: 500;
  626. color: rgba(153, 153, 153, 1);
  627. line-height: 45rpx;
  628. }
  629. .my_group {
  630. width: 120rpx;
  631. height: 50rpx;
  632. background: rgba(255, 0, 0, 1);
  633. border-radius: 25rpx;
  634. font-size: 24rpx;
  635. font-family: PingFang SC;
  636. font-weight: 500;
  637. color: rgba(248, 248, 248, 1);
  638. line-height: 50rpx;
  639. text-align: center;
  640. }
  641. .group_pre_num {
  642. display: fixed;
  643. bottom: 0;
  644. z-index: 250;
  645. font-size: 22rpx;
  646. font-family: PingFang SC;
  647. font-weight: 500;
  648. color: rgba(153, 153, 153, 1);
  649. line-height: 45rpx;
  650. text-align: center;
  651. }
  652. .make_order_pre_left {
  653. display: flex;
  654. align-items: center;
  655. }
  656. </style>