123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <template>
- <view class="content">
- <swiper :indicator-dots="true" class="box">
- <swiper-item class="djq-wrap" v-for="(item, index) in list">
- <view>
- <view class="djq-top flex f-d-c f-j-c">
- <view class="djq-name">{{ item.coupon_title }}</view>
- <view class="djq-time">{{ item.end_time == 0 ? '永久有效' : '有效期至' + item.end_time }}</view>
- </view>
- <view class="djq-body">
- <view class="used" v-if="item.status == 1"><image src="../../static/img/ysy.png" mode=""></image></view>
- <view class="used" v-if="item.status == 2"><image src="../../static/img/ygq.png" mode=""></image></view>
- <view class="ewm">
- <tki-qrcode
- :cid="cid"
- ref="qrcode"
- :val="item.code"
- :size="size"
- :unit="unit"
- :background="background"
- :foreground="foreground"
- :pdground="pdground"
- :iconSize="iconSize"
- :lv="lv"
- :onval="onval"
- :loadMake="loadMake"
- :usingComponents="usingComponents"
- @result="qrR"
- />
- </view>
- <view class="ewm-code">{{ item.code }}</view>
- </view>
- </view>
- </swiper-item>
- </swiper>
- </view>
- </template>
- <script>
- import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
- import { view_order } from '@/api/order.js';
- export default {
- components: {
- tkiQrcode
- },
- data() {
- return {
- list: [],
- id: '',
- cid: 'tki-qrcode-canvas',
- size: 440,
- unit: 'upx',
- show: true,
- background: '#ffffff',
- foreground: '#333333',
- pdground: '#333333',
- icon: '',
- iconSize: 40,
- lv: 3,
- onval: true,
- loadMake: true,
- usingComponents: false,
- showLoading: false,
- loadingText: '二维码生成中',
- src: '',
- ratio: 1,
- ctxSrc: '',
- loading: true
- };
- },
- onLoad(opt) {
- this.id = opt.id;
- this.loadData();
- },
- onShow() {},
- onReachBottom() {},
- onReady() {},
- methods: {
- loadData() {
- const obj = this;
- view_order({
- order_id: this.id
- }).then(({ data }) => {
- this.list = data.coupon;
- console.log(this.list);
- });
- },
- qrR() {}
- }
- };
- </script>
- <style lang="scss">
- page {
- height: 100%;
- background-color: #f9e24f;
- }
- .box {
- width: 696rpx;
- margin: auto;
- height: 1060rpx;
- }
- .djq-wrap {
- width: 696rpx;
- background-color: #fff;
- position: relative;
- margin: auto;
- margin-top: 100rpx;
- .djq-top {
- height: 185rpx;
- background: #f5f5f5;
- overflow: hidden;
- .djq-name {
- font-size: 44rpx;
- font-weight: bold;
- color: #222222;
- }
- .djq-time {
- font-size: 24rpx;
- font-weight: 500;
- color: #686868;
- }
- &::after,
- &::before {
- content: '';
- height: 120rpx;
- width: 120rpx;
- border-radius: 50%;
- position: absolute;
- top: -60rpx;
- background-color: #f9e24f;
- }
- &::before {
- left: -60rpx;
- }
- &::after {
- right: -60rpx;
- }
- }
- .djq-body {
- height: 770rpx;
- position: relative;
- padding-top: 115rpx;
- &::after,
- &::before {
- content: '';
- height: 120rpx;
- width: 120rpx;
- border-radius: 50%;
- position: absolute;
- bottom: -60rpx;
- background-color: #f9e24f;
- }
- &::before {
- left: -60rpx;
- }
- &::after {
- right: -60rpx;
- }
- .used {
- position: absolute;
- top: 0rpx;
- right: 0rpx;
- z-index: 99;
- height: 440rpx;
- width: 440rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .ewm {
- width: 440rpx;
- height: 440rpx;
- margin: auto;
- }
- .ewm-code {
- padding-top: 55rpx;
- font-size: 44rpx;
- font-weight: bold;
- color: #333333;
- text-align: center;
- }
- }
- }
- </style>
|