Compare commits

...

3 Commits

Author SHA1 Message Date
wwl cd11bd5ea1 fix bug 2024-05-20 10:14:14 +08:00
wwl e89f63d1ce fix bug 2024-05-10 23:36:28 +08:00
wwl b380d3c704 fix bug 2024-05-10 10:15:18 +08:00
13 changed files with 48 additions and 38 deletions

View File

@ -11,5 +11,5 @@ APP_ID=wx72e9e1a93420862c
APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe
APP_MAP_NAME=BIRKENSTOCK门店定位
APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop
APP_IMAGE_CDN_NEW=https://ecx-brikenstock-image.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets
APP_IMAGE_CDN_NEW=https://image.birkenstock.net.cn/default_project/wxAssets
APP_DIANWU_URL=

View File

@ -11,5 +11,5 @@ APP_ID=wx55ff808ba0e28b1d
APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe
APP_MAP_NAME=oneX新零售门店定位
APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop
APP_IMAGE_CDN_NEW=https://ecx-brikenstock-image.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets
APP_IMAGE_CDN_NEW=https://image.birkenstock.net.cn/default_project/wxAssets
APP_DIANWU_URL=

View File

@ -11,5 +11,5 @@ APP_ID=wx72e9e1a93420862c
APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe
APP_MAP_NAME=BIRKENSTOCK门店定位
APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop
APP_IMAGE_CDN_NEW=https://ecx-brikenstock-image.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets
APP_IMAGE_CDN_NEW=https://image.birkenstock.net.cn/default_project/wxAssets
APP_DIANWU_URL=

View File

@ -11,5 +11,5 @@ APP_ID=wx55ff808ba0e28b1d
APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe
APP_MAP_NAME=oneX新零售门店定位
APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop
APP_IMAGE_CDN_NEW=https://ecx-brikenstock-image.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets
APP_IMAGE_CDN_NEW=https://image.birkenstock.net.cn/default_project/wxAssets
APP_DIANWU_URL=

View File

