couponList.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  1. <template>
  2. <view class="container">
  3. <view class="h">
  4. <view :class="'item ' + (status == 10 ? 'active' : '')" @tap="switchTab" data-index="10">
  5. <view class="txt">未使用</view>
  6. </view>
  7. <view :class="'item ' + (status == 1 ? 'active' : '')" @tap="switchTab" data-index="1">
  8. <view class="txt">已使用</view>
  9. </view>
  10. <view :class="'item ' + (status == 12 ? 'active' : '')" @tap="switchTab" data-index="12">
  11. <view class="txt">已过期</view>
  12. </view>
  13. </view>
  14. <!-- <van-tabs active="{{status}}" color="#09afff" bind:change="onTabChange">
  15. <van-tab title="未使用" name="10"></van-tab>
  16. <van-tab title="已使用" name="1"></van-tab>
  17. <van-tab title="已过期" name="12"></van-tab>
  18. </van-tabs> -->
  19. <view class="b">
  20. <!-- <view class="coupon-form" wx:if="{{status == 0}}">
  21. <view class="input-box">
  22. <input class="coupon-sn" placeholder="请输入优惠码" value="{{code}}" bindinput="bindExchange" />
  23. <van-icon name="close" class="clear-icon" wx:if="{{ code.length > 0 }}" catchtap="clearExchange" />
  24. </view>
  25. <view class="add-btn" bindtap='goExchange'>兑换</view>
  26. </view> -->
  27. <view v-if="status == 0" class="coupon-switch-block">
  28. <view
  29. :data-type="item.type"
  30. :class="'type-switch ' + (item.type === currentType ? 'active-switch' : '')"
  31. @tap="switchType"
  32. v-for="(item, index) in typeList"
  33. :key="index"
  34. >
  35. {{ item.name }}
  36. </view>
  37. </view>
  38. <scroll-view :scroll-y="true" :scroll-top="scrollTop" class="my-coupon-list">
  39. <!-- 未使用 -->
  40. <view class="my-coupon-item-valid" v-if="status == 0" v-for="(item, index) in couponList" :key="index">
  41. <view v-if="item.type == 4" class="marker">{{ item.name }}</view>
  42. <view class="coupon-top">
  43. <view class="coupon-top-left">
  44. <view class="coupon-value">
  45. <text v-if="item.voucherType == 1" :class="item.type == 4 ? 'coupon-flag-member' : 'coupon-flag'">¥</text>
  46. <text :class="item.type == 4 ? 'coupon-value-member' : 'coupon-value-num'" v-if="item.voucherType == 1">{{ item.discount }}</text>
  47. <text :class="item.type == 4 ? 'coupon-value-member' : 'coupon-value-num'" v-if="item.voucherType == 2">{{ item.discount / 10 }}</text>
  48. <text v-if="item.voucherType == 2" :class="item.type == 4 ? 'coupon-unit-member' : 'coupon-unit'">折</text>
  49. </view>
  50. <view class="coupon-type">
  51. <text v-if="item.voucherType == 1" style="color: #555555">满{{ item.min }}可用</text>
  52. <text v-if="item.voucherType == 2" style="color: #555555">满{{ item.min }}可用</text>
  53. </view>
  54. </view>
  55. <view class="coupon-top-content">
  56. <view class="coupon-valid-name">{{ item.name }}</view>
  57. <view>有效期至:{{ item.endTime }}</view>
  58. </view>
  59. </view>
  60. <view class="coupon-bottom">
  61. <text v-if="item.desc && item.name != item.desc">{{ item.desc }}</text>
  62. <text v-else></text>
  63. <view :class="item.type == 4 ? 'coupon-top-member' : 'coupon-top-right'" :data-id="item.couponId" :data-goodsvalue="item.goodsValue" @tap="goService">
  64. 立即使用
  65. </view>
  66. </view>
  67. </view>
  68. <!-- 已使用 已过期 -->
  69. <view class="my-coupon-item" v-if="status != 0" v-for="(item, index) in couponList" :key="index">
  70. <view class="coupon-left">
  71. <view>
  72. ¥
  73. <text class="coupon-amount">{{ item.discount }}</text>
  74. </view>
  75. <view class="coupon-type">
  76. <!-- {{item.name}} -->
  77. <span v-if="item.voucherType == 1">立减券</span>
  78. <span v-if="item.voucherType == 2">满减券</span>
  79. <span v-if="item.voucherType == 4">代金券</span>
  80. </view>
  81. <view
  82. v-if="status == 10"
  83. :class="'coupon-btn ' + (item.status === 10 ? 'active-btn' : '')"
  84. :data-id="item.couponId"
  85. :data-goodsvalue="item.goodsValue"
  86. @tap="goService"
  87. >
  88. 立即使用
  89. </view>
  90. </view>
  91. <view class="coupon-content">
  92. <view class="coupon-name">{{ item.name }}</view>
  93. <view class="coupon-date">有效期开始:{{ item.startTime }}</view>
  94. <view class="coupon-date">有效期结束:{{ item.endTime }}</view>
  95. </view>
  96. <view class="coupon-right">
  97. <image class="coupon-status" mode="aspectFit" v-if="item.status == 1" src="/static/images/coupon-used.png"></image>
  98. <image class="coupon-status" mode="aspectFit" v-if="item.status == 2" src="/static/images/coupon-invalid.png"></image>
  99. </view>
  100. </view>
  101. <view class="page" v-if="showPage">
  102. <view :class="'prev ' + (page <= 1 ? 'disabled' : '')" @tap="prevPage">上一页</view>
  103. <view :class="'next ' + (count / size < page ? 'disabled' : '')" @tap="nextPage">下一页</view>
  104. </view>
  105. </scroll-view>
  106. <!-- <scroll-view class="coupon-list" scroll-y="true" scroll-top="{{scrollTop}}">
  107. <view class="item {{ status == 0 ? 'active' : ''}}" wx:for="{{couponList}}" wx:for-index="index" wx:for-item="item" wx:key="id">
  108. <view class="tag">{{item.tag}}</view>
  109. <view class="content">
  110. <view class="left">
  111. <view class="discount">{{item.discount}}元</view>
  112. <view class="min"> 满{{item.min}}元使用</view>
  113. </view>
  114. <view class="right">
  115. <view class="name">{{item.name}}</view>
  116. <view class="time"> 有效期:{{item.startTime}} - {{item.endTime}}</view>
  117. </view>
  118. </view>
  119. <view class="condition">
  120. <text class="txt">{{item.desc}}</text>
  121. <image src="{{item.pic}}" class="icon"></image>
  122. </view>
  123. </view>
  124. <view class="page" wx:if="{{showPage}}">
  125. <view class="prev {{ page <= 1 ? 'disabled' : ''}}" bindtap="prevPage">上一页</view>
  126. <view class="next {{ (count / size) < page ? 'disabled' : ''}}" bindtap="nextPage">下一页</view>
  127. </view>
  128. </scroll-view> -->
  129. <view class="no-list" v-if="couponList == 0">没有更多了</view>
  130. </view>
  131. </view>
  132. </template>
  133. <script>
  134. var util = require('../../../utils/util.js');
  135. var api = require('../../../config/api.js');
  136. var app = getApp();
  137. export default {
  138. data() {
  139. return {
  140. couponList: [],
  141. code: '',
  142. codeChannelType: '',
  143. //2是抖音 其他小商城
  144. status: 10,
  145. page: 1,
  146. limit: 20,
  147. count: 0,
  148. scrollTop: 0,
  149. showPage: false,
  150. currentType: 0,
  151. typeList: [
  152. {
  153. name: '全部',
  154. type: 0
  155. },
  156. {
  157. name: '代金券',
  158. type: 4
  159. },
  160. {
  161. name: '立减券',
  162. type: 1
  163. },
  164. {
  165. name: '满减券',
  166. type: 2
  167. }
  168. ],
  169. totalList: [],
  170. size: 0
  171. };
  172. }
  173. /**
  174. * 生命周期函数--监听页面加载
  175. */,
  176. onLoad: function (options) {
  177. console.info(options);
  178. let that = this;
  179. that.getCouponList();
  180. },
  181. /**
  182. * 生命周期函数--监听页面显示
  183. */
  184. onShow: function () {
  185. // if (app.globalData.hasLogin && this.data.code.length > 0) {
  186. // if (this.data.codeChannelType && this.data.codeChannelType == 2)
  187. // this.goDouyinExchange();
  188. // else
  189. // this.goExchange();
  190. // }
  191. },
  192. /**
  193. * 生命周期函数--监听页面初次渲染完成
  194. */
  195. onReady: function () {},
  196. /**
  197. * 生命周期函数--监听页面隐藏
  198. */
  199. onHide: function () {},
  200. /**
  201. * 生命周期函数--监听页面卸载
  202. */
  203. onUnload: function () {},
  204. /**
  205. * 页面相关事件处理函数--监听用户下拉动作
  206. */
  207. onPullDownRefresh() {
  208. uni.showNavigationBarLoading(); //在标题栏中显示加载
  209. this.getCouponList();
  210. uni.hideNavigationBarLoading(); //完成停止加载
  211. uni.stopPullDownRefresh(); //停止下拉刷新
  212. },
  213. /**
  214. * 页面上拉触底事件的处理函数
  215. */
  216. onReachBottom: function () {},
  217. /**
  218. * 用户点击右上角分享
  219. */
  220. onShareAppMessage: function () {},
  221. methods: {
  222. goService(e) {
  223. let goodsvalue = e.currentTarget.dataset.goodsvalue;
  224. let id = e.currentTarget.dataset.id;
  225. console.log(goodsvalue);
  226. if (goodsvalue.length == 1) {
  227. uni.navigateTo({
  228. url: '/pages/goods/goods?id=' + goodsvalue[0]
  229. });
  230. } else if (goodsvalue.length > 1) {
  231. uni.navigateTo({
  232. url: '/pages/ucenter/coupon/couponGoods?id=' + id
  233. });
  234. } else {
  235. uni.switchTab({
  236. url: '/pages/tabBar/catalog/catalog'
  237. });
  238. }
  239. },
  240. getCouponList: function () {
  241. let that = this;
  242. that.setData({
  243. scrollTop: 0,
  244. showPage: false,
  245. couponList: []
  246. });
  247. util.request(api.CouponMyList, {
  248. status: that.status,
  249. page: that.page,
  250. limit: that.limit
  251. }).then(function (res) {
  252. if (res.errno === 0) {
  253. that.setData({
  254. scrollTop: 0,
  255. couponList: res.data.list,
  256. showPage: res.data.total > that.limit,
  257. count: res.data.total
  258. });
  259. if (that.status == 0) {
  260. that.setData({
  261. totalList: res.data.list
  262. });
  263. }
  264. }
  265. });
  266. },
  267. bindExchange: function (e) {
  268. this.setData({
  269. code: e.detail.value
  270. });
  271. },
  272. clearExchange: function () {
  273. this.setData({
  274. code: ''
  275. });
  276. },
  277. goExchange: function () {
  278. if (!this.code || this.code.length === 0) {
  279. util.showErrorToast('请输入兑换码');
  280. return;
  281. }
  282. let that = this;
  283. uni.showModal({
  284. title: '提示',
  285. content: '确定要兑换吗?兑换后将无法撤回',
  286. success: (res) => {
  287. if (res.confirm) {
  288. util.request(
  289. api.CouponExchange,
  290. {
  291. code: this.code
  292. },
  293. 'POST'
  294. ).then(function (res) {
  295. if (res.errno === 0) {
  296. that.getCouponList();
  297. that.clearExchange();
  298. uni.showToast({
  299. title: '领取成功',
  300. duration: 2000
  301. });
  302. } else {
  303. util.showErrorToast(res.errmsg);
  304. }
  305. });
  306. }
  307. }
  308. });
  309. },
  310. nextPage: function (event) {
  311. var that = this;
  312. if (this.page > that.count / that.limit) {
  313. return true;
  314. }
  315. that.setData({
  316. page: that.page + 1,
  317. currentType: 0
  318. });
  319. this.getCouponList();
  320. },
  321. prevPage: function (event) {
  322. if (this.page <= 1) {
  323. return false;
  324. }
  325. var that = this;
  326. that.setData({
  327. page: that.page - 1,
  328. currentType: 0
  329. });
  330. this.getCouponList();
  331. },
  332. switchTab: function (e) {
  333. this.setData({
  334. couponList: [],
  335. status: e.currentTarget.dataset.index,
  336. page: 1,
  337. limit: 20,
  338. count: 0,
  339. scrollTop: 0,
  340. showPage: false
  341. });
  342. this.getCouponList();
  343. },
  344. switchType(e) {
  345. let type = e.currentTarget.dataset.type;
  346. let currentList = [];
  347. if (type == 0) {
  348. currentList = this.totalList;
  349. } else if (type == 3) {
  350. //会员券
  351. currentList = this.totalList.filter((item) => {
  352. return item.type == 4;
  353. });
  354. } else {
  355. currentList = this.totalList.filter((item) => {
  356. return item.voucherType == type;
  357. });
  358. }
  359. this.setData({
  360. currentType: type,
  361. couponList: currentList
  362. });
  363. },
  364. onTabChange(e) {
  365. let status = e.detail.name;
  366. this.setData({
  367. couponList: [],
  368. status: status,
  369. page: 1,
  370. limit: 20,
  371. count: 0,
  372. scrollTop: 0,
  373. showPage: false
  374. });
  375. this.getCouponList();
  376. }
  377. }
  378. };
  379. </script>
  380. <style>
  381. page {
  382. background: #f4f4f4;
  383. min-height: 100%;
  384. }
  385. .container {
  386. background: #f4f4f4;
  387. min-height: 100%;
  388. /* padding-top: 30rpx; */
  389. }
  390. .container .h {
  391. position: fixed;
  392. left: 0;
  393. top: 0;
  394. z-index: 1000;
  395. width: 100%;
  396. display: flex;
  397. background: #fff;
  398. height: 84rpx;
  399. border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  400. }
  401. .container .h .item {
  402. display: inline-block;
  403. height: 82rpx;
  404. width: 50%;
  405. padding: 0 15rpx;
  406. text-align: center;
  407. }
  408. .container .h .item .txt {
  409. display: inline-block;
  410. height: 82rpx;
  411. padding: 0 20rpx;
  412. line-height: 82rpx;
  413. color: #333;
  414. font-size: 30rpx;
  415. width: 170rpx;
  416. }
  417. .container .h .item.active .txt {
  418. color: #ab2b2b;
  419. border-bottom: 4rpx solid #ab2b2b;
  420. }
  421. .container .b {
  422. padding-top: 12rpx;
  423. height: auto;
  424. border-top: 1rpx solid #ddd;
  425. }
  426. .container .b .coupon-form {
  427. height: 110rpx;
  428. width: 100%;
  429. background: #fff;
  430. padding-left: 30rpx;
  431. padding-right: 30rpx;
  432. padding-top: 20rpx;
  433. display: flex;
  434. }
  435. .container .b .input-box {
  436. flex: 1;
  437. height: 70rpx;
  438. color: #333;
  439. font-size: 24rpx;
  440. background: #fff;
  441. position: relative;
  442. border: 1px solid rgba(0, 0, 0, 0.15);
  443. border-radius: 35rpx;
  444. margin-right: 30rpx;
  445. }
  446. .container .b .input-box .coupon-sn {
  447. position: absolute;
  448. top: 10rpx;
  449. left: 30rpx;
  450. height: 50rpx;
  451. width: 100%;
  452. color: #000;
  453. line-height: 50rpx;
  454. font-size: 24rpx;
  455. }
  456. .container .b .clear-icon {
  457. position: absolute;
  458. top: 20rpx;
  459. right: 18rpx;
  460. z-index: 2;
  461. display: block;
  462. background: #fff;
  463. }
  464. .container .b .add-btn {
  465. height: 70rpx;
  466. border: none;
  467. width: 168rpx;
  468. /* background: #b4282d; */
  469. background: #4e4e4e;
  470. border-radius: 35rpx;
  471. line-height: 70rpx;
  472. color: #fff;
  473. font-size: 28rpx;
  474. text-align: center;
  475. }
  476. .container .b .add-btn.disabled {
  477. background: #ccc;
  478. }
  479. .container .b .help {
  480. height: 72rpx;
  481. line-height: 72rpx;
  482. text-align: right;
  483. padding-right: 30rpx;
  484. background-size: 28rpx;
  485. color: #999;
  486. font-size: 24rpx;
  487. }
  488. .container .b .coupon-list {
  489. width: 750rpx;
  490. height: 100%;
  491. overflow: hidden;
  492. }
  493. .container .b .item {
  494. position: relative;
  495. height: 290rpx;
  496. background: #ccc7c7;
  497. margin-bottom: 30rpx;
  498. margin-left: 30rpx;
  499. margin-right: 30rpx;
  500. padding-top: 52rpx;
  501. }
  502. .container .b .item.active {
  503. background: linear-gradient(to right, #cfa568, #e3bf79);
  504. }
  505. .container .b .tag {
  506. height: 32rpx;
  507. background: #a48143;
  508. padding-left: 16rpx;
  509. padding-right: 16rpx;
  510. position: absolute;
  511. left: 20rpx;
  512. color: #fff;
  513. top: 20rpx;
  514. font-size: 20rpx;
  515. text-align: center;
  516. line-height: 32rpx;
  517. }
  518. .container .b .content {
  519. margin-top: 24rpx;
  520. margin-left: 40rpx;
  521. display: flex;
  522. margin-right: 40rpx;
  523. flex-direction: row;
  524. }
  525. .container .b .content .left {
  526. flex: 1;
  527. }
  528. .container .b .discount {
  529. font-size: 50rpx;
  530. color: #b4282d;
  531. }
  532. .container .b .min {
  533. color: #fff;
  534. }
  535. .container .b .content .right {
  536. width: 400rpx;
  537. }
  538. .container .b .name {
  539. font-size: 44rpx;
  540. color: #fff;
  541. margin-bottom: 14rpx;
  542. }
  543. .container .b .time {
  544. font-size: 24rpx;
  545. color: #fff;
  546. line-height: 30rpx;
  547. }
  548. .container .b .condition {
  549. position: absolute;
  550. width: 100%;
  551. bottom: 0;
  552. left: 0;
  553. height: 78rpx;
  554. background: rgba(0, 0, 0, 0.08);
  555. padding: 24rpx 40rpx;
  556. display: flex;
  557. flex-direction: row;
  558. }
  559. .container .b .condition .txt {
  560. display: block;
  561. height: 30rpx;
  562. flex: 1;
  563. overflow: hidden;
  564. font-size: 24rpx;
  565. line-height: 30rpx;
  566. color: #fff;
  567. }
  568. .container .b .condition .icon {
  569. margin-left: 30rpx;
  570. width: 24rpx;
  571. height: 24rpx;
  572. }
  573. .container .b .page {
  574. width: 750rpx;
  575. height: 108rpx;
  576. background: #fff;
  577. margin-bottom: 20rpx;
  578. }
  579. .container .b .page view {
  580. height: 108rpx;
  581. width: 50%;
  582. float: left;
  583. font-size: 29rpx;
  584. color: #333;
  585. text-align: center;
  586. line-height: 108rpx;
  587. }
  588. .container .b .page .prev {
  589. border-right: 1px solid #d9d9d9;
  590. }
  591. .container .b .page .disabled {
  592. color: #ccc;
  593. }
  594. .b .no-list {
  595. margin: 16rpx 0 0;
  596. text-align: center;
  597. color: #999;
  598. font-size: 28rpx;
  599. }
  600. .my-coupon-list {
  601. padding: 20rpx 24rpx;
  602. width: auto;
  603. height: 100%;
  604. overflow: hidden;
  605. margin-top: 30px;
  606. }
  607. .my-coupon-item {
  608. border-radius: 18rpx;
  609. background: #fff;
  610. height: 190rpx;
  611. margin: 0 0 20rpx;
  612. display: flex;
  613. justify-content: space-between;
  614. padding: 0 20rpx 0 0;
  615. width: 706rpx;
  616. }
  617. .coupon-left {
  618. background: rgba(9, 175, 255, 0.1);
  619. width: 230rpx;
  620. display: flex;
  621. flex-direction: column;
  622. align-items: center;
  623. justify-content: space-between;
  624. height: 190rpx;
  625. padding: 18rpx 0 30rpx;
  626. }
  627. .coupon-left .coupon-amount {
  628. font-size: 48rpx;
  629. font-weight: bold;
  630. }
  631. .coupon-left .coupon-type {
  632. font-size: 24rpx;
  633. font-weight: bold;
  634. white-space: nowrap;
  635. overflow: hidden;
  636. text-overflow: ellipsis;
  637. width: 220rpx;
  638. text-align: center;
  639. }
  640. .coupon-left .coupon-btn {
  641. background: #999999;
  642. color: #fff;
  643. width: 120rpx;
  644. height: 32rpx;
  645. line-height: 32rpx;
  646. font-size: 22rpx;
  647. margin-top: 10rpx;
  648. border-radius: 30rpx;
  649. text-align: center;
  650. }
  651. .coupon-left .coupon-btn.active-btn {
  652. background: #09afff;
  653. }
  654. .coupon-content {
  655. margin: 0 20rpx 0 30rpx;
  656. display: flex;
  657. flex-direction: column;
  658. justify-content: space-between;
  659. padding: 40rpx 0;
  660. flex: 1;
  661. }
  662. .coupon-content view.coupon-name {
  663. color: #999;
  664. font-size: 30rpx;
  665. font-weight: bold;
  666. white-space: nowrap;
  667. overflow: hidden;
  668. text-overflow: ellipsis;
  669. width: 330rpx;
  670. }
  671. .coupon-content view.coupon-date {
  672. color: #999;
  673. font-size: 20rpx;
  674. }
  675. .coupon-right {
  676. width: 84rpx;
  677. height: 114rpx;
  678. padding-top: 30rpx;
  679. }
  680. .coupon-status {
  681. width: 84rpx;
  682. height: 84rpx;
  683. }
  684. .my-coupon-item-valid {
  685. background: #fff;
  686. box-shadow: 0rpx 6rpx 14rpx 0px rgba(142, 142, 142, 0.03);
  687. border-radius: 20rpx;
  688. width: 696rpx;
  689. margin-bottom: 24rpx;
  690. padding: 0 30rpx;
  691. }
  692. .my-coupon-item-valid .marker {
  693. position: absolute;
  694. right: 10rpx;
  695. float: right;
  696. padding: 5rpx;
  697. width: 136rpx;
  698. /* border-radius: 1rpx solid #; */
  699. background: #f5da9e;
  700. color: #c8965a;
  701. text-align: center;
  702. border-bottom-left-radius: 20rpx;
  703. /* margin-right: -30rpx; */
  704. border-top-right-radius: 15rpx;
  705. }
  706. .coupon-top {
  707. display: flex;
  708. height: 152rpx;
  709. align-items: center;
  710. justify-content: space-between;
  711. padding: 0rpx 8rpx 0 0;
  712. }
  713. .coupon-top-left {
  714. width: 150rpx;
  715. color: #09afff;
  716. font-size: 22rpx;
  717. padding: 8rpx 0 0 4rpx;
  718. }
  719. .coupon-top-left .coupon-value {
  720. display: flex;
  721. align-items: flex-end;
  722. height: 54rpx;
  723. margin-bottom: 10rpx;
  724. font-size: 24rpx;
  725. font-weight: bold;
  726. }
  727. .coupon-top-left .coupon-value .coupon-value-num {
  728. font-size: 70rpx;
  729. line-height: 54rpx;
  730. }
  731. .coupon-top-left .coupon-value .coupon-unit {
  732. color: #09afff;
  733. margin-left: 4rpx;
  734. }
  735. .coupon-top-left .coupon-value .coupon-unit-member {
  736. color: #e9b06b;
  737. margin-left: 4rpx;
  738. }
  739. .coupon-top-left .coupon-value .coupon-flag {
  740. color: #09afff;
  741. margin-right: 4rpx;
  742. }
  743. .coupon-top-left .coupon-value .coupon-flag-member {
  744. color: #e9b06b;
  745. margin-right: 4rpx;
  746. }
  747. .coupon-top-left .coupon-value .coupon-value-member {
  748. font-size: 70rpx;
  749. line-height: 54rpx;
  750. color: #e9b06b;
  751. }
  752. .coupon-top-content {
  753. flex: 1;
  754. margin: 0 30rpx 0 20rpx;
  755. color: #b4b4b4;
  756. font-size: 22rpx;
  757. font-weight: normal;
  758. }
  759. .coupon-valid-name {
  760. font-weight: bold;
  761. color: #555555;
  762. font-size: 32rpx;
  763. margin-bottom: 10rpx;
  764. width: 380rpx;
  765. overflow: hidden;
  766. text-overflow: ellipsis;
  767. white-space: nowrap;
  768. }
  769. .coupon-top-right {
  770. /* writing-mode: vertical-lr; */
  771. width: 142rpx;
  772. height: 56rpx;
  773. background: #09afff;
  774. border-radius: 42rpx;
  775. text-align: center;
  776. color: #ffffff;
  777. line-height: 56rpx;
  778. font-size: 20rpx;
  779. letter-spacing: 3rpx;
  780. }
  781. .coupon-top-member {
  782. width: 142rpx;
  783. height: 56rpx;
  784. background: #e9b06b;
  785. border-radius: 42rpx;
  786. text-align: center;
  787. color: #ffffff;
  788. line-height: 56rpx;
  789. font-size: 20rpx;
  790. letter-spacing: 3rpx;
  791. }
  792. .coupon-bottom {
  793. padding: 10rpx 4rpx 22rpx;
  794. color: #757575;
  795. font-size: 20rpx;
  796. line-height: 36rpx;
  797. border-top: 1rpx dashed #d4d4d4;
  798. letter-spacing: 2rpx;
  799. display: flex;
  800. justify-content: space-between;
  801. align-items: center;
  802. }
  803. .coupon-switch-block {
  804. height: 104rpx;
  805. padding: 0 27rpx;
  806. display: flex;
  807. align-items: center;
  808. margin-bottom: -20rpx;
  809. justify-content: center;
  810. }
  811. .van-tab--active.van-tab > view.van-ellipsis {
  812. color: #000 !important;
  813. letter-spacing: 2rpx;
  814. }
  815. .type-switch {
  816. width: 132rpx;
  817. height: 46rpx;
  818. line-height: 42rpx;
  819. border: 2rpx solid #b4b4b4;
  820. border-radius: 46rpx;
  821. text-align: center;
  822. color: #b4b4b4;
  823. font-size: 24rpx;
  824. margin: 10rpx;
  825. }
  826. .type-switch.active-switch {
  827. background: #4e4e4e;
  828. color: #fff;
  829. /* border: 2rpx solid #09AFFF; */
  830. }
  831. </style>