|
@@ -8,21 +8,28 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="flex-justify-around">
|
|
<view class="flex-justify-around">
|
|
|
- <view @click="setType(1)" class="fs-28 fw-600 mb-24" :class="type == 1?'fc-41ABF5':''">可用优惠券(1)</view>
|
|
|
|
|
- <view @click="setType(2)" class="fs-28 fw-600 mb-24" :class="type == 2?'fc-41ABF5':''">可领优惠券(2)</view>
|
|
|
|
|
|
|
+ <view @click="setType(1)" class="fs-28 fw-600 mb-24" :class="type == 1?'fc-41ABF5':''">可用优惠券({{expressCouponData.coupon.length}})</view>
|
|
|
|
|
+ <view @click="setType(2)" class="fs-28 fw-600 mb-24" :class="type == 2?'fc-41ABF5':''">可领优惠券({{expressCouponData.receive.length}})</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="scroll-view-css" v-if="type == 1">
|
|
<view class="scroll-view-css" v-if="type == 1">
|
|
|
- <scroll-view :scroll-y="true" class="scroll-view-css">
|
|
|
|
|
- <view class="item-box display-flex mb-20" v-for="(item,i) in 10" :key="i">
|
|
|
|
|
|
|
+ <view v-if="expressCouponData.coupon.length === 0" class="scroll-view-css">
|
|
|
|
|
+ <EnBlank :customSrc='true'>
|
|
|
|
|
+ <template v-slot:blankImg>
|
|
|
|
|
+ <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </EnBlank>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <scroll-view v-else :scroll-y="true" class="scroll-view-css">
|
|
|
|
|
+ <view class="item-box display-flex mb-20" v-for="(item,i) in expressCouponData.coupon" :key="i" @click="setFun(item)">
|
|
|
<view class="item-left flex-direction align-items-center flex-justify-center bgc-FCE7E2">
|
|
<view class="item-left flex-direction align-items-center flex-justify-center bgc-FCE7E2">
|
|
|
<view class="align-items-center">
|
|
<view class="align-items-center">
|
|
|
<view class="fs-30 fw-600 fc-FB3D03">¥</view>
|
|
<view class="fs-30 fw-600 fc-FB3D03">¥</view>
|
|
|
- <view class="fs-48 fw-600 fc-FB3D03">10</view>
|
|
|
|
|
|
|
+ <view class="fs-48 fw-600 fc-FB3D03">{{item.money}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="fs-24" :class="item.type == 0?'fc-6':'fc-9'">
|
|
<view class="fs-24" :class="item.type == 0?'fc-6':'fc-9'">
|
|
|
- 满90元可用
|
|
|
|
|
|
|
+ {{item.desc}}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="ball"></view>
|
|
<view class="ball"></view>
|
|
|
<view class="ball-two"></view>
|
|
<view class="ball-two"></view>
|
|
@@ -30,37 +37,39 @@
|
|
|
<view class="item-hr"></view>
|
|
<view class="item-hr"></view>
|
|
|
<view class="item-right flex-1 bgc-f">
|
|
<view class="item-right flex-1 bgc-f">
|
|
|
<view class="fs-28 fw-600 mb-12 ticket-name text-overflow-ellipsis w382">
|
|
<view class="fs-28 fw-600 mb-12 ticket-name text-overflow-ellipsis w382">
|
|
|
- 优惠券名称优惠券名称惠券名优惠券名称优惠券名称惠券名优惠券名称优惠券名称惠券名
|
|
|
|
|
|
|
+ {{item.name}}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="fs-24 mb-12 fc-FB3D03">
|
|
<view class="fs-24 mb-12 fc-FB3D03">
|
|
|
- 2024.05.08-2024.05.24
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex-justify-space">
|
|
|
|
|
- <view class="fs-24 fc-6">
|
|
|
|
|
- 券类型:外卖券
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ {{item.start_time}} - {{item.end_time}}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <image v-if="id==i" class="s-icon" src="@/static/img/common/y-select.png" mode=""></image>
|
|
|
|
|
|
|
+ <image v-if="coupon_id==item.id" class="s-icon" src="@/static/img/common/y-select.png" mode=""></image>
|
|
|
<image v-else class="s-icon"src="@/static/img/common/n-select.png" mode=""></image>
|
|
<image v-else class="s-icon"src="@/static/img/common/n-select.png" mode=""></image>
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="scroll-view-css" v-else>
|
|
<view class="scroll-view-css" v-else>
|
|
|
- <view class="scroll-view-css">
|
|
|
|
|
- <view class=" display-flex mb-20" v-for="(item,index) in 10" :key="index">
|
|
|
|
|
|
|
+ <view v-if="expressCouponData.receive.length === 0" class="scroll-view-css">
|
|
|
|
|
+ <EnBlank :customSrc='true'>
|
|
|
|
|
+ <template v-slot:blankImg>
|
|
|
|
|
+ <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </EnBlank>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-else class="scroll-view-css">
|
|
|
|
|
+ <view class=" display-flex mb-20" v-for="(item,i) in expressCouponData.receive" :key="i">
|
|
|
<view class="item-right flex-direction flex-justify-center flex-1 bgc-f">
|
|
<view class="item-right flex-direction flex-justify-center flex-1 bgc-f">
|
|
|
<view class="fs-28 mb-12 ticket-name text-overflow-ellipsis fc-3 fw-600">
|
|
<view class="fs-28 mb-12 ticket-name text-overflow-ellipsis fc-3 fw-600">
|
|
|
- 优惠券名称优惠券名称优惠券名称优惠券名称优
|
|
|
|
|
|
|
+ {{item.name}}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="fs-24 fc-6 mb-12">
|
|
<view class="fs-24 fc-6 mb-12">
|
|
|
- 有效时间:2024.05.08-2024.05.24
|
|
|
|
|
|
|
+ 有效时间:{{item.start_time}} - {{item.end_time}}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="flex-justify-space">
|
|
<view class="flex-justify-space">
|
|
|
<view class="fs-24 fc-6">
|
|
<view class="fs-24 fc-6">
|
|
|
- 券类型:外卖券
|
|
|
|
|
|
|
+ 券类型:{{item.scene == 1?'外卖券':'代取券'}}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -68,38 +77,72 @@
|
|
|
<view class="item-left flex-direction align-items-center flex-justify-center bgc-FCE7E2">
|
|
<view class="item-left flex-direction align-items-center flex-justify-center bgc-FCE7E2">
|
|
|
<view class="align-items-center">
|
|
<view class="align-items-center">
|
|
|
<view class="fs-30 fw-600 fc-FB3D03">¥</view>
|
|
<view class="fs-30 fw-600 fc-FB3D03">¥</view>
|
|
|
- <view class="fs-48 fw-600 fc-FB3D03">10</view>
|
|
|
|
|
|
|
+ <view class="fs-48 fw-600 fc-FB3D03">{{item.money}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="fs-24 mb-18 fc-6">
|
|
<view class="fs-24 mb-18 fc-6">
|
|
|
- 满90元可用
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="but-box fs-28 fc-f">
|
|
|
|
|
- 立即领取
|
|
|
|
|
|
|
+ {{item.desc}}
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="but-box fs-28 fc-f" @click="getFun(item)">立即领取</view>
|
|
|
<view class="ball"></view>
|
|
<view class="ball"></view>
|
|
|
<view class="ball-two"></view>
|
|
<view class="ball-two"></view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</uni-popup>
|
|
</uni-popup>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import EnBlank from "@/components/en-utils/en-blank/en-blank";
|
|
|
|
|
+ import {getExpressCoupon} from '@/api/express.js';
|
|
|
|
|
+ import {receiveCoupon} from '@/api/coupon.js';
|
|
|
|
|
+ import tools from "@/service/tools";
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
|
|
+ components:{EnBlank},
|
|
|
data(){
|
|
data(){
|
|
|
return{
|
|
return{
|
|
|
- type:1,//1可用 2可领
|
|
|
|
|
- id:1,
|
|
|
|
|
|
|
+ type:1,//1可用类型 2可领类型
|
|
|
|
|
+ coupon_id:1,
|
|
|
|
|
+ dataType:'',//1外卖 2代取 3干洗
|
|
|
|
|
+ isAJAX:false,
|
|
|
|
|
+
|
|
|
|
|
+ // 代取优惠券
|
|
|
|
|
+ expressCouponData:{
|
|
|
|
|
+ coupon:[],//可用
|
|
|
|
|
+ receive:[],//可领
|
|
|
|
|
+ },
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods:{
|
|
methods:{
|
|
|
- getList(){
|
|
|
|
|
- this.openPop();
|
|
|
|
|
|
|
+ getList(e,id){
|
|
|
|
|
+ if(id){
|
|
|
|
|
+ this.coupon_id = id;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.coupon_id = '';
|
|
|
|
|
+ }
|
|
|
|
|
+ this.dataType = Number(e)
|
|
|
|
|
+ if(e == 1){
|
|
|
|
|
+
|
|
|
|
|
+ }else if(e == 2){
|
|
|
|
|
+ this.getExpressCoupon()
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ // 代取 获取优惠券
|
|
|
|
|
+ getExpressCoupon(){
|
|
|
|
|
+ let operate_id = uni.getStorageSync('operate_id');
|
|
|
|
|
+ getExpressCoupon({operate_id:operate_id}).then((res)=>{
|
|
|
|
|
+ if(res.code === 1){
|
|
|
|
|
+ this.expressCouponData = res.data;
|
|
|
|
|
+ this.openPop();
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
setType(type){
|
|
setType(type){
|
|
|
if(type != this.type){
|
|
if(type != this.type){
|
|
|
this.type = type
|
|
this.type = type
|
|
@@ -111,6 +154,36 @@
|
|
|
closeCoupon(){
|
|
closeCoupon(){
|
|
|
this.$refs.popupCoupon.close();
|
|
this.$refs.popupCoupon.close();
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ setFun(item){
|
|
|
|
|
+ this.$emit('giveCouPon',item);
|
|
|
|
|
+ this.closeCoupon();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ getFun(item){
|
|
|
|
|
+ if(this.isAJAX){
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.isAJAX = true;
|
|
|
|
|
+ receiveCoupon({grant_id:item.grant_id,coupon_id:item.coupon_id}).then((res)=>{
|
|
|
|
|
+ if(res.code === 1){
|
|
|
|
|
+ this.isAJAX = false;
|
|
|
|
|
+ tools.success('领取成功');
|
|
|
|
|
+ this.resetList();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.isAJAX = false;
|
|
|
|
|
+ tools.success('领取失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ resetList(){
|
|
|
|
|
+ if(this.dataType == 1){
|
|
|
|
|
+
|
|
|
|
|
+ }else if(this.dataType == 2){
|
|
|
|
|
+ this.getExpressCoupon()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|