From c826a3fa86a9ec9b1eb7aed1c1b6c0a4d09f7297 Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期四, 21 九月 2023 11:58:54 +0800
Subject: [PATCH] 企业端

---
 h5/pages/index/index.vue             |   47 ++++++---
 h5/components/bigImg.vue             |    4 
 h5/main.js                           |    5 +
 company_admin/src/api/system/menu.js |    2 
 company_admin/.env.development       |    4 
 h5/package-lock.json                 |   25 +++++
 h5/static/default_nodata@2x.png      |    0 
 h5/components/bigImg1.vue            |  140 ++++++++++++++++++++++++++++
 h5/components/noData.vue             |   27 +++++
 9 files changed, 232 insertions(+), 22 deletions(-)

diff --git a/company_admin/.env.development b/company_admin/.env.development
index d53d032..45dcba9 100644
--- a/company_admin/.env.development
+++ b/company_admin/.env.development
@@ -3,8 +3,8 @@
 
 # VUE_APP_API = 'https://dmtest.ahapp.net/preselect_interface/'
 
-VUE_APP_API = 'http://192.168.0.15:10022/'
+# VUE_APP_API = 'http://192.168.0.15:10024/'
 
-# VUE_APP_API = 'https://dmtest.ahapp.net/preselect_web_interface/'
+VUE_APP_API = 'https://dmtest.ahapp.net/preselect_web_interface/'
 
 # VUE_APP_API = 'https://dmtest.ahapp.net/preselect_interface/'
\ No newline at end of file
diff --git a/company_admin/src/api/system/menu.js b/company_admin/src/api/system/menu.js
index 19f25a0..0d3d593 100644
--- a/company_admin/src/api/system/menu.js
+++ b/company_admin/src/api/system/menu.js
@@ -36,7 +36,7 @@
 
 // 鏌ヨ鑿滃崟鏍�
 export function fetchMenuTree () {
-  return request.get('/system/menu/treeNodes')
+  return request.get('/system/menu/treeNodes?type=1')
 }
 
 // 鎺掑簭
diff --git a/h5/components/bigImg.vue b/h5/components/bigImg.vue
index ead3946..2cf1eef 100644
--- a/h5/components/bigImg.vue
+++ b/h5/components/bigImg.vue
@@ -6,8 +6,8 @@
 				<view class="img_content_tu_nr">
 					<swiper style="width: 100%; height: 100%;" @change="handlechange" :current="mycurrent" :indicator-dots="false"  :circular="true" :interval="1000" :duration="1000">
 						<swiper-item v-for="(item,index) in imgList" :key="index">
-							<view :class="['swiper-item',index==mycurrent ? 'active' : '']">
-								<image :src="item" style="width: 100%;height: 100%;" mode="aspectFit" />
+							<view :class="['swiper-item',index == mycurrent ? 'active' : '']">
+								<image :src="item" style="width: 150%;height: 150%;" mode="aspectFit" />
 							</view>
 						</swiper-item>
 					</swiper>
