From 113bd5f979f1fd04732abca040539022ca2c7125 Mon Sep 17 00:00:00 2001 From: wwl Date: Thu, 18 Apr 2024 11:46:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E5=93=811774?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.config.js | 1 + src/components/sp-page/index.js | 2 +- src/pages/index.js | 2 +- src/pages/other/goods.js | 46 +++++++++++++++++++++++ src/pages/other/goods.scss | 29 ++++++++++++++ src/pages/recommend/list.js | 8 ++++ src/pages/recommend/list.scss | 13 +++++++ src/subpage/pages/trade/comps/new-item.js | 6 +-- src/subpage/pages/trade/list.js | 6 +++ src/subpages/trade/after-sale.js | 2 +- 10 files changed, 109 insertions(+), 6 deletions(-) create mode 100644 src/pages/other/goods.js create mode 100644 src/pages/other/goods.scss diff --git a/src/app.config.js b/src/app.config.js index 8756efd..c9b8227 100755 --- a/src/app.config.js +++ b/src/app.config.js @@ -20,6 +20,7 @@ const config = { 'pages/recommend/list', // 推荐软文列表 现在改为活动介绍 'pages/recommend/detail', // 活动介绍 'pages/recommend/status', // 活动状态 + 'pages/other/goods', // 特殊商品页面 'pages/member/item-fav', // 收藏页面 'pages/custom/custom-page', // 自定义页面 diff --git a/src/components/sp-page/index.js b/src/components/sp-page/index.js index ab43a44..9003947 100755 --- a/src/components/sp-page/index.js +++ b/src/components/sp-page/index.js @@ -321,7 +321,7 @@ function SpPage (props, ref) { /> {showNavCartIcon ? cartCount > 0 ? Taro.redirectTo({ url: '/pages/cart/espier-index' })} height={36} mode='heightFix' isNew /> : Taro.redirectTo({ url: '/pages/cart/espier-index' })} height={36} mode='heightFix' isNew /> : null} {showNavHomeIcon && Taro.redirectTo({ url: '/pages/index' })} height={36} mode='heightFix' isNew />} - {showNavSearchIcon && Taro.navigateTo({ url: '/pages/item/list' })} src={`member/chazhao-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew />} + {showNavSearchIcon && Taro.navigateTo({ url: '/pages/item/list?showSearch=true' })} src={`member/chazhao-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew />} } {showNavkfIcon && Taro.redirectTo({ url: '/pages/cart/espier-index' })} height={46} mode='heightFix' isNew />} diff --git a/src/pages/index.js b/src/pages/index.js index 5896936..677deb8 100755 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -52,7 +52,7 @@ import './home/index.scss' const initialState = { wgts: [], showBackToTop: false, - loading: true, + loading: false, searchComp: null, pageData: null, fixedTop: false, diff --git a/src/pages/other/goods.js b/src/pages/other/goods.js new file mode 100644 index 0000000..3566f77 --- /dev/null +++ b/src/pages/other/goods.js @@ -0,0 +1,46 @@ +import React, { useEffect, useRef } from "react" +import { useImmer } from "use-immer" +import Taro, { getCurrentInstance } from "@tarojs/taro" +import api from "@/api" +import { SpPage, SpImage } from '@/components' +import { View, Text, Picker, Input } from "@tarojs/components" +import './goods.scss' + +const initState = { + loading: false +} +function goods () { + const [state, setState] = useImmer(initState) + const { loading } = state + const { windowHeight, windowWidth } = Taro.getSystemInfoSync() + const width = windowWidth * 2 + const goods_1774 = [1, 2, 3, 4, 5, 6, 7] + const handleBackToIndex = () => { + Taro.redirectTo({ url: '/pages/index' }) + } + const handleGoBuy = (item, index) => { + console.log("🚀 ~ file: goods.js:22 ~ item:", item, index) + } + useEffect(() => { + setTimeout(() => { + setState((draft) => { + draft.loading = false + }) + }, 300) + }, []) + + return ( + + + {goods_1774.map((item, index) => + {(index === 3 || index === 5) && handleGoBuy(item, index)} >} + )} + + + 返回首页 + + + ) +} + +export default goods diff --git a/src/pages/other/goods.scss b/src/pages/other/goods.scss new file mode 100644 index 0000000..415f341 --- /dev/null +++ b/src/pages/other/goods.scss @@ -0,0 +1,29 @@ +.page-other-goods { + .custom-navigation { + background-color: #000 !important; + } + .content-btn { + margin: 0 auto; + width: 650px; + height: 80px; + line-height: 80px; + text-align: center; + /* prettier-ignore */ + border: 1PX solid var(--color-primary); + font-size: 34px; + border-radius: 6px; + margin-top: 30px; + margin-bottom: 30px; + } + .go-buy { + position: absolute; + left: 0; + right: 0; + bottom: 0; + top: 0; + height: 100%; + width: 100%; + background: transparent; + z-index: 2; + } +} diff --git a/src/pages/recommend/list.js b/src/pages/recommend/list.js index 9d59ab0..da74d7b 100755 --- a/src/pages/recommend/list.js +++ b/src/pages/recommend/list.js @@ -615,6 +615,11 @@ export default class RecommendList extends Component { url: url + activeInfo.activity_id }) } + handleBackToIndex = () => { + Taro.redirectTo({ + url: '/pages/index' + }) + } render () { const { @@ -818,6 +823,9 @@ export default class RecommendList extends Component { + + 返回首页 + } diff --git a/src/pages/recommend/list.scss b/src/pages/recommend/list.scss index 3cda02b..2b68f5e 100755 --- a/src/pages/recommend/list.scss +++ b/src/pages/recommend/list.scss @@ -38,6 +38,19 @@ .content-item { margin-bottom: 50px; } + .content-btn { + margin: 0 auto; + width: 650px; + height: 80px; + line-height: 80px; + text-align: center; + /* prettier-ignore */ + border: 1PX solid var(--color-primary); + font-size: 34px; + border-radius: 6px; + margin-top: 30px; + margin-bottom: 70px; + } } .active-content { position: relative; diff --git a/src/subpage/pages/trade/comps/new-item.js b/src/subpage/pages/trade/comps/new-item.js index a8b4efa..cb84b64 100755 --- a/src/subpage/pages/trade/comps/new-item.js +++ b/src/subpage/pages/trade/comps/new-item.js @@ -267,7 +267,7 @@ export default class TradeItem extends Component { 查看物流 )} - {!info.aftersales_bn ?