xiebaomin 1 vuosi sitten
vanhempi
commit
c63bfdc758

+ 1 - 0
components.d.ts

@@ -26,6 +26,7 @@ declare module 'vue' {
     VanForm: typeof import('vant/es')['Form']
     VanHighlight: typeof import('vant/es')['Highlight']
     VanImage: typeof import('vant/es')['Image']
+    VanImagePreview: typeof import('vant/es')['ImagePreview']
     VanSearch: typeof import('vant/es')['Search']
     VanSwipe: typeof import('vant/es')['Swipe']
     VanSwipeItem: typeof import('vant/es')['SwipeItem']

+ 2 - 1
index.html

@@ -5,7 +5,8 @@
     <meta name="referrer" content="never">
     <link rel="icon" type="image/svg+xml" href="/vite.svg" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>Vite + Vue + TS</title>
+    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1" />
+    <title>内容库</title>
     <style>
       #app {
         width: 100vw;

+ 1 - 1
src/Hooks/usePermission/permiMode.tsx

@@ -48,7 +48,7 @@ const MyComponent = (prop: IPermiObj | Boolean): ComponentOptions =>
 			`
 			const route = useRoute()
 			const handleClick = () => {
-				window.location.href = import.meta.env.VITE_HTTP_URL + obj.redirect + '?t=' + route.query.t + '&isDataBase=' + 1 + '&spId=' + route.query.spId
+				window.location.href = import.meta.env.VITE_HTTP_URL + obj.redirect + '?t=' + route.query.t + '&isDataBase=' + 1 + '&spId=' + route.query.spId + '&id=' + route.query.id
 			}
 			const pageLocation = ref<number>(0)
 			const stop = () => {

+ 1 - 1
src/api/context/context.ts

@@ -11,7 +11,7 @@ import type {
 	IShareConfig,
 	DShareConfigResultData,
 	IStatistics,
-	DPreviewResultData
+	DPreviewResultData,
 } from '@/types/api/context.type'
 import { requestGET, requestPOST } from '@/types/api/index'
 import { DForm } from '@/types/views/add.type'

+ 68 - 19
src/components/image-preview/image-preview.vue

@@ -1,32 +1,81 @@
 <template>
-	<div class="imagePreview">
-		<van-swipe :autoplay="3000" lazy-render>
-			<van-swipe-item v-for="image,index in urls" :key="index">
-				<img :src="image" style="width: 100%;" />
-			</van-swipe-item>
-		</van-swipe>
-	</div>
+  <div class="imagePreview">
+    <van-swipe :autoplay="3000" lazy-render>
+      <van-swipe-item v-for="(image, index) in urls" :key="index">
+        <div class="stop_save" />
+        <img :src="image" style="width: 100%" />
+      </van-swipe-item>
+    </van-swipe>
+  </div>
 </template>
 
 <script setup lang="ts">
+import { IImagePreviewList } from "./index.type";
+withDefaults(defineProps<IImagePreviewList>(), {
+	urls: () => [
+		'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
+    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
+	]
+})
 
-import { IImagePreviewList } from './index.type';
-
-defineProps<IImagePreviewList>()
-
+//const urls = [
+//  "https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg",
+//  "https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg",
+//];
 
+document.body.addEventListener(
+  "touchstart",
+  (e) => {
+		e.preventDefault();
+  },
+  { passive: false }
+);
 </script>
 
 <style scoped lang="scss">
 .imagePreview {
-	padding: 80px 20px;
-	width: 100%;
-	box-sizing: border-box;
-	height: 100vh;
+  padding: 80px 20px;
+  width: 100%;
+  box-sizing: border-box;
+  height: 100vh;
 }
 :deep() {
-	.van-swipe,.van-swipe-item,.van-swipe__track {
-		width: 100%;
-	}
+  .van-swipe,
+  .van-swipe-item,
+  .van-swipe__track {
+    width: 100%;
+    position: relative;
+  }
+  .stop_save {
+    position: absolute;
+    z-index: 100;
+    left: 0;
+    right: 0;
+    top: 0;
+    bottom: 0;
+    opacity: 0;
+    -webkit-touch-callout: none;
+  }
+  .van-image {
+    pointer-events: none !important;
+    -webkit-user-select: none !important;
+    -moz-user-select: none !important;
+    user-select: none !important;
+    -webkit-touch-callout: none;
+  }
+}
+img {
+  pointer-events: none !important;
+  -webkit-user-select: none !important;
+  -moz-user-select: none !important;
+  user-select: none !important;
+  -webkit-touch-callout: none !important;
+}
+* {
+  -webkit-touch-callout: none;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
 }
-</style>
+</style>

+ 23 - 2
src/components/pdf-preview/pdf-preview.vue

@@ -33,10 +33,31 @@ const initPDF = () => {
         state.numPages = pdf.numPages;
       })
 };
-
+document.body.addEventListener(
+  "touchstart",
+  (e) => {
+		e.preventDefault();
+  },
+  { passive: false }
+);
 onMounted(() => {
 	initPDF()
 })
 </script>
 
-<style scoped></style>
+<style scoped lang="scss">
+img {
+  pointer-events: none !important;
+  -webkit-user-select: none !important;
+  -moz-user-select: none !important;
+  user-select: none !important;
+  -webkit-touch-callout: none !important;
+}
+* {
+  -webkit-touch-callout: none;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+</style>

+ 11 - 0
src/types/api/context.type.ts

@@ -12,6 +12,11 @@ export type ILabelKeyResultData = { // 标签返回
 	k: string;
 }
 
+export type INewLabelKeyResultData = { // 标签返回
+	keyword: string;
+	id: number;
+}
+
 export type DWaters = {
 	ossUrl: string;
 	ossName: string;
@@ -50,6 +55,8 @@ export type DShareConfigResultData = {
 
 export type DLabelKeyResultData = DResultListData<ILabelKeyResultData> 
 
+export type DNewLabelKeyResultData = DResultListData<INewLabelKeyResultData> 
+
 export type DStoreResultData = DResultListData<IStoreResultData>
 
 export type IPreviewForm = {
@@ -63,6 +70,9 @@ export type DPreviewResultData = IResultData<IPreviewForm>
 export interface ILabelKeyRequest extends IGlobalListRequest { // 参数
 	v: string;
 }
+export interface INewLabelKeyRequest extends IGlobalListRequest {
+	keyword: string;
+}
 
 export interface IArchiveRequest { // 参数
 	title?: string
@@ -124,4 +134,5 @@ export interface ContextRequest {
 	'https://zplma.caimei365.com/wx/sdk/config/data': IShareConfig
 	'/user/record/Statistics': IStatistics
 	'/commodity/product/archive/add': DForm
+	'/home/findKeyWordList': INewLabelKeyRequest
 }

+ 2 - 1
src/views/Preview/index.vue

@@ -3,6 +3,7 @@
   <pdf-preview v-if="params.type === '3' && fileUrl" :url="fileUrl" :is-permi="isPermi"/>
   <image-preview v-if="params.type === '1' && form?.waters" :urls="form?.waters" :is-permi="isPermi"/>
   <permi-mode v-if="!query.isSp" />
+  <!--<iframe frameborder="0" src="http://localhost:8009/login.html" />-->
   <!--<div class="hidden">
     <div>pageHide: {{ pageHide }}</div>
     <div>visibility: {{ visibility }}</div>
@@ -74,7 +75,7 @@ const statistical = useStatisticalTime((time) => {
     accessClient: "0",
     pagePath: location.href,
     accessDuration: t * 1000,
-    pageType: "67",
+    pageType: params.value.type === '1' ? '70' : params.value.type === '2' ? '71' : '69',
     pageLabel: "内容库预览",
     userId: params.value.userId || "0",
     productId: form.value?.productId || "0",