首页轮播图跳转公众号

main
wwl 2024-04-26 09:44:14 +08:00
parent f1be6694c0
commit 6d4ab29b2e
7 changed files with 83 additions and 29 deletions

View File

@ -1,8 +1,8 @@
APP_BASE_URL=https://slb.birkenstock.net.cn/api/h5app/wxapp
APP_WEBSOCKET=wss://slb.birkenstock.net.cn/ws
APP_BASE_URL=https://test.birkenstock.net.cn/api/h5app/wxapp
APP_WEBSOCKET=wss://test.birkenstock.net.cn/ws
APP_COMPANY_ID=1
APP_PLATFORM=standard
APP_CUSTOM_SERVER=https://slb.birkenstock.net.cn/
APP_CUSTOM_SERVER=https://test.birkenstock.net.cn/
APP_HOME_PAGE=/pages/index
APP_TRACK=youshu
APP_YOUSHU_TOKEN=bi281e87ab2424481a

View File

@ -304,6 +304,7 @@ function SpPage (props, ref) {
// 'icon-home1': cusCurrentPage == 1,
'icon-fanhui': alwaysBackUrl ? true : cusCurrentPage != 1
})}
style={{ color: isBlack ? 'white' : 'black' }}
onClick={() => {
if (alwaysBackUrl) {
Taro.navigateTo({

View File

@ -167,14 +167,15 @@ page {
.spot-pagination-bullet {
// margin-right: 5px;
// border-radius: 20%;
height: 4px;
height: 6px;
width: 30px;
background: #ddd;
background: #d9d9d9;
transition: all 0.3s ease-in-out 0s;
}
//
.spot-pagination-bullet-active {
background: #fff;
// background: #fff;
background: #818181;
}
}
.icon-kf {

View File

@ -366,9 +366,17 @@ function Home () {
})
}
}) || []).sort((a, b) => a.sort - b.sort)
const _swiperList = [...activeSwiper, {
type: 'image',
src: process.env.APP_IMAGE_CDN_NEW + '/1774/kv.jpg?t' + new Date().getTime(),
goods: [],
onClick: () => {
// Taro.navigateTo({ url: '/pages/other/goods' })
}
}, ...list]
setState((draft) => {
draft.swiperList = [...activeSwiper, ...list]
draft.goodList = list[0].goods || []
draft.swiperList = _swiperList
draft.goodList = _swiperList[0].goods || []
draft.loading = false
draft.activeInfo = {
...activity_info,
@ -480,7 +488,7 @@ function Home () {
}, 500)
}
} else if (deltaY < 0) {
if (currentIndex === 0) return
if (goodList?.length == 0) return
// 上滑操作
setState((draft) => {
draft.showBottom = true
@ -524,7 +532,8 @@ function Home () {
const onSwiperChange = (e) => {
const { current } = e.detail
if (current === 0) {
const _goodList = swiperList[current].goods || []
if (current === 0 || _goodList.length === 0) {
setState((draft) => {
draft.showBottom = false
draft.isUpOperation = false
@ -532,7 +541,7 @@ function Home () {
}
setState((draft) => {
draft.currentIndex = current
draft.goodList = swiperList[current].goods || []
draft.goodList = _goodList
})
}
@ -562,6 +571,11 @@ function Home () {
url: url
})
}
const indexUrl = 'https://mp.weixin.qq.com/s/LBXthKa-P9gNK8FCv3n1pA'
const handleGoWx = () => {
Taro.navigateTo({ url: '/pages/webview?url=' + encodeURIComponent(indexUrl) })
}
return (
<SpPage
className='page-index'
@ -625,13 +639,14 @@ function Home () {
duration={800}
// indicatorDots
circular
autoplay={!isUpOperation}
autoplay={process.env.NODE_ENV === 'development' ? false : !isUpOperation}
onChange={onSwiperChange}
>
{state.swiperList.map((item, index) => (
<SwiperItem key={index} className="" style={{ height: "100%" }}>
{item.type === "image" && (
<Image
onClick={item.onClick}
src={item.src}
style={{ width: "100%", height: "100%", objectPosition: "center" }}
mode={isUpOperation ? 'aspectFill' : 'aspectFill'}
@ -677,16 +692,20 @@ function Home () {
</SwiperItem>
))}
</Swiper>
{!isUpOperation && currentIndex === 0 ? <View className="item-btns" style="left: 220rpx;
bottom: 180rpx;" >
{<View onClick={handleGoWx} className="item-btn" style={{ padding: '50rpx 156rpx', opacity: 0, background: 'transparent', border: 'none' }} >
<View className="item-btn-txt"></View>
</View>}
</View> : null}
{!isUpOperation && <>
{currentIndex === 0 ? <View className="item-btns">
{/* currentIndex === -1 ? <View className="item-btns">
<View className="item-tit">{activeInfo.activity_name}</View>
{/* <SpLogin newUser={isNewUser} onChange={handleApply}> */}
{activeInfo.end_time * 1000 >= Date.now() && <View className="item-btn" style={{ padding: '30rpx 60rpx' }} onClick={() => handleApply()}>
<View className="item-btn-txt">{activeInfo.total_count ? '已报名' : '活动申请'}</View>
{/* <Image className="jiantou" mode="aspectFit" src={require('../assets/hengjiantou.gif')}></Image> */}
</View>}
{/* </SpLogin> */}
</View> :
</View> : */}
{goodList?.length > 0 &&
<View className="item-img-box">
<View className="item-img-txt"> </View>
<Image className="item-img" height="62" src={require('../assets/i-sou.gif')} isShowMenuByLongpress={false} lazyLoad isNew={false} />

View File

@ -756,11 +756,13 @@ function EspierDetail (props) {
<Text className='desc-title-txt'>{info?.itemName}</Text>
<SpGoodsPrice info={curItem ? curItem : info} />
</View>
</View> */}
{true ? <>
</View>
false ? <>
{goods_1774[1].map((item, index) => <SpImage src={`1774/${item}`} width={width} isNew >
</SpImage>)}
</> : <>
</> :
*/}
{<>
{isArray(info.intro) ? (
<View>
{info.intro.map((item, idx) => (
@ -768,18 +770,15 @@ function EspierDetail (props) {
{item.name === 'film' && <WgtFilm info={item} />}
{item.name === 'slider' && <WgtSlider info={item} />}
{item.name === 'writing' && <WgtWriting info={item} />}
{/* {item.name === 'heading' && <WgtHeading info={item} />} */}
{item.name === 'headline' && <WgtHeadline info={item} />}
{item.name === 'goods' && <WgtGoods info={item} />}
</View>
))}
</View>
) : (
) :
<>
{/* <SpHtml content={info.intro} /> */}
</>
)}
{introList.length ? introList.map((item, index) => <View className={classNames('sp-accordion')} key={`item__${index}`}>
</>}
{introList.length ? introList.length === 2 ? <SpHtml content={introList[0].content} /> : introList.map((item, index) => <View className={classNames('sp-accordion')} key={`item__${index}`}>
<AtAccordion
open={item.isOpen}
isAnimation={false}
@ -825,7 +824,7 @@ function EspierDetail (props) {
{/* 商品评价 */}
{/* <CompEvaluation list={evaluationList} itemId={info.itemId}></CompEvaluation> */}
{isArray(historyList) ? <View className='bottom-box'>
{isArray(historyList) && introList?.length > 2 ? <View className='bottom-box'>
<View className="bottom-box-tit">浏览历史</View>
<ScrollView scrollX scrollWithAnimation showScrollbar={true} scrollLeft={0} className="shop-box">
{historyList.map((item, idx) => (

View File

@ -7,7 +7,8 @@ import { View, Text, Picker, Input } from "@tarojs/components"
import './goods.scss'
const initState = {
loading: false
loading: false,
shopList: []
}
function goods () {
const [state, setState] = useImmer(initState)
@ -15,13 +16,24 @@ function goods () {
const { windowHeight, windowWidth } = Taro.getSystemInfoSync()
const width = windowWidth * 2
const goods_1774 = [1, 2, 3, 4, 5, 6, 7]
const { shopList } = state
const handleBackToIndex = () => {
Taro.redirectTo({ url: '/pages/index' })
}
const handleGoBuy = (item, index) => {
console.log("🚀 ~ file: goods.js:22 ~ item:", item, index)
if (index === 3) {
Taro.navigateTo({
url: `/pages/item/espier-detail?id=${shopList[0]?.itemId}`
})
}
if (index === 5) {
Taro.navigateTo({
url: `/pages/item/espier-detail?id=${shopList[1]?.itemId}`
})
}
}
useEffect(() => {
getShop()
setTimeout(() => {
setState((draft) => {
draft.loading = false
@ -29,6 +41,23 @@ function goods () {
}, 300)
}, [])
const getShop = async () => {
let params = {
page: 1,
pageSize: 10,
keywords: '',
approve_status: 'onsale,only_show,offline_sale',
item_type: 'normal',
is_point: 'false',
goodsSort: 6
}
const { list: BK_075List = [] } = await api.item.search({ ...params, keywords: 'BK075' })
const { list: BK_074List = [] } = await api.item.search({ ...params, keywords: 'BK074' })
setState((draft) => {
draft.shopList = [...BK_075List, ...BK_074List]
})
}
return (
<SpPage loading={loading} title={''} className='page-other-goods has-navbar' showNavSearchIcon showNavLogo>
<View className="" style={{ minHeight: windowHeight * 2, background: '#000' }} >

View File

@ -1,6 +1,11 @@
.page-other-goods {
.custom-navigation {
background-color: #000 !important;
.left-container {
.icon-fanhui {
color: #fff !important;
}
}
}
.content-btn {
margin: 0 auto;