This commit is contained in:
2025-06-26 13:56:00 +08:00
parent 5147d79bff
commit dcd277835b
16 changed files with 190 additions and 9 deletions

View File

@@ -8,7 +8,7 @@ export default {
onShow: function () { onShow: function () {
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN
const UserStore = useUserStore(); const UserStore = useUserStore();
if (!UserStore.isLogin) { if (!UserStore.isLogin && window.location.href.indexOf('/pages/register/index') < 0) {
toPage('/pages/login/index'); toPage('/pages/login/index');
} }
// #endif // #endif

View File

@@ -404,6 +404,13 @@ const system = {
data: data data: data
}); });
}, },
getPoster: async (data) => {
return request({
method: MethodsENUM.POST,
url: "/user/getPoster",
data: data
});
},
} }
export default system; export default system;

View File

@@ -0,0 +1,79 @@
<script setup>
import UQRCode from 'uqrcodejs';
import {onMounted, ref} from 'vue';
const emits = defineEmits(['handleLongPress']);
const {bg, invite, member_url} = defineProps({
bg: {
type: String,
default: null
},
invite: {
type: String,
default: null
},
member_url: {
type: String,
default: null
},
});
const itemList = [
{text: '置顶', type: 1},
{text: '取消', type: 0},
]
const CanvasRef = ref();
const QRRef = ref();
let canvas = null;
onMounted(() => {
const _canvas = CanvasRef.value.$el.children[0];
const ctx = _canvas.getContext("2d");
canvas = _canvas;
draw(ctx, _canvas);
});
const draw = (ctx, canvas) => {
const img = new Image();
img.crossOrigin = 'Anonymous';
img.src = bg;
img.onload = function () {
ctx.drawImage(img, 0, 0, canvas.width / 3, canvas.height / 3);
const qr = new UQRCode();
qr.data = `${member_url}/pages/register/index?invite=${invite}`;
qr.size = 200;
qr.margin = 10;
qr.make()
const QRRefCanvas = QRRef.value.$el.children[0];
qr.canvasContext = QRRefCanvas.getContext("2d");
qr.drawCanvas().then(() => {
const base64 = QRRefCanvas.toDataURL('image/png');
const qr_img = new Image();
qr_img.src = base64;
qr_img.onload = function () {
const size = 70;
const x = 20;
const y = canvas.height / 3 - 88;
ctx.drawImage(qr_img, x, y, size, size);
}
});
}
}
const handleLongPress = () => {
emits('handleLongPress', canvas.toDataURL('image/png'));
}
</script>
<template>
<view class="!size-full relative" @longpress="handleLongPress">
<canvas class="!absolute !size-[200px] opacity-0" ref="QRRef"></canvas>
<canvas
class="!size-full"
ref="CanvasRef"/>
</view>
</template>
<style scoped lang="scss">
</style>

View File

