diff --git a/components/goods-comments/goods-comments.vue b/components/goods-comments/goods-comments.vue index 88b49fd..b8b1f90 100644 --- a/components/goods-comments/goods-comments.vue +++ b/components/goods-comments/goods-comments.vue @@ -1,127 +1,137 @@ - diff --git a/pages.json b/pages.json index 945884b..5b4b358 100644 --- a/pages.json +++ b/pages.json @@ -27,7 +27,7 @@ // #endif "enablePullDownRefresh": false, // 禁止页面下拉 - "disableScroll": true, + // "disableScroll": true, "navigationBarTitleText": "" } }, diff --git a/pages/buy/buy.vue b/pages/buy/buy.vue index cc5e73b..4fe1425 100644 --- a/pages/buy/buy.vue +++ b/pages/buy/buy.vue @@ -11,7 +11,7 @@ {{ item.name }} --> - + - - 收货地址 + + @@ -48,7 +48,8 @@ {{ address.tel }} - 修改地址 + + @@ -89,18 +90,22 @@ - + - + + + {{ application_title }} + + - + @@ -184,8 +189,48 @@ + + + + 快递运费 + + 普通配送 + 快递免邮 + + + + 优惠折扣 + + + + 选择优惠券 + + + + + + 订单备注 + + + + + 共{{ group.order_base.buy_count }}件 + 小计: {{ currency_symbol }}{{ group.order_base.actual_price }} @@ -224,26 +269,8 @@ - - - - - {{ user_note_value || $t('buy.buy.2rhko1') }} - - - {{ $t('buy.buy.q7jq76') }} - - - - {{ item }} - - - - - - - + @@ -278,6 +305,28 @@ + + + + + 余额支付 + + + + + + + + + + + 银行卡支付 + + + + + + @@ -290,15 +339,15 @@ - + - - - {{ $t('buy.buy.wx78ju') }} - {{ currency_symbol }}{{ total_price }} + + + {{ currency_symbol }}{{ total_price }} + 明细:共{{ total_count }}件 - + {{ $t('buy.buy.4884hk') }} @@ -400,6 +449,7 @@ export default { data() { return { + application_title: app.globalData.get_application_title(), theme_view: app.globalData.get_theme_value_view(), theme_color: app.globalData.get_theme_color(), common_static_url: common_static_url, @@ -415,6 +465,7 @@ address: null, address_id: null, total_price: 0, + total_count: 0, user_note_value: '', user_note_status: false, is_first: 1, @@ -543,6 +594,18 @@ }, methods: { + payHandle() { + uni.showToast({ + title: '暂未开放', + icon: 'none', + }); + }, + showCouponHandle() { + uni.showToast({ + title: '暂无优惠券', + icon: 'none', + }); + }, // 是否显示充值账户 getShowAccount() { uni.request({ @@ -862,6 +925,7 @@ this.setData({ goods_list: goods_list, total_price: data.base.actual_price, + total_count: data.base.goods_count, data_list_loding_status: 3, common_site_type: data.common_site_type || 0, buy_site_model_value: data.base.site_model || 0, @@ -1486,22 +1550,20 @@ } $color: #ff723b; .address-wrap { - background-color: $color; - padding: 0 2px 2px; border-radius: 6px; .top-tips { color: #fff; padding: 4px; } .address-info { - padding: 10px; + padding: 26upx; background-color: #fff; border-radius: 4px; .info-wrap { display: flex; align-items: center; .icon { - $size: 60upx; + $size: 70upx; width: $size; height: $size; } @@ -1516,7 +1578,6 @@ color: #000; } .base2 { - padding-top: 8px; color: #999; display: flex; gap: 6px; @@ -1556,4 +1617,71 @@ } } } + .company_name { + display: flex; + align-items: center; + gap: 6px; + .icon { + $size: 38upx; + width: $size; + height: $size; + } + } + + .row-wrap { + padding-top: 20upx; + .row { + display: flex; + align-items: center; + &:not(:first-child) { + margin-top: 28upx; + } + .t { + width: 160upx; + font-size: 28upx; + } + .ipt { + flex: 1; + font-size: 28upx; + } + .right { + flex: 1; + display: flex; + align-items: center; + &.between { + justify-content: space-between; + } + .t1 { + color: #999; + } + .coupon { + display: flex; + align-items: center; + gap: 8upx; + } + } + } + } + .footer-bottom { + width: 100%; + background-color: #fff; + position: fixed; + left: 0; + bottom: 0; + z-index: 999; + .price-wrap { + display: flex; + flex-direction: column; + justify-content: center; + padding-left: 28upx; + .price { + color: #ff723b; + font-size: 36upx; + } + .t { + color: #666; + font-size: 24upx; + } + } + } diff --git a/pages/goods-category/goods-category.vue b/pages/goods-category/goods-category.vue index 6001bdb..6f7b195 100644 --- a/pages/goods-category/goods-category.vue +++ b/pages/goods-category/goods-category.vue @@ -1,368 +1,77 @@ @@ -414,7 +123,7 @@ is_first: 1, search_keywords_value: '', nav_active_index: 0, - nav_active_item_two_index: -1, + nav_active_item_two_index: 0, nav_active_item_three_index: -1, scroll_top: 0, scroll_top_old: 0, @@ -457,6 +166,12 @@ cart_content_style: '', footer_height_value: 0, categoryIndex: '', + tabWidths: [], + scrollLeft: 0, + tabWidths1: [], + scrollLeft1: 0, + sort_all: true, + headerHieght: 0, }; }, @@ -508,8 +223,104 @@ this.$refs.common.on_show({ object: this, method: 'init' }); } }, - + onReachBottom() { + this.data_page++; + this.get_goods_list(); + }, methods: { + // 初始化获取所有选项卡的宽度 + initTabWidths() { + const query = uni.createSelectorQuery().in(this); + query + .selectAll('.tab-item0') + .boundingClientRect((rects) => { + this.tabWidths = rects.map((rect) => rect.width); + }) + .exec(); + + query + .selectAll('.tab-item1') + .boundingClientRect((rects) => { + this.tabWidths1 = rects.map((rect) => rect.width); + }) + .exec(); + + query + .select('.header-wrap') + .boundingClientRect((rect) => { + this.headerHieght = rect.height; + }) + .exec(); + }, + // 处理选项卡点击 + handleTabClick(index, key) { + this[key] = index; + + if (key == 'nav_active_index') { + // 重置二级分类的索引和滚动条位置 + + // 检查是否有二级分类 + let arr = this.category_list[this.nav_active_index].items; + + this.nav_active_item_two_index = arr.length ? 0 : -1; + this.scrollLeft1 = 0; + + // 计算需要滚动的距离使目标选项卡居中 + let scrollLeft = 0; + for (let i = 0; i < index; i++) { + scrollLeft += this.tabWidths[i] || 0; + } + + // 获取容器宽度和当前选项卡宽度 + const containerWidth = uni.getSystemInfoSync().windowWidth - 50; + const currentTabWidth = this.tabWidths[index] || 0; + + // 计算居中偏移量 + scrollLeft = scrollLeft + currentTabWidth / 2 - containerWidth / 2; + + // 确保滚动距离不小于0 + scrollLeft = Math.max(0, scrollLeft); + + // 设置滚动位置 + this.scrollLeft = scrollLeft; + } + + if (key == 'nav_active_item_two_index') { + // 计算需要滚动的距离使目标选项卡居中 + let scrollLeft1 = 0; + for (let i = 0; i < index; i++) { + scrollLeft1 += this.tabWidths1[i] || 0; + } + + // 获取容器宽度和当前选项卡宽度 + const containerWidth = uni.getSystemInfoSync().windowWidth - 50; + const currentTabWidth = this.tabWidths1[index] || 0; + + // 计算居中偏移量 + scrollLeft1 = scrollLeft1 + currentTabWidth / 2 - containerWidth / 2; + + // 确保滚动距离不小于0 + scrollLeft1 = Math.max(0, scrollLeft1); + + // 设置滚动位置 + this.scrollLeft1 = scrollLeft1; + } + + this.data_content = this.category_list[this.nav_active_index] || null; + this.data_page = 1; + this.data_list = []; + this.data_list_loding_status = 1; + this.data_bottom_line_status = false; + + this.sort_all = true; + this.set_resources_data(); + + this.get_goods_list(1); + + this.$nextTick(() => { + this.initTabWidths(); + }); + }, // 资源设置 set_resources_data() { var search_nav_sort_list = [ @@ -654,6 +465,12 @@ this.setData({ is_first: 0, }); + + this.$nextTick(() => { + setTimeout(() => { + this.initTabWidths(); + }, 500); + }); } else { this.setData({ data_list_loding_status: 2, @@ -909,6 +726,11 @@ // 搜索事件 search_button_event(e) { + // 进入搜索页面 + app.globalData.url_open('/pages/goods-search/goods-search'); + + return; + // 商品列表模式 if (this.category_show_level == 0) { this.setData({ @@ -1369,30 +1191,39 @@ // 排序事件 nav_sort_event(e) { - var index = e.currentTarget.dataset.index || 0; - var temp_search_nav_sort = this.search_nav_sort_list; - var temp_sort = temp_search_nav_sort[index]['sort'] == 'desc' ? 'asc' : 'desc'; - for (var i in temp_search_nav_sort) { - if (i != index) { - if (temp_search_nav_sort[i]['icon'] != null) { - temp_search_nav_sort[i]['icon'] = 'default'; + if (e.currentTarget.dataset.index == -1) { + this.sort_all = true; + this.set_resources_data(); + } else { + this.sort_all = false; + var index = e.currentTarget.dataset.index || 0; + var temp_search_nav_sort = this.search_nav_sort_list; + var temp_sort = temp_search_nav_sort[index]['sort'] == 'desc' ? 'asc' : 'desc'; + for (var i in temp_search_nav_sort) { + if (i != index) { + if (temp_search_nav_sort[i]['icon'] != null) { + temp_search_nav_sort[i]['icon'] = 'default'; + } + temp_search_nav_sort[i]['sort'] = 'desc'; } - temp_search_nav_sort[i]['sort'] = 'desc'; } - } - temp_search_nav_sort[index]['sort'] = temp_sort; - if (temp_search_nav_sort[index]['icon'] != null) { - temp_search_nav_sort[index]['icon'] = temp_sort; - } + temp_search_nav_sort[index]['sort'] = temp_sort; + if (temp_search_nav_sort[index]['icon'] != null) { + temp_search_nav_sort[index]['icon'] = temp_sort; + } + this.setData({ + search_nav_sort_index: index, + search_nav_sort_list: temp_search_nav_sort, + }); + } this.setData({ - search_nav_sort_index: index, - search_nav_sort_list: temp_search_nav_sort, data_page: 1, data_list: [], data_list_loding_status: 1, data_bottom_line_status: false, }); + this.reset_scroll(); this.get_goods_list(1); }, @@ -1407,6 +1238,190 @@ }, }; - + diff --git a/pages/goods-category/goods-category1.vue b/pages/goods-category/goods-category1.vue new file mode 100644 index 0000000..6001bdb --- /dev/null +++ b/pages/goods-category/goods-category1.vue @@ -0,0 +1,1412 @@ + + + + diff --git a/pages/goods-detail/goods-detail.css b/pages/goods-detail/goods-detail.css index 8e64496..9fab77b 100644 --- a/pages/goods-detail/goods-detail.css +++ b/pages/goods-detail/goods-detail.css @@ -157,15 +157,12 @@ font-size: 30rpx; line-height: 40rpx; font-weight: bold; - width: calc(100% - 200rpx); + width: 100%; } .goods-base-content image { width: 40rpx; height: 40rpx; } -.goods-base-content .collect { - width: 76rpx; -} /** * 视频 @@ -197,7 +194,7 @@ .goods-base-price, .price-content, .goods-base-right-opt { - min-height: 145rpx; + min-height: 116rpx; } .price-content { width: calc(100% - 200rpx); @@ -215,9 +212,6 @@ width: 40rpx; height: 40rpx; } -.goods-base-right-opt .collect { - width: 76rpx; -} .price-content .price-icon { padding: 0px 8rpx; color: #fff; diff --git a/pages/goods-detail/goods-detail.vue b/pages/goods-detail/goods-detail.vue index 7333b50..6e3c795 100644 --- a/pages/goods-detail/goods-detail.vue +++ b/pages/goods-detail/goods-detail.vue @@ -1,1511 +1,1523 @@ - diff --git a/pages/login/login.vue b/pages/login/login.vue index 825c992..ad5a4f4 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -1,1758 +1,1762 @@