createOrder_coupon.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. <template>
  2. <view class="mask" :class="maskState === 0 ? 'none' : maskState === 1 ? 'show' : ''" @click="toggleMask">
  3. <view class="mask-content">
  4. <!-- 优惠券页面,仿mt -->
  5. <view class="coupon-item" @click="chooseCoupon(item)" v-for="(item, index) in couponList" :key="index" v-if="showCoupon(item.man)">
  6. <view class="con">
  7. <view class="left">
  8. <text class="title">{{ item.title }}</text>
  9. <text class="time">有效期至{{ item.time }}</text>
  10. </view>
  11. <view class="right">
  12. <text class="price">{{ item.price }}</text>
  13. <text>满{{ item.man }}可用</text>
  14. </view>
  15. <view class="circle l"></view>
  16. <view class="circle r"></view>
  17. </view>
  18. <text class="tips">{{ item.type }}</text>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. props: {
  26. couponList: {
  27. type: Array,
  28. default: () => []
  29. },
  30. totalPrice: [String, Number]
  31. },
  32. data() {
  33. return {
  34. maskState: 0
  35. };
  36. },
  37. methods: {
  38. showCoupon(money) {
  39. if ((+this.totalPrice) >= (+money) ) {
  40. return true;
  41. } else {
  42. return false;
  43. }
  44. },
  45. toggleMask() {
  46. this.$emit('closeCoupon', '');
  47. },
  48. //选择优惠券
  49. chooseCoupon(e) {
  50. this.$emit('change', e);
  51. }
  52. }
  53. };
  54. </script>
  55. <style lang="scss">
  56. page {
  57. background: $page-color-base;
  58. padding-bottom: 100rpx;
  59. }
  60. .address-section {
  61. padding: 30rpx 0;
  62. background: #fff;
  63. position: relative;
  64. .order-content {
  65. display: flex;
  66. align-items: center;
  67. }
  68. .iconlocation {
  69. flex-shrink: 0;
  70. display: flex;
  71. align-items: center;
  72. justify-content: center;
  73. width: 90rpx;
  74. color: #888;
  75. font-size: 44rpx;
  76. }
  77. .cen {
  78. display: flex;
  79. flex-direction: column;
  80. flex: 1;
  81. font-size: 28rpx;
  82. color: $font-color-dark;
  83. }
  84. .name {
  85. font-size: 34rpx;
  86. margin-right: 24rpx;
  87. }
  88. .address {
  89. margin-top: 16rpx;
  90. margin-right: 20rpx;
  91. color: $font-color-light;
  92. }
  93. .icon-you {
  94. font-size: 32rpx;
  95. color: $font-color-light;
  96. margin-right: 30rpx;
  97. }
  98. .a-bg {
  99. position: absolute;
  100. left: 0;
  101. bottom: 0;
  102. display: block;
  103. width: 100%;
  104. height: 5rpx;
  105. }
  106. }
  107. .goods-section {
  108. margin-top: 16rpx;
  109. background: #fff;
  110. padding-bottom: 1px;
  111. .g-header {
  112. display: flex;
  113. align-items: center;
  114. height: 84rpx;
  115. padding: 0 30rpx;
  116. position: relative;
  117. }
  118. .logo {
  119. display: block;
  120. width: 50rpx;
  121. height: 50rpx;
  122. border-radius: 100px;
  123. }
  124. .name {
  125. font-size: 30rpx;
  126. color: $font-color-base;
  127. margin-left: 24rpx;
  128. }
  129. .g-item {
  130. display: flex;
  131. margin: 20rpx 30rpx;
  132. image {
  133. flex-shrink: 0;
  134. display: block;
  135. width: 140rpx;
  136. height: 140rpx;
  137. border-radius: 4rpx;
  138. }
  139. .right {
  140. flex: 1;
  141. padding-left: 24rpx;
  142. overflow: hidden;
  143. }
  144. .title {
  145. font-size: 30rpx;
  146. color: $font-color-dark;
  147. }
  148. .spec {
  149. font-size: 26rpx;
  150. color: $font-color-light;
  151. }
  152. .price-box {
  153. display: flex;
  154. align-items: center;
  155. font-size: 32rpx;
  156. color: $font-color-dark;
  157. padding-top: 10rpx;
  158. .price {
  159. margin-bottom: 4rpx;
  160. }
  161. .number {
  162. font-size: 26rpx;
  163. color: $font-color-base;
  164. margin-left: 20rpx;
  165. }
  166. }
  167. .step-box {
  168. position: relative;
  169. }
  170. }
  171. }
  172. .yt-list {
  173. margin-top: 16rpx;
  174. background: #fff;
  175. }
  176. .yt-list-cell {
  177. display: flex;
  178. align-items: center;
  179. padding: 10rpx 30rpx 10rpx 40rpx;
  180. line-height: 70rpx;
  181. position: relative;
  182. &.cell-hover {
  183. background: #fafafa;
  184. }
  185. &.b-b:after {
  186. left: 30rpx;
  187. }
  188. .cell-icon {
  189. height: 32rpx;
  190. width: 32rpx;
  191. font-size: 22rpx;
  192. color: #fff;
  193. text-align: center;
  194. line-height: 32rpx;
  195. background: #f85e52;
  196. border-radius: 4rpx;
  197. margin-right: 12rpx;
  198. &.hb {
  199. background: #ffaa0e;
  200. }
  201. &.lpk {
  202. background: #3ab54a;
  203. }
  204. }
  205. .cell-more {
  206. align-self: center;
  207. font-size: 24rpx;
  208. color: $font-color-light;
  209. margin-left: 8rpx;
  210. margin-right: -10rpx;
  211. }
  212. .cell-tit {
  213. flex: 1;
  214. font-size: 26rpx;
  215. color: $font-color-light;
  216. margin-right: 10rpx;
  217. }
  218. .cell-tip {
  219. font-size: 26rpx;
  220. color: $font-color-dark;
  221. &.disabled {
  222. color: $font-color-light;
  223. }
  224. &.active {
  225. color: $base-color;
  226. }
  227. &.red {
  228. color: $base-color;
  229. }
  230. }
  231. &.desc-cell {
  232. .cell-tit {
  233. max-width: 90rpx;
  234. }
  235. }
  236. .desc {
  237. flex: 1;
  238. font-size: $font-base;
  239. color: $font-color-dark;
  240. }
  241. }
  242. /* 支付列表 */
  243. .pay-list {
  244. padding-left: 40rpx;
  245. margin-top: 16rpx;
  246. background: #fff;
  247. .pay-item {
  248. display: flex;
  249. align-items: center;
  250. padding-right: 20rpx;
  251. line-height: 1;
  252. height: 110rpx;
  253. position: relative;
  254. }
  255. .icon-weixinzhifu {
  256. width: 80rpx;
  257. font-size: 40rpx;
  258. color: #6bcc03;
  259. }
  260. .icon-alipay {
  261. width: 80rpx;
  262. font-size: 40rpx;
  263. color: #06b4fd;
  264. }
  265. .icon-xuanzhong2 {
  266. display: flex;
  267. align-items: center;
  268. justify-content: center;
  269. width: 60rpx;
  270. height: 60rpx;
  271. font-size: 40rpx;
  272. color: $base-color;
  273. }
  274. .tit {
  275. font-size: 32rpx;
  276. color: $font-color-dark;
  277. flex: 1;
  278. }
  279. }
  280. .footer {
  281. position: fixed;
  282. left: 0;
  283. bottom: 0;
  284. z-index: 995;
  285. display: flex;
  286. align-items: center;
  287. width: 100%;
  288. height: 90rpx;
  289. justify-content: space-between;
  290. font-size: 30rpx;
  291. background-color: #fff;
  292. z-index: 998;
  293. color: $font-color-base;
  294. box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
  295. .price-content {
  296. padding-left: 30rpx;
  297. }
  298. .price-tip {
  299. color: $base-color;
  300. margin-left: 8rpx;
  301. }
  302. .price {
  303. font-size: 36rpx;
  304. color: $base-color;
  305. }
  306. .submit {
  307. display: flex;
  308. align-items: center;
  309. justify-content: center;
  310. width: 280rpx;
  311. height: 100%;
  312. color: #fff;
  313. font-size: 32rpx;
  314. background-color: $base-color;
  315. }
  316. }
  317. /* 优惠券面板 */
  318. .mask {
  319. display: flex;
  320. align-items: flex-end;
  321. position: fixed;
  322. left: 0;
  323. top: var(--window-top);
  324. bottom: 0;
  325. width: 100%;
  326. background: rgba(0, 0, 0, 0);
  327. z-index: 9995;
  328. transition: 0.3s;
  329. .mask-content {
  330. width: 100%;
  331. min-height: 30vh;
  332. max-height: 70vh;
  333. background: #f3f3f3;
  334. transform: translateY(100%);
  335. transition: 0.3s;
  336. overflow-y: scroll;
  337. }
  338. &.none {
  339. display: none;
  340. }
  341. &.show {
  342. background: rgba(0, 0, 0, 0.4);
  343. .mask-content {
  344. transform: translateY(0);
  345. }
  346. }
  347. }
  348. /* 优惠券列表 */
  349. .coupon-item {
  350. display: flex;
  351. flex-direction: column;
  352. margin: 20rpx 24rpx;
  353. background: #fff;
  354. .con {
  355. display: flex;
  356. align-items: center;
  357. position: relative;
  358. height: 120rpx;
  359. padding: 0 30rpx;
  360. &:after {
  361. position: absolute;
  362. left: 0;
  363. bottom: 0;
  364. content: '';
  365. width: 100%;
  366. height: 0;
  367. border-bottom: 1px dashed #f3f3f3;
  368. transform: scaleY(50%);
  369. }
  370. }
  371. .left {
  372. display: flex;
  373. flex-direction: column;
  374. justify-content: center;
  375. flex: 1;
  376. overflow: hidden;
  377. height: 100rpx;
  378. }
  379. .title {
  380. font-size: 32rpx;
  381. color: $font-color-dark;
  382. margin-bottom: 10rpx;
  383. }
  384. .time {
  385. font-size: 24rpx;
  386. color: $font-color-light;
  387. }
  388. .right {
  389. display: flex;
  390. flex-direction: column;
  391. justify-content: center;
  392. align-items: center;
  393. font-size: 26rpx;
  394. color: $font-color-base;
  395. height: 100rpx;
  396. }
  397. .price {
  398. font-size: 44rpx;
  399. color: $base-color;
  400. &:before {
  401. content: '¥';
  402. font-size: 34rpx;
  403. }
  404. }
  405. .tips {
  406. font-size: 24rpx;
  407. color: $font-color-light;
  408. line-height: 60rpx;
  409. padding-left: 30rpx;
  410. }
  411. .circle {
  412. position: absolute;
  413. left: -6rpx;
  414. bottom: -10rpx;
  415. z-index: 10;
  416. width: 20rpx;
  417. height: 20rpx;
  418. background: #f3f3f3;
  419. border-radius: 100px;
  420. &.r {
  421. left: auto;
  422. right: -6rpx;
  423. }
  424. }
  425. }
  426. </style>