style: 调整ai店铺商品布局、tabbar中心icon白边处理
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<s-layout :navbar="navBar" title="金种子" navPreset="seed">
|
||||
<s-layout :navbar="navBar" title="金种子" navPreset="float">
|
||||
<view class="pages w100" :style="{ marginTop: -height + 'px' }">
|
||||
<view class="w100">
|
||||
<!-- <image class="w100" :src="$url + 'home/seed_1.png'" mode="widthFix" /> -->
|
||||
|
||||
+52
-10
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<s-layout title="邀请好友">
|
||||
<view class="share_page_bg" id="captureBox">
|
||||
<s-layout :navbar="navBar" title="邀请好友" navPreset="float">
|
||||
<view class="share_page_bg" id="captureBox" :style="{ marginTop: `-${navHeight}px` }">
|
||||
<view class="slogan">
|
||||
<image class="slogan_img" src="/static/share_bg.png" mode="widthFix" />
|
||||
</view>
|
||||
@@ -55,10 +55,22 @@
|
||||
import Qrcode from './components/Qrcode';
|
||||
import { getCurrentInstance, nextTick, ref } from 'vue';
|
||||
import * as api from '@/sheep/api/home/index';
|
||||
import { onPageScroll } from '@dcloudio/uni-app';
|
||||
|
||||
const instance = getCurrentInstance();
|
||||
const proxy = instance?.proxy;
|
||||
|
||||
const sysInfoForNav = uni.getSystemInfoSync();
|
||||
const navHeight = ref((sysInfoForNav?.statusBarHeight || 0) + 44);
|
||||
const navBar = ref('inner');
|
||||
onPageScroll((e) => {
|
||||
if ((e?.scrollTop || 0) > 20) {
|
||||
navBar.value = 'normal';
|
||||
} else {
|
||||
navBar.value = 'inner';
|
||||
}
|
||||
});
|
||||
|
||||
const inviteinfo = ref({});
|
||||
const qrCodeUrl = ref('');
|
||||
const qrcodeRef = ref(null);
|
||||
@@ -168,6 +180,7 @@
|
||||
|
||||
const rect = await getCaptureBoxRect();
|
||||
const sysInfo = uni.getSystemInfoSync();
|
||||
const excludeTopPx = (sysInfo?.statusBarHeight || 0) + 44;
|
||||
const ratioX =
|
||||
typeof plus !== 'undefined' && plus.screen && plus.screen.resolutionWidth
|
||||
? plus.screen.resolutionWidth / sysInfo.windowWidth
|
||||
@@ -180,20 +193,18 @@
|
||||
const maxHeight = Math.max(1, Math.floor(sysInfo.windowHeight * ratioY));
|
||||
|
||||
const clip = {
|
||||
top: Math.max(0, Math.floor((rect.top || 0) * ratioY)),
|
||||
top: Math.max(0, Math.floor(((rect.top || 0) + excludeTopPx) * ratioY)),
|
||||
left: Math.max(0, Math.floor((rect.left || 0) * ratioX)),
|
||||
width: Math.max(1, Math.floor((rect.width || 1) * ratioX)),
|
||||
height: Math.max(1, Math.floor((rect.height || 1) * ratioY)),
|
||||
height: Math.max(1, Math.floor(Math.max(1, (rect.height || 1) - excludeTopPx) * ratioY)),
|
||||
};
|
||||
|
||||
const sideExpand = Math.max(0, Math.floor(30 * ratioX));
|
||||
const topExpand = Math.max(0, Math.floor(60 * ratioY));
|
||||
const bottomExpand = Math.max(0, Math.floor(20 * ratioY));
|
||||
|
||||
clip.top = Math.max(0, clip.top - topExpand);
|
||||
clip.left = Math.max(0, clip.left - sideExpand);
|
||||
clip.width = clip.width + sideExpand * 2;
|
||||
clip.height = clip.height + topExpand + bottomExpand;
|
||||
clip.height = clip.height + bottomExpand;
|
||||
|
||||
if (clip.left >= maxWidth) clip.left = maxWidth - 1;
|
||||
if (clip.top >= maxHeight) clip.top = maxHeight - 1;
|
||||
@@ -282,9 +293,40 @@
|
||||
try {
|
||||
uni.showLoading({ title: '生成分享图片...' });
|
||||
await nextTick();
|
||||
await sleep(450);
|
||||
for (let i = 0; i < 8; i++) {
|
||||
if (qrCodeUrl.value) break;
|
||||
await sleep(200);
|
||||
}
|
||||
const rect = await getCaptureBoxRect();
|
||||
const sysInfo = uni.getSystemInfoSync();
|
||||
const excludeTopPx = (sysInfo?.statusBarHeight || 0) + 44;
|
||||
const ratioX =
|
||||
typeof plus !== 'undefined' && plus.screen && plus.screen.resolutionWidth
|
||||
? plus.screen.resolutionWidth / sysInfo.windowWidth
|
||||
: sysInfo.pixelRatio || 1;
|
||||
const ratioY =
|
||||
typeof plus !== 'undefined' && plus.screen && plus.screen.resolutionHeight
|
||||
? plus.screen.resolutionHeight / sysInfo.windowHeight
|
||||
: sysInfo.pixelRatio || 1;
|
||||
const maxWidth = Math.max(1, Math.floor(sysInfo.windowWidth * ratioX));
|
||||
const maxHeight = Math.max(1, Math.floor(sysInfo.windowHeight * ratioY));
|
||||
const clip = {
|
||||
top: Math.max(0, Math.floor(((rect.top || 0) + excludeTopPx) * ratioY)),
|
||||
left: Math.max(0, Math.floor((rect.left || 0) * ratioX)),
|
||||
width: Math.max(1, Math.floor((rect.width || 1) * ratioX)),
|
||||
height: Math.max(1, Math.floor(Math.max(1, (rect.height || 1) - excludeTopPx) * ratioY)),
|
||||
};
|
||||
const sideExpand = Math.max(0, Math.floor(30 * ratioX));
|
||||
const bottomExpand = Math.max(0, Math.floor(20 * ratioY));
|
||||
clip.left = Math.max(0, clip.left - sideExpand);
|
||||
clip.width = clip.width + sideExpand * 2;
|
||||
clip.height = clip.height + bottomExpand;
|
||||
if (clip.left >= maxWidth) clip.left = maxWidth - 1;
|
||||
if (clip.top >= maxHeight) clip.top = maxHeight - 1;
|
||||
if (clip.left + clip.width > maxWidth) clip.width = maxWidth - clip.left;
|
||||
if (clip.top + clip.height > maxHeight) clip.height = maxHeight - clip.top;
|
||||
uni.hideLoading();
|
||||
const { localPath: shareImage } = await drawCurrentWebviewToFile();
|
||||
const { localPath: shareImage } = await drawCurrentWebviewToFile({ clip });
|
||||
uni.share({
|
||||
provider,
|
||||
type: 1,
|
||||
@@ -306,7 +348,7 @@
|
||||
.share_page_bg {
|
||||
position: relative;
|
||||
min-height: 100vh;
|
||||
padding: 520rpx 40rpx 80rpx;
|
||||
padding: 570rpx 40rpx 80rpx;
|
||||
box-sizing: border-box;
|
||||
// background: #0b53d8;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
import cardTabber from '@/components/card_tabber/card_tabber.vue';
|
||||
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance, watch, nextTick } from 'vue';
|
||||
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance, watch, nextTick, computed } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { getWallet } from '@/sheep/api/home/pay';
|
||||
|
||||
@@ -128,6 +128,7 @@
|
||||
let sysInfo = uni.getSystemInfoSync();
|
||||
let paddingTop = ref(20);
|
||||
paddingTop.value = sysInfo.statusBarHeight + uni.upx2px(88);
|
||||
const headerBgHeight = computed(() => `${paddingTop.value + uni.upx2px(320)}px`);
|
||||
let realStatus = ref(0); //是否已经实名认证
|
||||
let agentLevelObj = {
|
||||
2: 'home/igency_1.png',
|
||||
@@ -324,7 +325,7 @@
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 380rpx;
|
||||
height: v-bind('headerBgHeight');
|
||||
background: #00f;
|
||||
border-radius: 0 0 30rpx 30rpx;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user