store.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <view class="seckill-section m-t" v-if="list">
  3. <view class="s-header">
  4. <view class="f-left-icon">
  5. <image src="https://hy.liuniu946.com/app/index/d.png" mode=""></image>
  6. </view>
  7. <view class="tit-box"><text class="tit">好店好券</text></view>
  8. <view class="tip-box">
  9. <text class="tip" >超值体验</text>
  10. </view>
  11. </view>
  12. <view class="box">
  13. <view class="title">
  14. 最强商家联盟<br>
  15. <text class="text">买到就是赚到</text>
  16. </view>
  17. <view class="textNav iconfont iconenter" @click="navToo('/pages/store/index')" ></view>
  18. </view>
  19. <scroll-view class="floor-list" scroll-x>
  20. <view :style="{width:th}" class="scoll-wrapper" >
  21. <view v-for="(item, index) in list" :key="index" class="floor-item" @click="navTo('/pages/store/shopDetail?id=' + item.id)">
  22. <image class="list-image" :src="item.image" mode="aspectFill"></image>
  23. <text class="title clamp">{{ item.name }}</text>
  24. <view class="price-box" v-if="item.cou.lenght">
  25. <image src="https://hy.liuniu946.com/app/index/yhj.png" mode=""></image>
  26. <view class="price">
  27. {{ item.cou[0].coupon_price }}元代金卷
  28. </view>
  29. <view class="price_1">
  30. ¥{{ item.cou[0].use_min_price }}
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </scroll-view>
  36. </view>
  37. </template>
  38. <script>
  39. import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
  40. import {
  41. sycoustore,
  42. } from '@/api/order.js';
  43. import {
  44. timeComputed
  45. } from '@/utils/rocessor.js';
  46. export default {
  47. components: {
  48. uniCountdown
  49. },
  50. data() {
  51. return {
  52. list: [],
  53. page: 1,
  54. limit: 10,
  55. showTime: '', //显示的时间
  56. showTImeId: '', //显示时间id用于查询数据
  57. stopTimeH: 0,
  58. stopTimeM: 0,
  59. stopTimeS: 0,
  60. th:'100%'
  61. };
  62. },
  63. created: function(e) {
  64. // 载入数据
  65. this.getList();
  66. },
  67. methods: {
  68. navTo(url) {
  69. uni.navigateTo({
  70. url
  71. });
  72. },
  73. navToo(url) {
  74. uni.switchTab({
  75. url
  76. })
  77. },
  78. getList() {
  79. sycoustore({
  80. page: this.page,
  81. limit: this.limit
  82. },
  83. this.showTImeId
  84. )
  85. .then(e => {
  86. this.list = e.data.list;
  87. console.log(e.data.list,'999999999');
  88. if(this.list.length>3){
  89. this.th=this.list.length*230+'rpx'
  90. }
  91. console.log(this.list.length,'ss');
  92. })
  93. .catch(e => {
  94. console.log(e);
  95. });
  96. },
  97. }
  98. };
  99. </script>
  100. <style lang="scss">
  101. /*优惠券专区 */
  102. .yuezhuan{
  103. text-align: center;
  104. z-index: 999;
  105. position: absolute;
  106. text-align: center;
  107. width:30%;
  108. }
  109. .seckill-section {
  110. position: relative;
  111. margin-top: 20rpx;
  112. background-color: #fff;
  113. padding: 4rpx 30rpx 24rpx;
  114. .s-header {
  115. display: flex;
  116. align-items: center;
  117. height: 92rpx;
  118. line-height: 1;
  119. .tit-box {
  120. flex-shrink: 0;
  121. }
  122. .tit {
  123. @extend %font-title;
  124. }
  125. .f-left-icon {
  126. // @extend %f-left-icon;
  127. margin-right: 5rpx;
  128. width: 37rpx;
  129. height: 36rpx;
  130. image {
  131. width: 100%;
  132. height: 100%;
  133. }
  134. }
  135. .tip-box {
  136. flex-grow: 1;
  137. display: flex;
  138. justify-content: flex-start;
  139. align-items: center;
  140. }
  141. .tip {
  142. font-size: $font-sm;
  143. color:#95A0B1;
  144. font-weight: bold;
  145. padding-left: 10rpx;
  146. padding-right: 10rpx;
  147. }
  148. .timer {
  149. display: inline-block;
  150. width: 40rpx;
  151. height: 36rpx;
  152. text-align: center;
  153. line-height: 36rpx;
  154. margin-right: 14rpx;
  155. font-size: $font-sm + 2rpx;
  156. color: #fff;
  157. border-radius: 2px;
  158. background: rgba(0, 0, 0, 0.8);
  159. }
  160. .iconenter {
  161. font-size: $font-sm;
  162. color: $font-color-light;
  163. flex: 1;
  164. text-align: right;
  165. }
  166. }
  167. .box{
  168. position: absolute;
  169. width:92%;
  170. display: flex;
  171. color: #fff;
  172. height: 220rpx;
  173. border-top-right-radius: 20rpx;
  174. border-top-left-radius: 20rpx;
  175. background: linear-gradient(to right, #F75022, #FF8B6C);
  176. .title{
  177. padding: 20rpx;
  178. font-size:38rpx;
  179. margin-left: 20rpx;
  180. .text{
  181. font-size:28rpx ;
  182. }
  183. }
  184. .textNav {
  185. text-align: center;
  186. margin-left: 40%;
  187. margin-top:40rpx;
  188. line-height: 1;
  189. padding: 15rpx 0;
  190. flex-shrink: 0;
  191. flex-grow: 1;
  192. min-width: 100rpx;
  193. }
  194. }
  195. .floor-list {
  196. margin-top: 120rpx;
  197. white-space: nowrap;
  198. background-color:#F4F4F4;
  199. padding: 20rpx;
  200. border-bottom-right-radius: 20rpx;
  201. border-bottom-left-radius: 20rpx;
  202. }
  203. .scoll-wrapper {
  204. z-index: 99;
  205. top: -80rpx;
  206. border-radius: 20rpx;
  207. padding: 20rpx;
  208. background-color: #fff;
  209. display: flex;
  210. justify-content: left;
  211. align-items: center;
  212. .noGoodsBg {
  213. display: flex;
  214. align-items: center;
  215. justify-content: center;
  216. height: 100%;
  217. position: absolute;
  218. top: 0;
  219. left: 0;
  220. width: 100%;
  221. color: $font-color-light;
  222. }
  223. .floor-item {
  224. display: flex;
  225. justify-content: center;
  226. flex-direction: column;
  227. width: 200rpx;
  228. height: 300rpx;
  229. /* #ifdef MP-WEIXIN */
  230. height: 340rpx;
  231. /* #endif */
  232. margin: 0 10rpx;
  233. background: #FFFFFF;
  234. border: 3rpx solid #F0E6CF;
  235. border-radius: 10rpx;
  236. .list-image {
  237. margin: 10rpx auto;
  238. width: 180rpx;
  239. height: 180rpx;
  240. border-radius: 6rpx;
  241. }
  242. .clamp{
  243. margin-left: 10rpx;
  244. }
  245. /* #ifdef MP-WEIXIN */
  246. .price-box{
  247. overflow: hidden;
  248. }
  249. /* #endif */
  250. .price-box image{
  251. margin-top: 4rpx;
  252. margin-left:8rpx;
  253. width: 180rpx;
  254. height: 40rpx;
  255. }
  256. .price {
  257. text-align: center;
  258. margin-top: -40rpx;
  259. margin-left: 20rpx;
  260. font-size:20rpx !important;
  261. position: absolute;
  262. color:#fff;
  263. }
  264. .price_1{
  265. font-size: 22rpx;
  266. font-weight: 500;
  267. color:#FF4C4C;
  268. line-height: 26px;
  269. }
  270. }
  271. .item{
  272. display: flex;
  273. justify-content: center;
  274. margin: 0 auto;
  275. }
  276. }
  277. }
  278. </style>