diff --git a/components/choiceness/choiceness.vue b/components/choiceness/choiceness.vue index 45f9d73..10ce871 100644 --- a/components/choiceness/choiceness.vue +++ b/components/choiceness/choiceness.vue @@ -7,8 +7,10 @@ - - {{ item.title }} + + + {{ item.title }} + ¥ @@ -49,7 +51,7 @@ export default { }, // jumpInfo(item) { - console.log('秦星星---1',item); + console.log('秦星星---1', item); uni.navigateTo({ url: "/pages/other_package/productInfo/productInfo?id=" + item.id, }); @@ -101,6 +103,9 @@ export default { width: 43%; margin-bottom: 20rpx; padding: 20rpx; + display: flex; + flex-direction: column; + justify-content: space-between; } .product_item_name { diff --git a/pages/home/home.vue b/pages/home/home.vue index bec7ee3..9c63c0e 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -4,9 +4,8 @@ - - + + @@ -202,8 +201,8 @@ @@ -765,8 +764,17 @@ export default { background: linear-gradient(270deg, #af39c4 0%, #7732ff 100%); padding: calc(var(--status-bar-height) + 20rpx) 30rpx 20rpx; box-sizing: border-box; - /* 消除 fixed 定位与下方重叠层之间的 1px GPU 子像素渲染缝隙(白线) */ - box-shadow: 0 2rpx 0 #9336df; + + &::after { + content: ''; + position: absolute; + bottom: -2px; + left: 0; + right: 0; + height: 4px; + background: linear-gradient(270deg, #af39c4 0%, #7732ff 100%); + pointer-events: none; + } } .header_right_warp { @@ -783,7 +791,7 @@ export default { padding: 10rpx 20rpx; background: #ffffff30; border-radius: 24rpx; - background: linear-gradient(270deg, #ae39c5, #7932fe) 2 2; + // background: linear-gradient(270deg, #ae39c5, #7932fe); } .chart_img { diff --git a/pages/rwa_package/dongjian/search.vue b/pages/rwa_package/dongjian/search.vue index 6166463..3f7e999 100644 --- a/pages/rwa_package/dongjian/search.vue +++ b/pages/rwa_package/dongjian/search.vue @@ -227,6 +227,11 @@ export default { padding: 0 32rpx; box-sizing: border-box; background-color: #fff; + /* #ifdef MP-WEIXIN */ + padding-top: 80rpx !important; + height: auto !important; + min-height: calc(118rpx + 80rpx) !important; + /* #endif */ .search-box { width: 100%; diff --git a/pages/sort/sort.vue b/pages/sort/sort.vue index 0bd16e7..43cff95 100644 --- a/pages/sort/sort.vue +++ b/pages/sort/sort.vue @@ -5,8 +5,8 @@ 分类 @@ -32,9 +32,9 @@ - + - + @@ -46,7 +46,8 @@ - + {{ item1.name }} @@ -78,6 +79,7 @@ export default { return { selCategory: 1, scrollTop: 0, //tab标题的滚动条位置 + rightScrollTop: 0, // 右侧内容的滚动条位置 current: null, // 预设当前项的值 menuHeight: 0, // 左边菜单的高度 menuItemHeight: 0, // 左边菜单item的高度 @@ -86,6 +88,7 @@ export default { tabbarContentList: [], // 右侧内容的分类 tabbarContentLoading: false, platformType: true, + isFromSortShop: false, }; }, @@ -97,28 +100,38 @@ export default { const appUpdate = uni.getStorageSync("platform"); this.platformType = appUpdate == "android" ? "ANDROID" : "IOS"; /*#endif*/ - const then = this; + + const isBackFromSortShop = this.isFromSortShop; + this.isFromSortShop = false; + this.getSort(0).then((resp) => { if (resp && resp.length !== 0) { this.tabbarList = resp; - const sortId = uni.getStorageSync("sortId"); - // 如果有默认的参数就默认选中参数 - if (sortId && sortId !== 0) { - let fData = {}; - let currentIndex = 0; - resp.map((item, index) => { - if (item.id === sortId) { - fData = item; - currentIndex = index; - return; - } - }); - this.swichMenu(fData, currentIndex); + let targetIndex = 0; + let fData = resp[0]; + + if (isBackFromSortShop) { + const sortId = uni.getStorageSync("sortId"); + if (sortId && sortId !== 0) { + resp.forEach((item, index) => { + if (item.id === sortId) { + fData = item; + targetIndex = index; + } + }); + } else if (this.current !== null && this.current >= 0 && this.current < resp.length) { + targetIndex = this.current; + fData = resp[targetIndex]; + } } else { - const fData = resp[0]; - // 否则就选中第一个 - this.swichMenu(fData, 0); + uni.removeStorageSync("sortId"); + this.current = 0; + this.scrollTop = 0; + targetIndex = 0; + fData = resp[0]; } + + this.swichMenu(fData, targetIndex, true); } }); this.getCarouselImage(); @@ -146,6 +159,7 @@ export default { }, jumpInfo(item) { console.log(item, "item"); + this.isFromSortShop = true; // uni.navigateTo({ // url: `/pages/other_package/productInfo/productInfo?id=${item.id}`, // }) @@ -170,9 +184,13 @@ export default { return Math.floor(Math.random() * 35); }, // 点击左边的栏目切换 - async swichMenu(item, index) { + async swichMenu(item, index, force = false) { console.log('点击左边的栏目切换', item, index, "item, index"); - if (index == this.current) return; + if (!force && index == this.current && this.tabbarContentList.length > 0) return; + if (item && item.id) { + uni.setStorageSync("sortId", item.id); + } + this.rightScrollTop = 0; this.tabbarContentLoading = true; const firstData = await this.getSort(item.id); for (let fItem of firstData) { @@ -186,7 +204,7 @@ export default { await this.getElRect("menu-scroll-view", "menuHeight"); await this.getElRect("u-tab-item", "menuItemHeight"); } - // 将菜单菜单活动item垂直居中 + // 将菜单活动item垂直居中 this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - @@ -196,19 +214,19 @@ export default { // 获取一个目标元素的高度 getElRect(elClass, dataVal) { - new Promise((resolve, reject) => { + return new Promise((resolve) => { const query = uni.createSelectorQuery().in(this); query .select("." + elClass) .fields({ size: true }, (res) => { - // 如果节点尚未生成,res值为null,循环调用执行 if (!res) { setTimeout(() => { - this.getElRect(elClass); + this.getElRect(elClass, dataVal).then(resolve); }, 10); return; } this[dataVal] = res.height; + resolve(res); }) .exec(); }); @@ -232,26 +250,35 @@ export default {