diff --git a/h5/components/bigImg1.vue b/h5/components/bigImg1.vue
new file mode 100644
index 0000000..404f165
--- /dev/null
+++ b/h5/components/bigImg1.vue
@@ -0,0 +1,140 @@
+<template>
+	<view class="img" :style="{ opacity: opacity, zIndex: zindex }">
+		<view class="img_content">
+			<view class="img_content_tu">
+				<image class="left" src="@/static/ic_left@2x.png" mode="widthFix" @click="jian"></image>
+				<view class="img_content_tu_nr">
+					<swiper style="width: 100%; height: 100%;" @change="handlechange" :current="mycurrent" :indicator-dots="false"  :circular="true" :interval="1000" :duration="1000">
+						<swiper-item v-for="(item,index) in imgList" :key="index">
+							<view :class="['swiper-item',index == mycurrent ? 'active' : '']">
+								<image :src="item" style="width: 100%;height: 100%;" mode="aspectFit" />
+							</view>
+						</swiper-item>
+					</swiper>
+				</view>
+				<image class="right" src="@/static/ic_right@2x.png" mode="widthFix" @click="add"></image>
+			</view>
+			<view class="img_content_close">
+				<image src="@/static/ic_close@2x.png" mode="widthFix" @click="close"></image>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				opacity: 0,
+				zindex: '-1',
+				mycurrent: 0
+			}
+		},
+		props: {
+			imgList: {
+				type: Array,
+				default: () => []
+			}
+		},
+		methods: {
+			add() {
+				if (this.imgList.length - 1 === this.mycurrent) return
+				this.mycurrent++
+			},
+			jian() {
+				if (this.mycurrent === 0) return
+				this.mycurrent--
+			},
+			handlechange(e){
+				this.mycurrent=e.detail.current
+			},
+			open(i) {
+				this.mycurrent = i
+				this.zindex = 3
+				this.opacity = 1
+			},
+			close() {
+				this.zindex = '-1'
+				this.opacity = 0
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.img {
+		width: 100vw;
+		height: 100vh;
+		background: rgba(0,0,0,0.4);
+		position: fixed;
+		transition: .2s;
+		top: 0;
+		left: 0;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		
+		.img_content {
+			display: flex;
+			flex-direction: column;
+			.img_content_tu {
+				display: flex;
+				align-items: center;
+				.img_content_tu_nr {
+					width: 600px;
+					height: 600px;
+					padding: 30px;
+					box-sizing: border-box;
+					border-radius: 8px;
+					margin: 0 32px;
+					display: flex;
+					align-items: center;
+					flex-wrap: nowrap;
+					.swiper-item{
+						width: 100%;
+						border-radius: 30rpx;
+						overflow: hidden;
+						// 鍍忚繖绉嶅寮犺疆鎾浘鍚屾椂鍑虹幇鍦ㄤ竴灞忕殑鎯呭喌涓嬪氨涓嶈鎸囧畾width浜嗭紝涓嶇劧浣犱細鍙戠幇previous-margin鍜� next-margin浼氬嚭鐜版兂涓嶅埌鐨勬晥鏋�
+						// 濡傛灉鎯宠璁剧疆瀹芥瘡涓�寮犺疆鎾浘鐨勫搴︼紝鍙渶瑕佽缃畃revious-margin鍜宯ext-margin灏卞彲浠ヤ簡锛屾兂瑕佽缃珮搴︾洿鎺ユ敼涓嬮潰鐨刪eight灏卞彲浠ヤ簡
+						// width: 450rpx;
+						height: 100%;
+						// transform: scale(1);
+						// transition: all 0.5s ease;
+						text-align: center;
+						// transition: all 0.5s ease-in-out;
+					}
+					.img_content_tu_nr_item {
+						width: 100%;
+						height: 600px;
+						image {
+							width: 100%;
+							height: 100%;
+						}
+					}
+				}
+				.left {
+					width: 80px;
+					height: 80px;
+					cursor: pointer;
+				}
+				.right {
+					width: 80px;
+					height: 80px;
+					cursor: pointer;
+				}
+			}
+			.img_content_close {
+				width: 100%;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				margin-top: 40px;
+				image {
+					width: 60px;
+					height: 60px;
+					cursor: pointer;
+				}
+			}
+		}
+	}
+</style>
\ No newline at end of file
diff --git a/h5/components/noData.vue b/h5/components/noData.vue
new file mode 100644
index 0000000..35c85b8
--- /dev/null
+++ b/h5/components/noData.vue
@@ -0,0 +1,27 @@
+<template>
+	<view class="no">
+		<image src="@/static/default_nodata@2x.png" mode="widthFix"></image>
+	</view>
+</template>
+
+<script>
+	export default {
+		name:"noData"
+	}
+</script>
+
+<style lang="scss" scoped>
+	.no {
+		width: 100%;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		// margin-top: 36px;
+		padding: 36px 0;
+		box-sizing: border-box;
+		image {
+			width: 268px;
+			height: 268px;
+		}
+	}
+</style>
\ No newline at end of file
diff --git a/h5/main.js b/h5/main.js
index 7bead7b..e9c6651 100644
--- a/h5/main.js
+++ b/h5/main.js
@@ -7,6 +7,11 @@
 
 import store from './store/index.js'
 
+import 'viewerjs/dist/viewer.css'
+import Viewer from 'v-viewer'
+
+Vue.use(Viewer)
+
 Vue.prototype.$store = store;
 
 try {
diff --git a/h5/package-lock.json b/h5/package-lock.json
new file mode 100644
index 0000000..f54d67b
--- /dev/null
+++ b/h5/package-lock.json
@@ -0,0 +1,25 @@
+{
+  "requires": true,
+  "lockfileVersion": 1,
+  "dependencies": {
+    "throttle-debounce": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-2.3.0.tgz",
+      "integrity": "sha512-H7oLPV0P7+jgvrk+6mwwwBDmxTaxnu9HMXmloNLXwnNO0ZxZ31Orah2n8lU1eMPvsaowP2CX+USCgyovXfdOFQ=="
+    },
+    "v-viewer": {
+      "version": "1.6.4",
+      "resolved": "https://registry.npmjs.org/v-viewer/-/v-viewer-1.6.4.tgz",
+      "integrity": "sha512-LVkiUHpmsbsZXebeNXnu8krRCi5i2n07FeLFxoIVGhw8lVvTBO0ffpbDC6mLEuacCjrIh09HjIqpciwUtWE8lQ==",
+      "requires": {
+        "throttle-debounce": "^2.0.1",
+        "viewerjs": "^1.5.0"
+      }
+    },
+    "viewerjs": {
+      "version": "1.11.6",
+      "resolved": "https://registry.npmjs.org/viewerjs/-/viewerjs-1.11.6.tgz",
+      "integrity": "sha512-TlhdSp2oEOLFXvEp4psKaeTjR5zBjTRcM/sHUN8PkV1UWuY8HKC8n7GaVdW5Xqnwdr/F1OmzLik1QwDjI4w/nw=="
+    }
+  }
+}
diff --git a/h5/pages/index/index.vue b/h5/pages/index/index.vue
index 1571973..2df63d8 100644
--- a/h5/pages/index/index.vue
+++ b/h5/pages/index/index.vue
@@ -198,16 +198,19 @@
 						</view>
 					</view>
 					<view class="productPage_shop" v-if="status === 1 && !pkcontent">
-						<view class="productPage_shop_item" v-for="(item, index) in isSOU ? shopPageDataSou : shopPageData" :key="index" @click="clickshoppageItem(item)">
-							<view class="productPage_shop_item_img">
-								<image :src="item.imgurl ? item.prefixUrl + item.imgurl : ''" mode="widthFix"></image>
+						<noData v-if="shopPageData.length === 0 && shopPageDataSou.length === 0" />
+						<template v-else>
+							<view class="productPage_shop_item" v-for="(item, index) in isSOU ? shopPageDataSou : shopPageData" :key="index" @click="clickshoppageItem(item)">
+								<view class="productPage_shop_item_img">
+									<image :src="item.imgurl ? item.prefixUrl + item.imgurl : ''" mode="widthFix"></image>
+								</view>
+								<!-- stringOperations(item.name, 6) -->
+								<text>{{item.name}}</text>
 							</view>
-							<!-- stringOperations(item.name, 6) -->
-							<text>{{item.name}}</text>
-						</view>
-						<view class="productPage_shop_zw"></view>
-						<view class="productPage_shop_zw"></view>
-						<view class="productPage_shop_zw"></view>
+							<view class="productPage_shop_zw"></view>
+							<view class="productPage_shop_zw"></view>
+							<view class="productPage_shop_zw"></view>
+						</template>
 					</view>
 					 <!-- v-if="status === 2" -->
 					<view class="productPage_parameter" v-if="isPK && pkcontent">
@@ -242,6 +245,10 @@
 			<bigImg
 				ref="bigImg"
 				:imgList="imgList"/>
+			<!-- 鏌ョ湅澶у浘 -->
+			<bigImg1
+				ref="bigImg1"
+				:imgList="imgList"/>
 			<!-- 鎼滅储 -->
 			
 			<!-- 鎼滅储缁勪欢 -->
@@ -259,7 +266,9 @@
 
 <script>
 	import bigImg from '@/components/bigImg.vue'
+	import bigImg1 from '@/components/bigImg1.vue'
 	import search from '@/components/search.vue'
+	import noData from '@/components/noData.vue'
 	import { mapState } from 'vuex'
 	import { categoryList, goodsList, brandList, h5Image, goodsPage, listForH5 } from '@/apis/index.js'
 	export default {
@@ -338,7 +347,7 @@
 				page: 1
 			}
 		},
-		components: { bigImg, search },
+		components: { bigImg, search, noData, bigImg1 },
 		onLoad() {
 			var that = this
 			// 鐩戝惉閿洏缁勫悎閿�
@@ -694,7 +703,12 @@
 						})
 					}
 				})
