新增商品1774详情页

main
wwl 2024-04-18 11:46:10 +08:00
parent ebdcaad967
commit 113bd5f979
10 changed files with 109 additions and 6 deletions

View File

@ -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', // 自定义页面

View File

@ -321,7 +321,7 @@ function SpPage (props, ref) {
/>
{showNavCartIcon ? cartCount > 0 ? <AtBadge value={cartCount} maxValue={99}><SpImage src={`member/cart.png`} onClick={() => Taro.redirectTo({ url: '/pages/cart/espier-index' })} height={36} mode='heightFix' isNew /></AtBadge> : <SpImage src={`member/cart.png`} onClick={() => Taro.redirectTo({ url: '/pages/cart/espier-index' })} height={36} mode='heightFix' isNew /> : null}
{showNavHomeIcon && <SpImage src={`cart/home.png`} onClick={() => Taro.redirectTo({ url: '/pages/index' })} height={36} mode='heightFix' isNew />}
{showNavSearchIcon && <SpImage onClick={() => Taro.navigateTo({ url: '/pages/item/list' })} src={`member/chazhao-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew />}
{showNavSearchIcon && <SpImage onClick={() => Taro.navigateTo({ url: '/pages/item/list?showSearch=true' })} src={`member/chazhao-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew />}
</View>
}
{showNavkfIcon && <SpChat><SpImage className='icon-kf' src={`index/kf.png`} onClick={() => Taro.redirectTo({ url: '/pages/cart/espier-index' })} height={46} mode='heightFix' isNew /></SpChat>}

View File

@ -52,7 +52,7 @@ import './home/index.scss'
const initialState = {
wgts: [],
showBackToTop: false,
loading: true,
loading: false,
searchComp: null,
pageData: null,
fixedTop: false,

46
src/pages/other/goods.js Normal file
View File

@ -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 (
<SpPage loading={loading} title={''} className='page-other-goods has-navbar' showNavSearchIcon showNavLogo>
<View className="" style={{ minHeight: windowHeight * 2, background: '#000' }} >
{goods_1774.map((item, index) => <SpImage src={`1774/${item}.jpg`} width={width} isNew >
{(index === 3 || index === 5) && <View className="go-buy" onClick={() => handleGoBuy(item, index)} ></View>}
</SpImage>)}
</View>
<View className="content-btn" onClick={handleBackToIndex} >
返回首页
</View>
</SpPage>
)
}
export default goods

View File

@ -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;
}
}

View File

@ -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 {
<SpImage height={height * 2} width={windowWidth * 2} mode="aspectFill" src='recommend/08.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={height * 2} width={windowWidth * 2} mode="aspectFill" src='recommend/09.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
</View>
<View className="content-btn" onClick={this.handleBackToIndex} >
返回首页
</View>
</View>
}

View File

@ -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;

View File

@ -267,7 +267,7 @@ export default class TradeItem extends Component {
查看物流
</Button>
)}
{!info.aftersales_bn ? <Button
{!info.aftersales_status ? <Button
className='btn-action'
style={`background: ${colors.data[0].primary}`}
// onClick={this.handleClickBtn.bind(this, 'detail')}
@ -313,7 +313,7 @@ export default class TradeItem extends Component {
</Button>
) : null} */}
{
info.can_apply_aftersales === 1 && !info.aftersales_bn && info.is_rate != 1 && (
info.can_apply_aftersales === 1 && (!info.aftersales_status) && info.is_rate != 1 && (
<Button
className='btn-action'
style={`box-shadow: 0 0 0 1PX ${colors.data[0].primary}; color: ${colors.data[0].primary}`}
@ -335,7 +335,7 @@ export default class TradeItem extends Component {
</View>
</View>
)}
{!customFooter && !!info.aftersales_bn && info.status !== 'WAIT_BUYER_CONFIRM_GOODS' && (
{!customFooter && info.aftersales_status && info.status !== 'WAIT_BUYER_CONFIRM_GOODS' && (
<View className='trade-item__ft'>
<View className='trade-item__ft-actions'></View>
<View className='trade-item__ft-bd'>

View File

@ -172,6 +172,12 @@ export default class TradeList extends Component {
aftersales_type: ({ aftersales }) => {
return aftersales?.aftersales_type
},
aftersales_progress: ({ aftersales }) => {
return aftersales?.progress
},
aftersales_status: ({ aftersales, aftersales_bn }) => {
return (aftersales_bn || aftersales?.aftersales_bn) && aftersales?.progress !== 3
},
status: ({ order_status }) => resolveOrderStatus(order_status),
totalItems: ({ items }) => items?.reduce((acc, item) => +item.num + acc, 0),
// payment: ({ item_fee_new }) => (item_fee_new / 100).toFixed(2),

View File

@ -306,7 +306,7 @@ function TradeAfterSale (props) {
copyText(addr)
}
return <SpPage ref={pageRef} loading={loading} title={!afterSaleTid ? '申请售后' : '售后进度'} className='page-trade-after-sale has-navbar' isBlack showNavSearchIcon renderFooter={
return <SpPage ref={pageRef} loading={loading} title={!afterSaleTid ? '申请售后' : '售后进度'} className='page-trade-after-sale has-navbar' isBlack renderFooter={
!loading && !afterSaleTid ? <View className='btn-wrap'>
<AtButton type='primary' onClick={onSubmit}>提交售后申请</AtButton>
</View> : null