From a4d2fac5cd85413c24926c694203e615cf041474 Mon Sep 17 00:00:00 2001 From: TianYu <332368756@qq.com> Date: Thu, 25 May 2023 15:35:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-app/main.js | 42 +++++++++++++++--------------- yudao-ui-app/package.json | 2 ++ yudao-ui-app/pages/index/index.vue | 42 ++++++++++++++++-------------- 3 files changed, 45 insertions(+), 41 deletions(-) diff --git a/yudao-ui-app/main.js b/yudao-ui-app/main.js index b6b8b459d..36bb9d4c3 100644 --- a/yudao-ui-app/main.js +++ b/yudao-ui-app/main.js @@ -18,32 +18,32 @@ import { parseQuery } from "./utils"; import Auth from './libs/wechat'; import { SPREAD } from './config/cache'; Vue.prototype.$wechat = Auth; -let cookieName = "VCONSOLE", - query = parseQuery(), - urlSpread = query["spread"], - vconsole = query[cookieName.toLowerCase()], - md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式 - md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式 +// let cookieName = "VCONSOLE", +// query = parseQuery(), +// urlSpread = query["spread"], +// // vconsole = query[cookieName.toLowerCase()], +// vconsole = "b14d1e9baeced9bb7525ab19ee35f2d2", +// md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式 +// md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式 -if (urlSpread !== undefined) { - var spread = Cache.get(SPREAD); - urlSpread = parseInt(urlSpread); - if (!Number.isNaN(urlSpread) && spread !== urlSpread) { - Cache.set("spread", urlSpread || 0); - } else if (spread === 0 || typeof spread !== "number") { - Cache.set("spread", urlSpread || 0); - } -} +// if (urlSpread !== undefined) { +// var spread = Cache.get(SPREAD); +// urlSpread = parseInt(urlSpread); +// if (!Number.isNaN(urlSpread) && spread !== urlSpread) { +// Cache.set("spread", urlSpread || 0); +// } else if (spread === 0 || typeof spread !== "number") { +// Cache.set("spread", urlSpread || 0); +// } +// } -if (vconsole !== undefined) { - if (vconsole === md5UnCrmeb && Cache.has(cookieName)) - Cache.clear(cookieName); -} else vconsole = Cache.get(cookieName); +// if (vconsole !== undefined) { +// if (vconsole === md5UnCrmeb && Cache.has(cookieName)) +// Cache.clear(cookieName); +// } else vconsole = Cache.get(cookieName); import VConsole from './components/vconsole.min.js' -if (vconsole !== undefined && vconsole === md5Crmeb) { - Cache.set(cookieName, md5Crmeb, 3600); +if (process.env.isVConsole) { let vConsole = new VConsole(); } diff --git a/yudao-ui-app/package.json b/yudao-ui-app/package.json index c33a2c9b1..40092a0fc 100644 --- a/yudao-ui-app/package.json +++ b/yudao-ui-app/package.json @@ -20,6 +20,7 @@ "title": "开发版", "env": { "UNI_PLATFORM": "h5", + "isVConsole": true, "APP_BASE_URL": "http://192.168.1.147:48080" } }, @@ -27,6 +28,7 @@ "title": "生产版", "env": { "UNI_PLATFORM": "h5", + "isVConsole": false, "APP_BASE_URL": "http://api.cyywl.top" } } diff --git a/yudao-ui-app/pages/index/index.vue b/yudao-ui-app/pages/index/index.vue index 40c7c78f6..9686a6715 100644 --- a/yudao-ui-app/pages/index/index.vue +++ b/yudao-ui-app/pages/index/index.vue @@ -40,7 +40,7 @@ - + {{item.storeName}} - + - + @@ -107,13 +107,13 @@ import { getTemlIds } from '@/api/api.js'; - + // import { // SUBSCRIBE_MESSAGE, // TIPS_KEY // } from '@/config/cache'; // #endif - // #ifdef H5 + // #ifdef H5 import { follow } from '@/api/public.js'; @@ -366,17 +366,17 @@ go(){ console.log(this.productList,'------') }, - + // 获取banner和userInfo getBanners(){ - + // console.log(this.$store.tenantId,'tenantId') getBanner().then(res=>{ this.bannerList = res.data.list[0] console.log(this.bannerList,'banner') }) console.log(this.userInfo.userId,'userInfo111111') - + }, getCoupon: function(id, index) { let that = this; @@ -483,7 +483,7 @@ this.getGroomList(); this.shareApi(); this.getcouponList(); - + // #ifdef H5 // that.subscribe = res.data.subscribe; // #endif @@ -625,7 +625,7 @@ get_host_product: function() { let that = this; that.loading = true; - + if (that.hotScroll) return getProductHot( that.hotPage, @@ -644,7 +644,9 @@ // 获取H5 搜索框高度 let appSearchH = uni.createSelectorQuery().select(".serch-wrapper"); appSearchH.boundingClientRect(function(data) { - self.searchH = data.height + if(data){ + self.searchH = data.height + } }).exec() // #endif }, @@ -712,13 +714,13 @@ .left { width: 164rpx; height: 164rpx; - + .image { border: 3rpx solid #EE5423; border-radius: 50%; border: linear-gradient(0deg, #F77C4D, #EE5423); } - + } .center { width: 330rpx; @@ -797,7 +799,7 @@ display: flex; justify-content: center; align-items: center; - + } .hot { width: 663rpx; @@ -806,7 +808,7 @@ margin-left: 44rpx; background: #fff; border-radius: 20rpx; - + .contain { width: 100%; height: 1rpx; @@ -938,7 +940,7 @@ background: #fff; overflow: hidden; border-radius: 20rpx; - + image { width: 100%; height: 294rpx; @@ -966,7 +968,7 @@ } .car { position: absolute; - + width: 60rpx; height: 60rpx; background: url(@/static/images/shop/car.png); @@ -978,11 +980,11 @@ ::v-deep .notice{ .u-icon__icon { color: #FF4802 !important; - + span { font-size: 28rpx; } -} - +} + }