|
@@ -1,26 +1,26 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="选择优惠券"></u-navbar>
|
|
|
- <view class="coupon-title">可用优惠券:0</view>
|
|
|
+ <view class="coupon-title">可用优惠券:{{listNum}}</view>
|
|
|
<view class="coupon-list">
|
|
|
- <!-- <view class="flex coupon-list-item">
|
|
|
+ <view class="flex coupon-list-item" v-for="(item,index) in list" :key="index">
|
|
|
<view class="flex coupon-list-item-info">
|
|
|
- <image src="../../static/logo.png" mode=""></image>
|
|
|
- <view class="flex content">
|
|
|
- <view class="txt">xx盲票优惠券</view>
|
|
|
- <view class="txt">使用期限:2022.03.02-2022.04.01</view>
|
|
|
- <view class="txt">适用范围:指定盲票</view>
|
|
|
- </view>
|
|
|
<view class="money">
|
|
|
- <view class="">¥<text>10</text></view>
|
|
|
+ <view class="">¥<text>{{item.discount}}</text></view>
|
|
|
+ </view>
|
|
|
+ <view class="flex content">
|
|
|
+ <view class="txt title">{{item.title}}</view>
|
|
|
+ <view class="txt">使用期限:{{ $parseTime(item.validStart, '{y}.{m}.{d}')}}-{{$parseTime(item.validEnd, '{y}.{m}.{d}')}}</view>
|
|
|
+ <view class="txt">适用范围:{{item.useAreaDesc || '-'}}</view>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
<view class="checked">
|
|
|
<view class="flex circle">
|
|
|
<view class="action" v-if="actionIndex == 0"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view> -->
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
<view class="flex empty" v-if="!list.length">
|
|
@@ -36,6 +36,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import env from '../../config/env.js'
|
|
|
+ import $http from '@/utils/request.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -44,11 +46,41 @@
|
|
|
pageNum: 1,
|
|
|
total: 0,
|
|
|
list: [],
|
|
|
+
|
|
|
+ listNum:'',
|
|
|
};
|
|
|
},
|
|
|
+ onShow(){
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
methods:{
|
|
|
+ getList(){
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ $http.post('/api/v1/mp/user/ticket/order/coupon/list', {}).then(
|
|
|
+ res => {
|
|
|
+ uni.hideLoading();
|
|
|
+ console.log(res)
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.listNum = res.data.length
|
|
|
+ res.data.forEach(item =>{
|
|
|
+ let useAreaDesc = JSON.parse(item.useArea)
|
|
|
+ item.useAreaDesc = useAreaDesc.desc
|
|
|
+ })
|
|
|
+ this.list = this.list.concat(res.data)
|
|
|
+ console.log(this.list)
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ uni.hideLoading();
|
|
|
+ })
|
|
|
+ },
|
|
|
changeChecked(e){
|
|
|
console.log(e);
|
|
|
+ },
|
|
|
+ exchange(){
|
|
|
+ // 获取所选项
|
|
|
+ // 返回立即支付位置
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -76,7 +108,7 @@
|
|
|
&-info{
|
|
|
flex: 1;
|
|
|
justify-content: flex-start;
|
|
|
-
|
|
|
+ height: 170rpx;
|
|
|
image{
|
|
|
width: 84rpx;
|
|
|
height: 132rpx;
|
|
@@ -89,9 +121,13 @@
|
|
|
align-items: flex-start;
|
|
|
justify-content: space-between;
|
|
|
}
|
|
|
+ .content .title{
|
|
|
+ font-size: 32rpx;
|
|
|
+ line-height: 50rpx;
|
|
|
+ }
|
|
|
|
|
|
.money{
|
|
|
- margin-left: 10rpx;
|
|
|
+ padding-right: 30rpx;
|
|
|
font-weight: bold;
|
|
|
text{
|
|
|
font-size: 50rpx;
|