couponList.vue 26 KB

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