update
@@ -8,7 +8,7 @@ export default {
|
||||
onShow: function () {
|
||||
// #ifndef MP-WEIXIN
|
||||
const UserStore = useUserStore();
|
||||
if (!UserStore.isLogin) {
|
||||
if (!UserStore.isLogin && window.location.href.indexOf('/pages/register/index') < 0) {
|
||||
toPage('/pages/login/index');
|
||||
}
|
||||
// #endif
|
||||
|
||||
@@ -404,6 +404,13 @@ const system = {
|
||||
data: data
|
||||
});
|
||||
},
|
||||
getPoster: async (data) => {
|
||||
return request({
|
||||
method: MethodsENUM.POST,
|
||||
url: "/user/getPoster",
|
||||
data: data
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
export default system;
|
||||
|
||||
79
src/pages/InviteFriends/Poster.vue
Normal 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>
|
||||
@@ -1,17 +1,107 @@
|
||||
<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 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>
|
||||
|
||||
<template>
|
||||
<!--邀请好友-->
|
||||
<XNav></XNav>
|
||||
|
||||
<view class="h-[calc(100vh-100rpx)] relative">
|
||||
<image class="!w-full" mode="widthFix" :src="yqhyBg"></image>
|
||||
<view class="h-[calc(100vh-100rpx)] w-full fixed top-[100rpx] left-0">
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
|
||||
@@ -6,6 +6,7 @@ import XInput from "../../components/XInput.vue";
|
||||
import SendMsg from "../../components/SendMsg.vue";
|
||||
import Api from "../../api/index.js";
|
||||
import {showToast, toPage, verifyForm} from "../../utils/uils.js";
|
||||
import {onLoad} from "@dcloudio/uni-app";
|
||||
|
||||
const form = reactive({
|
||||
wechat: null,
|
||||
@@ -47,6 +48,11 @@ const success = async () => {
|
||||
showToast(msg);
|
||||
await toPage(`/pages/login/index?showWX=1`);
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
const {invite} = options;
|
||||
form.invite = invite;
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -87,8 +87,7 @@ onMounted(() => {
|
||||
回填时间:
|
||||
</view>
|
||||
<view class="block-info">
|
||||
{{ dayjs(data.task_content[current].start_time).format('YYYY-MM-DD HH:mm') }} 至
|
||||
{{ dayjs(data.task_content[current].end_time).format('YYYY-MM-DD HH:mm') }}
|
||||
{{ data.children.back[current].time }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
BIN
src/static/icons/SHOU.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
src/static/images/HB1.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
src/static/images/HB2.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
src/static/images/LMK.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/static/images/LXHB.png
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
src/static/images/TITLEBG.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
src/static/images/WS.png
Normal file
|
After Width: | Height: | Size: 178 KiB |
BIN
src/static/images/YQBX.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
@@ -34,7 +34,8 @@ request.interceptors.request.use(
|
||||
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) {
|
||||
const {context, iv} = AESCrypto.encrypt(JSON.stringify(config.data));
|
||||
|
||||
@@ -177,7 +177,6 @@ export const uploadFile = ({count}) => {
|
||||
}
|
||||
|
||||
export const verifyForm = (model, rules) => {
|
||||
console.log('进来了')
|
||||
Object.entries(model).forEach(([key, value]) => {
|
||||
console.log(rules[key], key, value)
|
||||
if (rules[key]) {
|
||||
|
||||