-				this.$refs.bigImg.open(0)
+				// console.log(this.imgList)
+				this.$viewerApi({
+				  images: this.imgList,
+				})
+				// this.$refs.bigImg.open(0)
+				// this.$refs.bigImg1.open(0)
 			},
 			empty() {
 				this.shopList = []
@@ -1135,7 +1149,7 @@
 				margin-top: 16px;
 				.commodityFrom_head {
 					width: 100%;
-					height: 60px;
+					height: 45px;
 					padding: 10px 8px;
 					box-sizing: border-box;
 					background: rgba(0,224,255,0.24) linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(0,0,0,0.21) 100%);
@@ -1182,7 +1196,7 @@
 						flex-direction: column;
 						.commodityFrom_body_content_item {
 							width: 100%;
-							height: 56px;
+							height: 45px;
 							display: flex;
 							align-items: center;
 							margin-bottom: 6px;
@@ -1203,7 +1217,7 @@
 								opacity: 0;
 								transform: translate(0%, 0%);
 								z-index: -1;
-								height: 56px;
+								height: 45px;
 								display: flex;
 								align-items: center;
 								background: rgba(0,224,255,0.3);
@@ -1352,7 +1366,7 @@
 					}
 					.commodityFrom_body_total {
 						width: 100%;
-						height: 56px;
+						height: 45px;
 						display: flex;
 						align-items: center;
 						.commodityFrom_body_total_item {
@@ -1444,7 +1458,6 @@
 					}
 				}
 			}
-			
 			.productPage {
 				width: 100%;
 				padding: 0 22px;
@@ -1452,7 +1465,7 @@
 				margin-top: 16px;
 				.productPage_head {
 					width: 100%;
-					height: 60px;
+					height: 45px;
 					display: flex;
 					align-items: center;
 					background: rgba(0,224,255,0.34) linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(0,0,0,0.21) 100%);
diff --git a/h5/static/default_nodata@2x.png b/h5/static/default_nodata@2x.png
new file mode 100644
index 0000000..0ef2f94
--- /dev/null
+++ b/h5/static/default_nodata@2x.png
Binary files differ

--
Gitblit v1.9.3