update
This commit is contained in:
@@ -35,7 +35,8 @@
|
|||||||
"build:mp-xhs": "uni build -p mp-xhs",
|
"build:mp-xhs": "uni build -p mp-xhs",
|
||||||
"build:quickapp-webview": "uni build -p quickapp-webview",
|
"build:quickapp-webview": "uni build -p quickapp-webview",
|
||||||
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
||||||
"build:quickapp-webview-union": "uni build -p quickapp-webview-union"
|
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
|
||||||
|
"postinstall": "weapp-tw patch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dcloudio/uni-app": "3.0.0-alpha-4050420250306001",
|
"@dcloudio/uni-app": "3.0.0-alpha-4050420250306001",
|
||||||
@@ -78,8 +79,10 @@
|
|||||||
"@dcloudio/uni-cli-shared": "3.0.0-alpha-4050420250306001",
|
"@dcloudio/uni-cli-shared": "3.0.0-alpha-4050420250306001",
|
||||||
"@dcloudio/uni-stacktracey": "3.0.0-alpha-4050420250306001",
|
"@dcloudio/uni-stacktracey": "3.0.0-alpha-4050420250306001",
|
||||||
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-4050420250306001",
|
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-4050420250306001",
|
||||||
|
"@tailwindcss/postcss": "^4.1.5",
|
||||||
"@types/crypto-js": "^4.2.2",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@vue/runtime-core": "^3.4.21",
|
"@vue/runtime-core": "^3.4.21",
|
||||||
"vite": "6.2.2"
|
"vite": "6.3.5",
|
||||||
|
"weapp-tailwindcss": "^4.1.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1913
pnpm-lock.yaml
generated
1913
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -19,5 +19,9 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/*每个页面公共css */
|
/* #ifdef MP-WEIXIN */
|
||||||
|
@import "weapp-tailwindcss/css";
|
||||||
|
|
||||||
|
@source not "dist";
|
||||||
|
/* #endif */
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {ref} from 'vue';
|
import {ref} from 'vue';
|
||||||
|
|
||||||
const {src, list} = defineProps({
|
const {src, list, imageClass} = defineProps({
|
||||||
src: {
|
src: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
@@ -13,6 +13,10 @@ const {src, list} = defineProps({
|
|||||||
cur: {
|
cur: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
|
},
|
||||||
|
imageClass: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -28,7 +32,7 @@ const preview = () => {
|
|||||||
<image @click="preview" v-bind="$attrs" :src="src" mode="aspectFill"></image>
|
<image @click="preview" v-bind="$attrs" :src="src" mode="aspectFill"></image>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<image @click="preview" :src="src" mode="aspectFill"></image>
|
<image @click="preview" :class="imageClass" :src="src" mode="aspectFill"></image>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<view
|
<view
|
||||||
|
|||||||
@@ -54,7 +54,8 @@
|
|||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": false
|
"urlCheck": false
|
||||||
},
|
},
|
||||||
"usingComponents": true
|
"usingComponents": true,
|
||||||
|
"lazyCodeLoading": "requiredComponents"
|
||||||
},
|
},
|
||||||
"h5": {
|
"h5": {
|
||||||
"router": {
|
"router": {
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
// #ifdef MP-WEIXIN
|
||||||
|
{
|
||||||
|
"path": "pages/downloadMaterials/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "领取素材"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// #endif
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
{
|
{
|
||||||
"path": "pages/home/index",
|
"path": "pages/home/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -72,13 +80,6 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/downloadMaterials/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "领取素材",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/comingSoon/index",
|
"path": "pages/comingSoon/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -156,6 +157,7 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
@@ -170,6 +172,7 @@
|
|||||||
"tui-(.*)": "thorui-uni/lib/thorui/tui-$1/tui-$1.vue"
|
"tui-(.*)": "thorui-uni/lib/thorui/tui-$1/tui-$1.vue"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
"color": "#C9CDD4",
|
"color": "#C9CDD4",
|
||||||
"selectedColor": "#2D5CF6",
|
"selectedColor": "#2D5CF6",
|
||||||
@@ -202,4 +205,5 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,9 @@ const tabs = ref([
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!--下载素材-->
|
<!--下载素材-->
|
||||||
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<x-nav></x-nav>
|
<x-nav></x-nav>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
<tui-tabs :tabs="tabs" :currentTab="current" @change="({index})=>current=index"></tui-tabs>
|
<tui-tabs :tabs="tabs" :currentTab="current" @change="({index})=>current=index"></tui-tabs>
|
||||||
|
|
||||||
@@ -72,14 +74,14 @@ const tabs = ref([
|
|||||||
<view class="title">素材(请按顺序下载&发布)</view>
|
<view class="title">素材(请按顺序下载&发布)</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="!grid grid-cols-5 flex-wrap gap-[32rpx]">
|
<view class="!grid grid-cols-5 flex-wrap gap-[32rpx]">
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="copy-button" @click="download(mock)">批量保存</view>
|
<view class="copy-button" @click="download(mock)">批量保存</view>
|
||||||
@@ -92,30 +94,34 @@ const tabs = ref([
|
|||||||
正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文文正文正文文正文正文文正文正文
|
正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文文正文正文文正文正文文正文正文
|
||||||
|
|
||||||
<view class="!grid grid-cols-5 flex-wrap gap-[32rpx]">
|
<view class="!grid grid-cols-5 flex-wrap gap-[32rpx]">
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="!flex gap-[24rpx] justify-center">
|
<view class="!flex gap-[24rpx] justify-center">
|
||||||
<view class="copy-button !mx-0" @click="copy('我是标题我是标题我是标题我是标题我是标题')">复制文字</view>
|
<view class="copy-button !mx-0" @click="copy('我是标题我是标题我是标题我是标题我是标题')">复制文字
|
||||||
|
</view>
|
||||||
<view class="copy-button !mx-0" @click="download(mock)">保存图片</view>
|
<view class="copy-button !mx-0" @click="download(mock)">保存图片</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="block">
|
<view class="block">
|
||||||
<view class="title">评论2<x-link class="!ml-auto" show-description>查看引导</x-link></view>
|
<view class="title">评论2
|
||||||
|
<x-link class="!ml-auto" show-description>查看引导</x-link>
|
||||||
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文文正文正文文正文正文文正文正文
|
正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文文正文正文文正文正文文正文正文
|
||||||
|
|
||||||
<view class="!grid grid-cols-5 flex-wrap gap-[32rpx]">
|
<view class="!grid grid-cols-5 flex-wrap gap-[32rpx]">
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
<x-image :src="testIcon" class="!w-[100%] !h-auto !aspect-square"></x-image>
|
<x-image :src="testIcon" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="!flex gap-[24rpx] justify-center">
|
<view class="!flex gap-[24rpx] justify-center">
|
||||||
<view class="copy-button !mx-0" @click="copy('我是标题我是标题我是标题我是标题我是标题')">复制文字</view>
|
<view class="copy-button !mx-0" @click="copy('我是标题我是标题我是标题我是标题我是标题')">复制文字
|
||||||
|
</view>
|
||||||
<view class="copy-button !mx-0" @click="download(mock)">保存图片</view>
|
<view class="copy-button !mx-0" @click="download(mock)">保存图片</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
|
/* #ifndef MP-WEIXIN */
|
||||||
@import "tailwindcss";
|
@import "tailwindcss";
|
||||||
|
/* #endif */
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
export const showToast = (options) => {
|
export const showToast = (options) => {
|
||||||
if (typeof options === 'string') {
|
if (typeof options === 'string') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: options,
|
title: options, icon: 'none',
|
||||||
icon: 'none',
|
|
||||||
}).then();
|
}).then();
|
||||||
} else {
|
} else {
|
||||||
uni.showToast(options).then();
|
uni.showToast(options).then();
|
||||||
@@ -31,6 +30,7 @@ export const backPage = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const copy = (context) => {
|
export const copy = (context) => {
|
||||||
|
// #ifndef APP-PLUS || MP-WEIXIN
|
||||||
try {
|
try {
|
||||||
navigator.clipboard.writeText(context)
|
navigator.clipboard.writeText(context)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -42,10 +42,20 @@ export const copy = (context) => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
showToast('复制失败');
|
showToast('复制失败');
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS || MP-WEIXIN
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: context, success: () => {
|
||||||
|
showToast('已复制');
|
||||||
|
}, fail: () => {
|
||||||
|
showToast('复制失败');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
export const download = (urls) => {
|
export const download = (urls) => {
|
||||||
// #ifndef APP-PLUS
|
// #ifndef APP-PLUS || MP-WEIXIN
|
||||||
const promises1 = urls.map(url => new Promise((resolve, reject) => {
|
const promises1 = urls.map(url => new Promise((resolve, reject) => {
|
||||||
const iframe = document.createElement('iframe');
|
const iframe = document.createElement('iframe');
|
||||||
iframe.src = url;
|
iframe.src = url;
|
||||||
@@ -62,7 +72,6 @@ export const download = (urls) => {
|
|||||||
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
const promises2 = urls.map(v => new Promise((resolve, reject) => {
|
const promises2 = urls.map(v => new Promise((resolve, reject) => {
|
||||||
urls.forEach(v => {
|
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: v,
|
url: v,
|
||||||
success: () => {
|
success: () => {
|
||||||
@@ -72,7 +81,6 @@ export const download = (urls) => {
|
|||||||
reject(false);
|
reject(false);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
|
||||||
}));
|
}));
|
||||||
Promise.all(promises2).then(() => {
|
Promise.all(promises2).then(() => {
|
||||||
showToast('保存成功');
|
showToast('保存成功');
|
||||||
@@ -80,4 +88,32 @@ export const download = (urls) => {
|
|||||||
showToast('保存失败');
|
showToast('保存失败');
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
const promises3 = urls.map(v => new Promise((resolve, reject) => {
|
||||||
|
uni.downloadFile({
|
||||||
|
url: v,
|
||||||
|
success: ({tempFilePath}) => {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: tempFilePath,
|
||||||
|
success: () => {
|
||||||
|
resolve(true);
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log(err);
|
||||||
|
reject(false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
reject(false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}));
|
||||||
|
Promise.all(promises3).then(() => {
|
||||||
|
showToast('保存成功');
|
||||||
|
}).catch(() => {
|
||||||
|
showToast('保存失败');
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,21 @@
|
|||||||
import {defineConfig} from 'vite';
|
import {defineConfig} from 'vite';
|
||||||
import uni from '@dcloudio/vite-plugin-uni';
|
import uni from '@dcloudio/vite-plugin-uni';
|
||||||
import tailwindcss from "@tailwindcss/vite";
|
import {UnifiedViteWeappTailwindcssPlugin} from 'weapp-tailwindcss/vite';
|
||||||
|
import tailwindcss from '@tailwindcss/postcss'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
uni.default(),
|
uni.default(),
|
||||||
tailwindcss(),
|
UnifiedViteWeappTailwindcssPlugin({
|
||||||
|
rem2rpx: true,
|
||||||
|
})
|
||||||
],
|
],
|
||||||
css: {
|
css: {
|
||||||
|
postcss: {
|
||||||
|
plugins: [
|
||||||
|
tailwindcss()
|
||||||
|
]
|
||||||
|
},
|
||||||
preprocessorOptions: {
|
preprocessorOptions: {
|
||||||
scss: {
|
scss: {
|
||||||
silenceDeprecations: ['legacy-js-api'],
|
silenceDeprecations: ['legacy-js-api'],
|
||||||
|
|||||||
Reference in New Issue
Block a user