pinInfo.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <template>
  2. <view class="pingtuanA"
  3. :style="'background: url(' + img_url + 'pinGroup/group_bg.png) no-repeat;background-size:100% 100%;'">
  4. <view class="pintuan_left">
  5. <view class="pintuan_left_price" v-if="pinInfo.spellPrice">¥{{pinInfo.spellPrice}}</view>
  6. <view class="pintuan_left_group">
  7. <view class="pintuan_left_num">
  8. <image :src="img_url + 'pinGroup/pintuan.png'"></image>
  9. <text>{{pinInfo.requiredNum}}{{$L("人团")}}</text>
  10. </view>
  11. <view class="group_return_regiment" v-if="pinInfo.leaderPrice!=0">
  12. {{$L("团长优惠价")}}¥{{pinInfo.leaderPrice}}
  13. </view>
  14. </view>
  15. </view>
  16. <!-- promotion_start_flag 1未开始 0结束 2进行中-->
  17. <!-- 进行中 -->
  18. <view class="pintuan_right" v-if="pinInfo.state == 1">
  19. <view class="pintuan_right_num">{{$L("已拼")}}{{pinInfo.saleNum}}{{$L("件")}}</view>
  20. <view>
  21. <text style="font-size: 26rpx;">{{$L("距结束")}}</text>
  22. <div class="countdown" style="display: inline-block;width: auto;">
  23. <div class="countdown_group">
  24. <text>{{pinDay || 0}}{{$L("天")}}</text>
  25. <text class="countdown1">{{pinHours}}</text>
  26. <text class="countdown2">:</text>
  27. <text class="countdown1">{{pinMinutes}}</text>
  28. <text class="countdown2">:</text>
  29. <text class="countdown1">{{pinSeconds}}</text>
  30. </div>
  31. </div>
  32. </view>
  33. </view>
  34. <!-- 未开始 -->
  35. <view class="pintuan_right" v-if="pinInfo.state == 0">
  36. <view class="pintuan_right_num">{{$L("活动未开始")}}</view>
  37. <view>
  38. <text style="font-size: 26rpx;">{{$L("距开始")}}</text>
  39. <div class="countdown" style="display: inline-block;width: auto;">
  40. <div class="countdown_group">
  41. <text>{{pinDay || 0}}{{$L("天")}}</text>
  42. <text class="countdown1">{{pinHours}}</text>
  43. <text class="countdown2">:</text>
  44. <text class="countdown1">{{pinMinutes}}</text>
  45. <text class="countdown2">:</text>
  46. <text class="countdown1">{{pinSeconds}}</text>
  47. </div>
  48. </div>
  49. </view>
  50. </view>
  51. </view>
  52. </block>
  53. </template>
  54. <script>
  55. export default {
  56. name: 'pinInfo',
  57. props: ['pinInfo'],
  58. data() {
  59. return {
  60. img_url: getApp().globalData.imgUrl,
  61. pinDay: '00',
  62. pinHours: '00',
  63. pinMinutes: '00',
  64. pinSeconds: '00'
  65. }
  66. },
  67. created() {
  68. let countTime = 0;
  69. let now = new Date()
  70. let startTime = new Date(this.pinInfo.startTime)
  71. if (now < startTime) {
  72. countTime = (startTime.getTime() - now.getTime()) / 1000
  73. } else {
  74. countTime = this.pinInfo.distanceEndTime
  75. }
  76. this.secInterval = setInterval(() => {
  77. if (countTime == 0) {
  78. //倒计时结束,清除倒计时
  79. clearInterval(this.secInterval);
  80. this.$emit('getGoodsDetail')
  81. } else {
  82. countTime--;
  83. let day = parseInt(countTime / 60 / 60 / 24);
  84. let hours = parseInt(countTime / 60 / 60 % 24);
  85. let minutes = parseInt(countTime / 60 % 60);
  86. let seconds = parseInt(countTime % 60);
  87. this.pinDay = day;
  88. this.pinHours = hours > 9 ? hours : '0' + hours;
  89. this.pinMinutes = minutes > 9 ? minutes : '0' + minutes;
  90. this.pinSeconds = seconds > 9 ? seconds : '0' + seconds;
  91. }
  92. }, 1000)
  93. }
  94. }
  95. </script>
  96. <style>
  97. .pingtuanA {
  98. background-size: 100% 100%;
  99. width: 100%;
  100. height: 140rpx;
  101. display: flex;
  102. align-items: center;
  103. padding: 0 26rpx 0 31rpx;
  104. box-sizing: border-box;
  105. color: #FFFFFF;
  106. justify-content: space-between;
  107. }
  108. .pingtuanA .left {
  109. width: 60%;
  110. height: 100%;
  111. line-height: 100rpx;
  112. display: inline-block;
  113. float: left;
  114. overflow: hidden;
  115. }
  116. .left .jge {
  117. font-size: 51rpx;
  118. padding-left: 21rpx;
  119. }
  120. .tuanfan {
  121. float: right;
  122. font-size: 20rpx;
  123. width: 150rpx;
  124. height: 83rpx;
  125. line-height: 37rpx;
  126. padding-top: 17rpx;
  127. }
  128. .usertuan p {
  129. background: #b20a10;
  130. margin-top: 2rpx;
  131. padding: 0 12rpx;
  132. border-radius: 32rpx;
  133. }
  134. .usertuan image {
  135. width: 23rpx;
  136. height: 19rpx;
  137. margin-right: 5rpx;
  138. }
  139. .left .jge span {
  140. font-size: 32rpx;
  141. margin-right: 8rpx;
  142. }
  143. .pingtuanA .right {
  144. display: inline-block;
  145. width: 40%;
  146. height: 100%;
  147. background: transparent;
  148. padding: 12rpx 0 0 0;
  149. color: #65540f;
  150. }
  151. .dime {
  152. /* padding-left: 50rpx; */
  153. font-size: 20rpx;
  154. display: flex;
  155. align-items: center;
  156. }
  157. .dime image {
  158. display: inline-block;
  159. width: 26rpx;
  160. height: 26rpx;
  161. }
  162. .dime em {
  163. margin: 0 8rpx;
  164. }
  165. .pingtuanA .dime span {
  166. margin: 0 5rpx;
  167. display: inline-block;
  168. width: 34rpx;
  169. height: 24rpx;
  170. text-align: center;
  171. line-height: 24rpx;
  172. background: #d0b340;
  173. }
  174. .pingtuanA .dime span:nth-child(2n) {
  175. padding: 0;
  176. width: 1rpx;
  177. height: 1rpx;
  178. }
  179. .rtop {
  180. font-size: 28rpx;
  181. text-align: center;
  182. margin-bottom: 8rpx;
  183. }
  184. .pintuan_left {
  185. display: flex;
  186. flex-direction: column;
  187. }
  188. .pintuan_left_price {
  189. font-size: 44rpx;
  190. font-family: PingFang SC;
  191. font-weight: 500;
  192. color: rgba(255, 255, 255, 1);
  193. line-height: 44rpx;
  194. }
  195. .pintuan_left_group {
  196. display: flex;
  197. align-items: center;
  198. margin-top: 21rpx;
  199. min-width: 249rpx;
  200. height: 30rpx;
  201. border-radius: 15rpx 15rpx 0 15rpx;
  202. }
  203. .pintuan_left_num {
  204. min-width: 135rpx;
  205. height: 30rpx;
  206. background: #EF1720;
  207. border-radius: 15rpx;
  208. display: flex;
  209. align-items: center;
  210. justify-content: center;
  211. border: 1rpx solid #FFFFFF;
  212. box-sizing: border-box;
  213. }
  214. .pintuan_left_num image {
  215. width: 25rpx;
  216. height: 21rpx;
  217. margin-right: 9rpx;
  218. }
  219. .pintuan_left_num text {
  220. font-size: 22rpx;
  221. font-family: PingFang SC;
  222. font-weight: 400;
  223. color: rgba(255, 255, 255, 1);
  224. }
  225. .group_return_regiment {
  226. /* width:135rpx; */
  227. padding: 0 12rpx;
  228. box-sizing: border-box;
  229. height: 30rpx;
  230. background: rgba(255, 255, 255, 1);
  231. border-radius: 0 15rpx 0 15rpx;
  232. font-size: 22rpx;
  233. font-family: PingFang SC;
  234. font-weight: 400;
  235. color: rgba(233, 17, 30, 1);
  236. display: flex;
  237. align-items: center;
  238. justify-content: center;
  239. margin-left: -10rpx;
  240. }
  241. .pintuan_right {
  242. display: flex;
  243. flex-direction: column;
  244. justify-content: center;
  245. align-items: center;
  246. }
  247. .pintuan_right_num {
  248. font-size: 30rpx;
  249. font-family: PingFang SC;
  250. font-weight: 500;
  251. color: rgba(255, 255, 255, 1);
  252. }
  253. .pingtuan1 {
  254. width: 100%;
  255. height: 140rpx;
  256. display: flex;
  257. justify-content: space-between;
  258. padding: 0 20rpx 0 33rpx;
  259. box-sizing: border-box;
  260. }
  261. .count_down1 {
  262. display: flex;
  263. align-items: center;
  264. }
  265. .count_down_title {
  266. font-size: 24rpx;
  267. font-family: PingFang SC;
  268. font-weight: 500;
  269. color: rgba(255, 255, 255, 1);
  270. flex-shrink: 0;
  271. }
  272. .countdown {
  273. display: flex;
  274. align-items: center;
  275. flex-shrink: 0;
  276. }
  277. .count_down_day {
  278. font-size: 20rpx;
  279. font-family: PingFang SC;
  280. font-weight: 500;
  281. color: rgba(255, 255, 255, 1);
  282. margin: 0 9rpx;
  283. flex-shrink: 0;
  284. }
  285. .count_down_hours,
  286. .count_down_minutes,
  287. .count_down_seconds {
  288. width: 34rpx;
  289. height: 34rpx;
  290. background: rgba(255, 255, 255, 1);
  291. border-radius: 50%;
  292. text-align: center;
  293. color: #FF284D;
  294. font-size: 20rpx;
  295. display: flex;
  296. align-items: center;
  297. justify-content: center;
  298. line-height: 34rpx;
  299. }
  300. .count_down_flag {
  301. font-size: 20rpx;
  302. color: #fff;
  303. margin: 0 9rpx;
  304. }
  305. .limited_discount_hours,
  306. .limited_discount_minutes,
  307. .limited_discount_seconds {
  308. color: #B329FA;
  309. }
  310. .countdown_group {
  311. display: flex;
  312. /* align-items: center; */
  313. font-size: 24rpx;
  314. font-family: PingFang SC;
  315. font-weight: 500;
  316. color: #FFFFFF;
  317. }
  318. .countdown1 {
  319. width: 34rpx;
  320. height: 34rpx;
  321. background: #FFFFFF;
  322. border-radius: 50%;
  323. font-size: 20rpx;
  324. font-family: PingFang SC;
  325. font-weight: 500;
  326. color: #F12826;
  327. text-align: center;
  328. line-height: 34rpx;
  329. margin-left: 10rpx;
  330. }
  331. .countdown_group text:nth-of-type(1) {
  332. font-size: 24rpx;
  333. font-family: PingFang SC;
  334. font-weight: 500;
  335. color: #FFFFFF;
  336. }
  337. .countdown2 {
  338. margin-left: 10rpx;
  339. }
  340. </style>