This commit is contained in:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user