新增营销系统、分销系统、会员功能、门店、提现功能
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
import { toRefs } from "vue";
|
||||
import { receiveACoupon } from "@/api/coupon";
|
||||
import { useRouter } from "@/hooks/useRouter";
|
||||
const emit = defineEmits(['receiveCoupon'])
|
||||
|
||||
const {push} = useRouter()
|
||||
const props = defineProps({
|
||||
@ -32,11 +33,13 @@ const {
|
||||
|
||||
const getCoupon = async () => {
|
||||
await receiveACoupon(coupons.value.id)
|
||||
emit('receiveCoupon')
|
||||
uni.showToast({
|
||||
title: "领取成功",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
const goToProduct = (coupons) => {
|
||||
@ -120,9 +123,6 @@ const goToProduct = (coupons) => {
|
||||
padding: 14rpx 22rpx;
|
||||
background: #ee6d46;
|
||||
color: #fff;
|
||||
}
|
||||
.get-coupon {
|
||||
|
||||
}
|
||||
.disable{
|
||||
background: #666666;
|
||||
|
@ -5,12 +5,12 @@
|
||||
* @description:index.utli
|
||||
* @update: 2023-10-31 11:19
|
||||
* */
|
||||
import { ref, computed } from "vue";
|
||||
import { computed, ref } from "vue";
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import {getCouponList} from "@/api/coupon";
|
||||
import { getCouponList } from "@/api/coupon";
|
||||
import { tabList } from "@/pages/discountCoupon/index.data";
|
||||
|
||||
export function useDiscountCoupon(){
|
||||
export function useDiscountCoupon() {
|
||||
const tabCurrent = ref(0) // tab选中
|
||||
const couponType = ref(1) // 1、可使用,2、已使用,3、已失效
|
||||
const couponListLoading = ref(false)
|
||||
@ -21,16 +21,16 @@ export function useDiscountCoupon(){
|
||||
* tab发生改变
|
||||
* @param e
|
||||
*/
|
||||
async function handleTabsChange(e){
|
||||
async function handleTabsChange(e) {
|
||||
console.log(e)
|
||||
couponList.value = []
|
||||
tabCurrent.value = e.index
|
||||
couponType.value = e.value
|
||||
await doGetCouponList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取购物车列表
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function doGetCouponList() {
|
||||
try {
|
||||
|
@ -6,12 +6,7 @@
|
||||
@update: 2023-10-31 11:05
|
||||
-->
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { useRouter } from "@/hooks/useRouter";
|
||||
|
||||
const {goBack} = useRouter();
|
||||
const {scrollTop} = useScroll()
|
||||
import { useDiscountCoupon } from "@/pages/discountCoupon/index.utils";
|
||||
import CouponItem from "@/pages/discountCoupon/components/CouponItem.vue";
|
||||
import Empty from "@/components/Empty/index.vue"
|
||||
@ -19,6 +14,9 @@ import { emptyCouponIcon } from "@/utils/images";
|
||||
import ReturnTop from "@/components/ReturnTop/index.vue";
|
||||
import { useScroll } from "@/hooks/useScroll";
|
||||
|
||||
const {goBack} = useRouter();
|
||||
const {scrollTop} = useScroll()
|
||||
|
||||
const {
|
||||
tabList,
|
||||
tabCurrent,
|
||||
@ -45,7 +43,9 @@ const {
|
||||
<!-- coupon list -->
|
||||
<view class="coupon-box">
|
||||
<template v-if="!showEmpty">
|
||||
<view class="coupon-list" v-for="item in couponList">
|
||||
<view
|
||||
class="coupon-list"
|
||||
v-for="item in couponList">
|
||||
<CouponItem
|
||||
:coupons="item"
|
||||
:tabType="tabCurrent"
|
||||
@ -80,6 +80,7 @@ const {
|
||||
padding: 35rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
|
||||
.coupon-list {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
Reference in New Issue
Block a user