@ -70,7 +70,7 @@ function SpLogin (props, ref) {
const auth_type = isWeixin ? 'wxapp' : 'aliapp'
api.wx.login({ code: codeRef.current, showError: false, auth_type }).then(async ({ token }) => {
if (token) {
Taro.showLoading({ title: '' })
Taro.showLoading({ title: '', mask: true })
await setToken(token)
onChange && onChange()
Taro.hideLoading()

View File

@ -74,11 +74,11 @@ function SpSkuSelect (props, ref) {
const key = [a.skuValue[0].specId, b.skuValue[0].specId, c.skuValue[0].specId].join('_')
const item = skuDictRef.current[key]
// && item.store > 0
selItem = key && item && ['onsale'].includes(item.approveStatus) ? item : null
selItem = key && item && ['onsale', 'offline_sale'].includes(item.approveStatus) ? item : null
}
}
// 默认选中有库存并且前端可销售的sku
const defaultSpecItem = selItem ?? specItems.find((item) => item.store > 0 && ['onsale'].includes(item.approveStatus))
const defaultSpecItem = selItem ?? specItems.find((item) => item.store > 0 && ['onsale', 'offline_sale'].includes(item.approveStatus))
let selection = Array(specItems.length).fill(null)
if (defaultSpecItem) {
selection = defaultSpecItem.specItem.map((item) => item.specId)
@ -105,7 +105,7 @@ function SpSkuSelect (props, ref) {
return Object.keys(skuDictRef.current).some((key) => {
if (key == reg) {
return skuDictRef.current[key].store > 0 && ['onsale'].includes(skuDictRef.current[key].approveStatus)
return skuDictRef.current[key].store > 0 && ['onsale', 'offline_sale'].includes(skuDictRef.current[key].approveStatus)
} else {
return false
}
@ -198,7 +198,7 @@ function SpSkuSelect (props, ref) {
console.log("🚀 ~ _selKey:", _selKey, _selection)
const isNotStore = ((idx === 0 && isClickPattern) || idx === 1) && Object.keys(skuDictRef.current).every((key) => {
if (key.indexOf(_selKey) === 0) {
return skuDictRef.current[key].store <= 0 && ['onsale'].includes(skuDictRef.current[key].approveStatus)
return skuDictRef.current[key].store <= 0 && ['onsale', 'offline_sale'].includes(skuDictRef.current[key].approveStatus)
} else {
return true
}

View File

@ -341,10 +341,11 @@ function Home () {
const getSwiperList = async () => {
const { status, activity_info = {}, total_count } = await api.user.registrationActivity({ activity_id: 2 })
const activeSwiper = activity_info.pics.map(item => ({
const activeSwiper = (activity_info.pics || [])?.map(item => ({
type: 'image',
src: item,
goods: []
goods: [],
onClick: handleGoWx
}))
const res = await api.shop.homeSwiperList({ page: 1, pageSize: 999 })
const list = (res?.list?.map((item) => {
@ -366,14 +367,14 @@ function Home () {
})
}
}) || []).sort((a, b) => a.sort - b.sort)
const _swiperList = [...activeSwiper, {
const _swiperList = [{
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]
}, ...activeSwiper, ...list]
setState((draft) => {
draft.swiperList = _swiperList
draft.goodList = _swiperList[0].goods || []
@ -693,7 +694,7 @@ function Home () {
</SwiperItem>
))}
</Swiper>
{!isUpOperation && currentIndex === 0 ? <View className="item-btns" style="left: 220rpx;
{!isUpOperation && currentIndex === 1 ? <View className="item-btns" style="left: 220rpx;
bottom: 180rpx;" >
{<View onClick={handleGoWx} className="item-btn" style={{ padding: '74rpx 156rpx', opacity: 0, background: 'transparent', border: 'none' }} >
<View className="item-btn-txt"></View>

View File

@ -7,7 +7,7 @@ import { View, Text, Picker, Input } from "@tarojs/components"
import './goods.scss'
const initState = {
loading: false,
loading: true,
shopList: []
}
function goods () {
@ -33,12 +33,12 @@ function goods () {
}
}
useEffect(() => {
getShop()
setTimeout(() => {
setState((draft) => {
draft.loading = false
})
}, 300)
}, 500)
getShop()
}, [])
const getShop = async () => {
@ -59,13 +59,16 @@ function goods () {
}
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 >
<SpPage title={''} className='page-other-goods has-navbar' showNavSearchIcon showNavLogo>
<View className="" style={{ minHeight: windowHeight * 2, background: '#000', display: loading ? 'none' : 'block' }} >
{goods_1774.map((item, index) => <SpImage src={`1774/${item}.jpg?t=${Date.now()}`} width={width} isNew >
{(index === 3 || index === 5) && <View className="go-buy" onClick={() => handleGoBuy(item, index)} ></View>}
</SpImage>)}
{/* {goods_1774.map((item, index) => <View style={{ width, background: `url(${process.env.APP_IMAGE_CDN_NEW}/1774/${item}.jpg?t=${Date.now()}) no-repeat center center`, backgroundSize: 'cover' }} src={`1774/${item}.jpg?t=${Date.now()}`} width={width} isNew >
{(index === 3 || index === 5) && <View className="go-buy" onClick={() => handleGoBuy(item, index)} ></View>}
</View>)} */}
</View>
<View className="content-btn" onClick={handleBackToIndex} >
<View style={{ display: loading ? 'none' : 'block' }} className="content-btn" onClick={handleBackToIndex} >
返回首页
</View>
</SpPage>

View File

@ -109,7 +109,7 @@ export default function detail () {
if (!checked) {
const res = await Taro.showModal({
title: '提示',
content: `请先阅读并同意${appName}活动细则`,
content: `请先阅读并同意BIRKENSTOCK活动细则`,
showCancel: true,
cancel: '取消',
cancelText: '拒绝',
@ -249,7 +249,7 @@ export default function detail () {
onClick={() => Taro.navigateTo({ url: '/subpages/auth/reg-rule?type=activity_rule' })}
style={`color: #000000;text-decoration: underline;`}
>
{`${appName}活动细则》`}
{`BIRKENSTOCK活动细则》`}
</Text>
</View>
</View>

View File

@ -8,7 +8,7 @@ import api from '@/api'
import dayjs from 'dayjs'
import { AtIcon } from 'taro-ui'
import { classNames, navigateTo } from '@/utils'
import { useLogin } from '@/hooks'
// import { useLogin } from '@/hooks'
import './detail.scss'
const initState = {
@ -28,10 +28,10 @@ export default function detail () {
const $instance = getCurrentInstance()
const [state, setState] = useImmer(initState)
const { appName } = useSelector((_state) => _state.sys)
const { userInfo = {} } = useSelector((_state) => _state.user)
const { isLogin } = useLogin({
autoLogin: true,
})
const { userInfo = null } = useSelector((_state) => _state.user)
// const { isLogin } = useLogin({
// autoLogin: false,
// })
// useDidShow(() => {
// }, [])
@ -65,7 +65,7 @@ export default function detail () {
}
draft.checked = !!_item
// MM-DD
draft.changci = changci.map((item, index) => ({ index: index + 1, start: dayjs(item.start_time).format('MM-DD HH:mm'), end: dayjs(item.end_time).format('HH:mm'), limit: item.join_limit, join: item.has_join_num, id: item.registration_session_id, activity_id: item.activity_id, has_stauts: item.has_stauts == 1 }))
draft.changci = changci.map((item, index) => ({ index: index + 1, start: dayjs(item.start_time).format('M月D日 H:mm'), end: dayjs(item.end_time).format('HH:mm'), limit: item.join_limit, join: item.has_join_num, id: item.registration_session_id, activity_id: item.activity_id, has_stauts: item.has_stauts == 1 }))
draft.applyStatus = _applyStatus
})
}
@ -75,7 +75,7 @@ export default function detail () {
}, [])
useEffect(() => {
if (isLogin && userInfo) {
if (userInfo) {
setState(draft => {
draft.formInfo = {
username: userInfo.username,
@ -83,13 +83,13 @@ export default function detail () {
}
})
}
}, [userInfo, isLogin])
}, [userInfo])
const { isLoading, activeInfo = {}, changci, visible, formInfo, checked, status, isShare, alwaysBackUrl, isSub, applyStatus } = state
const handleConfirm = async () => {
if (!isLogin || !userInfo) return
if (!userInfo) return
if (activeInfo.status) {
Taro.navigateTo({ url: '/pages/recommend/status?success=true&id=' + activeInfo.activity_id })
return
@ -238,6 +238,7 @@ export default function detail () {
}
const handleGoApply = (item) => {
if (!userInfo) return
if (item.has_stauts) {
navigateTo('/pages/recommend/status?id=' + activeInfo.activity_id + '&time=')
} else {
@ -264,7 +265,7 @@ export default function detail () {
<View className="name-box">
<View className="activity_name">{activeInfo.activity_name}</View>
</View>
<View className="activity_time">{activeInfo.start == activeInfo.end ? activeInfo.start : `${activeInfo.start} - ${activeInfo.end}`}</View>
{/* <View className="activity_time">{activeInfo.start == activeInfo.end ? activeInfo.start : `${activeInfo.start} - ${activeInfo.end}`}</View> */}
<View className="activity_addr">
<Image mode="widthFix" src={require('@/assets/icon/map.png')}></Image>
<Text>{activeInfo.address}</Text>
@ -279,7 +280,9 @@ export default function detail () {
<View style={{ paddingBottom: '80px' }}>
{changci.length > 0 && changci.map((item, index) => <View className='time-item' key={index + '__item'}>
<Text className="time-item-title">{item.index} {item.start}-{item.end}</Text>
<View className={`btn ${(item.limit - item.join <= 0) && !item.has_stauts ? 'disabled' : ''}`} onClick={() => handleGoApply(item)} >{item.has_stauts ? '已报名' : item.limit - item.join > 0 ? `${item.limit - item.join}席可选` : '已满员'}</View>
<SpLogin onChange={getActiveDetail}>
<View className={`btn_n ${(item.limit - item.join <= 0) && !item.has_stauts ? 'disabled' : ''}`} onClick={() => handleGoApply(item)} >{item.has_stauts ? '已报名' : item.limit - item.join > 0 ? `${item.limit - item.join}席可选` : '已满员'}</View>
</SpLogin>
</View>)}
</View>

View File

@ -226,7 +226,7 @@
padding: 16rpx 16rpx 16rpx 36rpx;
color: #999;
margin-bottom: 16rpx;
.btn {
.btn_n {
width: 140rpx;
height: 54rpx;
line-height: 54rpx;

View File

@ -38,6 +38,8 @@ export default function status () {
const _start = dayjs(activity_info.start_time * 1000)
const _end = dayjs(activity_info.end_time * 1000)
const _session = changci.find(item => item.has_stauts == 1) || {}
_session.start = dayjs(_session.start_time).format('M月D日 H:mm')
_session.end = dayjs(_session.end_time).format('H:mm')
const _item = _session.recordList?.[0] || {}
let url = ''
const qrData = JSON.stringify({
@ -52,7 +54,6 @@ export default function status () {
list.map((item) => {
record[item.field_name] = item.answer || ''
})
console.log("🚀 ~ file: status.js:52 ~ record:", _item)
setState(draft => {
draft.activeInfo = {
...activity_info,
@ -195,7 +196,8 @@ export default function status () {
</>}
<View className="activity_time flex-col">
<Text className="title">活动时间</Text>
<Text className="value">{activeInfo.start == activeInfo.end ? activeInfo.start : `${activeInfo.start} - ${activeInfo.end} ${session.start_time.substr(11, 5)} - ${session.end_time.substr(11, 5)}`}</Text>
{/* <Text className="value">{activeInfo.start == activeInfo.end ? activeInfo.start : `${activeInfo.start} - ${activeInfo.end} ${session.start_time.substr(11, 5)} - ${session.end_time.substr(11, 5)}`}</Text> */}
<Text className="value">{session.start} - {session.end}</Text>
</View>
<View className="activity_addr flex-col">
<Text className="title">活动地点</Text>

View File

@ -43,7 +43,8 @@ export default class RegRule extends Component {
data = registerContent + privacyContent
navBarTitle = `${registerTitle}${privactTitle}`
} else if (type === 'activity_rule') {
data = await Taro.request({ url: process.env.APP_IMAGE_CDN_NEW + '/active-rule.txt' }).then(res => res.data)
const res = await Taro.request({ url: process.env.APP_IMAGE_CDN_NEW + '/active-rule.txt?t=' + Date.now() })
data = res.data || ''
navBarTitle = 'BIRKENSTOCK活动细则'
}
else if (type) {