Seckill.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <template>
  2. <view :class="['qn-page-' + theme]">
  3. <!-- 自定义头部 -->
  4. <view class="nav-bar">
  5. <uniStatusBar />
  6. <view class="nav-bar-cont">
  7. <view class="nav-bar-left" @click="backPage">
  8. <text class="nv-back ibonfont ibonfanhui"></text>
  9. </view>
  10. <view class="nav-bar-center">秒杀抢购</view>
  11. </view>
  12. </view>
  13. <!-- 自定义头部 END -->
  14. <view class="goods-view" :style="{marginTop:`calc(${barHeight}px + 108rpx)`}">
  15. <view class="goods-item clearfix" v-for="(item, index) in activityList" :key="index" @click="goPage(`/pagesT/product/product?id=${item.goodsId}&skuId=${item.skuId}`)">
  16. <view class="float_left goods-img"><image :src="item.images[0]" mode="aspectFit"></image></view>
  17. <view class="float_left goods-right">
  18. <view class="goods-name">{{ item.goodsName }}</view>
  19. <view class="activity-tit">{{ item.title }}</view>
  20. <view class="activity-limitNum">每人限购{{item.limitNum}}{{item.unitName}}</view>
  21. <view class="price-view clearfix">
  22. <view class="float_left p-left">
  23. <text class="ic-rmb">¥</text>
  24. <text class="price">{{ item.price}}</text>
  25. <text class="markrt-price">¥{{ item.salePrice }}</text>
  26. </view>
  27. <view class="buy-btn float_right">
  28. <view class="activityNum-view">
  29. 爆卖{{item.activityNum}}{{item.unitName}}
  30. </view>
  31. <view>
  32. 马上抢
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import uniStatusBar from '@/components/uni-status-bar/uni-status-bar.vue';
  43. export default {
  44. components: {
  45. uniStatusBar
  46. },
  47. data() {
  48. return {
  49. tabCurrentIndex: 0,
  50. navList: [
  51. {
  52. state: 0,
  53. text: '已开抢',
  54. time: '8:00',
  55. loadingType: 'more',
  56. orderList: []
  57. },
  58. {
  59. state: 1,
  60. text: '已开抢',
  61. time: '12:00',
  62. loadingType: 'more',
  63. orderList: []
  64. },
  65. {
  66. state: 2,
  67. text: '即将开始',
  68. time: '16:00',
  69. loadingType: 'more',
  70. orderList: []
  71. },
  72. {
  73. state: 3,
  74. text: '已开抢',
  75. time: '22:00',
  76. loadingType: 'more',
  77. orderList: []
  78. },
  79. {
  80. state: 4,
  81. text: '已开抢',
  82. time: '24:00',
  83. loadingType: 'more',
  84. orderList: []
  85. }
  86. ],
  87. activityList: []
  88. };
  89. },
  90. onShareAppMessage(options) {
  91. return {
  92. title: this.$store.state.baseSet.shop,
  93. path: '/pages/index/index?businessmanId=' + (this.$store.state.userStatus.id||''),
  94. success: res => {
  95. console.log(res);
  96. }
  97. };
  98. },
  99. watch:{
  100. '$store.state.locationObj'(val){
  101. if(JSON.stringify(val)==='{}'){
  102. this.getAuthorizeInfo();
  103. return
  104. }
  105. this.getActivityAll();
  106. }
  107. },
  108. onLoad() {
  109. if(JSON.stringify(this.$store.state.locationObj)==='{}'){
  110. this.getAuthorizeInfo();
  111. return
  112. }
  113. this.getActivityAll();
  114. },
  115. // 下拉刷新
  116. onPullDownRefresh() {
  117. this.getActivityAll();
  118. },
  119. methods: {
  120. // phaseTime(item){
  121. // setInterval(() => {
  122. // item.times = this.$_utils.formatDate(item.endTime - new Date(), 'hh:mm:ss').split(':');
  123. // }, 1000);
  124. // },
  125. tabClick(item, index) {
  126. this.tabCurrentIndex = index;
  127. this.state = item.state;
  128. this.tabCurrentIndex = item.state;
  129. // this.getOrderSelect()
  130. },
  131. changeTab(e) {
  132. this.tabCurrentIndex = e.target.current;
  133. },
  134. getActivityAll() {
  135. this.$u.api.getActivityAll().then(res=>{
  136. uni.stopPullDownRefresh();
  137. this.activityList = res.data;
  138. });
  139. }
  140. }
  141. };
  142. </script>
  143. <style lang="scss">
  144. page {
  145. background: #f5f5f5;
  146. }
  147. .progress {
  148. width: 70%;
  149. }
  150. .nav-bar {
  151. position: fixed;
  152. z-index: 9;
  153. top: 0;
  154. left: 0;
  155. width: 100%;
  156. background: linear-gradient(315deg, rgba(247, 95, 48, 1) 0%, rgba(242, 58, 58, 1) 100%);
  157. color: #fff;
  158. .nav-bar-cont {
  159. position: relative;
  160. line-height: 88upx;
  161. height: 88upx;
  162. width: 100%;
  163. .nav-bar-left {
  164. position: absolute;
  165. left: 0;
  166. height: 100%;
  167. top: 0;
  168. padding-left: 12upx;
  169. .nv-back {
  170. font-size: 40rpx;
  171. color: #ffffff;
  172. transform: translateY(6upx);
  173. }
  174. }
  175. .nav-bar-center {
  176. text-align: center;
  177. width: 100%;
  178. font-size: 34upx;
  179. }
  180. }
  181. .time-view {
  182. padding-bottom: 20upx;
  183. .time-scrollx {
  184. white-space: nowrap;
  185. .time-li {
  186. display: inline-block;
  187. text-align: center;
  188. padding-right: 56upx;
  189. font-size: 38upx;
  190. opacity: 0.7;
  191. .time-status {
  192. font-size: 24upx;
  193. }
  194. }
  195. .timeOn:hover {
  196. opacity: 1;
  197. font-size: 45upx;
  198. }
  199. // &.timeOn {
  200. // opacity: 1;
  201. // }
  202. .time-li:first-child {
  203. padding-left: 30upx;
  204. }
  205. }
  206. }
  207. }
  208. .goods-view {
  209. margin-top: 146upx;
  210. .goods-item {
  211. width: 702upx;
  212. margin: 20upx auto 0;
  213. background: #fff;
  214. border-radius: 12upx;
  215. padding: 24upx 30upx;
  216. .goods-img {
  217. width: 194upx;
  218. height: 170upx;
  219. background: #f5f5f5;
  220. margin-right: 24upx;
  221. image {
  222. border-radius: 8upx;
  223. width: 100%;
  224. height: 100%;
  225. }
  226. }
  227. .goods-right {
  228. width: 414upx;
  229. .goods-name {
  230. font-size: 28upx;
  231. color: #303133;
  232. width: 100%;
  233. text-overflow: -o-ellipsis-lastline;
  234. overflow: hidden;
  235. text-overflow: ellipsis;
  236. display: -webkit-box;
  237. -webkit-line-clamp: 1;
  238. line-clamp: 1;
  239. -webkit-box-orient: vertical;
  240. }
  241. .activity-limitNum,.activity-tit{
  242. font-size: 22upx;
  243. color: #909399;
  244. font-weight: 300;
  245. white-space: nowrap;
  246. width: 100%;
  247. overflow: hidden;
  248. /* 默认溢出隐藏 */
  249. text-overflow: ellipsis;
  250. color: #F56C6C;
  251. }
  252. .activity-tit{
  253. font-weight: 600;
  254. }
  255. .activity-limitNum{
  256. color: #F56C6C;
  257. font-size: 22upx
  258. }
  259. .speed-view {
  260. width: 200upx;
  261. height: 12upx;
  262. background: #ffd9d9;
  263. border-radius: 12upx;
  264. .speed-in-view {
  265. border-radius: 12upx;
  266. width: 66%;
  267. height: 12upx;
  268. background: #f23a3a;
  269. }
  270. }
  271. .skill-num {
  272. font-size: 24upx;
  273. font-weight: 300;
  274. color: #666;
  275. margin-left: 20upx;
  276. transform: translateY(-12upx);
  277. }
  278. .price-view {
  279. .p-left {
  280. color: $price-color;
  281. .ic-rmb {
  282. font-size: 22upx;
  283. }
  284. .price {
  285. font-size: 42upx;
  286. }
  287. .markrt-price {
  288. font-size: 24upx;
  289. margin-left: 24upx;
  290. text-decoration: line-through;
  291. color: #999;
  292. }
  293. }
  294. .buy-btn {
  295. background: #f23a3a;
  296. // width: 128upx;
  297. // height: 56upx;
  298. text-align: center;
  299. // line-height: 56upx;
  300. border-radius: 4upx;
  301. padding: 6upx 30upx;
  302. color: #fff;
  303. font-size: 26upx;
  304. .activityNum-view{
  305. font-size: 20upx;
  306. padding-bottom: 2upx;
  307. }
  308. }
  309. }
  310. }
  311. }
  312. }
  313. .time-ul {
  314. padding: 10upx 0;
  315. font-size: 26upx;
  316. // margin-left: 20upx;
  317. .icon-maohao {
  318. height: 40upx;
  319. width: 20upx;
  320. text-align: center;
  321. font-size: 28upx;
  322. line-height: 40upx;
  323. }
  324. .time-li {
  325. height: 40upx;
  326. background-color: #fd463e;
  327. color: #fff;
  328. width: 50upx;
  329. line-height: 40upx;
  330. text-align: center;
  331. border-radius: 8upx;
  332. }
  333. }
  334. </style>