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

This commit is contained in:
2024-08-30 13:22:42 +08:00
parent 1d8532eccf
commit b95fb364df
3 changed files with 24 additions and 18 deletions

View File

@@ -2,15 +2,13 @@
import {ref} from 'vue';
import Taro from '@tarojs/taro';
const show = ref(false);
const overlay = ref();
const isShow = ref(false);
defineExpose({
show,
isShow,
});
defineProps({
const props = defineProps({
src: {
required: true,
type: String,
@@ -18,29 +16,36 @@ defineProps({
},
type: Number,
cb: {
required: true,
type: Function,
default: () => {},
type: Function || null,
default: null,
},
});
Taro.useLoad(async () => {
if (Taro.getStorageSync('token')) show.value = true;
// const res = await getSignRecord()
// console.log(res)
const clickFn = type => {
if (props.cb) props.cb(type);
else isShow.value = false;
};
Taro.useLoad(() => {
if (Taro.getStorageSync('token')) isShow.value = true;
});
</script>
<template>
<nut-overlay
v-model:visible="show"
v-model:visible="isShow"
:lock-scroll="true"
:close-on-click-overlay="false">
<view class="wrapper">
<view @click.stop="cb(type)">
<image class="image" :src="src" />
<view @click.stop="clickFn(type)">
<image
:style="{
width: src.naturalWidth,
height: src.naturalHeight < 600 ? src.naturalHeight : '480px',
}"
:src="src" />
</view>
<view @click.stop="show = false">
<view @click.stop="isShow = false">
<image class="icon" src="../static/index/close.png" />
</view>
</view>

View File

@@ -48,15 +48,16 @@
hover-class="none">
</navigator>
<MerList :get-user-location="getUserLocal" />
<Popup :src="require('../../static/popTip.png')" />
</view>
</template>
<script setup lang="ts">
import Taro from '@tarojs/taro';
import {ref} from 'vue';
import {getHomeList, getStoreList} from '@/api/home';
import {getHomeList} from '@/api/home';
import MerList from '@/components/MerList.vue';
import {showTips} from '@/utils';
import Popup from '@/components/Popup.vue';
const statusBarHeight = Taro.getSystemInfoSync().statusBarHeight;
const BarHeight = ref((statusBarHeight as number) + 7);

BIN
src/static/popTip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB