diff --git a/src/app.config.js b/src/app.config.js
index c9b8227..808e1fa 100755
--- a/src/app.config.js
+++ b/src/app.config.js
@@ -19,6 +19,7 @@ const config = {
'pages/article/index', // 文章页面
'pages/recommend/list', // 推荐软文列表 现在改为活动介绍
'pages/recommend/detail', // 活动介绍
+ 'pages/recommend/apply', // 报名信息
'pages/recommend/status', // 活动状态
'pages/other/goods', // 特殊商品页面
'pages/member/item-fav', // 收藏页面
diff --git a/src/components/sp-checkbox/index.js b/src/components/sp-checkbox/index.js
index 8c1bf2e..09103cd 100755
--- a/src/components/sp-checkbox/index.js
+++ b/src/components/sp-checkbox/index.js
@@ -10,13 +10,13 @@ function SpCheckboxNew (props) {
checked = false,
label,
onChange = () => { },
- disabled = false
+ disabled = false,
+ isRadio = false
} = props
const [isChecked, setChecked] = useState(checked)
const onChangeCheckbox = () => {
- console.log("🚀 ~ file: index.js:23 ~ disabled:", disabled)
if (disabled) return
setChecked(!isChecked)
onChange && onChange(!isChecked)
@@ -36,7 +36,7 @@ function SpCheckboxNew (props) {
)}
onClick={onChangeCheckbox}
>
- {/* */}
-
+ : }
{label || children}
)
diff --git a/src/components/sp-page/index.js b/src/components/sp-page/index.js
index 9003947..eac447f 100755
--- a/src/components/sp-page/index.js
+++ b/src/components/sp-page/index.js
@@ -54,6 +54,7 @@ function SpPage (props, ref) {
showNavSearchIcon = false,
showLogoLoading = false,
alwaysBackUrl = '',
+ showNavBackIcon = true
} = props
let { renderTitle } = props
const wrapRef = useRef(null)
@@ -298,7 +299,7 @@ function SpPage (props, ref) {
{/* */}
{showCustomNavigation ? Taro.navigateTo({ url: '/pages/item/list?showSearch=true' })} src={`member/chazhao-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew />
:
-
+ />}
{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?showSearch=true' })} src={`member/chazhao-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew />}
diff --git a/src/pages/index.js b/src/pages/index.js
index 677deb8..e5a6ea3 100755
--- a/src/pages/index.js
+++ b/src/pages/index.js
@@ -43,16 +43,16 @@ import { useImmer } from 'use-immer'
import { useLogin, useNavigation } from '@/hooks'
import HomeWgts from './home/comps/home-wgts'
import { WgtHomeHeader, WgtHomeHeaderShop } from './home/wgts'
-// import CompAddTip from './home/comps/comp-addtip'
-// import CompFloatMenu from './home/comps/comp-floatmenu'
+import CompAddTip from './home/comps/comp-addtip'
+import CompFloatMenu from './home/comps/comp-floatmenu'
import './home/index.scss'
-// const MCompAddTip = React.memo(CompAddTip)
+const MCompAddTip = React.memo(CompAddTip)
const initialState = {
wgts: [],
showBackToTop: false,
- loading: false,
+ loading: true,
searchComp: null,
pageData: null,
fixedTop: false,
@@ -340,12 +340,12 @@ function Home () {
}
const getSwiperList = async () => {
- // const { status, activity_info = {}, total_count } = await api.user.registrationActivity({ activity_id: 1 })
- // const activeSwiper = activity_info.pics.map(item => ({
- // type: 'image',
- // src: item,
- // goods: []
- // }))
+ const { status, activity_info = {}, total_count } = await api.user.registrationActivity({ activity_id: 2 })
+ const activeSwiper = activity_info.pics.map(item => ({
+ type: 'image',
+ src: item,
+ goods: []
+ }))
const res = await api.shop.homeSwiperList({ page: 1, pageSize: 999 })
const list = (res?.list?.map((item) => {
return {
@@ -367,15 +367,14 @@ function Home () {
}
}) || []).sort((a, b) => a.sort - b.sort)
setState((draft) => {
- // draft.swiperList = [...activeSwiper, ...list]
- draft.swiperList = list
+ draft.swiperList = [...activeSwiper, ...list]
draft.goodList = list[0].goods || []
draft.loading = false
- // draft.activeInfo = {
- // ...activity_info,
- // total_count,
- // status
- // }
+ draft.activeInfo = {
+ ...activity_info,
+ total_count,
+ status
+ }
})
}
@@ -481,7 +480,7 @@ function Home () {
}, 500)
}
} else if (deltaY < 0) {
- // if (currentIndex === 0) return
+ if (currentIndex === 0) return
// 上滑操作
setState((draft) => {
draft.showBottom = true
@@ -525,12 +524,12 @@ function Home () {
const onSwiperChange = (e) => {
const { current } = e.detail
- // if (current === 0) {
- // setState((draft) => {
- // draft.showBottom = false
- // draft.isUpOperation = false
- // })
- // }
+ if (current === 0) {
+ setState((draft) => {
+ draft.showBottom = false
+ draft.isUpOperation = false
+ })
+ }
setState((draft) => {
draft.currentIndex = current
draft.goodList = swiperList[current].goods || []
@@ -658,8 +657,10 @@ function Home () {
objectFit="cover"
style={{ width: "100%", height: "100%" }}
onPlay={() => {
+
}}
onEnded={() => {
+
}}
/>
)}
@@ -670,17 +671,26 @@ function Home () {
} */}
- {item.type === "video" && setState(v => { v.muted = !state.muted })} >
+ {!isUpOperation && item.type === "video" && setState(v => { v.muted = !state.muted })} >
}
))}
{!isUpOperation && <>
-
- 滑 动 探 索
-
-
+ {currentIndex === 0 ?
+ {activeInfo.activity_name}
+ {/* */}
+ {activeInfo.end_time * 1000 >= Date.now() && handleApply()}>
+ {activeInfo.total_count ? '已报名' : '活动申请'}
+ {/* */}
+ }
+ {/* */}
+ :
+
+ 滑 动 探 索
+
+ }
{swiperList.map((_, index) => (
diff --git a/src/pages/index copy.js b/src/pages/index.js.bak
similarity index 93%
rename from src/pages/index copy.js
rename to src/pages/index.js.bak
index 75bbfd7..677deb8 100755
--- a/src/pages/index copy.js
+++ b/src/pages/index.js.bak
@@ -43,16 +43,16 @@ import { useImmer } from 'use-immer'
import { useLogin, useNavigation } from '@/hooks'
import HomeWgts from './home/comps/home-wgts'
import { WgtHomeHeader, WgtHomeHeaderShop } from './home/wgts'
-import CompAddTip from './home/comps/comp-addtip'
-import CompFloatMenu from './home/comps/comp-floatmenu'
+// import CompAddTip from './home/comps/comp-addtip'
+// import CompFloatMenu from './home/comps/comp-floatmenu'
import './home/index.scss'
-const MCompAddTip = React.memo(CompAddTip)
+// const MCompAddTip = React.memo(CompAddTip)
const initialState = {
wgts: [],
showBackToTop: false,
- loading: true,
+ loading: false,
searchComp: null,
pageData: null,
fixedTop: false,
@@ -340,12 +340,12 @@ function Home () {
}
const getSwiperList = async () => {
- const { status, activity_info = {}, total_count } = await api.user.registrationActivity({ activity_id: 1 })
- const activeSwiper = activity_info.pics.map(item => ({
- type: 'image',
- src: item,
- goods: []
- }))
+ // const { status, activity_info = {}, total_count } = await api.user.registrationActivity({ activity_id: 1 })
+ // const activeSwiper = activity_info.pics.map(item => ({
+ // type: 'image',
+ // src: item,
+ // goods: []
+ // }))
const res = await api.shop.homeSwiperList({ page: 1, pageSize: 999 })
const list = (res?.list?.map((item) => {
return {
@@ -367,14 +367,15 @@ function Home () {
}
}) || []).sort((a, b) => a.sort - b.sort)
setState((draft) => {
- draft.swiperList = [...activeSwiper, ...list]
+ // draft.swiperList = [...activeSwiper, ...list]
+ draft.swiperList = list
draft.goodList = list[0].goods || []
draft.loading = false
- draft.activeInfo = {
- ...activity_info,
- total_count,
- status
- }
+ // draft.activeInfo = {
+ // ...activity_info,
+ // total_count,
+ // status
+ // }
})
}
@@ -480,7 +481,7 @@ function Home () {
}, 500)
}
} else if (deltaY < 0) {
- if (currentIndex === 0) return
+ // if (currentIndex === 0) return
// 上滑操作
setState((draft) => {
draft.showBottom = true
@@ -524,12 +525,12 @@ function Home () {
const onSwiperChange = (e) => {
const { current } = e.detail
- if (current === 0) {
- setState((draft) => {
- draft.showBottom = false
- draft.isUpOperation = false
- })
- }
+ // if (current === 0) {
+ // setState((draft) => {
+ // draft.showBottom = false
+ // draft.isUpOperation = false
+ // })
+ // }
setState((draft) => {
draft.currentIndex = current
draft.goodList = swiperList[current].goods || []
@@ -657,10 +658,8 @@ function Home () {
objectFit="cover"
style={{ width: "100%", height: "100%" }}
onPlay={() => {
-
}}
onEnded={() => {
-
}}
/>
)}
@@ -671,26 +670,17 @@ function Home () {
} */}
- {!isUpOperation && item.type === "video" && setState(v => { v.muted = !state.muted })} >
+ {item.type === "video" && setState(v => { v.muted = !state.muted })} >
}
))}
{!isUpOperation && <>
- {currentIndex === 0 ?
- {activeInfo.activity_name}
- {/* */}
- {activeInfo.end_time * 1000 >= Date.now() && handleApply()}>
- {activeInfo.total_count ? '已报名' : '活动申请'}
- {/* */}
- }
- {/* */}
- :
-
- 滑 动 探 索
-
- }
+
+ 滑 动 探 索
+
+
{swiperList.map((_, index) => (
diff --git a/src/pages/item/espier-detail.js b/src/pages/item/espier-detail.js
index 4ade176..fae4bce 100755
--- a/src/pages/item/espier-detail.js
+++ b/src/pages/item/espier-detail.js
@@ -117,6 +117,12 @@ function EspierDetail (props) {
const { setNavigationBarTitle } = useNavigation()
const dispatch = useDispatch()
const skuSelectRef = useRef()
+ const { windowWidth } = Taro.getSystemInfoSync()
+ const width = windowWidth * 2
+ const goods_1774 = {
+ 1: ['1/1-1.jpg', '1/1-2.jpg', '1/1-3.jpg'],
+ 2: ['2/2-1.jpg', '2/2-2.jpg', '2/2-3.jpg'],
+ }
const [state, setState] = useImmer(initialState)
const {
@@ -396,7 +402,6 @@ function EspierDetail (props) {
}
}
- const { windowWidth } = Taro.getSystemInfoSync()
let sessionFrom = {}
if (info) {
@@ -752,29 +757,53 @@ function EspierDetail (props) {
*/}
- {isArray(info.intro) ? (
-
- {info.intro.map((item, idx) => (
-
- {item.name === 'film' && }
- {item.name === 'slider' && }
- {item.name === 'writing' && }
- {/* {item.name === 'heading' && } */}
- {item.name === 'headline' && }
- {item.name === 'goods' && }
-
- ))}
-
- ) : (
- <>
- {/* */}
- >
- )}
- {introList.length ? introList.map((item, index) =>
- {
+ {true ? <>
+ {goods_1774[1].map((item, index) =>
+ )}
+ > : <>
+ {isArray(info.intro) ? (
+
+ {info.intro.map((item, idx) => (
+
+ {item.name === 'film' && }
+ {item.name === 'slider' && }
+ {item.name === 'writing' && }
+ {/* {item.name === 'heading' && } */}
+ {item.name === 'headline' && }
+ {item.name === 'goods' && }
+
+ ))}
+
+ ) : (
+ <>
+ {/* */}
+ >
+ )}
+ {introList.length ? introList.map((item, index) =>
+ {
+ setState((draft) => {
+ draft.introList = draft.introList.map((v, i) => {
+ v.isOpen = false
+ return v
+ })
+ draft.introList[index].isOpen = !item.isOpen
+ })
+ // if (!item.isOpen) {
+ // setState((draft) => {
+ // draft.scrollTop = 1042 + Math.random() / 10
+ // })
+ // }
+ }}
+ title={item.title}
+ >
+ {item.type !== 'eva' ? :
+
+ }
+
+ {
setState((draft) => {
draft.introList = draft.introList.map((v, i) => {
v.isOpen = false
@@ -787,51 +816,32 @@ function EspierDetail (props) {
// draft.scrollTop = 1042 + Math.random() / 10
// })
// }
- }}
- title={item.title}
- >
- {item.type !== 'eva' ? :
-
- }
-
- {
- setState((draft) => {
- draft.introList = draft.introList.map((v, i) => {
- v.isOpen = false
- return v
- })
- draft.introList[index].isOpen = !item.isOpen
- })
- // if (!item.isOpen) {
- // setState((draft) => {
- // draft.scrollTop = 1042 + Math.random() / 10
- // })
- // }
- }}>
- {item.isOpen ? :
- }
- {item.isOpen ? <>> : }
-
- ) : }
- {/* 商品评价 */}
+ }}>
+ {item.isOpen ? :
+ }
+ {item.isOpen ? <>> : }
+
+ ) : }
+ {/* 商品评价 */}
- {/* */}
- {isArray(historyList) ?
- 浏览历史
-
- {historyList.map((item, idx) => (
-
-
-
- ))}
-
- : <>>}
+ {/* */}
+ {isArray(historyList) ?
+ 浏览历史
+
+ {historyList.map((item, idx) => (
+
+
+
+ ))}
+
+ : <>>}
+ >}
)}
diff --git a/src/pages/recommend/apply.js b/src/pages/recommend/apply.js
new file mode 100644
index 0000000..2f54b0e
--- /dev/null
+++ b/src/pages/recommend/apply.js
@@ -0,0 +1,403 @@
+import React, { useEffect } from 'react'
+import { View, Text, Input, Image, Button, Picker } from '@tarojs/components'
+import Taro, { getCurrentInstance, useDidShow, useShareAppMessage } from '@tarojs/taro'
+import { SpPage, SpHtml, SpCheckbox, SpLogin, SpImage } from '@/components'
+import { useSelector } from 'react-redux'
+import { useImmer } from 'use-immer'
+import api from '@/api'
+import dayjs from 'dayjs'
+import { AtIcon } from 'taro-ui'
+import { classNames, navigateTo, pickBy } from '@/utils'
+import { useLogin } from '@/hooks'
+import './apply.scss'
+
+const initState = {
+ activeInfo: {},
+ isLoading: true,
+ visible: false,
+ checked: false,
+ formInfo: {},
+ status: '',
+ isShare: false,
+ alwaysBackUrl: "/pages/index",
+ isSub: false,
+ formData: {},
+ formList: [{}],
+ areaList: [],
+}
+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 getActiveDetail = async () => {
+ const { id: activity_id, alwaysBackUrl } = $instance.router.params
+ if (!activity_id) return
+ const { status, activity_info = {}, total_count, user_code, recordList = {} } = await api.user.registrationActivity({ activity_id })
+ if (total_count > 0 && !alwaysBackUrl) {
+ Taro.redirectTo({ url: '/pages/recommend/status?&id=' + activity_id })
+ return
+ }
+ const _start = dayjs(activity_info.start_time * 1000)
+ const _end = dayjs(activity_info.end_time * 1000)
+ if (alwaysBackUrl) {
+ setState(draft => {
+ draft.alwaysBackUrl = alwaysBackUrl + "?id=" + activity_id
+ })
+ }
+ const _item = recordList.list?.[0] || {}
+ setState(draft => {
+ draft.isLoading = false
+ draft.activeInfo = {
+ ...activity_info,
+ user_code,
+ total_count,
+ start: `${_start.month() + 1}月${_start.date()}日`,
+ end: `${_end.month() + 1}月${_end.date()}日`,
+ status: _item.is_write_off === '1' ? 'done' : _item.status,
+ isLoading: false
+ }
+ draft.checked = !!_item
+ })
+ }
+
+ useEffect(() => {
+ getActiveDetail()
+ fetchAreaData()
+ }, [])
+
+ useEffect(() => {
+ if (isLogin && userInfo) {
+ setState(draft => {
+ draft.formInfo = {
+ username: userInfo.username,
+ mobile: userInfo.mobile,
+ }
+ })
+ }
+ }, [userInfo, isLogin])
+
+
+ const { isLoading, activeInfo = {}, visible, formInfo, checked, status, isShare, alwaysBackUrl, isSub, formData, formList, areaList } = state
+
+ const handleConfirm = async () => {
+ if (!isLogin || !userInfo) return
+ if (activeInfo.status) {
+ Taro.navigateTo({ url: '/pages/recommend/status?success=true&id=' + activeInfo.activity_id })
+ return
+ }
+ if (!checked) {
+ const res = await Taro.showModal({
+ title: '提示',
+ content: `请先阅读并同意${appName}活动细则`,
+ showCancel: true,
+ cancel: '取消',
+ cancelText: '拒绝',
+ confirmText: '同意',
+ cancelColor: '#a5a5a5',
+ confirmColor: '#000'
+ })
+ if (!res.confirm) return
+ setState((draft) => {
+ draft.checked = true
+ draft.visible = true
+ })
+ }
+ setState((draft) => {
+ draft.visible = true
+ })
+ }
+
+ const fetchAreaData = async () => {
+ let res = await api.member.areaList()
+ const _nList = pickBy(res, {
+ label: 'label',
+ value: 'id',
+ // children: 'children'
+ })
+ setState(draft => {
+ draft.areaList = _nList
+ })
+ }
+
+ const renderFooter = () => {
+ if (isLoading || status === 'passed') {
+ return null
+ }
+ return
+
+ setState((draft) => { draft.checked = !checked })} />
+
+ !activeInfo.status && setState((draft) => { draft.checked = !checked })} >我已经阅读并同意
+ Taro.navigateTo({ url: '/subpages/auth/reg-rule?type=activity_rule' })}
+ style={`color: #000000;text-decoration: underline;`}
+ >
+ {`《${appName}活动细则》`}
+
+
+
+ {/* {!status ? '确认报名' : status === 'pending' ? '报名中' : '已报名'} */}
+
+ {!activeInfo.status ? '确认报名' : '报名详情'}
+
+
+ }
+
+ const onIptChange = (e, name) => {
+ const { value } = e.detail
+ setState((draft) => {
+ draft.formData[name] = value
+ })
+ }
+
+ const handleSubmit = async () => {
+ if (isSub) {
+ return
+ }
+ setState((draft) => {
+ draft.isSub = true
+ })
+ if (isShare) {
+ handeleShare()
+ return
+ }
+ if (!formInfo.username?.trim()) {
+ Taro.showToast({
+ title: '请输入姓名',
+ icon: 'none'
+ })
+ return
+ }
+ if (!formInfo.mobile?.trim()) {
+ Taro.showToast({
+ title: '请输入手机号',
+ icon: 'none'
+ })
+ return
+ }
+ const content = {
+ title: '',
+ sort: 1,
+ formdata: formItem.map((d) => {
+ return {
+ ...d,
+ answer: formInfo[d.field_name]
+ }
+ })
+ }
+ const { status } = await api.user.registrationSubmit({
+ formdata: { content: JSON.stringify([content]) },
+ activity_id: activeInfo.activity_id
+ })
+ if (status) {
+ setState((draft) => {
+ draft.visible = false
+ draft.status = status
+ })
+ const templeparams = {
+ temp_name: 'yykweishop',
+ source_type: 'activity'
+ }
+ const { template_id } = await api.user.newWxaMsgTmpl(templeparams)
+ Taro.requestSubscribeMessage({
+ tmplIds: template_id,
+ success: () => {
+ },
+ fail: (err) => {
+ },
+ complete: () => {
+ Taro.navigateTo({ url: '/pages/recommend/status?success=true&id=' + activeInfo.activity_id })
+ }
+ })
+ }
+ setState((draft) => {
+ draft.isSub = false
+ })
+ }
+ const onClickShare = () => {
+ setState((draft) => {
+ draft.visible = true
+ draft.isShare = true
+ })
+ }
+ useShareAppMessage(() => {
+ return {
+ title: activeInfo.activity_name,
+ path: `/pages/recommend/detail?id=${activeInfo.activity_id}`,
+ // imageUrl: activeInfo.pics[0]
+ imageUrl: `${process.env.APP_IMAGE_CDN_NEW}/share-logo.jpg`
+ }
+ })
+ const handleClose = () => {
+ setState((draft) => {
+ draft.visible = false
+ })
+ setTimeout(() => {
+ setState((draft) => {
+ draft.isShare = false
+ })
+ }, 800)
+ }
+
+ const pickerChange = (e) => {
+ const { value } = e.detail
+ console.log("🚀 ~ file: apply.js:247 ~ value:", value)
+ // setState((draft) => {
+ // draft.formData.sex = value
+ // })
+ }
+ const handleAddApply = (flag) => {
+ if (formList.length > 2) {
+ return
+ }
+ if (flag) {
+ setState((draft) => {
+ draft.formList = [...formList, {}]
+ })
+ } else {
+ setState((draft) => {
+ draft.formList = [formList[0]]
+ })
+ }
+ }
+
+ const formItem = activeInfo.formdata?.key_index || []
+ // !!activeInfo?.total_count ? <>> :
+ return (
+ > : renderFooter()} loading={isLoading} className='page-recommend-apply' alwaysBackUrl={alwaysBackUrl} isBlack>
+ 第一场 13:00-14:00
+ 请填写您的个人信息
+ {formList.map((item, index) =>
+
+ 姓名
+
+ 0 ? '他人' : ''}姓名`}
+ onInput={(e) => onIptChange(e, 'username')}
+ />
+
+
+
+ 手机
+
+ 0 ? '他人' : ''}手机号`}
+ onInput={(e) => onIptChange(e, 'mobile')}
+ />
+
+
+
+
+ 性别
+
+
+ 男
+
+
+
+ 女
+
+
+
+
+
+
+
+ 是否拥有BIRKENSTOCK鞋履
+
+
+ 是
+
+
+
+ 否
+
+
+
+
+
+
+
+ 常驻城市(选填)
+
+
+ 测试
+
+
+
+
+
+ {index === 0 &&
+
+ 是否协同他人一起参加
+
+ handleAddApply(1)} className="flex-row">
+ 是
+
+
+ handleAddApply(0)} className="flex-row">
+ 否
+
+
+
+
+ }
+ )}
+
+
+
+
+
+
+ {isShare ? '分享' : '报名信息'}
+
+
+
+ {!isShare && formItem.map((item, index) => (
+
+ {item.field_title}
+
+ {item.form_element === 'text' ? onIptChange(e, item.field_name)}
+ /> : null}
+
+
+ ))}
+ {isShare ? :
+ {'确认报名信息'}}
+
+
+
+
+
+ )
+}
diff --git a/src/pages/recommend/apply.scss b/src/pages/recommend/apply.scss
new file mode 100644
index 0000000..077ead6
--- /dev/null
+++ b/src/pages/recommend/apply.scss
@@ -0,0 +1,126 @@
+.page-recommend-apply {
+ .sp-page-body {
+ padding: 0 50px 60px;
+ }
+ .activity_apply_time {
+ font-size: 30rpx;
+ font-weight: 500;
+ color: #000;
+ margin-bottom: 50rpx;
+ margin-top: 14rpx;
+ text-align: center;
+ }
+ .activity_apply_tit {
+ font-size: 34rpx;
+ font-weight: 500;
+ color: #000;
+ margin-bottom: 30rpx;
+ }
+ .user-form {
+ margin-bottom: 80px;
+ .icon-arrowRight {
+ color: #000;
+ font-size: 36rpx;
+ rotate: 90deg;
+ }
+ }
+ .user-form-item {
+ margin-bottom: 30rpx;
+ &-title {
+ margin-bottom: 6rpx;
+ }
+ &-ipt {
+ width: 100%;
+ color: #000 !important;
+ }
+ .cell-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ border-radius: 6rpx;
+ background: #e1e1e1;
+ padding: 22rpx 22rpx 22rpx 42rpx;
+ color: #999;
+ &-tit {
+ font-size: 28rpx;
+ color: #000;
+ }
+ .flex-row {
+ margin-left: 20rpx;
+ }
+ }
+ }
+ .flex-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ }
+ .sex-label {
+ color: #000;
+ margin: 0 20px;
+ }
+ .radio {
+ width: 26px;
+ height: 26px;
+ border-radius: 50%;
+ /* prettier-ignore */
+ border: 1PX solid #000;
+ position: relative;
+ transition: all 0.3s ease-in-out 0s;
+ &.checked::after {
+ content: '';
+ display: block;
+ width: 18px;
+ height: 18px;
+ border-radius: 50%;
+ background-color: #000;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ }
+ }
+
+ .sp-page-footer {
+ min-height: 200px;
+ padding: 0 50px;
+ .check-box {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin: 16px auto;
+ .icon-my {
+ font-size: 30px;
+ }
+ view {
+ font-size: 22px;
+ }
+ }
+ .bottom {
+ // position: fixed;
+ // bottom: 80px;
+ // left: 0;
+ // right: 0;
+ width: 100%;
+ margin-bottom: 50px;
+ .btn {
+ display: flex;
+ height: 80px;
+ align-items: center;
+ justify-content: center;
+ font-size: 32px;
+ line-height: 1;
+ background: #000;
+ color: #fff;
+ border-radius: 6px;
+ &.notop {
+ margin-top: 10px;
+ }
+ &-disabled {
+ background: #666;
+ }
+ }
+ }
+ }
+}
diff --git a/src/pages/recommend/detail.js b/src/pages/recommend/detail.js
index 8794831..bd96c59 100644
--- a/src/pages/recommend/detail.js
+++ b/src/pages/recommend/detail.js
@@ -1,7 +1,7 @@
import React, { useEffect } from 'react'
import { View, Text, Input, Image, Button } from '@tarojs/components'
import Taro, { getCurrentInstance, useDidShow, useShareAppMessage } from '@tarojs/taro'
-import { SpPage, SpHtml, SpCheckbox, SpLogin } from '@/components'
+import { SpPage, SpHtml, SpCheckbox, SpLogin, SpImage } from '@/components'
import { useSelector } from 'react-redux'
import { useImmer } from 'use-immer'
import api from '@/api'
@@ -232,11 +232,15 @@ export default function detail () {
const formItem = activeInfo.formdata?.key_index || []
// !!activeInfo?.total_count ? <>> :
+ // renderFooter={!!activeInfo?.total_count ? <>> : renderFooter()}
return (
- > : renderFooter()} loading={isLoading} className='page-recommend-detail' alwaysBackUrl={alwaysBackUrl} isBlack>
+
+
+
+
+
{activeInfo.activity_name}
-
{activeInfo.start} - {activeInfo.end}
@@ -244,6 +248,19 @@ export default function detail () {
{activeInfo.address}
+
+
+ 选择活动时段报名
+ (为确保您的体验,活动当天每场次仅限5人)
+
+
+
+ {[{}, {}, {}].map((item, index) =>
+ 第{index + 1}场 13:00-14:00
+ navigateTo('/pages/recommend/apply?id=' + activeInfo.activity_id + '&time=' + index)} >{2}席可选
+ )}
+
+
image {
@@ -203,46 +203,84 @@
opacity: 1;
}
}
-}
-.sp-page-footer {
- min-height: 200px;
- padding: 0 50px;
- .check-box {
- margin-top: 100px;
- width: 100%;
+ .activity_apply_tit {
+ color: #000;
+ display: flex;
+ align-items: baseline;
+ margin-bottom: 20rpx;
+ .big {
+ font-size: 30rpx;
+ font-weight: 500;
+ }
+ .small {
+ font-size: 20rpx;
+ margin-left: 10rpx;
+ }
+ }
+ .time-item {
display: flex;
align-items: center;
- justify-content: center;
- margin: 10px auto;
- .icon-my {
- font-size: 36px;
- }
- view {
- font-size: 22px;
+ justify-content: space-between;
+ border-radius: 6rpx;
+ background: #e1e1e1;
+ padding: 16rpx 16rpx 16rpx 36rpx;
+ color: #999;
+ margin-bottom: 16rpx;
+ .btn {
+ width: 140rpx;
+ height: 54rpx;
+ line-height: 54rpx;
+ border-radius: 6rpx;
+ font-size: 24rpx;
+ text-align: center;
+ color: #fff;
+ background: #000;
+ &.disabled {
+ background: #c7c7c795;
+ opacity: 0.8;
+ }
}
}
- .bottom {
- // position: fixed;
- // bottom: 80px;
- // left: 0;
- // right: 0;
- width: 100%;
- margin-bottom: 50px;
- .btn {
+ .sp-page-footer {
+ min-height: 200px;
+ padding: 0 50px;
+ .check-box {
+ margin-top: 100px;
+ width: 100%;
display: flex;
- height: 80px;
align-items: center;
justify-content: center;
- font-size: 32px;
- line-height: 1;
- background: #000;
- color: #fff;
- border-radius: 6px;
- &.notop {
- margin-top: 10px;
+ margin: 10px auto;
+ .icon-my {
+ font-size: 30px;
}
- &-disabled {
- background: #666;
+ view {
+ font-size: 22px;
+ }
+ }
+ .bottom {
+ // position: fixed;
+ // bottom: 80px;
+ // left: 0;
+ // right: 0;
+ width: 100%;
+ margin-bottom: 50px;
+ .btn {
+ display: flex;
+ height: 80px;
+ align-items: center;
+ justify-content: center;
+ font-size: 32px;
+ line-height: 1;
+ background: #000;
+ color: #fff;
+ border-radius: 6px;
+ &.notop {
+ margin-top: 10px;
+ }
+ &-disabled {
+ background: #666;
+ }
}
}
}
diff --git a/src/pages/recommend/status.js b/src/pages/recommend/status.js
index 27cea54..2c08634 100644
--- a/src/pages/recommend/status.js
+++ b/src/pages/recommend/status.js
@@ -1,4 +1,4 @@
-import React, { useEffect } from 'react'
+import React, { useEffect, useState } from 'react'
import { View, Text, Input, Image, Button } from '@tarojs/components'
import Taro, { getCurrentInstance, useDidShow, useShareAppMessage } from '@tarojs/taro'
import { SpPage, SpHtml, SpCheckbox, SpImage } from '@/components'
@@ -7,7 +7,7 @@ import { getActiveDetail } from '@/api/community'
import { useImmer } from 'use-immer'
import api from '@/api'
import dayjs from 'dayjs'
-import { AtIcon } from 'taro-ui'
+import { AtIcon, AtModal } from 'taro-ui'
import { classNames, navigateTo, isArray } from '@/utils'
import QRCode from 'qrcode'
import './status.scss'
@@ -23,6 +23,7 @@ const initState = {
export default function status () {
const $instance = getCurrentInstance()
const [state, setState] = useImmer(initState)
+ const [showModal, setShowModal] = useState(false)
const { cur_activity_info, loading, activeInfo, qrUrl, visible } = state
useEffect(() => {
@@ -111,17 +112,18 @@ export default function status () {
}
const handleCancel = async () => {
- const res = await Taro.showModal({
- title: '提示',
- content: `确定要取消预约吗?`,
- showCancel: true,
- cancel: '取消',
- cancelText: '取消',
- confirmText: '确认',
- cancelColor: '#a5a5a5',
- confirmColor: '#000'
- })
- if (!res.confirm) return
+ setShowModal(false)
+ // const res = await Taro.showModal({
+ // title: '提示',
+ // content: `确定要取消预约吗?`,
+ // showCancel: true,
+ // cancel: '取消',
+ // cancelText: '取消',
+ // confirmText: '确认',
+ // cancelColor: '#a5a5a5',
+ // confirmColor: '#000'
+ // })
+ // if (!res.confirm) return
const { id } = $instance.router.params
await api.user.cancelRegistrationRecord({
activity_id: id
@@ -150,12 +152,16 @@ export default function status () {
return (
-
-
+
+ {/* */}
+ {activeInfo.status === 'pending' ? '待审核' : activeInfo.status === 'done' ? '已签到' : "已报名 待通过"}
+
+
+
+
{activeInfo.activity_name}
-
@@ -167,6 +173,17 @@ export default function status () {
{activeInfo?.mobile}
+ 同行朋友
+
+
+ 姓名
+ {activeInfo?.username}
+
+
+ 手机号
+ {activeInfo?.mobile}
+
+
活动时间
{activeInfo?.start} - {activeInfo?.end}
@@ -185,7 +202,7 @@ export default function status () {
入场请出示预约凭证
: }
- {activeInfo.status !== 'done' && 取消预约}
+ {activeInfo.status !== 'done' && setShowModal(true)}>取消预约}
+
+ setShowModal(false)}
+ onCancel={() => handleCancel}
+ onConfirm={() => {
+ setShowModal(false)
+ }}
+ content={'尊敬的用户:\n现场活动席位数量有限,如取消目前报名,\n可能导致您无法选择其他时间段活动,\n请问您确认要取消吗?'}
+ />
)
}
diff --git a/src/pages/recommend/status.scss b/src/pages/recommend/status.scss
index 4163f16..5c3166d 100644
--- a/src/pages/recommend/status.scss
+++ b/src/pages/recommend/status.scss
@@ -9,6 +9,12 @@
font-size: 40px;
}
}
+ .tit__label {
+ font-size: 40px;
+ text-align: center;
+ margin-bottom: 20px;
+ font-weight: bold;
+ }
.activity_name {
font-size: 40px;
font-weight: bold;
@@ -49,14 +55,14 @@
.activity_time {
font-size: 24px;
color: #999;
- margin-bottom: 50px;
+ margin-bottom: 80px;
}
.activity_addr {
font-size: 24px;
color: #999;
}
.activity_intro {
- font-size: 30px;
+ font-size: 34px;
text-decoration: underline;
margin: 90px 0 50px;
}
@@ -91,20 +97,21 @@
}
}
.cancel-txt {
- font-size: 18px;
+ font-size: 22px;
text-align: center;
- margin-top: 30px;
+ margin-top: 20px;
text-decoration: underline;
+ font-weight: bold;
}
.name-box {
display: flex;
align-items: flex-start;
justify-content: space-between;
- .share_icon {
- height: 40px;
- width: 60px;
- padding: 10px 0 10px 20px;
- }
+ }
+ .share_icon {
+ height: 60px;
+ width: 40px;
+ padding: 10px 0 10px 20px;
}
.sp-picker {
.mask {
@@ -248,4 +255,37 @@
}
}
}
+ .at-modal {
+ &__overlay {
+ background-color: rgba(0, 0, 0, 0.6);
+ }
+ &__container {
+ width: 560px;
+ border-radius: 10px;
+ }
+ &__header {
+ font-size: 40px;
+ font-weight: bold;
+ padding-top: 40px;
+ }
+ &__content {
+ padding: 60rpx 20rpx 50rpx;
+ text-align: center;
+ min-height: auto;
+ display: flex;
+ .content-simple {
+ font-size: 28px;
+ white-space: pre-wrap;
+ min-height: 150px;
+ text-align: left;
+ display: flex;
+ text {
+ margin: 0 auto;
+ }
+ }
+ }
+ .at-modal__footer--simple .at-modal__action > button:last-child:nth-child(2) {
+ color: #222;
+ }
+ }
}
diff --git a/src/subpages/member/index.js b/src/subpages/member/index.js
index 6785aac..800d6b8 100755
--- a/src/subpages/member/index.js
+++ b/src/subpages/member/index.js
@@ -469,7 +469,7 @@ function MemberIndex (props) {
// console.log('====config===', config.menu)
return (
- } title='' showNavSearchIcon={false} showNavLogo isBlack isTop>
+ } title='' showNavSearchIcon={false} showNavBackIcon={false} showNavLogo isBlack isTop>