|
|
<script setup>
|
|
|
import DraggableButton from "@/pages/components/goHome.vue";
|
|
|
/**
|
|
|
* name:
|
|
|
* user:sa0ChunLuyu
|
|
|
* date:2024年9月11日 19:24:50
|
|
|
*/
|
|
|
import { ref } from "vue";
|
|
|
import { $api, $response } from "@/api";
|
|
|
import { onShow } from "@dcloudio/uni-app";
|
|
|
import { useStore } from "@/store";
|
|
|
const $store = useStore();
|
|
|
|
|
|
let couponList = ref([]);
|
|
|
let yytjInfo = ref({});
|
|
|
const mountedAction = () => {
|
|
|
yytjInfo.value = $store.getYytjInfo();
|
|
|
GetPersonIntegralSaveMoneyCouponInfo();
|
|
|
};
|
|
|
|
|
|
const GetPersonIntegralSaveMoneyCouponInfo = async () => {
|
|
|
const response = await $api("GetPersonIntegralSaveMoneyCouponInfo", {
|
|
|
person_id: $store.getUser()?.person_id,
|
|
|
});
|
|
|
$response(response, () => {
|
|
|
couponList.value = response.data.coupon_list;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const selectCoupon = (item) => {
|
|
|
yytjInfo.value.couponId = item.id;
|
|
|
yytjInfo.value.couponPrice = item.price;
|
|
|
$store.setYytjInfo(yytjInfo.value);
|
|
|
uni.navigateBack({ delta: 1 });
|
|
|
};
|
|
|
|
|
|
const config_ref = ref(null);
|
|
|
const configRef = (e) => {
|
|
|
if (!config_ref.value) {
|
|
|
config_ref.value = e;
|
|
|
mountedAction();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
onShow(() => {
|
|
|
if (!!config_ref.value) {
|
|
|
mountedAction();
|
|
|
}
|
|
|
});
|
|
|
</script>
|
|
|
<template>
|
|
|
<DraggableButton />
|
|
|
<view>
|
|
|
<view v-if="!!$store.config">
|
|
|
<view :ref="configRef"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="px-20rpx py-10rpx box-border">
|
|
|
<view
|
|
|
class="px-10rpx py-30rpx box-border bg-#fff shadow-[0rpx_0rpx_10rpx_0rpx_rgba(0,0,0,0.04)] rounded-15rpx"
|
|
|
>
|
|
|
<view
|
|
|
v-for="(item, index) in couponList"
|
|
|
:key="index"
|
|
|
class="mb-20rpx flex"
|
|
|
@click="selectCoupon(item)"
|
|
|
>
|
|
|
<view class="min-w-200rpx max-w-200rpx h-170rpx yhq1 center flex-col">
|
|
|
<view>
|
|
|
<text class="text-#fff text-24rpx">¥</text>
|
|
|
<text class="text-#fff text-50rpx">{{ item.price }}</text>
|
|
|
</view>
|
|
|
<text class="text-#fff text-22rpx">{{ item.desc }}</text>
|
|
|
</view>
|
|
|
<view
|
|
|
class="grow box-border b-1 b-l-0 b-#E5E5E5 b-solid rounded-r-15rpx flex between py-5rpx"
|
|
|
>
|
|
|
<view
|
|
|
class="grow px-30rpx py-25rpx box-border flex-col between h-full items-start b-0 b-r-1 b-#E5E5E5 b-solid"
|
|
|
>
|
|
|
<text class="text-28rpx text-#B38933">{{ item.title }}</text>
|
|
|
<text class="text-20rpx text-#7C7C7C">{{
|
|
|
item.date_range?.join(" —— ")
|
|
|
}}</text>
|
|
|
</view>
|
|
|
<view
|
|
|
class="max-w-60rpx min-w-60rpx text-#B38933 text-25rpx center mx-0"
|
|
|
>
|
|
|
立<br />即<br />使<br />用
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
<style scoped>
|
|
|
.yhq1 {
|
|
|
background-image: url("@/static/assets/slices/yhq1.png");
|
|
|
background-size: 100% 100%;
|
|
|
}
|
|
|
</style>
|