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

View File

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

BIN
src/static/popTip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB