feat(custom):
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-04-29 15:22:17 +08:00
parent dcbd0eaae5
commit 2819372cb9
12 changed files with 109 additions and 31 deletions

View File

@@ -1,28 +1,34 @@
<script setup lang="ts">
import { ref } from "vue";
import Taro from "@tarojs/taro";
import { userSign } from "@/api/user";
const show = ref(false);
const overlay = ref();
defineExpose({
show,
});
defineProps({
src: {
required: true,
type: String,
default: "",
},
type: Number,
cb: {
required: true,
type: Function,
default: () => {},
},
});
Taro.useLoad(async () => {
if (Taro.getStorageSync("token")) show.value = true;
// const res = await getSignRecord()
// console.log(res)
});
const toSign = async () => {
try {
await userSign();
Taro.showToast({
title: "签到成功",
icon: "none",
});
} catch (e) {
console.log(e);
}
show.value = false;
};
</script>
<template>
@@ -32,8 +38,8 @@ const toSign = async () => {
:close-on-click-overlay="false"
>
<view class="wrapper">
<view @click.stop="toSign">
<image class="image" src="../static/index/poppBg.png" />
<view @click.stop="cb(type)">
<image class="image" :src="src" />
</view>
<view @click.stop="show = false">
<image class="icon" src="../static/index/close.png" />