@@ -1,17 +1,107 @@
<script setup> <script setup>
import {onMounted, reactive, ref} from 'vue';
import YQBX from '../../static/images/YQBX.png';
import SHOU from '../../static/icons/SHOU.png';
import LMK from '../../static/images/LMK.png';
import HB1 from '../../static/images/HB1.png';
import HB2 from '../../static/images/HB2.png';
import WS from '../../static/images/WS.png';
import TITLEBG from '../../static/images/TITLEBG.png';
import yqhyBg from '../../static/icons/yqhy-bg.png'; import yqhyBg from '../../static/icons/yqhy-bg.png';
import XNav from "../../components/XNav.vue"; import XNav from "../../components/XNav.vue";
import Api from "../../api/index.js";
import Poster from "./Poster.vue";
const swiperCur = ref(0);
const showActionSheet = ref(false);
const itemList = [
{text: '保存到相册', type: 1},
{text: '取消', type: 0},
];
const list = reactive({
invite: null,
member_url: null,
poster: [],
});
onMounted(() => {
Api.system.getPoster().then(({data}) => {
list.length = 0;
Object.assign(list, data);
})
})
let nowActive = null;
const handleLongPress = (base64) => {
nowActive = base64;
showActionSheet.value = true;
}
const success = ({type}) => {
if (type === 1) {
const link = document.createElement('a');
link.href = nowActive;
link.download = '邀请海报.png';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
}
</script> </script>
<template> <template>
<!--邀请好友--> <!--邀请好友-->
<XNav></XNav> <XNav></XNav>
<view class="h-[calc(100vh-100rpx)] relative"> <view class="h-[calc(100vh-100rpx)] w-full fixed top-[100rpx] left-0">
<image class="!w-full" mode="widthFix" :src="yqhyBg"></image> <image class="!size-full" mode="widthFix" :src="yqhyBg"></image>
</view>
<view class="!w-full !flex justify-center !mt-[48rpx]">
<image class="!h-[100rpx]" :src="YQBX" mode="heightFix"></image>
</view>
<view class="!w-full !flex justify-center !mt-[28rpx] relative">
<image class="!h-[70rpx]" :src="TITLEBG" mode="heightFix"></image>
<image class="!h-[54rpx] !absolute top-1/2 left-1/2 -translate-1/2" :src="LMK" mode="heightFix"></image>
<image class="!h-[104rpx] !absolute left-[10%]" :src="HB1" mode="heightFix"></image>
<image class="!h-[102rpx] !absolute right-[10%] bottom-[10%]" :src="HB2" mode="heightFix"></image>
</view>
<image class="!w-[942rpx] !absolute left-1/2 -translate-x-1/2 top-[40rpx]" :src="WS" mode="widthFix"></image>
<swiper
class="!h-[908rpx] !mt-[90rpx]"
previous-margin="95rpx"
next-margin="95rpx"
@change="({detail: {current}}) => swiperCur=current"
:current="swiperCur"
circular>
<swiper-item class="!w-[564rpx]" v-for="(v, index) in list.poster">
<Poster
:bg="v"
:invite="list.invite"
:member_url="list.member_url"
@handleLongPress="handleLongPress"
:class="['duration-500', index!==swiperCur?'scale-[0.8]':'']"></Poster>
</swiper-item>
</swiper>
<tui-actionsheet
:show="showActionSheet"
:itemList="itemList"
@click="success"
@cancel="showActionSheet=false">
</tui-actionsheet>
<view
class="!w-full !h-[88rpx] bg-[rgba(0,0,0,.21)] text-white relative z-10 !flex justify-center items-center !mt-[48rpx]">
提示
<image class="!w-[56rpx] !ml-[14rpx] !mr-[10rpx]" :src="SHOU" mode="widthFix"></image>
长摁图片保存到本地
</view> </view>
</template> </template>
<style scoped> <style lang="scss" scoped>
</style> </style>

View File

@@ -6,6 +6,7 @@ import XInput from "../../components/XInput.vue";
import SendMsg from "../../components/SendMsg.vue"; import SendMsg from "../../components/SendMsg.vue";
import Api from "../../api/index.js"; import Api from "../../api/index.js";
import {showToast, toPage, verifyForm} from "../../utils/uils.js"; import {showToast, toPage, verifyForm} from "../../utils/uils.js";
import {onLoad} from "@dcloudio/uni-app";
const form = reactive({ const form = reactive({
wechat: null, wechat: null,
@@ -47,6 +48,11 @@ const success = async () => {
showToast(msg); showToast(msg);
await toPage(`/pages/login/index?showWX=1`); await toPage(`/pages/login/index?showWX=1`);
} }
onLoad((options) => {
const {invite} = options;
form.invite = invite;
})
</script> </script>
<template> <template>

View File

@@ -87,8 +87,7 @@ onMounted(() => {
回填时间: 回填时间:
</view> </view>
<view class="block-info"> <view class="block-info">
{{ dayjs(data.task_content[current].start_time).format('YYYY-MM-DD HH:mm') }} {{ data.children.back[current].time }}
{{ dayjs(data.task_content[current].end_time).format('YYYY-MM-DD HH:mm') }}
</view> </view>
</view> </view>

BIN
src/static/icons/SHOU.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
src/static/images/HB1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
src/static/images/HB2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
src/static/images/LMK.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
src/static/images/LXHB.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

BIN
src/static/images/WS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

BIN
src/static/images/YQBX.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@@ -34,7 +34,8 @@ request.interceptors.request.use(
config.headers['Access-Token'] = token; config.headers['Access-Token'] = token;
} }
console.log(`请求拦截器${config.url}`, config.data); console.log(`请求拦截器1${config.url}`, config);
console.log(`请求拦截器2${config.url}`, config.data);
if (!config.UN_AES) { if (!config.UN_AES) {
const {context, iv} = AESCrypto.encrypt(JSON.stringify(config.data)); const {context, iv} = AESCrypto.encrypt(JSON.stringify(config.data));

View File

@@ -177,7 +177,6 @@ export const uploadFile = ({count}) => {
} }
export const verifyForm = (model, rules) => { export const verifyForm = (model, rules) => {
console.log('进来了')
Object.entries(model).forEach(([key, value]) => { Object.entries(model).forEach(([key, value]) => {
console.log(rules[key], key, value) console.log(rules[key], key, value)
if (rules[key]) { if (rules[key]) {