Compare commits
No commits in common. "3566cca5f0b5e0e20cc4977ede6d8eee2dbb3332" and "28c2adc9ec95c1a8474c0d3bc461f00e66a91bfa" have entirely different histories.
3566cca5f0
...
28c2adc9ec
|
|
@ -1,15 +0,0 @@
|
||||||
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://test.birkenstock.net.cn/
|
|
||||||
APP_HOME_PAGE=/pages/index
|
|
||||||
APP_TRACK=youshu
|
|
||||||
APP_YOUSHU_TOKEN=bi281e87ab2424481a
|
|
||||||
# APP_ID=wx3e1c17c88abf3e45
|
|
||||||
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://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets
|
|
||||||
APP_DIANWU_URL=
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
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://test.birkenstock.net.cn/
|
|
||||||
APP_HOME_PAGE=/pages/index
|
|
||||||
APP_TRACK=youshu
|
|
||||||
APP_YOUSHU_TOKEN=bi281e87ab2424481a
|
|
||||||
# APP_ID=wx3e1c17c88abf3e45
|
|
||||||
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://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets
|
|
||||||
APP_DIANWU_URL=
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
APP_BASE_URL=https://slb.birkenstock.net.cn/api/h5app/wxapp
|
APP_BASE_URL=http://47.103.169.154:8080/api/h5app/wxapp
|
||||||
APP_WEBSOCKET=wss://slb.birkenstock.net.cn/ws
|
APP_WEBSOCKET=wss://http://47.103.169.154:8080/ws
|
||||||
APP_COMPANY_ID=1
|
APP_COMPANY_ID=1
|
||||||
APP_PLATFORM=standard
|
APP_PLATFORM=standard
|
||||||
APP_CUSTOM_SERVER=https://slb.birkenstock.net.cn/
|
APP_CUSTOM_SERVER=http://47.103.169.154:8081/
|
||||||
APP_HOME_PAGE=/pages/index
|
APP_HOME_PAGE=/pages/index
|
||||||
APP_TRACK=youshu
|
APP_TRACK=youshu
|
||||||
APP_YOUSHU_TOKEN=bi281e87ab2424481a
|
APP_YOUSHU_TOKEN=bi281e87ab2424481a
|
||||||
# APP_ID=wx3e1c17c88abf3e45
|
# APP_ID=wx3e1c17c88abf3e45
|
||||||
APP_ID=wx72e9e1a93420862c
|
APP_ID=wx55ff808ba0e28b1d
|
||||||
APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe
|
APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe
|
||||||
APP_MAP_NAME=BIRKENSTOCK门店定位
|
APP_MAP_NAME=oneX新零售门店定位
|
||||||
APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop
|
APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop
|
||||||
APP_IMAGE_CDN_NEW=https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets
|
APP_IMAGE_CDN_NEW=https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets
|
||||||
APP_DIANWU_URL=
|
APP_DIANWU_URL=
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
APP_BASE_URL=http://47.103.169.154:8080/api/h5app/wxapp
|
|
||||||
APP_WEBSOCKET=wss://http://47.103.169.154:8080/ws
|
|
||||||
APP_COMPANY_ID=1
|
|
||||||
APP_PLATFORM=standard
|
|
||||||
APP_CUSTOM_SERVER=http://47.103.169.154:8081/
|
|
||||||
APP_HOME_PAGE=/pages/index
|
|
||||||
APP_TRACK=youshu
|
|
||||||
APP_YOUSHU_TOKEN=bi281e87ab2424481a
|
|
||||||
# APP_ID=wx3e1c17c88abf3e45
|
|
||||||
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://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets
|
|
||||||
APP_DIANWU_URL=
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
/* eslint-disable import/no-commonjs */
|
|
||||||
const path = require('path')
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
env: {
|
|
||||||
NODE_ENV: '"production"'
|
|
||||||
},
|
|
||||||
h5: process.env.APP_CDN
|
|
||||||
? {
|
|
||||||
output: {
|
|
||||||
filename: 'js/[name].[hash:8].js',
|
|
||||||
chunkFilename: 'js/[name].[chunkhash:8].js'
|
|
||||||
},
|
|
||||||
miniCssExtractPluginOption: {
|
|
||||||
filename: 'css/[name].[hash:8].css',
|
|
||||||
chunkFilename: 'css/[id].[hash:8].css'
|
|
||||||
},
|
|
||||||
webpackChain(chain) {
|
|
||||||
// const pkg = require(path.resolve(__dirname, '../package.json'))
|
|
||||||
// const { publicPath, bucket: CDNBucket, path: CDNPath } = pkg.cdn
|
|
||||||
const publicPath = process.env.APP_PUBLIC_PATH
|
|
||||||
const CDNPath = process.env.APP_CDN_PATH
|
|
||||||
|
|
||||||
let plugin = {}
|
|
||||||
if (process.env.APP_CDN == 'aws') {
|
|
||||||
plugin = {
|
|
||||||
'asw-s3': {
|
|
||||||
plugin: require('webpack-s3-plugin'),
|
|
||||||
args: [
|
|
||||||
{
|
|
||||||
exclude: /.*\.html$/,
|
|
||||||
s3Options: {
|
|
||||||
accessKeyId: process.env.APP_CDN_KEY,
|
|
||||||
secretAccessKey: process.env.APP_CDN_SCERET,
|
|
||||||
region: process.env.APP_CDN_REGION,
|
|
||||||
ACL: ''
|
|
||||||
},
|
|
||||||
s3UploadOptions: {
|
|
||||||
Bucket: process.env.APP_CDN_BUCKET
|
|
||||||
},
|
|
||||||
basePath: CDNPath
|
|
||||||
// cdnizerOptions: {
|
|
||||||
// defaultCDNBase: 'http://asdf.ca'
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
chain.output
|
|
||||||
.publicPath(`${publicPath}/${CDNPath}/`)
|
|
||||||
|
|
||||||
chain.merge({
|
|
||||||
plugin
|
|
||||||
// plugin: {
|
|
||||||
// 'qn-webpack': {
|
|
||||||
// plugin: require('qn-webpack'),
|
|
||||||
// args: [{
|
|
||||||
// accessKey: process.env.CDN_ACCESS_KEY,
|
|
||||||
// secretKey: process.env.CDN_SECRET_KEY,
|
|
||||||
// bucket: CDNBucket,
|
|
||||||
// path: CDNPath,
|
|
||||||
// exclude: /(?:manifest\.json|\.map)$/
|
|
||||||
// }]
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
: {
|
|
||||||
output: {
|
|
||||||
filename: 'js/[name].[hash:8].js',
|
|
||||||
chunkFilename: 'js/[name].[chunkhash:8].js'
|
|
||||||
},
|
|
||||||
miniCssExtractPluginOption: {
|
|
||||||
filename: 'css/[name].[hash:8].css',
|
|
||||||
chunkFilename: 'css/[id].[hash:8].css'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "bk",
|
"name": "BIRKENSTOCK",
|
||||||
"app_name": "BIRKENSTOCK",
|
"app_name": "BIRKENSTOCK",
|
||||||
"version": "3.13.20",
|
"version": "3.13.20",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf node_modules/.cache",
|
"clean": "rm -rf node_modules/.cache",
|
||||||
"build:weapp": "taro build --type weapp --trace-warnings",
|
"build:weapp": "taro build --type weapp --trace-warnings",
|
||||||
"build:weapp:test": "taro build --type weapp --trace-warnings",
|
|
||||||
"build:weapp:live": "APP_LIVE=true taro build --type weapp --trace-warnings",
|
"build:weapp:live": "APP_LIVE=true taro build --type weapp --trace-warnings",
|
||||||
"build:swan": "taro build --type swan",
|
"build:swan": "taro build --type swan",
|
||||||
"build:alipay": "taro build --type alipay",
|
"build:alipay": "taro build --type alipay",
|
||||||
|
|
|
||||||
|
|
@ -333,7 +333,6 @@ class API {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// console.log(5);
|
// console.log(5);
|
||||||
console.log(e)
|
console.log(e)
|
||||||
Taro.hideLoading()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showLoading) {
|
if (showLoading) {
|
||||||
|
|
|
||||||
|
|
@ -79,9 +79,6 @@ export function registrationSubmit (data) {
|
||||||
export function verifyRegistrationRecord (data) {
|
export function verifyRegistrationRecord (data) {
|
||||||
return req.post('/verifyRegistrationRecord', data)
|
return req.post('/verifyRegistrationRecord', data)
|
||||||
}
|
}
|
||||||
export function getVerifyRegistrationRecordList (data) {
|
|
||||||
return req.get('/getVerifyRegistrationRecordList', data)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function registrationRecordList (data) {
|
export function registrationRecordList (data) {
|
||||||
return req.get('/registrationRecordList', data)
|
return req.get('/registrationRecordList', data)
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ const config = {
|
||||||
'pages/article/index', // 文章页面
|
'pages/article/index', // 文章页面
|
||||||
'pages/recommend/list', // 推荐软文列表 现在改为活动介绍
|
'pages/recommend/list', // 推荐软文列表 现在改为活动介绍
|
||||||
'pages/recommend/detail', // 活动介绍
|
'pages/recommend/detail', // 活动介绍
|
||||||
'pages/recommend/apply', // 报名信息
|
|
||||||
'pages/recommend/status', // 活动状态
|
'pages/recommend/status', // 活动状态
|
||||||
'pages/other/goods', // 特殊商品页面
|
|
||||||
'pages/member/item-fav', // 收藏页面
|
'pages/member/item-fav', // 收藏页面
|
||||||
|
|
||||||
'pages/custom/custom-page', // 自定义页面
|
'pages/custom/custom-page', // 自定义页面
|
||||||
|
|
@ -79,7 +77,6 @@ const config = {
|
||||||
root: 'subpages/member',
|
root: 'subpages/member',
|
||||||
pages: [
|
pages: [
|
||||||
'index', // 会员中心
|
'index', // 会员中心
|
||||||
'qa-page', // 小程序自助服务Q&A
|
|
||||||
'point-detail', // 积分明细
|
'point-detail', // 积分明细
|
||||||
'point-rule', // 积分规则
|
'point-rule', // 积分规则
|
||||||
'member-level', // 会员等级
|
'member-level', // 会员等级
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 555 B |
Binary file not shown.
|
After Width: | Height: | Size: 709 B |
|
|
@ -12,7 +12,7 @@ export default class SearchBar extends Component {
|
||||||
isOpened: false,
|
isOpened: false,
|
||||||
keyword: '',
|
keyword: '',
|
||||||
showDailog: true,
|
showDailog: true,
|
||||||
localStorageKey: 'searchHistory',
|
localStorageKey: 'searchHistory'
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
@ -22,12 +22,7 @@ export default class SearchBar extends Component {
|
||||||
searchValue: '',
|
searchValue: '',
|
||||||
showSearchDailog: false,
|
showSearchDailog: false,
|
||||||
historyList: [],
|
historyList: [],
|
||||||
isShowAction: false,
|
isShowAction: false
|
||||||
qaList: [
|
|
||||||
{ content: '正常版和窄版的区别' },
|
|
||||||
{ content: '如何区分常规软木鞋床和软底软木鞋床' },
|
|
||||||
{ content: '人造革和牛皮革的区别' },
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -128,15 +123,9 @@ export default class SearchBar extends Component {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
handleClickQa = () => {
|
|
||||||
Taro.navigateTo({
|
|
||||||
url: '/subpages/member/qa-page?index=0'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { isFixed, keyword, showDailog, placeholder, hotSearch } = this.props
|
const { isFixed, keyword, showDailog, placeholder, hotSearch } = this.props
|
||||||
const { showSearchDailog, historyList, isShowAction, searchValue, qaList } = this.state
|
const { showSearchDailog, historyList, isShowAction, searchValue } = this.state
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
className={classNames(
|
className={classNames(
|
||||||
|
|
@ -247,16 +236,6 @@ export default class SearchBar extends Component {
|
||||||
{/* <View className='at-icon at-icon-chevron-right'></View> */}
|
{/* <View className='at-icon at-icon-chevron-right'></View> */}
|
||||||
</View>)}
|
</View>)}
|
||||||
</View>
|
</View>
|
||||||
<View className='search-input__history-title hot-title'>
|
|
||||||
<Text>常见问题</Text>
|
|
||||||
<Text className='hot-title__desc'></Text>
|
|
||||||
</View>
|
|
||||||
<View className='hot-list'>
|
|
||||||
{qaList.map((item, index) => <View className='hot-list__item' onClick={this.handleClickQa.bind(this)} key={index}>
|
|
||||||
<Text>{item.content}</Text>
|
|
||||||
{/* <View className='at-icon at-icon-chevron-right'></View> */}
|
|
||||||
</View>)}
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -119,8 +119,7 @@
|
||||||
}
|
}
|
||||||
&__input-cnt {
|
&__input-cnt {
|
||||||
border-radius: 5px !important;
|
border-radius: 5px !important;
|
||||||
/* prettier-ignore */
|
border: 1px solid #000;
|
||||||
border: 1PX solid #000;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,7 @@ function SpCheckboxNew (props) {
|
||||||
checked = false,
|
checked = false,
|
||||||
label,
|
label,
|
||||||
onChange = () => { },
|
onChange = () => { },
|
||||||
disabled = false,
|
disabled = false
|
||||||
isRadio = false
|
|
||||||
} = props
|
} = props
|
||||||
|
|
||||||
const [isChecked, setChecked] = useState(checked)
|
const [isChecked, setChecked] = useState(checked)
|
||||||
|
|
@ -36,7 +35,7 @@ function SpCheckboxNew (props) {
|
||||||
)}
|
)}
|
||||||
onClick={onChangeCheckbox}
|
onClick={onChangeCheckbox}
|
||||||
>
|
>
|
||||||
{isRadio ? <Text
|
{/* <Text
|
||||||
className={classNames(
|
className={classNames(
|
||||||
{
|
{
|
||||||
iconfont: true
|
iconfont: true
|
||||||
|
|
@ -44,18 +43,17 @@ function SpCheckboxNew (props) {
|
||||||
disabled ? 'icon-circle1' : isChecked ? 'icon-roundcheckfill' : 'icon-round',
|
disabled ? 'icon-circle1' : isChecked ? 'icon-roundcheckfill' : 'icon-round',
|
||||||
disabled && isChecked && 'icon-roundcheckfill'
|
disabled && isChecked && 'icon-roundcheckfill'
|
||||||
)}
|
)}
|
||||||
|
></Text> */}
|
||||||
|
<Text
|
||||||
|
className={classNames(
|
||||||
|
{
|
||||||
|
// iconfont: true,
|
||||||
|
"icon-my": true
|
||||||
|
},
|
||||||
|
disabled ? 'icon-checkbox-weixuan' : isChecked ? 'icon-checkbox-xuanzhong' : 'icon-checkbox-weixuan',
|
||||||
|
disabled && isChecked && 'icon-checkbox-xuanzhong'
|
||||||
|
)}
|
||||||
></Text>
|
></Text>
|
||||||
: <Text
|
|
||||||
style={{ color: disabled ? '#ccc !important' : '#000' }}
|
|
||||||
className={classNames(
|
|
||||||
{
|
|
||||||
// iconfont: true,
|
|
||||||
"icon-my": true
|
|
||||||
},
|
|
||||||
disabled ? 'icon-checkbox-weixuan' : isChecked ? 'icon-checkbox-xuanzhong' : 'icon-checkbox-weixuan',
|
|
||||||
disabled && isChecked && 'icon-checkbox-xuanzhong'
|
|
||||||
)}
|
|
||||||
></Text>}
|
|
||||||
<View className='sp-checkbox-new__label'>{label || children}</View>
|
<View className='sp-checkbox-new__label'>{label || children}</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -43,25 +43,14 @@ function SpCoupon (props) {
|
||||||
} = info
|
} = info
|
||||||
|
|
||||||
const { tag, invalidBg, bg } = COUPON_TYPE[cardType]
|
const { tag, invalidBg, bg } = COUPON_TYPE[cardType]
|
||||||
const couponTagFlag = info.tagClass === 'used' || info.tagClass === 'overdue' || !info.valid
|
const couponTagBg = info.tagClass === 'used' || info.tagClass === 'overdue' || !info.valid ? invalidBg : bg
|
||||||
const couponTagBg = couponTagFlag ? invalidBg : bg
|
|
||||||
// (couponStatus && couponStatus != 1) ||
|
|
||||||
const isInvalid = ((couponStatus && couponStatus != 1) || (info.tagClass === 'used' || info.tagClass === 'overdue') || isNotUse)
|
|
||||||
|
|
||||||
return (<View className="coupons-list-item" key={`coupon-item__${id}`} style={styleNames({
|
return (<View className="coupons-list-item" key={`coupon-item__${id}`} style={styleNames({
|
||||||
background: `url(${process.env.APP_IMAGE_CDN_NEW}/member/${isInvalid ? "quan-hui" : "quan-lan"}.png) no-repeat`,
|
background: `url(${process.env.APP_IMAGE_CDN_NEW}/member/${((couponStatus && couponStatus != 1) || (info.tagClass === 'used' || info.tagClass === 'overdue') || isNotUse) ? "quan-hui" : "quan-lan"}.png) no-repeat`,
|
||||||
'background-size': '100% 100%'
|
'background-size': '100% 100%'
|
||||||
})}>
|
})}>
|
||||||
<View className="coupons-list-item-left">
|
<View className="coupons-list-item-left">
|
||||||
<View className='coupons-list-item-money'>
|
<View className='coupons-list-item-money'><Text className='coupons-list-item-unit'>¥</Text><Text className="coupons-list-item-num">{reduceCost || 0}</Text></View>
|
||||||
{cardType === 'cash' &&
|
|
||||||
<><Text className='coupons-list-item-unit'>¥</Text><Text className="coupons-list-item-num">{reduceCost || 0}</Text></>
|
|
||||||
}
|
|
||||||
{cardType === 'discount' && <>
|
|
||||||
<Text className="coupons-list-item-num">{discount || 0}</Text>
|
|
||||||
<Text className='coupons-list-item-unit'>折</Text>
|
|
||||||
</>}
|
|
||||||
</View>
|
|
||||||
<View className="coupons-list-item-desc">满{leastCost}可用</View>
|
<View className="coupons-list-item-desc">满{leastCost}可用</View>
|
||||||
</View>
|
</View>
|
||||||
<View className="coupons-list-item-right">
|
<View className="coupons-list-item-right">
|
||||||
|
|
@ -74,7 +63,7 @@ function SpCoupon (props) {
|
||||||
{/* !valid || */}
|
{/* !valid || */}
|
||||||
{!isNotUse && <>
|
{!isNotUse && <>
|
||||||
{info.tagClass === 'used' || info.tagClass === 'overdue' ? <View className="coupons-list-item-btn">已{info.tagClass === 'used' ? '使用' : '过期'}</View>
|
{info.tagClass === 'used' || info.tagClass === 'overdue' ? <View className="coupons-list-item-btn">已{info.tagClass === 'used' ? '使用' : '过期'}</View>
|
||||||
: isInvalid ? <View className="coupons-list-item-btn">{couponStatus == 0 ? '已领完' : '已领取'}</View> : <View className="coupons-list-item-btn" onClick={onClick}>立即{isNew ? '兑换' : '使用'}</View>}
|
: <View className="coupons-list-item-btn" onClick={onClick}>立即{isNew ? '兑换' : '使用'}</View>}
|
||||||
</>}
|
</>}
|
||||||
</View>
|
</View>
|
||||||
</View>)
|
</View>)
|
||||||
|
|
|
||||||
|
|
@ -246,8 +246,7 @@
|
||||||
}
|
}
|
||||||
&-btn {
|
&-btn {
|
||||||
padding: 15px 20px;
|
padding: 15px 20px;
|
||||||
/* prettier-ignore */
|
border: 1px solid #fff;
|
||||||
border: 1PX solid #fff;
|
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
/* prettier-ignore */
|
border: 1px solid#d0d0d0;
|
||||||
border: 1PX solid#d0d0d0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&__bd {
|
&__bd {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { classNames } from '@/utils'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
||||||
function SpGoodsPrice (props) {
|
function SpGoodsPrice (props) {
|
||||||
const { info, showMarketPrice = false } = props
|
const { info } = props
|
||||||
const { priceSetting } = useSelector((state) => state.sys)
|
const { priceSetting } = useSelector((state) => state.sys)
|
||||||
const { cart_page, item_page, order_page } = priceSetting
|
const { cart_page, item_page, order_page } = priceSetting
|
||||||
const {
|
const {
|
||||||
|
|
@ -45,9 +45,9 @@ function SpGoodsPrice (props) {
|
||||||
{
|
{
|
||||||
!isPoint && <SpPrice size={36} className='sale-price' value={price} showSeparator noDecimal />
|
!isPoint && <SpPrice size={36} className='sale-price' value={price} showSeparator noDecimal />
|
||||||
}
|
}
|
||||||
{marketPrice > 0 && enMarketPrice && showMarketPrice && (
|
{/* {marketPrice > 0 && enMarketPrice && (
|
||||||
<SpPrice className='mkt-price' lineThrough value={marketPrice} />
|
<SpPrice className='mkt-price' lineThrough value={marketPrice} />
|
||||||
)}
|
)} */}
|
||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
{info.memberPrice < info.price && enMemberPrice && (
|
{info.memberPrice < info.price && enMemberPrice && (
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
.sp-goods-price {
|
.sp-goods-price {
|
||||||
.mkt-price {
|
.mkt-price {
|
||||||
margin-left: 18px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
.vip-price,
|
.vip-price,
|
||||||
.svip-price {
|
.svip-price {
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ class AtInputNumber extends AtComponent {
|
||||||
style={inputStyle}
|
style={inputStyle}
|
||||||
type={type}
|
type={type}
|
||||||
value={inputValue}
|
value={inputValue}
|
||||||
disabled={true}
|
disabled={disabled}
|
||||||
onInput={this.handleInput}
|
onInput={this.handleInput}
|
||||||
onBlur={this.handleBlur}
|
onBlur={this.handleBlur}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -177,8 +177,7 @@
|
||||||
line-height: 78rpx;
|
line-height: 78rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
/* prettier-ignore */
|
border: 1px solid #000;
|
||||||
border: 1PX solid #000;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import React, { useEffect, useState, useCallback, useRef, useImperativeHandle }
|
||||||
import { View, Text, Button, ScrollView } from '@tarojs/components'
|
import { View, Text, Button, ScrollView } from '@tarojs/components'
|
||||||
import { AtButton, AtCurtain } from 'taro-ui'
|
import { AtButton, AtCurtain } from 'taro-ui'
|
||||||
import { useImmer } from 'use-immer'
|
import { useImmer } from 'use-immer'
|
||||||
import { useSelector } from 'react-redux'
|
|
||||||
import S from '@/spx'
|
import S from '@/spx'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { isWeixin, isAlipay, classNames, showToast, entryLaunch } from '@/utils'
|
import { isWeixin, isAlipay, classNames, showToast, entryLaunch } from '@/utils'
|
||||||
|
|
@ -21,13 +20,12 @@ const initialState = {
|
||||||
agreeMentChecked: false
|
agreeMentChecked: false
|
||||||
}
|
}
|
||||||
function SpLogin (props, ref) {
|
function SpLogin (props, ref) {
|
||||||
const { children, className, onChange, newUser = false, url = '' } = props
|
const { children, className, onChange, newUser = false } = props
|
||||||
const { isLogin, login, setToken, checkPolicyChange } = useLogin({
|
const { isLogin, login, setToken, checkPolicyChange } = useLogin({
|
||||||
policyUpdateHook: (isUpdate) => {
|
policyUpdateHook: (isUpdate) => {
|
||||||
// isUpdate && setPolicyModal(true)
|
// isUpdate && setPolicyModal(true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const { appName } = useSelector((_state) => _state.sys)
|
|
||||||
const [isNewUser, setIsNewUser] = useState(false)
|
const [isNewUser, setIsNewUser] = useState(false)
|
||||||
const [policyModal, setPolicyModal] = useState(false)
|
const [policyModal, setPolicyModal] = useState(false)
|
||||||
const [loginModal, setLoginModal] = useState(false)
|
const [loginModal, setLoginModal] = useState(false)
|
||||||
|
|
@ -43,11 +41,13 @@ function SpLogin (props, ref) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (loginModal) {
|
if (loginModal) {
|
||||||
|
fetchPrivacyData()
|
||||||
Taro.login({
|
Taro.login({
|
||||||
success: ({ code }) => {
|
success: ({ code }) => {
|
||||||
codeRef.current = code
|
codeRef.current = code
|
||||||
},
|
},
|
||||||
fail: (e) => {
|
fail: (e) => {
|
||||||
|
console.error('[sp-login] taro login fail:', e)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -66,69 +66,58 @@ function SpLogin (props, ref) {
|
||||||
|
|
||||||
const handleBindPhone = async (e) => {
|
const handleBindPhone = async (e) => {
|
||||||
setLoginModal(false)
|
setLoginModal(false)
|
||||||
// const code = codeRef.current
|
const { encryptedData, iv, cloudID } = e.detail
|
||||||
const auth_type = isWeixin ? 'wxapp' : 'aliapp'
|
if (encryptedData && iv) {
|
||||||
api.wx.login({ code: codeRef.current, showError: false, auth_type }).then(async ({ token }) => {
|
const code = codeRef.current
|
||||||
if (token) {
|
let params = {
|
||||||
Taro.showLoading({ title: '' })
|
code,
|
||||||
await setToken(token)
|
encryptedData,
|
||||||
onChange && onChange()
|
iv,
|
||||||
|
cloudID,
|
||||||
|
user_type: 'wechat',
|
||||||
|
auth_type: 'wxapp'
|
||||||
|
}
|
||||||
|
// 内购分享码
|
||||||
|
const { code: purchaseCode } = Taro.getStorageSync(SG_ROUTER_PARAMS)
|
||||||
|
if (purchaseCode) {
|
||||||
|
params = {
|
||||||
|
...params,
|
||||||
|
purchanse_share_code: purchaseCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Taro.showLoading({ title: '' })
|
||||||
|
|
||||||
|
// const { uid } = entryLaunch.getLaunchParams()
|
||||||
|
const { uid, dtid } = Taro.getStorageSync(SG_ROUTER_PARAMS)
|
||||||
|
const { gu_user_id } = Taro.getStorageSync(SG_GUIDE_PARAMS)
|
||||||
|
if (uid) {
|
||||||
|
// 分销绑定
|
||||||
|
params['uid'] = uid
|
||||||
|
}
|
||||||
|
if (dtid) {
|
||||||
|
params['distributor_id'] = dtid
|
||||||
|
}
|
||||||
|
// gu_user_id: 欢迎语上带过来的员工编号, 同work_user_id
|
||||||
|
if (gu_user_id) {
|
||||||
|
params['channel'] = 1
|
||||||
|
params['work_userid'] = gu_user_id
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const { token, is_new } = await api.wx.newlogin(params)
|
||||||
|
if (token) {
|
||||||
|
setToken(token)
|
||||||
|
Taro.hideLoading()
|
||||||
|
setLoginModal(false)
|
||||||
|
showToast('恭喜您,注册成功')
|
||||||
|
onChange && onChange()
|
||||||
|
} else {
|
||||||
|
showToast('注册失败')
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
Taro.hideLoading()
|
Taro.hideLoading()
|
||||||
}
|
}
|
||||||
}).catch(async () => {
|
}
|
||||||
const { code } = await Taro.login()
|
|
||||||
const { encryptedData, iv, cloudID } = e.detail
|
|
||||||
if (encryptedData && iv) {
|
|
||||||
let params = {
|
|
||||||
code,
|
|
||||||
encryptedData,
|
|
||||||
iv,
|
|
||||||
cloudID,
|
|
||||||
user_type: 'wechat',
|
|
||||||
auth_type: 'wxapp'
|
|
||||||
}
|
|
||||||
// 内购分享码
|
|
||||||
const { code: purchaseCode } = Taro.getStorageSync(SG_ROUTER_PARAMS)
|
|
||||||
if (purchaseCode) {
|
|
||||||
params = {
|
|
||||||
...params,
|
|
||||||
purchanse_share_code: purchaseCode
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Taro.showLoading({ title: '' })
|
|
||||||
|
|
||||||
// const { uid } = entryLaunch.getLaunchParams()
|
|
||||||
const { uid, dtid } = Taro.getStorageSync(SG_ROUTER_PARAMS)
|
|
||||||
const { gu_user_id } = Taro.getStorageSync(SG_GUIDE_PARAMS)
|
|
||||||
if (uid) {
|
|
||||||
// 分销绑定
|
|
||||||
params['uid'] = uid
|
|
||||||
}
|
|
||||||
if (dtid) {
|
|
||||||
params['distributor_id'] = dtid
|
|
||||||
}
|
|
||||||
// gu_user_id: 欢迎语上带过来的员工编号, 同work_user_id
|
|
||||||
if (gu_user_id) {
|
|
||||||
params['channel'] = 1
|
|
||||||
params['work_userid'] = gu_user_id
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const { token, is_new } = await api.wx.newlogin(params)
|
|
||||||
if (token) {
|
|
||||||
setToken(token)
|
|
||||||
Taro.hideLoading()
|
|
||||||
setLoginModal(false)
|
|
||||||
showToast('恭喜您,注册成功')
|
|
||||||
onChange && onChange()
|
|
||||||
} else {
|
|
||||||
showToast('注册失败')
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
Taro.hideLoading()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleCloseModal = useCallback(() => {
|
const handleCloseModal = useCallback(() => {
|
||||||
|
|
@ -166,7 +155,6 @@ function SpLogin (props, ref) {
|
||||||
if (isLogin) {
|
if (isLogin) {
|
||||||
onChange && onChange()
|
onChange && onChange()
|
||||||
} else {
|
} else {
|
||||||
await fetchPrivacyData()
|
|
||||||
setLoginModal(true)
|
setLoginModal(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -254,7 +242,7 @@ function SpLogin (props, ref) {
|
||||||
</View>
|
</View>
|
||||||
<ScrollView scrollY
|
<ScrollView scrollY
|
||||||
scrollWithAnimation className="curtain_content_text" showScrollbar={false} enhanced>
|
scrollWithAnimation className="curtain_content_text" showScrollbar={false} enhanced>
|
||||||
亲爱的用户,感谢您使用{appName}微信小程序!为了加强对您个人信息的保护,我们根据最新法律的要求制定/更新了
|
亲爱的用户,感谢您使用Birkenstock微信小程序!为了加强对您个人信息的保护,我们根据最新法律的要求制定/更新了
|
||||||
<View className="agreement-list">
|
<View className="agreement-list">
|
||||||
<Text className='agreement-name' onClick={handleClickPrivacy.bind(this, 'member_register')}>《{registerName}》</Text>和
|
<Text className='agreement-name' onClick={handleClickPrivacy.bind(this, 'member_register')}>《{registerName}》</Text>和
|
||||||
<Text className='agreement-name' onClick={handleClickPrivacy.bind(this, 'privacy')}>《{privacyName}》</Text>
|
<Text className='agreement-name' onClick={handleClickPrivacy.bind(this, 'privacy')}>《{privacyName}》</Text>
|
||||||
|
|
@ -264,27 +252,24 @@ function SpLogin (props, ref) {
|
||||||
通过《隐私政策》,我们向您主要说明:
|
通过《隐私政策》,我们向您主要说明:
|
||||||
</View>
|
</View>
|
||||||
<View className="">
|
<View className="">
|
||||||
1.您在使用{appName}微信小程序时,可以选择浏览模式,也可以选择注册/登录成为{appName}微信小程序用户
|
1.您在使用Birkenstock微信小程序时,可以选择浏览模式,也可以选择注册/登录成为Birkenstock微信小程序用户
|
||||||
</View>
|
</View>
|
||||||
<View className="">
|
<View className="">
|
||||||
2为了向你提供{appName}微信小程序的其本服条,我们将基于合法以及正当必要的原则,按照本政策的规定向您提供各项服务
|
2为了向你提供Birkenstock微信小程序的其本服条,我们将基于合法以及正当必要的原则,按照本政策的规定向您提供各项服务
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<View className='btn-wrap'>
|
<View className='btn-wrap'>
|
||||||
<AtButton className='btn' type='primary' openType="getPhoneNumber" onGetPhoneNumber={handleBindPhone
|
{isNewUser && <AtButton className='btn' type='primary' openType="getPhoneNumber" onGetPhoneNumber={handleBindPhone
|
||||||
}> 同意并继续
|
|
||||||
</AtButton>
|
|
||||||
{/* {isNewUser && <AtButton className='btn' type='primary' openType="getPhoneNumber" onGetPhoneNumber={handleBindPhone
|
|
||||||
}>
|
}>
|
||||||
同意并继续
|
同意并继续
|
||||||
</AtButton>}
|
</AtButton>}
|
||||||
{!isNewUser && <AtButton className='btn' type='primary' onClick={handleUserLogin}>
|
{!isNewUser && <AtButton className='btn' type='primary' onClick={handleUserLogin}>
|
||||||
同意并继续
|
同意并继续
|
||||||
</AtButton>} */}
|
</AtButton>}
|
||||||
</View>
|
</View>
|
||||||
<View className="no-btn" onClick={() => setLoginModal(false)}>不同意</View>
|
<View className="no-btn" onClick={() => setLoginModal(false)}>不同意</View>
|
||||||
<View className="no-text">
|
<View className="no-text">
|
||||||
*如果您不同意{appName}隐私政策,您可继续浏览小程序,但您无法使用购物结算功能
|
*如果您不同意Birkenstock隐私政策,您可继续浏览小程序,但您无法使用购物结算功能
|
||||||
</View>
|
</View>
|
||||||
</View>}
|
</View>}
|
||||||
</AtCurtain>
|
</AtCurtain>
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
}
|
}
|
||||||
&__title {
|
&__title {
|
||||||
// font-size: floor(0.95 * $font-size);
|
// font-size: floor(0.95 * $font-size);
|
||||||
// @include multi-ellipsis(1);
|
@include multi-ellipsis(1);
|
||||||
margin-bottom: 26px;
|
margin-bottom: 26px;
|
||||||
color: #000;
|
color: #000;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
|
|
||||||
|
|
@ -48,13 +48,11 @@ function SpPage (props, ref) {
|
||||||
isTop = false,
|
isTop = false,
|
||||||
isBlack = false,
|
isBlack = false,
|
||||||
title = '', // 页面导航标题
|
title = '', // 页面导航标题
|
||||||
showNavLogo = false,
|
showNavLogo = true,
|
||||||
showNavkfIcon = false,
|
showNavkfIcon = false,
|
||||||
showNavHomeIcon = false,
|
showNavHomeIcon = false,
|
||||||
showNavSearchIcon = false,
|
showNavSearchIcon = false,
|
||||||
showLogoLoading = false,
|
showLogoLoading = false,
|
||||||
alwaysBackUrl = '',
|
|
||||||
showNavBackIcon = true
|
|
||||||
} = props
|
} = props
|
||||||
let { renderTitle } = props
|
let { renderTitle } = props
|
||||||
const wrapRef = useRef(null)
|
const wrapRef = useRef(null)
|
||||||
|
|
@ -134,8 +132,7 @@ function SpPage (props, ref) {
|
||||||
draft.pageTitle = pageTitle
|
draft.pageTitle = pageTitle
|
||||||
draft.isTabBarPage = isTabBarPage
|
draft.isTabBarPage = isTabBarPage
|
||||||
draft.showLeftContainer = !['/subpages/guide/index', '/pages/index'].includes(`/${page?.route}`)
|
draft.showLeftContainer = !['/subpages/guide/index', '/pages/index'].includes(`/${page?.route}`)
|
||||||
// '/subpages/member/index',
|
draft.showCustomNavigation = ['/pages/cart/espier-index', '/pages/index', '/subpages/member/index', '/pages/category/index', '/pages/recommend/list', '/pages/recommend/list'].includes(`/${page?.route}`)
|
||||||
draft.showCustomNavigation = ['/pages/cart/espier-index', '/pages/index', '/pages/category/index', '/pages/recommend/list'].includes(`/${page?.route}`)
|
|
||||||
// draft.showCustomNavigation = true
|
// draft.showCustomNavigation = true
|
||||||
draft.showNavCartIcon = ['/subpages/marketing/coupon-center', '/subpages/marketing/coupon', '/pages/item/list'].includes(`/${page?.route}`)
|
draft.showNavCartIcon = ['/subpages/marketing/coupon-center', '/subpages/marketing/coupon', '/pages/item/list'].includes(`/${page?.route}`)
|
||||||
})
|
})
|
||||||
|
|
@ -199,7 +196,7 @@ function SpPage (props, ref) {
|
||||||
|
|
||||||
let model = ''
|
let model = ''
|
||||||
let ipx = false
|
let ipx = false
|
||||||
let gNavbarH = 0, gStatusBarHeight = 0, gAreaH = 0
|
let gNavbarH = 0, gStatusBarHeight = 0
|
||||||
// let customNavigation = false
|
// let customNavigation = false
|
||||||
// let cusCurrentPage = 0
|
// let cusCurrentPage = 0
|
||||||
|
|
||||||
|
|
@ -210,8 +207,7 @@ function SpPage (props, ref) {
|
||||||
ipx = model.search(/iPhone\s*X|iPhone\s*11|iPhone\s*12|iPhone\s*13|iPhone\s*14|iPhone\s*15|iPhone\s*16|iPhone\s*10/g) > -1
|
ipx = model.search(/iPhone\s*X|iPhone\s*11|iPhone\s*12|iPhone\s*13|iPhone\s*14|iPhone\s*15|iPhone\s*16|iPhone\s*10/g) > -1
|
||||||
|
|
||||||
const menuButton = Taro.getMenuButtonBoundingClientRect()
|
const menuButton = Taro.getMenuButtonBoundingClientRect()
|
||||||
const { statusBarHeight, safeArea, screenHeight } = deviceInfo
|
const { statusBarHeight } = Taro.getSystemInfoSync()
|
||||||
gAreaH = (screenHeight - safeArea.bottom)
|
|
||||||
gNavbarH = Math.floor(statusBarHeight + menuButton.height + (menuButton.top - statusBarHeight) * 2)
|
gNavbarH = Math.floor(statusBarHeight + menuButton.height + (menuButton.top - statusBarHeight) * 2)
|
||||||
gStatusBarHeight = statusBarHeight
|
gStatusBarHeight = statusBarHeight
|
||||||
}
|
}
|
||||||
|
|
@ -259,7 +255,7 @@ function SpPage (props, ref) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
renderTitle = showCustomNavigation || showNavLogo ? <SpImage src={`member/logo-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew /> : undefined
|
renderTitle = showCustomNavigation && showNavLogo ? <SpImage src={`member/logo-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew /> : undefined
|
||||||
const navigationBarTitleText = props.navigationBarTitleText || getCurrentInstance().page?.config?.navigationBarTitleText
|
const navigationBarTitleText = props.navigationBarTitleText || getCurrentInstance().page?.config?.navigationBarTitleText
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
|
|
@ -299,19 +295,12 @@ function SpPage (props, ref) {
|
||||||
{/* <Image className="chazhao" src={require("@/assets/chazhao-light.png")}></Image> */}
|
{/* <Image className="chazhao" src={require("@/assets/chazhao-light.png")}></Image> */}
|
||||||
{showCustomNavigation ? <SpImage onClick={() => Taro.navigateTo({ url: '/pages/item/list?showSearch=true' })} src={`member/chazhao-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew />
|
{showCustomNavigation ? <SpImage onClick={() => Taro.navigateTo({ url: '/pages/item/list?showSearch=true' })} src={`member/chazhao-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew />
|
||||||
: <View className='icon-wrap'>
|
: <View className='icon-wrap'>
|
||||||
{showNavBackIcon && <Text
|
<Text
|
||||||
className={classNames('iconfont', {
|
className={classNames('iconfont', {
|
||||||
// 'icon-home1': cusCurrentPage == 1,
|
// 'icon-home1': cusCurrentPage == 1,
|
||||||
'icon-fanhui': alwaysBackUrl ? true : cusCurrentPage != 1
|
'icon-fanhui': cusCurrentPage != 1
|
||||||
})}
|
})}
|
||||||
// style={{ color: isBlack ? 'white' : 'black' }}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (alwaysBackUrl) {
|
|
||||||
Taro.navigateTo({
|
|
||||||
url: alwaysBackUrl,
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (cusCurrentPage == 1) {
|
if (cusCurrentPage == 1) {
|
||||||
Taro.redirectTo({
|
Taro.redirectTo({
|
||||||
url: isGoodsShelves() ? '/subpages/guide/index' : '/pages/index'
|
url: isGoodsShelves() ? '/subpages/guide/index' : '/pages/index'
|
||||||
|
|
@ -320,10 +309,10 @@ function SpPage (props, ref) {
|
||||||
Taro.navigateBack()
|
Taro.navigateBack()
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>}
|
/>
|
||||||
{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}
|
{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 />}
|
{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?showSearch=true' })} src={`member/chazhao-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew />}
|
{showNavSearchIcon && <SpImage onClick={() => Taro.navigateTo({ url: '/pages/item/list' })} src={`member/chazhao-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew />}
|
||||||
</View>
|
</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>}
|
{showNavkfIcon && <SpChat><SpImage className='icon-kf' src={`index/kf.png`} onClick={() => Taro.redirectTo({ url: '/pages/cart/espier-index' })} height={46} mode='heightFix' isNew /></SpChat>}
|
||||||
|
|
@ -368,7 +357,6 @@ function SpPage (props, ref) {
|
||||||
...pageTheme, ...lockStyle, ...pageBackground, 'padding-top': isTop ? currentPath === 'pages/index' ? 0 : `${customNavigation ? gStatusBarHeight : 0}px` : `${customNavigation ? gNavbarH : 0}px`,
|
...pageTheme, ...lockStyle, ...pageBackground, 'padding-top': isTop ? currentPath === 'pages/index' ? 0 : `${customNavigation ? gStatusBarHeight : 0}px` : `${customNavigation ? gNavbarH : 0}px`,
|
||||||
"--nav-height": `${gNavbarH}px`,
|
"--nav-height": `${gNavbarH}px`,
|
||||||
"--status-bar-height": `${gStatusBarHeight}px`,
|
"--status-bar-height": `${gStatusBarHeight}px`,
|
||||||
"--area-bottom-height": `${gAreaH}rpx`,
|
|
||||||
})}
|
})}
|
||||||
ref={wrapRef}
|
ref={wrapRef}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ function SpSkuSelect (props, ref) {
|
||||||
specItems.forEach((item) => {
|
specItems.forEach((item) => {
|
||||||
const key = item.specItem.map((spec) => spec.specId).join('_')
|
const key = item.specItem.map((spec) => spec.specId).join('_')
|
||||||
skuDictRef.current[key] = item
|
skuDictRef.current[key] = item
|
||||||
// console.log("🚀 ~ item库存为:", key, item.specItem.map((item) => item.specName).join('_'), item.store)
|
console.log("🚀 ~ item库存为:", key, item.specItem.map((item) => item.specName).join('_'), item.store)
|
||||||
})
|
})
|
||||||
let selItem = null
|
let selItem = null
|
||||||
if (skuList.length === 3) {
|
if (skuList.length === 3) {
|
||||||
|
|
|
||||||
|
|
@ -133,8 +133,7 @@
|
||||||
// }
|
// }
|
||||||
|
|
||||||
.at-input-number {
|
.at-input-number {
|
||||||
/* prettier-ignore */
|
border: 1px solid #999;
|
||||||
border: 1PX solid #999;
|
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
&__input {
|
&__input {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ export const STATUS_TYPES_MAP = {
|
||||||
WAIT_BUYER_CONFIRM: 'WAIT_BUYER_CONFIRM_GOODS',
|
WAIT_BUYER_CONFIRM: 'WAIT_BUYER_CONFIRM_GOODS',
|
||||||
DONE: 'TRADE_SUCCESS',
|
DONE: 'TRADE_SUCCESS',
|
||||||
CANCEL: 'TRADE_CLOSED',
|
CANCEL: 'TRADE_CLOSED',
|
||||||
PART_PAYMENT: 'WAIT_BUYER_PAY'
|
PART_PAYMENT:'WAIT_BUYER_PAY'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AFTER_SALE_STATUS = {
|
export const AFTER_SALE_STATUS = {
|
||||||
|
|
@ -84,9 +84,8 @@ export const ACTIVITY_STATUS = {
|
||||||
export const DEFAULT_POINT_NAME = '积分'
|
export const DEFAULT_POINT_NAME = '积分'
|
||||||
|
|
||||||
export const DEFAULT_THEME = {
|
export const DEFAULT_THEME = {
|
||||||
colorPrimary: '#000',
|
colorPrimary: '#d42f29',
|
||||||
// colorMarketing: '#fba629',
|
colorMarketing: '#fba629',
|
||||||
colorMarketing: '#000',
|
|
||||||
colorAccent: '#2e3030'
|
colorAccent: '#2e3030'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ export const COUPON = {
|
||||||
getNum: 'get_num',
|
getNum: 'get_num',
|
||||||
couponStatus: ({ quantity, get_limit, user_get_num, get_num }) => {
|
couponStatus: ({ quantity, get_limit, user_get_num, get_num }) => {
|
||||||
if (quantity - get_num <= 0) {
|
if (quantity - get_num <= 0) {
|
||||||
return '0' // 已领完
|
return 0 // 已领完
|
||||||
} else if (get_limit - user_get_num > 0) {
|
} else if (get_limit - user_get_num > 0) {
|
||||||
return 1 // 立即领取
|
return 1 // 立即领取
|
||||||
} else if (get_limit - user_get_num <= 0) {
|
} else if (get_limit - user_get_num <= 0) {
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ export const TRADE_AFTER_SALES_ITEM = {
|
||||||
return pickBy(_detail, {
|
return pickBy(_detail, {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
pic: 'pic',
|
pic: 'pic',
|
||||||
itemName: ({ item_name, item_name_2 }) => item_name_2 || item_name,
|
itemName: 'item_name',
|
||||||
price: ({ total_fee }) => total_fee / 100,
|
price: ({ total_fee }) => total_fee / 100,
|
||||||
num: 'num',
|
num: 'num',
|
||||||
// 可售后商品数
|
// 可售后商品数
|
||||||
|
|
@ -128,7 +128,7 @@ export const TRADE_AFTER_SALES_ITEM = {
|
||||||
afterSalesMobile: ({ aftersales_address }) => aftersales_address.aftersales_mobile,
|
afterSalesMobile: ({ aftersales_address }) => aftersales_address.aftersales_mobile,
|
||||||
afterSalesAddress: ({ aftersales_address }) => aftersales_address.aftersales_address,
|
afterSalesAddress: ({ aftersales_address }) => aftersales_address.aftersales_address,
|
||||||
afterSalesContact: ({ aftersales_address }) => aftersales_address.aftersales_contact,
|
afterSalesContact: ({ aftersales_address }) => aftersales_address.aftersales_contact,
|
||||||
afterSalesZip: ({ aftersales_address }) => aftersales_address.aftersales_post_code,
|
afterSalesZip: ({ aftersales_address }) => aftersales_address.post_code,
|
||||||
aftersalesHours: ({ aftersales_address }) => aftersales_address.aftersales_hours,
|
aftersalesHours: ({ aftersales_address }) => aftersales_address.aftersales_hours,
|
||||||
refundFee: ({ refund_fee }) => refund_fee / 100,
|
refundFee: ({ refund_fee }) => refund_fee / 100,
|
||||||
sendbackData: 'sendback_data',
|
sendbackData: 'sendback_data',
|
||||||
|
|
|
||||||
|
|
@ -41,23 +41,23 @@ export default (props = {}) => {
|
||||||
// 隐私协议
|
// 隐私协议
|
||||||
// const checkResult = await checkPolicyChange()
|
// const checkResult = await checkPolicyChange()
|
||||||
// if (checkResult) {
|
// if (checkResult) {
|
||||||
// Taro.showLoading({ title: '' })
|
Taro.showLoading({ title: '' })
|
||||||
let code
|
let code
|
||||||
try {
|
try {
|
||||||
const { code: _code } = await getCode()
|
const { code: _code } = await getCode()
|
||||||
code = _code
|
code = _code
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Taro.hideLoading()
|
Taro.hideLoading()
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!code) {
|
if (!code) {
|
||||||
// Taro.hideLoading()
|
Taro.hideLoading()
|
||||||
setIsNewUser(true)
|
setIsNewUser(true)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const { token } = await getToken(code)
|
const { token } = await getToken(code)
|
||||||
// Taro.hideLoading()
|
Taro.hideLoading()
|
||||||
setToken(token)
|
setToken(token)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Taro.hideLoading()
|
Taro.hideLoading()
|
||||||
|
|
@ -91,6 +91,7 @@ export default (props = {}) => {
|
||||||
|
|
||||||
const setToken = async (token) => {
|
const setToken = async (token) => {
|
||||||
const { redirect_url } = $instance.router.params
|
const { redirect_url } = $instance.router.params
|
||||||
|
console.log('redirect_url', redirect_url)
|
||||||
S.setAuthToken(token)
|
S.setAuthToken(token)
|
||||||
setIsLogin(true)
|
setIsLogin(true)
|
||||||
await getUserInfo()
|
await getUserInfo()
|
||||||
|
|
@ -176,15 +177,15 @@ export default (props = {}) => {
|
||||||
*/
|
*/
|
||||||
const getUserInfoAuth = (validate = true) => {
|
const getUserInfoAuth = (validate = true) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
console.log('getUserInfoAuth:获取用户信息授权(小程序)')
|
||||||
const token = S.getAuthToken()
|
const token = S.getAuthToken()
|
||||||
console.log('getUserInfoAuth:获取用户信息授权(小程序)', token, userInfo)
|
|
||||||
if (!token && validate) {
|
if (!token && validate) {
|
||||||
showToast('请先登录')
|
showToast('请先登录')
|
||||||
return
|
return
|
||||||
// reject()
|
// reject()
|
||||||
}
|
}
|
||||||
if (isWeixin) {
|
if (isWeixin) {
|
||||||
const { avatar, username } = userInfo || {}
|
const { avatar, username } = userInfo
|
||||||
if (avatar && username) {
|
if (avatar && username) {
|
||||||
resolve()
|
resolve()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,6 @@ export default (props = {}) => {
|
||||||
paySuccess(params, orderInfo)
|
paySuccess(params, orderInfo)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Taro.hideLoading()
|
|
||||||
console.error(e)
|
console.error(e)
|
||||||
payError(orderInfo)
|
payError(orderInfo)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ export default class TradeRate extends Component {
|
||||||
item_id: 'item_id',
|
item_id: 'item_id',
|
||||||
item_spec_desc: 'item_spec_desc',
|
item_spec_desc: 'item_spec_desc',
|
||||||
pic_path: 'pic',
|
pic_path: 'pic',
|
||||||
title: ({ item_name, item_name_2 }) => item_name_2 || item_name,
|
title: 'item_name',
|
||||||
price: ({ item_fee }) => (+item_fee / 100).toFixed(2),
|
price: ({ item_fee }) => (+item_fee / 100).toFixed(2),
|
||||||
num: 'num',
|
num: 'num',
|
||||||
star: 0,
|
star: 0,
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,19 @@
|
||||||
@import '@/style/imports';
|
@import "@/style/imports";
|
||||||
|
|
||||||
.destory-member {
|
.destory-member {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
.sp-page-body {
|
|
||||||
padding: 0 20rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.title {
|
.title {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
padding: 50px 0px;
|
padding: 50px 0px;
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
// margin: 0px 20px;
|
margin: 0px 20px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 30px 45px;
|
padding: 30px 45px;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
box-shadow: 0px 2px 10px 0px #eae7e0;
|
box-shadow: 0px 2px 10px 0px #EAE7E0;
|
||||||
}
|
}
|
||||||
.margin {
|
.margin {
|
||||||
margin-bottom: 35px;
|
margin-bottom: 35px;
|
||||||
|
|
@ -40,9 +36,9 @@
|
||||||
}
|
}
|
||||||
.button {
|
.button {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
background: #f4811f;
|
background: #F4811F;
|
||||||
border-radius: 60px;
|
border-radius: 60px;
|
||||||
color: #ffffff;
|
color: #FFFFFF;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 100px auto 50px auto;
|
margin: 100px auto 50px auto;
|
||||||
padding: 15px 0px;
|
padding: 15px 0px;
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ export default class MemberCode extends Component {
|
||||||
return (
|
return (
|
||||||
<SpPage>
|
<SpPage>
|
||||||
<View className='member-code-wrap' style={
|
<View className='member-code-wrap' style={
|
||||||
styleNames({ //member-bg
|
styleNames({
|
||||||
background: `url(${process.env.APP_IMAGE_CDN_NEW}/member/member-bg.png) no-repeat`,
|
background: `url(${process.env.APP_IMAGE_CDN_NEW}/member/member-bg.png) no-repeat`,
|
||||||
"backgroundSize": "100% 100%"
|
"backgroundSize": "100% 100%"
|
||||||
})
|
})
|
||||||
|
|
@ -67,7 +67,7 @@ export default class MemberCode extends Component {
|
||||||
<View className='grade_name'>{gradeInfo.grade_name}</View>
|
<View className='grade_name'>{gradeInfo.grade_name}</View>
|
||||||
<View className='member-code-box'>
|
<View className='member-code-box'>
|
||||||
{/* <Image className='member-code-bar' mode='aspectFill' src={info.barcode_url} /> */}
|
{/* <Image className='member-code-bar' mode='aspectFill' src={info.barcode_url} /> */}
|
||||||
<SpImage className='member-code-box-logo' height={40} mode='aspectFit' src="member/logo-black.png" isNew />
|
<SpImage className='member-code-box-logo' width={214} mode='aspectFill' src="member/logo-lan.png" isNew />
|
||||||
<Image className='member-code-box-qr' mode='aspectFit' src={info.qrcode_url} />
|
<Image className='member-code-box-qr' mode='aspectFit' src={info.qrcode_url} />
|
||||||
{/* <View>{info.userCardCode}</View> */}
|
{/* <View>{info.userCardCode}</View> */}
|
||||||
<View className='member-code-box-txt'>向门店出示二维码</View>
|
<View className='member-code-box-txt'>向门店出示二维码</View>
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ function CompGoodsItem (props) {
|
||||||
<View className='goods-title' onClick={onChangeGoodsIsCheck}>
|
<View className='goods-title' onClick={onChangeGoodsIsCheck}>
|
||||||
{/* {info.activity_type == 'package' && <Text className='goods-title__tag'>组合商品</Text>} */}
|
{/* {info.activity_type == 'package' && <Text className='goods-title__tag'>组合商品</Text>} */}
|
||||||
{info.is_plus_buy && <Text className='goods-title__tag'>加价购</Text>}
|
{info.is_plus_buy && <Text className='goods-title__tag'>加价购</Text>}
|
||||||
{info.item_name_2 || info.item_name}
|
{info.item_name}
|
||||||
</View>
|
</View>
|
||||||
{isShowDeleteIcon && (
|
{isShowDeleteIcon && (
|
||||||
// <Text className='iconfont icon-shanchu-01' onClick={() => onDelete(info)}></Text>
|
// <Text className='iconfont icon-shanchu-01' onClick={() => onDelete(info)}></Text>
|
||||||
|
|
|
||||||
|
|
@ -112,8 +112,7 @@
|
||||||
}
|
}
|
||||||
.goods-title {
|
.goods-title {
|
||||||
@include multi-ellipsis(2);
|
@include multi-ellipsis(2);
|
||||||
// width: 300px;
|
width: 300px;
|
||||||
width: 360px;
|
|
||||||
&__tag {
|
&__tag {
|
||||||
/* prettier-ignore */
|
/* prettier-ignore */
|
||||||
border: 1PX solid var(--color-primary);
|
border: 1PX solid var(--color-primary);
|
||||||
|
|
|
||||||
|
|
@ -369,7 +369,7 @@ function CartCheckout (props) {
|
||||||
url: `/subpage/pages/trade/invoice-info?id=${totalInfo.tid || ''}`,
|
url: `/subpage/pages/trade/invoice-info?id=${totalInfo.tid || ''}`,
|
||||||
events: {
|
events: {
|
||||||
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
|
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
|
||||||
acceptDataFromOpenedPage: ({ data = {} }) => {
|
acceptDataFromOpenedPage: function ({ data = {} }) {
|
||||||
const { invoiceTitle } = data
|
const { invoiceTitle } = data
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
draft.invoiceTitle = invoiceTitle
|
draft.invoiceTitle = invoiceTitle
|
||||||
|
|
@ -377,9 +377,9 @@ function CartCheckout (props) {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
success: (res) => {
|
success: function (res) {
|
||||||
// 通过eventChannel向被打开页面传送数据
|
// 通过eventChannel向被打开页面传送数据
|
||||||
res.eventChannel.emit('acceptDataFromOpenerPage', { data: { ...totalInfo, invoiceTitle: state.invoiceTitle, paramsInfo: state.paramsInfo } })
|
res.eventChannel.emit('acceptDataFromOpenerPage', { data: totalInfo })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
|
@ -1096,7 +1096,7 @@ function CartCheckout (props) {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{process.env.NODE_ENV === "development" && !bargain_id && (
|
{!bargain_id && (
|
||||||
<View style={{ marginBottom: '40rpx' }}>
|
<View style={{ marginBottom: '40rpx' }}>
|
||||||
<SpCell
|
<SpCell
|
||||||
isLink
|
isLink
|
||||||
|
|
|
||||||
|
|
@ -81,16 +81,16 @@ function CartIndex () {
|
||||||
|
|
||||||
const getCartList = async () => {
|
const getCartList = async () => {
|
||||||
// Taro.showLoading({ title: '', })
|
// Taro.showLoading({ title: '', })
|
||||||
// setState((draft) => {
|
setState((draft) => {
|
||||||
// draft.loading = true
|
draft.loading = true
|
||||||
// })
|
})
|
||||||
const { type = 'distributor' } = router?.params || {}
|
const { type = 'distributor' } = router?.params || {}
|
||||||
const params = {
|
const params = {
|
||||||
shop_type: type
|
shop_type: type
|
||||||
}
|
}
|
||||||
await dispatch(fetchCartList(params))
|
await dispatch(fetchCartList(params))
|
||||||
await dispatch(updateCount(params))
|
await dispatch(updateCount(params))
|
||||||
Taro.hideLoading()
|
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
draft.loading = false
|
draft.loading = false
|
||||||
})
|
})
|
||||||
|
|
@ -188,10 +188,10 @@ function CartIndex () {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
const onChangeGoodsIsCheck = async (item, type, checked) => {
|
const onChangeGoodsIsCheck = async (item, type, checked) => {
|
||||||
Taro.showLoading({ title: '', mask: true })
|
// Taro.showLoading({ title: '' })
|
||||||
// setState((draft) => {
|
setState((draft) => {
|
||||||
// draft.loading = true
|
draft.loading = true
|
||||||
// })
|
})
|
||||||
let parmas = { is_checked: checked }
|
let parmas = { is_checked: checked }
|
||||||
if (type === 'all') {
|
if (type === 'all') {
|
||||||
const cartIds = item.list.map((item) => item.cart_id)
|
const cartIds = item.list.map((item) => item.cart_id)
|
||||||
|
|
@ -224,10 +224,9 @@ function CartIndex () {
|
||||||
|
|
||||||
const onChangeCartGoodsItem = useDebounce(async (item, num) => {
|
const onChangeCartGoodsItem = useDebounce(async (item, num) => {
|
||||||
console.log(`onChangeCartGoodsItem:`, num)
|
console.log(`onChangeCartGoodsItem:`, num)
|
||||||
// setState((draft) => {
|
setState((draft) => {
|
||||||
// draft.loading = true
|
draft.loading = true
|
||||||
// })
|
})
|
||||||
Taro.showLoading({ title: '', mask: true })
|
|
||||||
let { shop_id, cart_id } = item
|
let { shop_id, cart_id } = item
|
||||||
const { type = 'distributor' } = router.params
|
const { type = 'distributor' } = router.params
|
||||||
await dispatch(updateCartItemNum({ shop_id, cart_id, num, type }))
|
await dispatch(updateCartItemNum({ shop_id, cart_id, num, type }))
|
||||||
|
|
@ -294,7 +293,7 @@ function CartIndex () {
|
||||||
</SpLogin>
|
</SpLogin>
|
||||||
</View>
|
</View>
|
||||||
)} */}
|
)} */}
|
||||||
{!loading && isLogin && groupsList?.length > 0 && (
|
{isLogin && (
|
||||||
<View>
|
<View>
|
||||||
{/* <SpTabs current={current} tablist={tablist} onChange={onChangeSpTab} /> */}
|
{/* <SpTabs current={current} tablist={tablist} onChange={onChangeSpTab} /> */}
|
||||||
<View className='valid-cart-block'>
|
<View className='valid-cart-block'>
|
||||||
|
|
@ -472,16 +471,14 @@ function CartIndex () {
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* && invalidCart.length == 0 */}
|
{/* && invalidCart.length == 0 */}
|
||||||
{!loading && validCart.length == 0 && (
|
{validCart.length == 0 && (
|
||||||
<View className='empty-box'>
|
<View className='empty-box'>
|
||||||
{/* <SpDefault type='cart' message='购物车内暂无商品~'>
|
{/* <SpDefault type='cart' message='购物车内暂无商品~'>
|
||||||
<AtButton type='primary' circle onClick={navigateTo.bind(this, '/pages/index', true)}>
|
<AtButton type='primary' circle onClick={navigateTo.bind(this, '/pages/index', true)}>
|
||||||
去选购
|
去选购
|
||||||
</AtButton>
|
</AtButton>
|
||||||
</SpDefault> */}
|
</SpDefault> */}
|
||||||
<View className='default-img' style={{ height: '80px', width: '100%', display: 'flex', justifyContent: 'center' }} >
|
<SpImage className='default-img' src='cart/logo-hui.png' width={160} isNew />
|
||||||
<SpImage src='cart/logo-hui.png' width={160} isNew />
|
|
||||||
</View>
|
|
||||||
<View className="empty-box-tit">购物车还是空的</View>
|
<View className="empty-box-tit">购物车还是空的</View>
|
||||||
<View className="empty-box-sub-tit">快去挑选自己喜欢的宝贝吧~</View>
|
<View className="empty-box-sub-tit">快去挑选自己喜欢的宝贝吧~</View>
|
||||||
<SpLogin onChange={() => { }}>
|
<SpLogin onChange={() => { }}>
|
||||||
|
|
@ -535,9 +532,9 @@ function CartIndex () {
|
||||||
</sView>}
|
</sView>}
|
||||||
|
|
||||||
{/* 猜你喜欢 */}
|
{/* 猜你喜欢 */}
|
||||||
{/* <SpRecommend className='recommend-block' info={recommendList} /> */}
|
<SpRecommend className='recommend-block' info={recommendList} />
|
||||||
|
|
||||||
{/* <SpPrivacyModal open={policyModal} onCancel={onPolicyChange} onConfirm={onPolicyChange} /> */}
|
<SpPrivacyModal open={policyModal} onCancel={onPolicyChange} onConfirm={onPolicyChange} />
|
||||||
</SpPage>
|
</SpPage>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.default-img {
|
.sp-image {
|
||||||
margin-bottom: 50px;
|
margin-bottom: 50px;
|
||||||
}
|
}
|
||||||
.at-button {
|
.at-button {
|
||||||
|
|
|
||||||
|
|
@ -160,8 +160,8 @@ const CompSeries = (props) => {
|
||||||
</View>
|
</View>
|
||||||
<SpImage
|
<SpImage
|
||||||
className={classNames(imgType ? 'cat-img' : 'cat-img-no')}
|
className={classNames(imgType ? 'cat-img' : 'cat-img-no')}
|
||||||
mode={currentID === '18' ? 'aspectFill' : 'widthFix'}
|
mode={currentID === '18' ? 'aspectFill' : 'aspectFit'}
|
||||||
height={currentID === '18' ? 350 : windowWidth > 375 ? 278 : 242}
|
height={currentID === '18' ? 350 : windowWidth > 400 ? 278 : 242}
|
||||||
src={item.img}
|
src={item.img}
|
||||||
/>
|
/>
|
||||||
</View> : <View
|
</View> : <View
|
||||||
|
|
|
||||||
|
|
@ -60,14 +60,6 @@ page {
|
||||||
/* #endif */
|
/* #endif */
|
||||||
}
|
}
|
||||||
.content-box {
|
.content-box {
|
||||||
--height: calc(var(--status-bar-height) + #{$tabbar-height} + var(--area-bottom-height));
|
|
||||||
.fadeIn {
|
|
||||||
animation: fadeInAnimation 0.25s ease-in;
|
|
||||||
}
|
|
||||||
&.content-box-ovh {
|
|
||||||
overflow: hidden;
|
|
||||||
height: calc(100vh - var(--height));
|
|
||||||
}
|
|
||||||
.swiper-wapper {
|
.swiper-wapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
|
|
@ -77,12 +69,10 @@ page {
|
||||||
}
|
}
|
||||||
.swiper {
|
.swiper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
// height: calc(100vh - #{$page-ipx-footer-height} - var(--status-bar-height));
|
height: calc(100vh - #{$page-ipx-footer-height} - var(--status-bar-height));
|
||||||
height: calc(100vh - var(--height));
|
// height: calc(100vh - #{$tabbar-height});
|
||||||
transition: height 0.2s linear;
|
transition: height 0.3s ease-in-out;
|
||||||
animation: fadeInAnimation 0.25s ease-in;
|
animation: fadeInAnimation 0.35s ease-in;
|
||||||
transform: translateZ(0);
|
|
||||||
overflow: hidden;
|
|
||||||
// &.swiper-narrow {
|
// &.swiper-narrow {
|
||||||
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
|
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
|
||||||
// }
|
// }
|
||||||
|
|
@ -92,10 +82,9 @@ page {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, 0%);
|
transform: translate(-50%, 0%);
|
||||||
transform: translateZ(-1);
|
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
z-index: 999;
|
z-index: 99;
|
||||||
animation: fadeInAnimation 0.3s ease-in;
|
animation: fadeInAnimation 0.35s ease-in;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
@ -114,10 +103,10 @@ page {
|
||||||
margin-bottom: 6px;
|
margin-bottom: 6px;
|
||||||
}
|
}
|
||||||
.swiper-narrow {
|
.swiper-narrow {
|
||||||
|
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
|
||||||
|
height: calc(100vh - 420px - #{$tabbar-height} - var(--status-bar-height));
|
||||||
|
transition: height 0.35s linear;
|
||||||
margin-top: -200px;
|
margin-top: -200px;
|
||||||
height: calc(100vh - 386px - var(--height));
|
|
||||||
// transform: translateY(-520px);
|
|
||||||
// transition: all 0.25s ease-in;
|
|
||||||
}
|
}
|
||||||
.item-btns {
|
.item-btns {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -155,7 +144,7 @@ page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.spot-pagination {
|
.spot-pagination {
|
||||||
animation: fadeInAnimation 0.3s ease-in;
|
animation: fadeInAnimation 0.35s ease-in;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
|
@ -167,15 +156,14 @@ page {
|
||||||
.spot-pagination-bullet {
|
.spot-pagination-bullet {
|
||||||
// margin-right: 5px;
|
// margin-right: 5px;
|
||||||
// border-radius: 20%;
|
// border-radius: 20%;
|
||||||
height: 6px;
|
height: 4px;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
background: #d9d9d9;
|
background: #ddd;
|
||||||
transition: all 0.3s ease-in-out 0s;
|
transition: all 0.3s ease-in-out 0s;
|
||||||
}
|
}
|
||||||
// 当前指示点样式
|
// 当前指示点样式
|
||||||
.spot-pagination-bullet-active {
|
.spot-pagination-bullet-active {
|
||||||
// background: #fff;
|
background: #fff;
|
||||||
background: #818181;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.icon-kf {
|
.icon-kf {
|
||||||
|
|
@ -192,68 +180,6 @@ page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.item-btns {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-start;
|
|
||||||
position: absolute;
|
|
||||||
left: 66px;
|
|
||||||
bottom: 170px;
|
|
||||||
z-index: 10;
|
|
||||||
// justify-content: flex-start;
|
|
||||||
.item-tit {
|
|
||||||
font-size: 42px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 36px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.item-btn {
|
|
||||||
// width: 180px;
|
|
||||||
// height: 56px;
|
|
||||||
padding: 20rpx 90rpx 20rpx 50rpx;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 28px;
|
|
||||||
border-radius: 10px;
|
|
||||||
background-color: #00000085;
|
|
||||||
border-width: 2px;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: #fff;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 22px;
|
|
||||||
line-height: 1;
|
|
||||||
transition: all 0.3s ease-in-out;
|
|
||||||
position: relative;
|
|
||||||
.icon-my {
|
|
||||||
font-size: 28px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-left: 16px;
|
|
||||||
}
|
|
||||||
.jiantou {
|
|
||||||
height: 50rpx;
|
|
||||||
width: 100rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.mutedBtn {
|
|
||||||
animation: fadeInAnimation 0.3s ease-in;
|
|
||||||
// background-color: #fff;
|
|
||||||
width: 100px;
|
|
||||||
height: 100px;
|
|
||||||
border-radius: 50%;
|
|
||||||
position: absolute;
|
|
||||||
right: 30px;
|
|
||||||
bottom: 30px;
|
|
||||||
z-index: 100;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
.muted-icon {
|
|
||||||
width: 60rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.shop-box {
|
.shop-box {
|
||||||
height: 520px;
|
height: 520px;
|
||||||
|
|
@ -343,7 +269,6 @@ page {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10%;
|
bottom: 10%;
|
||||||
opacity: 0;
|
|
||||||
&-title {
|
&-title {
|
||||||
font-size: 40px;
|
font-size: 40px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,7 @@ import {
|
||||||
SpNavBar,
|
SpNavBar,
|
||||||
SpImage,
|
SpImage,
|
||||||
SpGoodsItem,
|
SpGoodsItem,
|
||||||
SpChat,
|
SpChat
|
||||||
SpLogin
|
|
||||||
} from '@/components'
|
} from '@/components'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import {
|
import {
|
||||||
|
|
@ -104,9 +103,7 @@ const initialState = {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
goodList: [],
|
goodList: [],
|
||||||
recommend: [],
|
recommend: []
|
||||||
activeInfo: {},
|
|
||||||
muted: true,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Home () {
|
function Home () {
|
||||||
|
|
@ -114,7 +111,6 @@ function Home () {
|
||||||
const [startY, setStartY] = useState(0)
|
const [startY, setStartY] = useState(0)
|
||||||
const [startX, setStartX] = useState(0)
|
const [startX, setStartX] = useState(0)
|
||||||
const [likeList, setLikeList] = useImmer([])
|
const [likeList, setLikeList] = useImmer([])
|
||||||
const { isLogin, isNewUser } = useLogin()
|
|
||||||
|
|
||||||
const { initState, openRecommend, openLocation, openStore, appName, openScanQrcode } = useSelector(
|
const { initState, openRecommend, openLocation, openStore, appName, openScanQrcode } = useSelector(
|
||||||
(state) => state.sys
|
(state) => state.sys
|
||||||
|
|
@ -142,17 +138,17 @@ function Home () {
|
||||||
}
|
}
|
||||||
}, [initState])
|
}, [initState])
|
||||||
|
|
||||||
// useEffect(() => {
|
useEffect(() => {
|
||||||
// if (shopInfo && VERSION_STANDARD) {
|
if (shopInfo && VERSION_STANDARD) {
|
||||||
// fetchWgts()
|
fetchWgts()
|
||||||
// }
|
}
|
||||||
// }, [shopInfo])
|
}, [shopInfo])
|
||||||
|
|
||||||
// useEffect(() => {
|
useEffect(() => {
|
||||||
// if (location && VERSION_STANDARD) {
|
if (location && VERSION_STANDARD) {
|
||||||
// fetchWgts()
|
fetchWgts()
|
||||||
// }
|
}
|
||||||
// }, [location])
|
}, [location])
|
||||||
|
|
||||||
useShareAppMessage(async (res) => {
|
useShareAppMessage(async (res) => {
|
||||||
const { title, imageUrl } = await api.wx.shareSetting({ shareindex: 'index' })
|
const { title, imageUrl } = await api.wx.shareSetting({ shareindex: 'index' })
|
||||||
|
|
@ -191,7 +187,7 @@ function Home () {
|
||||||
fetchLocation()
|
fetchLocation()
|
||||||
// 非云店
|
// 非云店
|
||||||
if (!VERSION_STANDARD) {
|
if (!VERSION_STANDARD) {
|
||||||
// fetchWgts()
|
fetchWgts()
|
||||||
} else {
|
} else {
|
||||||
fetchStoreInfo(location)
|
fetchStoreInfo(location)
|
||||||
}
|
}
|
||||||
|
|
@ -208,49 +204,9 @@ function Home () {
|
||||||
// goodsSort: 6,
|
// goodsSort: 6,
|
||||||
distributor_id: 0
|
distributor_id: 0
|
||||||
}
|
}
|
||||||
// const { list: jdList } = await api.item.search({ ...req, tag_id: 1 })
|
const { list: jdList } = await api.item.search({ ...req, tag_id: 1 })
|
||||||
const { list: newList = [] } = await api.item.search({ ...req, tag_id: 4 })
|
const { list: newList } = await api.item.search({ ...req, tag_id: 2 })
|
||||||
const { list: hotList = [] } = await api.item.search({ ...req, tag_id: 3 })
|
const { list: hotList } = await api.item.search({ ...req, tag_id: 3 })
|
||||||
const { list: BOSTON_List = [] } = await api.item.search({ ...req, tag_id: 5 })
|
|
||||||
const { list: ARIZONA_List = [] } = await api.item.search({ ...req, tag_id: 6 })
|
|
||||||
const { list: LONDON_List = [] } = await api.item.search({ ...req, tag_id: 7 })
|
|
||||||
const newSort = {
|
|
||||||
"BK023": 1,
|
|
||||||
"BK066": 2,
|
|
||||||
"BK053": 3,
|
|
||||||
"BK038": 4,
|
|
||||||
"BK064": 5,
|
|
||||||
"BK014": 6
|
|
||||||
}
|
|
||||||
const hotSort = {
|
|
||||||
"BK014": 1,
|
|
||||||
"BK031": 2,
|
|
||||||
"BK018": 3,
|
|
||||||
"BK020": 4,
|
|
||||||
"BK052": 5,
|
|
||||||
"BK064": 6,
|
|
||||||
}
|
|
||||||
const BOSTON_sort = {
|
|
||||||
"BK020": 1,
|
|
||||||
"BK023": 2,
|
|
||||||
"BK025": 3,
|
|
||||||
"BK029": 4,
|
|
||||||
"BK030": 5,
|
|
||||||
"BK031": 6,
|
|
||||||
}
|
|
||||||
const ARIZONA_sort = {
|
|
||||||
"BK001": 1,
|
|
||||||
"BK017": 2,
|
|
||||||
"BK007": 3,
|
|
||||||
"BK010": 4,
|
|
||||||
"BK011": 5,
|
|
||||||
"BK014": 6,
|
|
||||||
}
|
|
||||||
const LONDON_sort = {
|
|
||||||
"BK052": 1,
|
|
||||||
"BK053": 2,
|
|
||||||
"BK051": 3,
|
|
||||||
}
|
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
draft.recommend = [{
|
draft.recommend = [{
|
||||||
type: 'new',
|
type: 'new',
|
||||||
|
|
@ -258,100 +214,35 @@ function Home () {
|
||||||
btnTxt: '查看更多',
|
btnTxt: '查看更多',
|
||||||
postions: 'left',
|
postions: 'left',
|
||||||
url: '',
|
url: '',
|
||||||
tag_id: 4,
|
img: 'index/rec/new.png',
|
||||||
img: 'index/rec/new.png?v=1',
|
list: newList.map(item => ({ ...item, price: (item.price / 100) }))
|
||||||
list: newList.map(item => ({ ...item, price: (item.price / 100) })).sort((a, b) => {
|
|
||||||
return newSort[a.item_name_3] - newSort[b.item_name_3]
|
|
||||||
})
|
|
||||||
}, {
|
}, {
|
||||||
type: 'hot',
|
type: 'hot',
|
||||||
text: "热销单品",
|
text: "热销单品",
|
||||||
btnTxt: '查看更多',
|
btnTxt: '查看更多',
|
||||||
postions: 'left',
|
postions: 'left',
|
||||||
url: '',
|
url: '',
|
||||||
tag_id: 3,
|
img: 'index/rec/hot.png',
|
||||||
img: 'index/rec/hot.png?v=1',
|
list: hotList.map(item => ({ ...item, price: (item.price / 100) }))
|
||||||
list: hotList.map(item => ({ ...item, price: (item.price / 100) })).sort((a, b) => {
|
|
||||||
return hotSort[a.item_name_3] - hotSort[b.item_name_3]
|
|
||||||
})
|
|
||||||
}, {
|
}, {
|
||||||
type: 'BOSTON',
|
type: 'jd',
|
||||||
text: "BOSTON",
|
|
||||||
btnTxt: 'BOSTON',
|
|
||||||
postions: 'left',
|
|
||||||
url: '',
|
|
||||||
tag_id: 5,
|
|
||||||
img: 'index/rec/Boston.png',
|
|
||||||
list: BOSTON_List.map(item => ({ ...item, price: (item.price / 100) })).sort((a, b) => {
|
|
||||||
return BOSTON_sort[a.item_name_3] - BOSTON_sort[b.item_name_3]
|
|
||||||
})
|
|
||||||
}, {
|
|
||||||
type: 'ARIZONA',
|
|
||||||
text: "ARIZONA",
|
text: "ARIZONA",
|
||||||
btnTxt: 'ARIZONA',
|
btnTxt: '经典双扣',
|
||||||
|
postions: 'right',
|
||||||
url: '',
|
url: '',
|
||||||
postions: 'left',
|
img: 'index/rec/jd.png',
|
||||||
tag_id: 6,
|
list: jdList.map(item => ({ ...item, price: (item.price / 100) }))
|
||||||
img: 'index/rec/Arizona.png',
|
|
||||||
list: ARIZONA_List.map(item => ({ ...item, price: (item.price / 100) })).sort((a, b) => {
|
|
||||||
return ARIZONA_sort[a.item_name_3] - ARIZONA_sort[b.item_name_3]
|
|
||||||
})
|
|
||||||
}, {
|
|
||||||
type: 'LONDON',
|
|
||||||
text: "LONDON",
|
|
||||||
btnTxt: 'LONDON',
|
|
||||||
url: '',
|
|
||||||
postions: 'left',
|
|
||||||
tag_id: 7,
|
|
||||||
img: 'index/rec/London.png',
|
|
||||||
list: LONDON_List.map(item => ({ ...item, price: (item.price / 100) })).sort((a, b) => {
|
|
||||||
return LONDON_sort[a.item_name_3] - LONDON_sort[b.item_name_3]
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
// bak
|
|
||||||
// draft.recommend = [{
|
|
||||||
// type: 'new',
|
|
||||||
// text: "新品推荐",
|
|
||||||
// btnTxt: '查看更多',
|
|
||||||
// postions: 'left',
|
|
||||||
// url: '',
|
|
||||||
// img: 'index/rec/new.png',
|
|
||||||
// list: newList.map(item => ({ ...item, price: (item.price / 100) }))
|
|
||||||
// }, {
|
|
||||||
// type: 'hot',
|
|
||||||
// text: "热销单品",
|
|
||||||
// btnTxt: '查看更多',
|
|
||||||
// postions: 'left',
|
|
||||||
// url: '',
|
|
||||||
// img: 'index/rec/hot.png',
|
|
||||||
// list: hotList.map(item => ({ ...item, price: (item.price / 100) }))
|
|
||||||
// }, {
|
|
||||||
// type: 'jd',
|
|
||||||
// text: "ARIZONA",
|
|
||||||
// btnTxt: '经典双扣',
|
|
||||||
// postions: 'right',
|
|
||||||
// url: '',
|
|
||||||
// img: 'index/rec/jd.png',
|
|
||||||
// list: jdList.map(item => ({ ...item, price: (item.price / 100) }))
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getSwiperList = async () => {
|
const getSwiperList = async () => {
|
||||||
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 res = await api.shop.homeSwiperList({ page: 1, pageSize: 999 })
|
||||||
const list = (res?.list?.map((item) => {
|
const list = res?.list?.map((item) => {
|
||||||
return {
|
return {
|
||||||
type: item.type || 'image',
|
type: item.type || 'image',
|
||||||
src: item.pic,
|
src: item.pic,
|
||||||
sort: item.sort,
|
|
||||||
goods: (item.goods_info_detail || []).map((ite) => {
|
goods: (item.goods_info_detail || []).map((ite) => {
|
||||||
return {
|
return {
|
||||||
itemName: ite.item_name,
|
itemName: ite.item_name,
|
||||||
|
|
@ -365,24 +256,10 @@ 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) => {
|
setState((draft) => {
|
||||||
draft.swiperList = _swiperList
|
draft.swiperList = list
|
||||||
draft.goodList = _swiperList[0].goods || []
|
draft.goodList = list[0].goods || []
|
||||||
draft.loading = false
|
|
||||||
draft.activeInfo = {
|
|
||||||
...activity_info,
|
|
||||||
total_count,
|
|
||||||
status
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -460,6 +337,7 @@ function Home () {
|
||||||
// params.distributor_id = undefined
|
// params.distributor_id = undefined
|
||||||
}
|
}
|
||||||
const res = await api.shop.getShop(params)
|
const res = await api.shop.getShop(params)
|
||||||
|
console.log('fetchStoreInfo:', res)
|
||||||
dispatch(updateShopInfo(res))
|
dispatch(updateShopInfo(res))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -474,6 +352,7 @@ function Home () {
|
||||||
const deltaY = clientY - startY
|
const deltaY = clientY - startY
|
||||||
const deltaX = clientX - startX
|
const deltaX = clientX - startX
|
||||||
if (Math.abs(deltaY) < 50) return
|
if (Math.abs(deltaY) < 50) return
|
||||||
|
|
||||||
if (deltaY > 0) {
|
if (deltaY > 0) {
|
||||||
// 下滑操作
|
// 下滑操作
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
|
|
@ -488,7 +367,6 @@ function Home () {
|
||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
} else if (deltaY < 0) {
|
} else if (deltaY < 0) {
|
||||||
if (goodList?.length == 0) return
|
|
||||||
// 上滑操作
|
// 上滑操作
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
draft.showBottom = true
|
draft.showBottom = true
|
||||||
|
|
@ -498,50 +376,16 @@ function Home () {
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
draft.showRecommend = true
|
draft.showRecommend = true
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 500)
|
||||||
if (!state.showBottom) {
|
if (!state.showBottom) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const [recommendTouch, setRecommendTouch] = useImmer({
|
|
||||||
recommendStartY: 0,
|
|
||||||
recommendStartX: 0,
|
|
||||||
recommendEndY: 0,
|
|
||||||
recommendEndX: 0,
|
|
||||||
})
|
|
||||||
const onRecommendTouch = (e) => {
|
|
||||||
const { clientY, clientX } = e.touches[0]
|
|
||||||
setRecommendTouch(v => v.recommendStartX = clientX)
|
|
||||||
setRecommendTouch(v => v.recommendStartY = clientY)
|
|
||||||
}
|
|
||||||
const onRecommendTouchEnd = (e) => {
|
|
||||||
const { clientY, clientX } = e.changedTouches[0]
|
|
||||||
const { recommendStartY, recommendStartX } = recommendTouch
|
|
||||||
const deltaY = clientY - recommendStartY
|
|
||||||
const deltaX = clientX - recommendStartX
|
|
||||||
if (Math.abs(deltaY) < 50) return
|
|
||||||
if (deltaY > 0) {
|
|
||||||
// 下滑操作
|
|
||||||
console.log("🚀 ~ file: index.js:456 ~ 下滑操作:", '下滑操作')
|
|
||||||
} else if (deltaY < 0) {
|
|
||||||
// 上滑操作
|
|
||||||
console.log("🚀 ~ file: index.js:460 ~ 上滑操作:", '上滑操作')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const onSwiperChange = (e) => {
|
const onSwiperChange = (e) => {
|
||||||
const { current } = e.detail
|
const { current } = e.detail
|
||||||
const _goodList = swiperList[current].goods || []
|
|
||||||
if (current === 0 || _goodList.length === 0) {
|
|
||||||
setState((draft) => {
|
|
||||||
draft.showBottom = false
|
|
||||||
draft.isUpOperation = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
draft.currentIndex = current
|
draft.currentIndex = current
|
||||||
draft.goodList = _goodList
|
draft.goodList = swiperList[current].goods || []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -552,31 +396,7 @@ function Home () {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const { activeInfo = {}, currentIndex } = state
|
|
||||||
|
|
||||||
const handleApply = () => {
|
|
||||||
// if (!isLogin) return
|
|
||||||
let url = '/pages/recommend/detail?id='
|
|
||||||
if (activeInfo.total_count) {
|
|
||||||
url = `/pages/recommend/status?id=`
|
|
||||||
}
|
|
||||||
Taro.navigateTo({
|
|
||||||
url: url + activeInfo.activity_id
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleGoRecommendGoods = (item) => {
|
|
||||||
const url = `/pages/item/list?tag_id=${item.tag_id || ''}`
|
|
||||||
Taro.navigateTo({
|
|
||||||
url: url
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const indexUrl = 'https://mp.weixin.qq.com/s/LBXthKa-P9gNK8FCv3n1pA'
|
|
||||||
const handleGoWx = () => {
|
|
||||||
return handleApply()
|
|
||||||
Taro.navigateTo({ url: '/pages/webview?url=' + encodeURIComponent(indexUrl) })
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<SpPage
|
<SpPage
|
||||||
className='page-index'
|
className='page-index'
|
||||||
|
|
@ -589,7 +409,7 @@ function Home () {
|
||||||
isTop={!isUpOperation}
|
isTop={!isUpOperation}
|
||||||
isBlack
|
isBlack
|
||||||
>
|
>
|
||||||
{false && <View
|
<View
|
||||||
className={classNames('home-body', {
|
className={classNames('home-body', {
|
||||||
'has-home-header': isShowHomeHeader && isWeixin
|
'has-home-header': isShowHomeHeader && isWeixin
|
||||||
})}
|
})}
|
||||||
|
|
@ -601,20 +421,18 @@ function Home () {
|
||||||
<SpRecommend className='recommend-block' info={likeList} />
|
<SpRecommend className='recommend-block' info={likeList} />
|
||||||
</HomeWgts>
|
</HomeWgts>
|
||||||
}
|
}
|
||||||
</View>}
|
</View>
|
||||||
|
|
||||||
{/* 小程序搜藏提示 */}
|
{/* 小程序搜藏提示 */}
|
||||||
{/* {isWeixin && <MCompAddTip />} */}
|
{isWeixin && <MCompAddTip />}
|
||||||
|
|
||||||
{/* 开屏广告 */}
|
{/* 开屏广告 */}
|
||||||
{/* {isWeixin && !showAdv && <SpScreenAd />} */}
|
{isWeixin && !showAdv && <SpScreenAd />}
|
||||||
|
|
||||||
{/* 优惠券包 */}
|
{/* 优惠券包 */}
|
||||||
{/* {VERSION_STANDARD && <SpCouponPackage />} */}
|
{VERSION_STANDARD && <SpCouponPackage />}
|
||||||
|
|
||||||
<View className={classNames('content-box', {
|
<View className="content-box">
|
||||||
// 'content-box-ovh': !isUpOperation
|
|
||||||
})}>
|
|
||||||
<View className="swiper-wapper" onTouchStart={handleTouchStart} onTouchEnd={handleTouchEnd}>
|
<View className="swiper-wapper" onTouchStart={handleTouchStart} onTouchEnd={handleTouchEnd}>
|
||||||
{/* <ScrollView
|
{/* <ScrollView
|
||||||
className='swiper-wapper'
|
className='swiper-wapper'
|
||||||
|
|
@ -640,14 +458,13 @@ function Home () {
|
||||||
duration={800}
|
duration={800}
|
||||||
// indicatorDots
|
// indicatorDots
|
||||||
circular
|
circular
|
||||||
autoplay={process.env.NODE_ENV === 'development' ? false : !isUpOperation}
|
autoplay={!isUpOperation}
|
||||||
onChange={onSwiperChange}
|
onChange={onSwiperChange}
|
||||||
>
|
>
|
||||||
{state.swiperList.map((item, index) => (
|
{state.swiperList.map((item, index) => (
|
||||||
<SwiperItem key={index} className="" style={{ height: "100%" }}>
|
<SwiperItem key={index} className="" style={{ height: "100%" }}>
|
||||||
{item.type === "image" && (
|
{item.type === "image" && (
|
||||||
<Image
|
<Image
|
||||||
onClick={item.onClick}
|
|
||||||
src={item.src}
|
src={item.src}
|
||||||
style={{ width: "100%", height: "100%", objectPosition: "center" }}
|
style={{ width: "100%", height: "100%", objectPosition: "center" }}
|
||||||
mode={isUpOperation ? 'aspectFill' : 'aspectFill'}
|
mode={isUpOperation ? 'aspectFill' : 'aspectFill'}
|
||||||
|
|
@ -664,7 +481,7 @@ function Home () {
|
||||||
controls={false}
|
controls={false}
|
||||||
autoplay={true}
|
autoplay={true}
|
||||||
loop={true}
|
loop={true}
|
||||||
muted={state.muted}
|
muted={true}
|
||||||
showProgress={false}
|
showProgress={false}
|
||||||
showFullscreenBtn={false}
|
showFullscreenBtn={false}
|
||||||
showPlayBtn={false}
|
showPlayBtn={false}
|
||||||
|
|
@ -687,36 +504,18 @@ function Home () {
|
||||||
<View className="item-btn-icon icon-my icon-arrow-right"></View>
|
<View className="item-btn-icon icon-my icon-arrow-right"></View>
|
||||||
</View>
|
</View>
|
||||||
</View>} */}
|
</View>} */}
|
||||||
{!isUpOperation && item.type === "video" && <View className="mutedBtn" onClick={() => setState(v => { v.muted = !state.muted })} >
|
|
||||||
<Image className="muted-icon" src={`${process.env.APP_IMAGE_CDN_NEW}/index/${state.muted ? 'muted' : 'muted-no'}.jpg`}></Image>
|
|
||||||
</View>}
|
|
||||||
</SwiperItem>
|
</SwiperItem>
|
||||||
))}
|
))}
|
||||||
</Swiper>
|
</Swiper>
|
||||||
{!isUpOperation && currentIndex === 0 ? <View className="item-btns" style="left: 220rpx;
|
{!isUpOperation && <View className="item-img-box">
|
||||||
bottom: 180rpx;" >
|
<View className="item-img-txt">滑 动 探 索</View>
|
||||||
{<View onClick={handleGoWx} className="item-btn" style={{ padding: '50rpx 156rpx', opacity: 0, background: 'transparent', border: 'none' }} >
|
<Image className="item-img" height="62" src={require('../assets/i-sou.gif')} isShowMenuByLongpress={false} lazyLoad isNew={false} />
|
||||||
<View className="item-btn-txt"></View>
|
</View>}
|
||||||
</View>}
|
{!isUpOperation && <View className='spot-pagination'>
|
||||||
</View> : null}
|
{swiperList.map((_, index) => (
|
||||||
{!isUpOperation && <>
|
<View key={index} className={'spot-pagination-bullet ' + ((state.currentIndex == index) ? 'spot-pagination-bullet-active' : "")} style={{ width: 1 / state.length * 100 + '%' }}></View>
|
||||||
{/* currentIndex === -1 ? <View className="item-btns">
|
))}
|
||||||
<View className="item-tit">{activeInfo.activity_name}</View>
|
</View>}
|
||||||
{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>
|
|
||||||
</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>}
|
|
||||||
<View className='spot-pagination'>
|
|
||||||
{swiperList.map((_, index) => (
|
|
||||||
<View key={index} className={'spot-pagination-bullet ' + ((state.currentIndex == index) ? 'spot-pagination-bullet-active' : "")} style={{ width: 1 / state.length * 100 + '%' }}></View>
|
|
||||||
))}
|
|
||||||
</View>
|
|
||||||
</>}
|
|
||||||
{isUpOperation && <View className="icon-kf">
|
{isUpOperation && <View className="icon-kf">
|
||||||
<SpChat><SpImage height="62" src='index/kf.png' isShowMenuByLongpress={false} lazyLoad isNew /></SpChat>
|
<SpChat><SpImage height="62" src='index/kf.png' isShowMenuByLongpress={false} lazyLoad isNew /></SpChat>
|
||||||
</View>}
|
</View>}
|
||||||
|
|
@ -733,14 +532,14 @@ function Home () {
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
</ScrollView>}
|
</ScrollView>}
|
||||||
{/* 推荐图片+商品 isUpOperation && */}
|
{/* 推荐图片+商品 */}
|
||||||
{isUpOperation && showRecommend && <>
|
{isUpOperation && <>
|
||||||
{recommend.length > 0 && recommend.map((_item, id) => <View key={id + '__item'} className="fadeIn" >
|
{recommend.length > 0 && recommend.map((_item, id) => <View key={id + '__item'}>
|
||||||
<SpImage width={windowWidth * 2} height={windowWidth >= 400 ? 920 : 800} mode='scaleToFill' src={_item.img} isShowMenuByLongpress={false} lazyLoad isNew >
|
<SpImage width={windowWidth * 2} height={windowWidth >= 400 ? 920 : 800} mode='scaleToFill' src={_item.img} isShowMenuByLongpress={false} lazyLoad isNew >
|
||||||
<View onClick={() => handleGoRecommendGoods(_item)} className="recommend_btn" style={{ [_item.postions]: '70rpx', opacity: 0 }}>
|
{/* <View className="recommend_btn" style={{ [_item.postions]: '70rpx' }}>
|
||||||
<View className="recommend_btn-title">{_item.text}</View>
|
<View className="recommend_btn-title">{_item.text}</View>
|
||||||
<View className="recommend_btn-btn">{_item.btnTxt}</View>
|
<View className="recommend_btn-btn">{_item.btnTxt}</View>
|
||||||
</View>
|
</View> */}
|
||||||
</SpImage>
|
</SpImage>
|
||||||
<ScrollView scrollX scrollWithAnimation showScrollbar={true} scrollLeft={0} className="shop-box fadeIn" >
|
<ScrollView scrollX scrollWithAnimation showScrollbar={true} scrollLeft={0} className="shop-box fadeIn" >
|
||||||
{_item.list?.map((item, idx) => (
|
{_item.list?.map((item, idx) => (
|
||||||
|
|
|
||||||
|
|
@ -1,773 +0,0 @@
|
||||||
import React, { useEffect, useState, useCallback } from 'react'
|
|
||||||
import Taro, {
|
|
||||||
getCurrentInstance,
|
|
||||||
useShareAppMessage,
|
|
||||||
useShareTimeline,
|
|
||||||
useDidShow,
|
|
||||||
usePageScroll,
|
|
||||||
usePullDownRefresh
|
|
||||||
} from '@tarojs/taro'
|
|
||||||
import { View, Image, Swiper, SwiperItem, Video, ScrollView } from '@tarojs/components'
|
|
||||||
import { useSelector, useDispatch } from 'react-redux'
|
|
||||||
import {
|
|
||||||
SpScreenAd,
|
|
||||||
SpPage,
|
|
||||||
SpSearch,
|
|
||||||
SpRecommend,
|
|
||||||
SpTabbar,
|
|
||||||
SpCouponPackage,
|
|
||||||
SpNavBar,
|
|
||||||
SpImage,
|
|
||||||
SpGoodsItem,
|
|
||||||
SpChat,
|
|
||||||
SpLogin
|
|
||||||
} from '@/components'
|
|
||||||
import api from '@/api'
|
|
||||||
import {
|
|
||||||
isWeixin,
|
|
||||||
isAPP,
|
|
||||||
isEmpty,
|
|
||||||
getDistributorId,
|
|
||||||
VERSION_STANDARD,
|
|
||||||
VERSION_PLATFORM,
|
|
||||||
VERSION_IN_PURCHASE,
|
|
||||||
VERSION_B2C,
|
|
||||||
classNames,
|
|
||||||
getCurrentPageRouteParams,
|
|
||||||
resolveStringifyParams
|
|
||||||
} from '@/utils'
|
|
||||||
import entryLaunch from '@/utils/entryLaunch'
|
|
||||||
import { updateLocation } from '@/store/slices/user'
|
|
||||||
import { updateShopInfo } from '@/store/slices/shop'
|
|
||||||
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 './home/index.scss'
|
|
||||||
// const MCompAddTip = React.memo(CompAddTip)
|
|
||||||
|
|
||||||
const initialState = {
|
|
||||||
wgts: [],
|
|
||||||
showBackToTop: false,
|
|
||||||
loading: false,
|
|
||||||
searchComp: null,
|
|
||||||
pageData: null,
|
|
||||||
fixedTop: false,
|
|
||||||
filterWgts: [],
|
|
||||||
isShowHomeHeader: false,
|
|
||||||
swiperList: [],
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
type: 'image',
|
|
||||||
src: process.env.APP_IMAGE_CDN_NEW + '/index/22.jpg'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'image',
|
|
||||||
// src: '//img10.360buyimg.com/ling/jfs/t1/181258/24/10385/53029/60d04978Ef21f2d42/92baeb21f907cd24.jpg'
|
|
||||||
src: process.env.APP_IMAGE_CDN_NEW + '/index/33.jpg'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'video',
|
|
||||||
src: 'https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets/index/video-1.mp4'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
length: 2,
|
|
||||||
showBottom: false,
|
|
||||||
scrollTop: 0,
|
|
||||||
isUpOperation: false,
|
|
||||||
showRecommend: false,
|
|
||||||
currentIndex: 0,
|
|
||||||
shopList: [
|
|
||||||
{
|
|
||||||
brief: "副标题",
|
|
||||||
itemName: "测试商品1",
|
|
||||||
price: "1099",
|
|
||||||
goods_id: 6,
|
|
||||||
pic: 'https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/image/1/2024/01/15/46fe6ca52277038e39ee2c026a4af3c9xHQuJ96YIcZWtjRS0HBCTzp7dzXIs2pl'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
brief: "副标题",
|
|
||||||
itemName: "测试商品2",
|
|
||||||
price: "1099",
|
|
||||||
goods_id: 6,
|
|
||||||
pic: 'https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/image/1/2024/01/15/801c18d59d95ea26930fefc43bf66febTQjxb65cpnCqVLaOsYmiHdkDdYqBnXVm'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
brief: "副标题",
|
|
||||||
itemName: "测试商品3",
|
|
||||||
price: "1099",
|
|
||||||
goods_id: 6,
|
|
||||||
pic: 'https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/image/1/2024/01/15/46fe6ca52277038e39ee2c026a4af3c90XruENsSSAhRiz0HPI3PjR8XQNVgbxHb'
|
|
||||||
},
|
|
||||||
],
|
|
||||||
goodList: [],
|
|
||||||
recommend: [],
|
|
||||||
activeInfo: {},
|
|
||||||
muted: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
function Home () {
|
|
||||||
const [state, setState] = useImmer(initialState)
|
|
||||||
const [startY, setStartY] = useState(0)
|
|
||||||
const [startX, setStartX] = useState(0)
|
|
||||||
const [likeList, setLikeList] = useImmer([])
|
|
||||||
const { isLogin, isNewUser } = useLogin()
|
|
||||||
|
|
||||||
const { initState, openRecommend, openLocation, openStore, appName, openScanQrcode } = useSelector(
|
|
||||||
(state) => state.sys
|
|
||||||
)
|
|
||||||
const { shopInfo } = useSelector(
|
|
||||||
(state) => state.shop
|
|
||||||
)
|
|
||||||
|
|
||||||
const showAdv = useSelector((member) => member.user.showAdv)
|
|
||||||
const { location } = useSelector((state) => state.user)
|
|
||||||
const { setNavigationBarTitle } = useNavigation()
|
|
||||||
const { windowWidth } = Taro.getSystemInfoSync()
|
|
||||||
const imgW = parseFloat(((windowWidth * 2 - 60 - 32) / 3).toFixed(4))
|
|
||||||
|
|
||||||
const { wgts, loading, searchComp, pageData, fixedTop, filterWgts, isShowHomeHeader, isUpOperation, showRecommend, shopList, swiperList, goodList, recommend } = state
|
|
||||||
|
|
||||||
const dispatch = useDispatch()
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (initState) {
|
|
||||||
init()
|
|
||||||
setNavigationBarTitle(appName)
|
|
||||||
getSwiperList()
|
|
||||||
getRecommendItems()
|
|
||||||
}
|
|
||||||
}, [initState])
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// if (shopInfo && VERSION_STANDARD) {
|
|
||||||
// fetchWgts()
|
|
||||||
// }
|
|
||||||
// }, [shopInfo])
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// if (location && VERSION_STANDARD) {
|
|
||||||
// fetchWgts()
|
|
||||||
// }
|
|
||||||
// }, [location])
|
|
||||||
|
|
||||||
useShareAppMessage(async (res) => {
|
|
||||||
const { title, imageUrl } = await api.wx.shareSetting({ shareindex: 'index' })
|
|
||||||
let params = getCurrentPageRouteParams()
|
|
||||||
const dtid = getDistributorId()
|
|
||||||
if (dtid && !('dtid' in params)) {
|
|
||||||
params = Object.assign(params, { dtid })
|
|
||||||
}
|
|
||||||
let path = `/pages/index${isEmpty(params) ? '' : '?' + resolveStringifyParams(params)}`
|
|
||||||
|
|
||||||
console.log('useShareAppMessage path:', path, params)
|
|
||||||
|
|
||||||
return {
|
|
||||||
title: title,
|
|
||||||
imageUrl: imageUrl,
|
|
||||||
path
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
useShareTimeline(async (res) => {
|
|
||||||
const { title, imageUrl } = await api.wx.shareSetting({ shareindex: 'index' })
|
|
||||||
let params = getCurrentPageRouteParams()
|
|
||||||
const dtid = getDistributorId()
|
|
||||||
|
|
||||||
if (dtid && !('dtid' in params)) {
|
|
||||||
params = Object.assign(params, { dtid })
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
title: title,
|
|
||||||
imageUrl: imageUrl,
|
|
||||||
query: resolveStringifyParams(params)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const init = async () => {
|
|
||||||
fetchLocation()
|
|
||||||
// 非云店
|
|
||||||
if (!VERSION_STANDARD) {
|
|
||||||
// fetchWgts()
|
|
||||||
} else {
|
|
||||||
fetchStoreInfo(location)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const getRecommendItems = async () => {
|
|
||||||
const req = {
|
|
||||||
page: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
approve_status: 'onsale',
|
|
||||||
approve_status: 'onsale,only_show',
|
|
||||||
item_type: 'normal',
|
|
||||||
is_point: false,
|
|
||||||
// goodsSort: 6,
|
|
||||||
distributor_id: 0
|
|
||||||
}
|
|
||||||
// const { list: jdList } = await api.item.search({ ...req, tag_id: 1 })
|
|
||||||
const { list: newList = [] } = await api.item.search({ ...req, tag_id: 4 })
|
|
||||||
const { list: hotList = [] } = await api.item.search({ ...req, tag_id: 3 })
|
|
||||||
const { list: BOSTON_List = [] } = await api.item.search({ ...req, tag_id: 5 })
|
|
||||||
const { list: ARIZONA_List = [] } = await api.item.search({ ...req, tag_id: 6 })
|
|
||||||
const { list: LONDON_List = [] } = await api.item.search({ ...req, tag_id: 7 })
|
|
||||||
const newSort = {
|
|
||||||
"BK023": 1,
|
|
||||||
"BK066": 2,
|
|
||||||
"BK053": 3,
|
|
||||||
"BK038": 4,
|
|
||||||
"BK064": 5,
|
|
||||||
"BK014": 6
|
|
||||||
}
|
|
||||||
const hotSort = {
|
|
||||||
"BK014": 1,
|
|
||||||
"BK031": 2,
|
|
||||||
"BK018": 3,
|
|
||||||
"BK020": 4,
|
|
||||||
"BK052": 5,
|
|
||||||
"BK064": 6,
|
|
||||||
}
|
|
||||||
const BOSTON_sort = {
|
|
||||||
"BK020": 1,
|
|
||||||
"BK023": 2,
|
|
||||||
"BK025": 3,
|
|
||||||
"BK029": 4,
|
|
||||||
"BK030": 5,
|
|
||||||
"BK031": 6,
|
|
||||||
}
|
|
||||||
const ARIZONA_sort = {
|
|
||||||
"BK001": 1,
|
|
||||||
"BK017": 2,
|
|
||||||
"BK007": 3,
|
|
||||||
"BK010": 4,
|
|
||||||
"BK011": 5,
|
|
||||||
"BK014": 6,
|
|
||||||
}
|
|
||||||
const LONDON_sort = {
|
|
||||||
"BK052": 1,
|
|
||||||
"BK053": 2,
|
|
||||||
"BK051": 3,
|
|
||||||
}
|
|
||||||
setState((draft) => {
|
|
||||||
draft.recommend = [{
|
|
||||||
type: 'new',
|
|
||||||
text: "新品推荐",
|
|
||||||
btnTxt: '查看更多',
|
|
||||||
postions: 'left',
|
|
||||||
url: '',
|
|
||||||
tag_id: 4,
|
|
||||||
img: 'index/rec/new.png?v=1',
|
|
||||||
list: newList.map(item => ({ ...item, price: (item.price / 100) })).sort((a, b) => {
|
|
||||||
return newSort[a.item_name_3] - newSort[b.item_name_3]
|
|
||||||
})
|
|
||||||
}, {
|
|
||||||
type: 'hot',
|
|
||||||
text: "热销单品",
|
|
||||||
btnTxt: '查看更多',
|
|
||||||
postions: 'left',
|
|
||||||
url: '',
|
|
||||||
tag_id: 3,
|
|
||||||
img: 'index/rec/hot.png?v=1',
|
|
||||||
list: hotList.map(item => ({ ...item, price: (item.price / 100) })).sort((a, b) => {
|
|
||||||
return hotSort[a.item_name_3] - hotSort[b.item_name_3]
|
|
||||||
})
|
|
||||||
}, {
|
|
||||||
type: 'BOSTON',
|
|
||||||
text: "BOSTON",
|
|
||||||
btnTxt: 'BOSTON',
|
|
||||||
postions: 'left',
|
|
||||||
url: '',
|
|
||||||
tag_id: 5,
|
|
||||||
img: 'index/rec/Boston.png',
|
|
||||||
list: BOSTON_List.map(item => ({ ...item, price: (item.price / 100) })).sort((a, b) => {
|
|
||||||
return BOSTON_sort[a.item_name_3] - BOSTON_sort[b.item_name_3]
|
|
||||||
})
|
|
||||||
}, {
|
|
||||||
type: 'ARIZONA',
|
|
||||||
text: "ARIZONA",
|
|
||||||
btnTxt: 'ARIZONA',
|
|
||||||
url: '',
|
|
||||||
postions: 'left',
|
|
||||||
tag_id: 6,
|
|
||||||
img: 'index/rec/Arizona.png',
|
|
||||||
list: ARIZONA_List.map(item => ({ ...item, price: (item.price / 100) })).sort((a, b) => {
|
|
||||||
return ARIZONA_sort[a.item_name_3] - ARIZONA_sort[b.item_name_3]
|
|
||||||
})
|
|
||||||
}, {
|
|
||||||
type: 'LONDON',
|
|
||||||
text: "LONDON",
|
|
||||||
btnTxt: 'LONDON',
|
|
||||||
url: '',
|
|
||||||
postions: 'left',
|
|
||||||
tag_id: 7,
|
|
||||||
img: 'index/rec/London.png',
|
|
||||||
list: LONDON_List.map(item => ({ ...item, price: (item.price / 100) })).sort((a, b) => {
|
|
||||||
return LONDON_sort[a.item_name_3] - LONDON_sort[b.item_name_3]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
]
|
|
||||||
// bak
|
|
||||||
// draft.recommend = [{
|
|
||||||
// type: 'new',
|
|
||||||
// text: "新品推荐",
|
|
||||||
// btnTxt: '查看更多',
|
|
||||||
// postions: 'left',
|
|
||||||
// url: '',
|
|
||||||
// img: 'index/rec/new.png',
|
|
||||||
// list: newList.map(item => ({ ...item, price: (item.price / 100) }))
|
|
||||||
// }, {
|
|
||||||
// type: 'hot',
|
|
||||||
// text: "热销单品",
|
|
||||||
// btnTxt: '查看更多',
|
|
||||||
// postions: 'left',
|
|
||||||
// url: '',
|
|
||||||
// img: 'index/rec/hot.png',
|
|
||||||
// list: hotList.map(item => ({ ...item, price: (item.price / 100) }))
|
|
||||||
// }, {
|
|
||||||
// type: 'jd',
|
|
||||||
// text: "ARIZONA",
|
|
||||||
// btnTxt: '经典双扣',
|
|
||||||
// postions: 'right',
|
|
||||||
// url: '',
|
|
||||||
// img: 'index/rec/jd.png',
|
|
||||||
// list: jdList.map(item => ({ ...item, price: (item.price / 100) }))
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
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 res = await api.shop.homeSwiperList({ page: 1, pageSize: 999 })
|
|
||||||
const list = (res?.list?.map((item) => {
|
|
||||||
return {
|
|
||||||
type: item.type || 'image',
|
|
||||||
src: item.pic,
|
|
||||||
sort: item.sort,
|
|
||||||
goods: (item.goods_info_detail || []).map((ite) => {
|
|
||||||
return {
|
|
||||||
itemName: ite.item_name,
|
|
||||||
goods_id: ite.item_id,
|
|
||||||
itemId: ite.item_id,
|
|
||||||
pic: ite.pics?.[0],
|
|
||||||
brief: ite.brief,
|
|
||||||
price: ite.price ? ite.price / 100 : 0,
|
|
||||||
spec_images: ite.spec_images || [],
|
|
||||||
tagList: ite.tagList || []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}) || []).sort((a, b) => a.sort - b.sort)
|
|
||||||
setState((draft) => {
|
|
||||||
// draft.swiperList = [...activeSwiper, ...list]
|
|
||||||
draft.swiperList = list
|
|
||||||
draft.goodList = list[0].goods || []
|
|
||||||
draft.loading = false
|
|
||||||
// draft.activeInfo = {
|
|
||||||
// ...activity_info,
|
|
||||||
// total_count,
|
|
||||||
// status
|
|
||||||
// }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchWgts = async () => {
|
|
||||||
setState((draft) => {
|
|
||||||
draft.wgts = []
|
|
||||||
draft.pageData = []
|
|
||||||
draft.filterWgts = []
|
|
||||||
draft.loading = true
|
|
||||||
})
|
|
||||||
const { config } = await api.shop.getShopTemplate({
|
|
||||||
distributor_id: getDistributorId()
|
|
||||||
})
|
|
||||||
const searchComp = config.find((wgt) => wgt.name == 'search')
|
|
||||||
const pageData = config.find((wgt) => wgt.name == 'page')
|
|
||||||
let filterWgts = []
|
|
||||||
if (searchComp && searchComp.config.fixTop) {
|
|
||||||
filterWgts = config.filter((wgt) => wgt.name !== 'search' && wgt.name != 'page')
|
|
||||||
} else {
|
|
||||||
filterWgts = config.filter((wgt) => wgt.name != 'page')
|
|
||||||
}
|
|
||||||
|
|
||||||
const fixedTop = searchComp && searchComp.config.fixTop
|
|
||||||
const isShowHomeHeader =
|
|
||||||
VERSION_PLATFORM ||
|
|
||||||
(openScanQrcode == 1 && isWeixin) ||
|
|
||||||
(VERSION_STANDARD && openStore && openLocation == 1) ||
|
|
||||||
fixedTop
|
|
||||||
|
|
||||||
setState((draft) => {
|
|
||||||
draft.wgts = config
|
|
||||||
draft.searchComp = searchComp
|
|
||||||
draft.pageData = pageData
|
|
||||||
draft.fixedTop = fixedTop
|
|
||||||
draft.isShowHomeHeader = isShowHomeHeader
|
|
||||||
draft.filterWgts = filterWgts
|
|
||||||
draft.loading = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchLikeList = async () => {
|
|
||||||
if (openRecommend == 1) {
|
|
||||||
const query = {
|
|
||||||
page: 1,
|
|
||||||
pageSize: 30
|
|
||||||
}
|
|
||||||
const { list } = await api.cart.likeList(query)
|
|
||||||
setLikeList(list)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 定位
|
|
||||||
const fetchLocation = () => {
|
|
||||||
if (!location && ((VERSION_STANDARD && openLocation == 1) || VERSION_PLATFORM)) {
|
|
||||||
try {
|
|
||||||
entryLaunch.isOpenPosition((res) => {
|
|
||||||
if (res.lat) {
|
|
||||||
dispatch(updateLocation(res))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} catch (e) {
|
|
||||||
console.error('map location fail:', e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchStoreInfo = async (location) => {
|
|
||||||
let params = {
|
|
||||||
distributor_id: getDistributorId() // 如果店铺id和经纬度都传会根据哪个去定位传参
|
|
||||||
}
|
|
||||||
if (openLocation == 1 && location) {
|
|
||||||
const { lat, lng } = location
|
|
||||||
params.lat = lat
|
|
||||||
params.lng = lng
|
|
||||||
// params.distributor_id = undefined
|
|
||||||
}
|
|
||||||
const res = await api.shop.getShop(params)
|
|
||||||
dispatch(updateShopInfo(res))
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleTouchStart = (e) => {
|
|
||||||
const { clientY, clientX } = e.touches[0]
|
|
||||||
setStartY(clientY)
|
|
||||||
setStartX(clientX)
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleTouchEnd = (e) => {
|
|
||||||
const { clientX, clientY } = e.changedTouches[0]
|
|
||||||
const deltaY = clientY - startY
|
|
||||||
const deltaX = clientX - startX
|
|
||||||
if (Math.abs(deltaY) < 50) return
|
|
||||||
if (deltaY > 0) {
|
|
||||||
// 下滑操作
|
|
||||||
setState((draft) => {
|
|
||||||
draft.showBottom = false
|
|
||||||
draft.showRecommend = false
|
|
||||||
})
|
|
||||||
if (state.showBottom) {
|
|
||||||
setTimeout(() => {
|
|
||||||
setState((draft) => {
|
|
||||||
draft.isUpOperation = false
|
|
||||||
})
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
} else if (deltaY < 0) {
|
|
||||||
// if (currentIndex === 0) return
|
|
||||||
// 上滑操作
|
|
||||||
setState((draft) => {
|
|
||||||
draft.showBottom = true
|
|
||||||
draft.isUpOperation = true
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
setState((draft) => {
|
|
||||||
draft.showRecommend = true
|
|
||||||
})
|
|
||||||
}, 1000)
|
|
||||||
if (!state.showBottom) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const [recommendTouch, setRecommendTouch] = useImmer({
|
|
||||||
recommendStartY: 0,
|
|
||||||
recommendStartX: 0,
|
|
||||||
recommendEndY: 0,
|
|
||||||
recommendEndX: 0,
|
|
||||||
})
|
|
||||||
const onRecommendTouch = (e) => {
|
|
||||||
const { clientY, clientX } = e.touches[0]
|
|
||||||
setRecommendTouch(v => v.recommendStartX = clientX)
|
|
||||||
setRecommendTouch(v => v.recommendStartY = clientY)
|
|
||||||
}
|
|
||||||
const onRecommendTouchEnd = (e) => {
|
|
||||||
const { clientY, clientX } = e.changedTouches[0]
|
|
||||||
const { recommendStartY, recommendStartX } = recommendTouch
|
|
||||||
const deltaY = clientY - recommendStartY
|
|
||||||
const deltaX = clientX - recommendStartX
|
|
||||||
if (Math.abs(deltaY) < 50) return
|
|
||||||
if (deltaY > 0) {
|
|
||||||
// 下滑操作
|
|
||||||
console.log("🚀 ~ file: index.js:456 ~ 下滑操作:", '下滑操作')
|
|
||||||
} else if (deltaY < 0) {
|
|
||||||
// 上滑操作
|
|
||||||
console.log("🚀 ~ file: index.js:460 ~ 上滑操作:", '上滑操作')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const onSwiperChange = (e) => {
|
|
||||||
const { current } = e.detail
|
|
||||||
// if (current === 0) {
|
|
||||||
// setState((draft) => {
|
|
||||||
// draft.showBottom = false
|
|
||||||
// draft.isUpOperation = false
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
setState((draft) => {
|
|
||||||
draft.currentIndex = current
|
|
||||||
draft.goodList = swiperList[current].goods || []
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleClickStore = (item) => {
|
|
||||||
const url = `/subpages/store/index?id=${item.distributor_info?.distributor_id || item.goods_id}`
|
|
||||||
Taro.navigateTo({
|
|
||||||
url
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const { activeInfo = {}, currentIndex } = state
|
|
||||||
|
|
||||||
const handleApply = () => {
|
|
||||||
// if (!isLogin) return
|
|
||||||
let url = '/pages/recommend/detail?id='
|
|
||||||
if (activeInfo.total_count) {
|
|
||||||
url = `/pages/recommend/status?id=`
|
|
||||||
}
|
|
||||||
Taro.navigateTo({
|
|
||||||
url: url + activeInfo.activity_id
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleGoRecommendGoods = (item) => {
|
|
||||||
const url = `/pages/item/list?tag_id=${item.tag_id || ''}`
|
|
||||||
Taro.navigateTo({
|
|
||||||
url: url
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<SpPage
|
|
||||||
className='page-index'
|
|
||||||
scrollToTopBtn
|
|
||||||
// renderNavigation={<SpNavBar />}
|
|
||||||
// pageConfig={pageData?.base}
|
|
||||||
// renderFloat={wgts.length > 0 && <CompFloatMenu />}
|
|
||||||
renderFooter={<SpTabbar />}
|
|
||||||
loading={loading}
|
|
||||||
isTop={!isUpOperation}
|
|
||||||
isBlack
|
|
||||||
>
|
|
||||||
{false && <View
|
|
||||||
className={classNames('home-body', {
|
|
||||||
'has-home-header': isShowHomeHeader && isWeixin
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
{isShowHomeHeader && <WgtHomeHeader>{fixedTop && <SpSearch info={searchComp} />}</WgtHomeHeader>}
|
|
||||||
{
|
|
||||||
filterWgts.length > 0 && <HomeWgts wgts={filterWgts} onLoad={fetchLikeList}>
|
|
||||||
{/* 猜你喜欢 */}
|
|
||||||
<SpRecommend className='recommend-block' info={likeList} />
|
|
||||||
</HomeWgts>
|
|
||||||
}
|
|
||||||
</View>}
|
|
||||||
|
|
||||||
{/* 小程序搜藏提示 */}
|
|
||||||
{/* {isWeixin && <MCompAddTip />} */}
|
|
||||||
|
|
||||||
{/* 开屏广告 */}
|
|
||||||
{/* {isWeixin && !showAdv && <SpScreenAd />} */}
|
|
||||||
|
|
||||||
{/* 优惠券包 */}
|
|
||||||
{/* {VERSION_STANDARD && <SpCouponPackage />} */}
|
|
||||||
|
|
||||||
<View className={classNames('content-box', {
|
|
||||||
// 'content-box-ovh': !isUpOperation
|
|
||||||
})}>
|
|
||||||
<View className="swiper-wapper" onTouchStart={handleTouchStart} onTouchEnd={handleTouchEnd}>
|
|
||||||
{/* <ScrollView
|
|
||||||
className='swiper-wapper'
|
|
||||||
scrollY
|
|
||||||
scrollWithAnimation
|
|
||||||
scrollTop={0}
|
|
||||||
// style={{ height: "calc(100vh - 140px)" }}
|
|
||||||
lowerThreshold={0}
|
|
||||||
upperThreshold={20}
|
|
||||||
// onScrollToUpper={this.onScrollToUpper.bind(this)} // 使用箭头函数的时候 可以这样写 `onScrollToUpper={this.onScrollToUpper}`
|
|
||||||
onScroll={onScroll}
|
|
||||||
onTouchStart={handleTouchStart} onTouchEnd={handleTouchEnd}
|
|
||||||
showScrollbar={false}
|
|
||||||
> */}
|
|
||||||
<Swiper
|
|
||||||
className={classNames('swiper', {
|
|
||||||
"swiper-narrow": state.showBottom
|
|
||||||
})}
|
|
||||||
indicatorColor="#999"
|
|
||||||
indicatorActiveColor="#333"
|
|
||||||
current={state.currentIndex}
|
|
||||||
interval={5000}
|
|
||||||
duration={800}
|
|
||||||
// indicatorDots
|
|
||||||
circular
|
|
||||||
autoplay={!isUpOperation}
|
|
||||||
onChange={onSwiperChange}
|
|
||||||
>
|
|
||||||
{state.swiperList.map((item, index) => (
|
|
||||||
<SwiperItem key={index} className="" style={{ height: "100%" }}>
|
|
||||||
{item.type === "image" && (
|
|
||||||
<Image
|
|
||||||
src={item.src}
|
|
||||||
style={{ width: "100%", height: "100%", objectPosition: "center" }}
|
|
||||||
mode={isUpOperation ? 'aspectFill' : 'aspectFill'}
|
|
||||||
showMenuByLongpress={false}
|
|
||||||
/>
|
|
||||||
// <SpImage style={{ width: "100%", height: "100%" }} height="100%" src={item.src} isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
|
|
||||||
)}
|
|
||||||
{item.type === "video" && (
|
|
||||||
<Video
|
|
||||||
id="video"
|
|
||||||
src={item.src}
|
|
||||||
poster={item.poster}
|
|
||||||
initialTime={0}
|
|
||||||
controls={false}
|
|
||||||
autoplay={true}
|
|
||||||
loop={true}
|
|
||||||
muted={state.muted}
|
|
||||||
showProgress={false}
|
|
||||||
showFullscreenBtn={false}
|
|
||||||
showPlayBtn={false}
|
|
||||||
showCenterPlayBtn={false}
|
|
||||||
enableProgressGesture={false}
|
|
||||||
objectFit="cover"
|
|
||||||
style={{ width: "100%", height: "100%" }}
|
|
||||||
onPlay={() => {
|
|
||||||
}}
|
|
||||||
onEnded={() => {
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{/* {isUpOperation && <View className="item-btns">
|
|
||||||
<View className="item-tit">BOSTON</View>
|
|
||||||
<View className="item-btn">
|
|
||||||
<View className="item-btn-txt">立即预约</View>
|
|
||||||
<View className="item-btn-icon icon-my icon-arrow-right"></View>
|
|
||||||
</View>
|
|
||||||
</View>} */}
|
|
||||||
{item.type === "video" && <View className="mutedBtn" onClick={() => setState(v => { v.muted = !state.muted })} >
|
|
||||||
<Image className="muted-icon" src={`${process.env.APP_IMAGE_CDN_NEW}/index/${state.muted ? 'muted' : 'muted-no'}.jpg`}></Image>
|
|
||||||
</View>}
|
|
||||||
</SwiperItem>
|
|
||||||
))}
|
|
||||||
</Swiper>
|
|
||||||
{!isUpOperation && <>
|
|
||||||
<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>
|
|
||||||
<View className='spot-pagination'>
|
|
||||||
{swiperList.map((_, index) => (
|
|
||||||
<View key={index} className={'spot-pagination-bullet ' + ((state.currentIndex == index) ? 'spot-pagination-bullet-active' : "")} style={{ width: 1 / state.length * 100 + '%' }}></View>
|
|
||||||
))}
|
|
||||||
</View>
|
|
||||||
</>}
|
|
||||||
{isUpOperation && <View className="icon-kf">
|
|
||||||
<SpChat><SpImage height="62" src='index/kf.png' isShowMenuByLongpress={false} lazyLoad isNew /></SpChat>
|
|
||||||
</View>}
|
|
||||||
</View>
|
|
||||||
{isUpOperation && <ScrollView scrollX scrollWithAnimation showScrollbar={true} scrollLeft={0} className="shop-box fadeIn" >
|
|
||||||
{goodList.map((item, idx) => (
|
|
||||||
<View className='goods-item-wrap fadeIn' animation={{ duration: 500, timingFunction: 'ease-in-out', delay: 0 }} key={`goods-item-l__${idx + item.goods_id}`}>
|
|
||||||
<SpGoodsItem
|
|
||||||
onStoreClick={handleClickStore}
|
|
||||||
info={{
|
|
||||||
...item
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
</ScrollView>}
|
|
||||||
{/* 推荐图片+商品 isUpOperation && */}
|
|
||||||
{isUpOperation && showRecommend && <>
|
|
||||||
{recommend.length > 0 && recommend.map((_item, id) => <View key={id + '__item'} className="fadeIn" >
|
|
||||||
<SpImage width={windowWidth * 2} height={windowWidth >= 400 ? 920 : 800} mode='scaleToFill' src={_item.img} isShowMenuByLongpress={false} lazyLoad isNew >
|
|
||||||
<View onClick={() => handleGoRecommendGoods(_item)} className="recommend_btn" style={{ [_item.postions]: '70rpx', opacity: 0 }}>
|
|
||||||
<View className="recommend_btn-title">{_item.text}</View>
|
|
||||||
<View className="recommend_btn-btn">{_item.btnTxt}</View>
|
|
||||||
</View>
|
|
||||||
</SpImage>
|
|
||||||
<ScrollView scrollX scrollWithAnimation showScrollbar={true} scrollLeft={0} className="shop-box fadeIn" >
|
|
||||||
{_item.list?.map((item, idx) => (
|
|
||||||
<View className='goods-item-wrap fadeIn' animation={{ duration: 500, timingFunction: 'ease-in-out', delay: 0 }} key={`goods-item-l__${idx + item.goods_id}`}>
|
|
||||||
<SpGoodsItem
|
|
||||||
onStoreClick={handleClickStore}
|
|
||||||
info={{
|
|
||||||
...item
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
</ScrollView>
|
|
||||||
</View>)}
|
|
||||||
</>}
|
|
||||||
{isUpOperation && showRecommend && <View className="brand" style={{ padding: '0 15px 15px', height: '250px' }}>
|
|
||||||
<SpImage width={windowWidth * 2 - 60} mode='widthFix' src="index/story/story.png" onClick={() => Taro.navigateTo({
|
|
||||||
url: '/pages/home/story'
|
|
||||||
})} isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
|
|
||||||
{/* <SpImage width={windowWidth * 2 - 60} mode='widthFix' src="index/story/more.png" isShowMenuByLongpress={false} lazyLoad isNew></SpImage> */}
|
|
||||||
{/* <View style={{ marginTop: '30px' }}>
|
|
||||||
<SpImage onClick={() => Taro.navigateTo({
|
|
||||||
url: '/pages/webview?url=' + encodeURIComponent('https://www.baidu.com')
|
|
||||||
})} width={windowWidth * 2 - 60} mode='widthFix' src="index/story/more.png" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
|
|
||||||
</View> */}
|
|
||||||
</View>}
|
|
||||||
|
|
||||||
|
|
||||||
{false && isUpOperation && showRecommend && <View className="brand" style={{ padding: '15px', height: '550px' }}>
|
|
||||||
<View className="brand-title">品牌介绍</View>
|
|
||||||
<ScrollView scrollX scrollWithAnimation showScrollbar={false} scrollLeft={0} className="brand-img" style={{ height: '220px' }}>
|
|
||||||
<View className="brand-img-left brand-img-item" style={{ marginRight: '8px' }}>
|
|
||||||
<SpImage className="brand-img-top" width={imgW} height={294} mode='aspectFill' src="index/img/1774-1902.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
|
|
||||||
<SpImage width={imgW} height={130} mode='aspectFill' src="index/img/1913.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
|
|
||||||
</View>
|
|
||||||
<View className="brand-img-center brand-img-item" style={{ marginRight: '8px' }}>
|
|
||||||
<SpImage height={440} width={imgW} mode='aspectFill' src="index/img/1968.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
|
|
||||||
</View>
|
|
||||||
<View className="brand-img-right brand-img-item" style={{ marginRight: '0px' }}>
|
|
||||||
<SpImage className="brand-img-top" width={imgW} height={324} mode='aspectFill' src="index/img/70.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
|
|
||||||
<SpImage width={imgW} height={100} mode='aspectFill' src="index/img/1980.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
|
||||||
<SpImage onClick={() => Taro.navigateTo({
|
|
||||||
url: '/pages/webview?url=' + encodeURIComponent('https://www.baidu.com')
|
|
||||||
})} className="brand-guanzhu" mode="widthFix" src="index/guanzhu.png" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
|
|
||||||
<View className="brand-dy">
|
|
||||||
<View className="brand-dy-tit">订阅消息</View>
|
|
||||||
<SpImage width={30} mode="widthFix" src="index/xiaoxi.png" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
|
|
||||||
</View>
|
|
||||||
{/* <SpImage className="brand-logo" width={168} mode="widthFix" src="index/logo.png" isShowMenuByLongpress={false} lazyLoad isNew></SpImage> */}
|
|
||||||
</View>}
|
|
||||||
|
|
||||||
{/* </ScrollView> */}
|
|
||||||
</View>
|
|
||||||
</SpPage>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Home
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { addCart } from '@/store/slices/cart'
|
||||||
import { BUY_TOOL_BTNS, ACTIVITY_LIST } from '@/consts'
|
import { BUY_TOOL_BTNS, ACTIVITY_LIST } from '@/consts'
|
||||||
import { fetchUserFavs, addUserFav, deleteUserFav } from '@/store/slices/user'
|
import { fetchUserFavs, addUserFav, deleteUserFav } from '@/store/slices/user'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { AtModal, AtBadge } from 'taro-ui'
|
import { AtModal } from 'taro-ui'
|
||||||
import './comp-buytoolbar.scss'
|
import './comp-buytoolbar.scss'
|
||||||
|
|
||||||
function CompGoodsBuyToolbar (props) {
|
function CompGoodsBuyToolbar (props) {
|
||||||
|
|
@ -161,9 +161,6 @@ function CompGoodsBuyToolbar (props) {
|
||||||
<Text className='toolbar-item-txt'>收藏</Text>
|
<Text className='toolbar-item-txt'>收藏</Text>
|
||||||
</View> */}
|
</View> */}
|
||||||
</SpLogin>
|
</SpLogin>
|
||||||
<View className='shoucang-wrap' style="marginLeft:30rpx" onClick={() => Taro.redirectTo({ url: '/pages/cart/espier-index' })}>
|
|
||||||
{cartCount > 0 ? <AtBadge value={cartCount} maxValue={99}><SpImage src={`member/cart.png`} height={50} mode='heightFix' isNew /></AtBadge> : <SpImage src={`member/cart.png`} height={54} mode='heightFix' isNew />}
|
|
||||||
</View>
|
|
||||||
{false && <View
|
{false && <View
|
||||||
className='toolbar-item'
|
className='toolbar-item'
|
||||||
onClick={navigateTo.bind(this, '/pages/cart/espier-index?tabbar=0')}
|
onClick={navigateTo.bind(this, '/pages/cart/espier-index?tabbar=0')}
|
||||||
|
|
|
||||||
|
|
@ -8,20 +8,6 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
.at-badge {
|
|
||||||
&__num {
|
|
||||||
font-size: 14px;
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
line-height: 24px;
|
|
||||||
top: -6px;
|
|
||||||
right: 4px;
|
|
||||||
padding: 0;
|
|
||||||
border-radius: 50%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.sp-login {
|
.sp-login {
|
||||||
margin-left: 30px;
|
margin-left: 30px;
|
||||||
|
|
|
||||||
|
|
@ -110,19 +110,13 @@ function EspierDetail (props) {
|
||||||
const $instance = getCurrentInstance()
|
const $instance = getCurrentInstance()
|
||||||
// const { type, id, dtid } = $instance.router.params
|
// const { type, id, dtid } = $instance.router.params
|
||||||
// const { type, id, dtid } = await entryLaunch.getRouteParams()
|
// const { type, id, dtid } = await entryLaunch.getRouteParams()
|
||||||
const { getUserInfoAuth, isLogin } = useLogin()
|
const { getUserInfoAuth } = useLogin()
|
||||||
const pageRef = useRef()
|
const pageRef = useRef()
|
||||||
const { userInfo } = useSelector((state) => state.user)
|
const { userInfo } = useSelector((state) => state.user)
|
||||||
const { colorPrimary, openRecommend } = useSelector((state) => state.sys)
|
const { colorPrimary, openRecommend } = useSelector((state) => state.sys)
|
||||||
const { setNavigationBarTitle } = useNavigation()
|
const { setNavigationBarTitle } = useNavigation()
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const skuSelectRef = useRef()
|
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 [state, setState] = useImmer(initialState)
|
||||||
const {
|
const {
|
||||||
|
|
@ -333,14 +327,14 @@ function EspierDetail (props) {
|
||||||
getRecommendList() // 猜你喜欢
|
getRecommendList() // 猜你喜欢
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLogin) {
|
api.member.itemHistorySave(data.itemId)
|
||||||
api.member.itemHistorySave(data.itemId)
|
|
||||||
const res = await api.member.itemHistory()
|
const res = await api.member.itemHistory()
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
draft.historyList = res.list.filter((item) => item.item_id !== data.itemId && !!item.itemData?.item_id)?.map((item) => ({ ...item.itemData, pic: item.itemData.pics?.[0] || '' })) || []
|
draft.historyList = res.list.filter((item) => item.item_id !== data.itemId && !!item.itemData?.item_id)?.map((item) => ({ ...item.itemData, pic: item.itemData.pics?.[0] || '' })) || []
|
||||||
draft.historyTotal = res.total_count
|
draft.historyTotal = res.total_count
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRecommendList = async () => {
|
const getRecommendList = async () => {
|
||||||
|
|
@ -402,6 +396,7 @@ function EspierDetail (props) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { windowWidth } = Taro.getSystemInfoSync()
|
||||||
|
|
||||||
let sessionFrom = {}
|
let sessionFrom = {}
|
||||||
if (info) {
|
if (info) {
|
||||||
|
|
@ -637,7 +632,7 @@ function EspierDetail (props) {
|
||||||
<View className='goods-info-title'>
|
<View className='goods-info-title'>
|
||||||
{/* 拼团、秒杀、限时特惠不显示 */}
|
{/* 拼团、秒杀、限时特惠不显示 */}
|
||||||
{!ACTIVITY_LIST[info.activityType] && (
|
{!ACTIVITY_LIST[info.activityType] && (
|
||||||
<SpGoodsPrice showMarketPrice={true} info={curItem ? curItem : info} size="30" />
|
<SpGoodsPrice info={curItem ? curItem : info} size="30" />
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
{showSaleTotal && <View className='item-bn-sales'>
|
{showSaleTotal && <View className='item-bn-sales'>
|
||||||
|
|
@ -647,7 +642,7 @@ function EspierDetail (props) {
|
||||||
</View>}
|
</View>}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* <CompGroup info={info} /> */}
|
<CompGroup info={info} />
|
||||||
|
|
||||||
{/* { !info.nospec && (
|
{/* { !info.nospec && (
|
||||||
<View className='sku-block'>
|
<View className='sku-block'>
|
||||||
|
|
@ -715,7 +710,7 @@ function EspierDetail (props) {
|
||||||
</View>} */}
|
</View>} */}
|
||||||
|
|
||||||
{/* 店铺 */}
|
{/* 店铺 */}
|
||||||
{/* {VERSION_PLATFORM && <CompStore info={info.distributorInfo} />} */}
|
{VERSION_PLATFORM && <CompStore info={info.distributorInfo} />}
|
||||||
|
|
||||||
{/* Sku选择器列表 */}
|
{/* Sku选择器列表 */}
|
||||||
{/* Sku选择器 */}
|
{/* Sku选择器 */}
|
||||||
|
|
@ -736,7 +731,7 @@ function EspierDetail (props) {
|
||||||
curItem && setState((draft) => {
|
curItem && setState((draft) => {
|
||||||
draft.skuText = skuText
|
draft.skuText = skuText
|
||||||
draft.curItem = curItem
|
draft.curItem = curItem
|
||||||
// 切换顶部轮播图
|
// 不切换顶部轮播图
|
||||||
draft.selSkuImg = curItem.specItem?.[0]?.specImgs?.[0]
|
draft.selSkuImg = curItem.specItem?.[0]?.specImgs?.[0]
|
||||||
if (idx === 0) draft.swiperList = curItem?.specItem?.[idx]?.specImgs
|
if (idx === 0) draft.swiperList = curItem?.specItem?.[idx]?.specImgs
|
||||||
})
|
})
|
||||||
|
|
@ -756,53 +751,30 @@ function EspierDetail (props) {
|
||||||
<Text className='desc-title-txt'>{info?.itemName}</Text>
|
<Text className='desc-title-txt'>{info?.itemName}</Text>
|
||||||
<SpGoodsPrice info={curItem ? curItem : info} />
|
<SpGoodsPrice info={curItem ? curItem : info} />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View> */}
|
||||||
false ? <>
|
{isArray(info.intro) ? (
|
||||||
{goods_1774[1].map((item, index) => <SpImage src={`1774/${item}`} width={width} isNew >
|
<View>
|
||||||
</SpImage>)}
|
{info.intro.map((item, idx) => (
|
||||||
</> :
|
<View className='wgt-wrap' key={`wgt-wrap__${idx}`}>
|
||||||
*/}
|
{item.name === 'film' && <WgtFilm info={item} />}
|
||||||
{<>
|
{item.name === 'slider' && <WgtSlider info={item} />}
|
||||||
{isArray(info.intro) ? (
|
{item.name === 'writing' && <WgtWriting info={item} />}
|
||||||
<View>
|
{/* {item.name === 'heading' && <WgtHeading info={item} />} */}
|
||||||
{info.intro.map((item, idx) => (
|
{item.name === 'headline' && <WgtHeadline info={item} />}
|
||||||
<View className='wgt-wrap' key={`wgt-wrap__${idx}`}>
|
{item.name === 'goods' && <WgtGoods info={item} />}
|
||||||
{item.name === 'film' && <WgtFilm info={item} />}
|
</View>
|
||||||
{item.name === 'slider' && <WgtSlider info={item} />}
|
))}
|
||||||
{item.name === 'writing' && <WgtWriting info={item} />}
|
</View>
|
||||||
{item.name === 'headline' && <WgtHeadline info={item} />}
|
) : (
|
||||||
{item.name === 'goods' && <WgtGoods info={item} />}
|
<>
|
||||||
</View>
|
{/* <SpHtml content={info.intro} /> */}
|
||||||
))}
|
</>
|
||||||
</View>
|
)}
|
||||||
) :
|
{introList.length ? introList.map((item, index) => <View className={classNames('sp-accordion')} key={`item__${index}`}>
|
||||||
<>
|
<AtAccordion
|
||||||
</>}
|
open={item.isOpen}
|
||||||
{introList.length ? introList.length === 2 ? <SpHtml content={introList[0].content} /> : introList.map((item, index) => <View className={classNames('sp-accordion')} key={`item__${index}`}>
|
isAnimation={false}
|
||||||
<AtAccordion
|
onClick={() => {
|
||||||
open={item.isOpen}
|
|
||||||
isAnimation={false}
|
|
||||||
onClick={() => {
|
|
||||||
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' ? <SpHtml content={item.content} /> :
|
|
||||||
<CompEvaluation list={evaluationList} itemId={info.itemId}></CompEvaluation>
|
|
||||||
}
|
|
||||||
</AtAccordion>
|
|
||||||
<View onClick={() => {
|
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
draft.introList = draft.introList.map((v, i) => {
|
draft.introList = draft.introList.map((v, i) => {
|
||||||
v.isOpen = false
|
v.isOpen = false
|
||||||
|
|
@ -815,32 +787,51 @@ function EspierDetail (props) {
|
||||||
// draft.scrollTop = 1042 + Math.random() / 10
|
// draft.scrollTop = 1042 + Math.random() / 10
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
}}>
|
}}
|
||||||
{item.isOpen ? <AtIcon value='subtract' size='16' color='#000' /> :
|
title={item.title}
|
||||||
<AtIcon value='add' size='16' color='#000' />}
|
>
|
||||||
{item.isOpen ? <></> : <View className="line"></View>}
|
{item.type !== 'eva' ? <SpHtml content={item.content} /> :
|
||||||
</View>
|
<CompEvaluation list={evaluationList} itemId={info.itemId}></CompEvaluation>
|
||||||
</View>) : <View style={{ height: `calc(100% - 380px)` }}></View>}
|
}
|
||||||
{/* 商品评价 */}
|
</AtAccordion>
|
||||||
|
<View onClick={() => {
|
||||||
|
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 ? <AtIcon value='subtract' size='16' color='#000' /> :
|
||||||
|
<AtIcon value='add' size='16' color='#000' />}
|
||||||
|
{item.isOpen ? <></> : <View className="line"></View>}
|
||||||
|
</View>
|
||||||
|
</View>) : <View style={{ height: `calc(100% - 380px)` }}></View>}
|
||||||
|
{/* 商品评价 */}
|
||||||
|
|
||||||
{/* <CompEvaluation list={evaluationList} itemId={info.itemId}></CompEvaluation> */}
|
{/* <CompEvaluation list={evaluationList} itemId={info.itemId}></CompEvaluation> */}
|
||||||
{isArray(historyList) && introList?.length > 2 ? <View className='bottom-box'>
|
{isArray(historyList) ? <View className='bottom-box'>
|
||||||
<View className="bottom-box-tit">浏览历史</View>
|
<View className="bottom-box-tit">浏览历史</View>
|
||||||
<ScrollView scrollX scrollWithAnimation showScrollbar={true} scrollLeft={0} className="shop-box">
|
<ScrollView scrollX scrollWithAnimation showScrollbar={true} scrollLeft={0} className="shop-box">
|
||||||
{historyList.map((item, idx) => (
|
{historyList.map((item, idx) => (
|
||||||
<View className='goods-item-wrap' key={`goods-item-l__${idx}`}>
|
<View className='goods-item-wrap' key={`goods-item-l__${idx}`}>
|
||||||
<SpGoodsItem
|
<SpGoodsItem
|
||||||
showSalePrice={false}
|
showSalePrice={false}
|
||||||
height={250}
|
height={250}
|
||||||
width={250}
|
width={250}
|
||||||
onStoreClick={handleClickStore}
|
onStoreClick={handleClickStore}
|
||||||
info={item}
|
info={item}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View> : <></>}
|
</View> : <></>}
|
||||||
</>}
|
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -50,15 +50,7 @@ const initialState = {
|
||||||
routerParams: null,
|
routerParams: null,
|
||||||
card_id: null, // 兑换券
|
card_id: null, // 兑换券
|
||||||
total: undefined,
|
total: undefined,
|
||||||
historyList: [],
|
historyList: []
|
||||||
loading: true,
|
|
||||||
tagItem: {
|
|
||||||
4: 'SS24新品推荐',
|
|
||||||
3: '热销单品',
|
|
||||||
5: 'Boston系列',
|
|
||||||
6: 'Arizona系列',
|
|
||||||
7: 'London系列',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ItemList () {
|
function ItemList () {
|
||||||
|
|
@ -78,9 +70,7 @@ function ItemList () {
|
||||||
fixTop,
|
fixTop,
|
||||||
routerParams,
|
routerParams,
|
||||||
total,
|
total,
|
||||||
historyList,
|
historyList
|
||||||
loading,
|
|
||||||
tagItem
|
|
||||||
} = state
|
} = state
|
||||||
const [isShowSearch, setIsShowSearch] = useState(false)
|
const [isShowSearch, setIsShowSearch] = useState(false)
|
||||||
const { cat_id, main_cat_id, tag_id, card_id, user_card_id } = routerParams || {}
|
const { cat_id, main_cat_id, tag_id, card_id, user_card_id } = routerParams || {}
|
||||||
|
|
@ -239,7 +229,6 @@ function ItemList () {
|
||||||
v.rightList[pageIndex - 1] = resRightList
|
v.rightList[pageIndex - 1] = resRightList
|
||||||
v.brandList = pickBy(brand_list?.list, doc.goods.WGT_GOODS_BRAND)
|
v.brandList = pickBy(brand_list?.list, doc.goods.WGT_GOODS_BRAND)
|
||||||
v.historyList = _historyList?.list || []
|
v.historyList = _historyList?.list || []
|
||||||
v.loading = false
|
|
||||||
if (v.tagList.length < 1) {
|
if (v.tagList.length < 1) {
|
||||||
if (select_tags_list.length > 0) {
|
if (select_tags_list.length > 0) {
|
||||||
v.tagList = [
|
v.tagList = [
|
||||||
|
|
@ -355,7 +344,6 @@ function ItemList () {
|
||||||
<SpPage
|
<SpPage
|
||||||
scrollToTopBtn
|
scrollToTopBtn
|
||||||
showNavCartIcon
|
showNavCartIcon
|
||||||
title={tag_id ? tagItem[tag_id] : '搜索列表'}
|
|
||||||
className={classNames('page-item-list has-navbar', {
|
className={classNames('page-item-list has-navbar', {
|
||||||
'has-tagbar': tagList.length > 0
|
'has-tagbar': tagList.length > 0
|
||||||
})}
|
})}
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ export default class ItemFav extends Component {
|
||||||
img: 'item_image',
|
img: 'item_image',
|
||||||
fav_id: 'fav_id',
|
fav_id: 'fav_id',
|
||||||
item_id: 'item_id',
|
item_id: 'item_id',
|
||||||
title: ({ item_name, item_name_2 }) => item_name_2 || item_name,
|
title: 'item_name',
|
||||||
desc: 'brief',
|
desc: 'brief',
|
||||||
item_type: 'item_type',
|
item_type: 'item_type',
|
||||||
distributor_id: 'distributor_id',
|
distributor_id: 'distributor_id',
|
||||||
|
|
|
||||||
|
|
@ -120,11 +120,9 @@
|
||||||
flex: 1;
|
flex: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow: hidden;
|
|
||||||
&__title {
|
&__title {
|
||||||
@include text-overflow();
|
@include text-overflow();
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
width: 98%;
|
|
||||||
}
|
}
|
||||||
&__price {
|
&__price {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -132,8 +130,8 @@
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
margin-top: 26px;
|
margin-top: 16px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 36px;
|
||||||
&__symbol {
|
&__symbol {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
@ -155,8 +153,7 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
&__btn {
|
&__btn {
|
||||||
/* prettier-ignore */
|
border: 1px solid #000;
|
||||||
border: 1PX solid #000;
|
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
padding: 15px 20px;
|
padding: 15px 20px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
|
|
||||||
|
|
@ -1,75 +0,0 @@
|
||||||
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,
|
|
||||||
shopList: []
|
|
||||||
}
|
|
||||||
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 { shopList } = state
|
|
||||||
const handleBackToIndex = () => {
|
|
||||||
Taro.redirectTo({ url: '/pages/index' })
|
|
||||||
}
|
|
||||||
const handleGoBuy = (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
|
|
||||||
})
|
|
||||||
}, 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' }} >
|
|
||||||
{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
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
.page-other-goods {
|
|
||||||
.custom-navigation {
|
|
||||||
background-color: #000 !important;
|
|
||||||
.left-container {
|
|
||||||
.icon-fanhui {
|
|
||||||
color: #fff !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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,485 +0,0 @@
|
||||||
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: [],
|
|
||||||
changci: {},
|
|
||||||
formDataList: [],
|
|
||||||
}
|
|
||||||
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 pages = getCurrentPages()
|
|
||||||
const current = pages[pages.length - 1]
|
|
||||||
const eventChannel = current.getOpenerEventChannel()
|
|
||||||
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] || {}
|
|
||||||
const { content = [] } = activity_info.formdata
|
|
||||||
const formdata = content[0]?.formdata || []
|
|
||||||
setState(draft => {
|
|
||||||
draft.isLoading = false
|
|
||||||
// draft.formList = formdata.sort((a, b) => a.id - b.id)
|
|
||||||
draft.formDataList = formdata
|
|
||||||
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()
|
|
||||||
eventChannel.on('apply', (res) => {
|
|
||||||
setState(draft => {
|
|
||||||
draft.changci = res
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (isLogin && userInfo) {
|
|
||||||
setState(draft => {
|
|
||||||
draft.formInfo = {
|
|
||||||
username: userInfo.username,
|
|
||||||
mobile: userInfo.mobile,
|
|
||||||
}
|
|
||||||
draft.formData['username'] = userInfo.username
|
|
||||||
draft.formData['mobile'] = userInfo.mobile
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, [userInfo, isLogin])
|
|
||||||
|
|
||||||
|
|
||||||
const { isLoading, activeInfo = {}, visible, formInfo, checked, status, isShare, alwaysBackUrl, isSub, formData, formList, areaList, formDataList, changci } = 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
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
const _formData = formDataList.map((d) => {
|
|
||||||
return {
|
|
||||||
...d,
|
|
||||||
answer: formData[d.field_name]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
let flag = true
|
|
||||||
try {
|
|
||||||
_formData.forEach((d) => {
|
|
||||||
const { field_name, field_title, answer } = d
|
|
||||||
const reg = /^[1][3,4,5,7,8,9][0-9]{9}$/
|
|
||||||
if ((formData['has_partner'] === '否' && field_name.includes('partner') || field_name.includes('city') || (field_name === 'mobile' && answer === userInfo.mobile))) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (field_name === 'mobile' || field_name === 'partner_mobile') {
|
|
||||||
if (!reg.test(answer)) {
|
|
||||||
Taro.showToast({
|
|
||||||
title: `${formData['has_partner'] === '是' ? '同行人' : ''}${field_title}格式不正确`,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
throw new Error(`${field_title}格式不正确`)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!answer || !answer.trim()) {
|
|
||||||
Taro.showToast({
|
|
||||||
title: `请填写${formData['has_partner'] === '是' ? '同行人' : ''}${field_title}`,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
throw new Error(`${formData['has_partner'] === '是' ? '同行人' : ''}${field_title}不能为空`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
flag = false
|
|
||||||
}
|
|
||||||
if (!flag) return
|
|
||||||
const content = {
|
|
||||||
title: '',
|
|
||||||
sort: 1,
|
|
||||||
formdata: _formData
|
|
||||||
}
|
|
||||||
const { status } = await api.user.registrationSubmit({
|
|
||||||
formdata: { content: JSON.stringify([content]) },
|
|
||||||
activity_id: activeInfo.activity_id,
|
|
||||||
registration_session_id: changci.id
|
|
||||||
})
|
|
||||||
if (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.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 <View className={"bottom"}>
|
|
||||||
<View className='check-box'>
|
|
||||||
<SpCheckbox disabled={!!activeInfo.status} checked={checked} colors="#000" onChange={() => setState((draft) => { draft.checked = !checked })} />
|
|
||||||
<View>
|
|
||||||
<Text onClick={() => !activeInfo.status && setState((draft) => { draft.checked = !checked })} >我已经阅读并同意</Text>
|
|
||||||
<Text
|
|
||||||
onClick={() => Taro.navigateTo({ url: '/subpages/auth/reg-rule?type=activity_rule' })}
|
|
||||||
style={`color: #000000;text-decoration: underline;`}
|
|
||||||
>
|
|
||||||
{`《${appName}活动细则》`}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
{/* <View onClick={handleConfirm} className={"btn"}>{!status ? '确认报名' : status === 'pending' ? '报名中' : '已报名'}</View> */}
|
|
||||||
<SpLogin onChange={getActiveDetail}>
|
|
||||||
<View onClick={handleConfirm} className={"btn"}>{!activeInfo.status ? '确认报名' : '报名详情'}</View>
|
|
||||||
</SpLogin>
|
|
||||||
</View>
|
|
||||||
}
|
|
||||||
|
|
||||||
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, key) => {
|
|
||||||
const { value } = e.detail
|
|
||||||
setState((draft) => {
|
|
||||||
draft.formData[key] = areaList[value]?.label
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const handleAddApply = (flag) => {
|
|
||||||
if (formList.length > 2) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (flag) {
|
|
||||||
setState((draft) => {
|
|
||||||
draft.formList = [...formList, {}]
|
|
||||||
draft.formData['has_partner'] = '是'
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
setState((draft) => {
|
|
||||||
draft.formList = [formList[0]]
|
|
||||||
draft.formData['has_partner'] = '否'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const formItem = activeInfo.formdata?.key_index || []
|
|
||||||
// !!activeInfo?.total_count ? <></> :
|
|
||||||
return (
|
|
||||||
<SpPage title='报名信息' renderFooter={!!activeInfo?.total_count ? <></> : renderFooter()} loading={isLoading} className='page-recommend-apply' >
|
|
||||||
<View className="activity_apply_time">第{changci.index}场 {changci.start}-{changci.end}</View>
|
|
||||||
<View className="activity_apply_tit">请填写您的个人信息</View>
|
|
||||||
{formList.map((item, index) => <View className='user-form' key={index}>
|
|
||||||
<View className="user-form-item">
|
|
||||||
<View className="user-form-item-title">姓名</View>
|
|
||||||
<View className='cell-item'>
|
|
||||||
<Input
|
|
||||||
value={formData[index === 0 ? 'username' : 'partner_name']}
|
|
||||||
className="user-form-item-ipt"
|
|
||||||
type="text"
|
|
||||||
placeholder={`请输入${index > 0 ? '他人' : ''}姓名`}
|
|
||||||
onInput={(e) => onIptChange(e, index === 0 ? 'username' : 'partner_name')}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className="user-form-item">
|
|
||||||
<View className="user-form-item-title">手机</View>
|
|
||||||
<View className='cell-item'>
|
|
||||||
<Input
|
|
||||||
value={formData[index === 0 ? 'mobile' : 'partner_mobile']}
|
|
||||||
className="user-form-item-ipt"
|
|
||||||
type="text"
|
|
||||||
placeholder={`请输入${index > 0 ? '他人' : ''}手机号`}
|
|
||||||
onInput={(e) => onIptChange(e, index === 0 ? 'mobile' : 'partner_mobile')}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className="user-form-item">
|
|
||||||
<View className='cell-item'>
|
|
||||||
<View className="cell-item-tit">性别</View>
|
|
||||||
<View className='flex-row'>
|
|
||||||
<View className="flex-row" onClick={() => onIptChange({ detail: { value: '男' } }, index === 0 ? 'gender' : 'partner_gender')} style={{ paddingRight: '10rpx' }} >
|
|
||||||
<View className="sex-label" >男</View>
|
|
||||||
<View className={classNames("radio ", { checked: formData[index === 0 ? 'gender' : 'partner_gender'] === '男' })}></View>
|
|
||||||
</View>
|
|
||||||
<View className="flex-row" onClick={() => onIptChange({ detail: { value: '女' } }, index === 0 ? 'gender' : 'partner_gender')} >
|
|
||||||
<View className="sex-label">女</View>
|
|
||||||
<View className={classNames("radio ", { checked: formData[index === 0 ? 'gender' : 'partner_gender'] === '女' })}></View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className="user-form-item">
|
|
||||||
<View className='cell-item'>
|
|
||||||
<View className="cell-item-tit">是否拥有BIRKENSTOCK鞋履</View>
|
|
||||||
<View className='flex-row'>
|
|
||||||
<View className="flex-row" onClick={() => onIptChange({ detail: { value: '是' } }, index === 0 ? 'has_bought' : 'partner_has_bought')} style={{ paddingRight: '10rpx' }}>
|
|
||||||
<View className="sex-label">是</View>
|
|
||||||
<View className={classNames("radio ", { checked: formData[index === 0 ? 'has_bought' : 'partner_has_bought'] === '是' })}></View>
|
|
||||||
</View>
|
|
||||||
<View className="flex-row" onClick={() => onIptChange({ detail: { value: '否' } }, index === 0 ? 'has_bought' : 'partner_has_bought')}>
|
|
||||||
<View className="sex-label">否</View>
|
|
||||||
<View className={classNames("radio ", { checked: formData[index === 0 ? 'has_bought' : 'partner_has_bought'] === '否' })}></View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className="user-form-item">
|
|
||||||
<View className='cell-item'>
|
|
||||||
<View className="cell-item-tit">常驻城市(选填)</View>
|
|
||||||
<Picker
|
|
||||||
mode='selector'
|
|
||||||
onChange={(e) => pickerChange(e, index === 0 ? 'city_name' : 'partner_city_name')}
|
|
||||||
range={areaList}
|
|
||||||
rangeKey="label"
|
|
||||||
>
|
|
||||||
<View className='flex-row'>
|
|
||||||
<View className="sex-label" style="minWidth: 120px;text-align: end;" >{formData[index === 0 ? 'city_name' : 'partner_city_name']}</View>
|
|
||||||
<View className="iconfont icon-arrowRight"></View>
|
|
||||||
</View>
|
|
||||||
</Picker>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
{index === 0 && <View className="user-form-item">
|
|
||||||
<View className='cell-item'>
|
|
||||||
<View className="cell-item-tit">是否协同他人一起参加</View>
|
|
||||||
<View className='flex-row'>
|
|
||||||
<View onClick={() => handleAddApply(1)} className="flex-row" style={{ paddingRight: '10rpx' }}>
|
|
||||||
<View className="sex-label">是</View>
|
|
||||||
<View className={classNames("radio ", { checked: formData['has_partner'] === '是' })}></View>
|
|
||||||
</View>
|
|
||||||
<View onClick={() => handleAddApply(0)} className="flex-row">
|
|
||||||
<View className="sex-label">否</View>
|
|
||||||
<View className={classNames("radio ", { checked: formData['has_partner'] === '否' })}></View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>}
|
|
||||||
</View>)}
|
|
||||||
|
|
||||||
|
|
||||||
<View className="sp-picker">
|
|
||||||
<View
|
|
||||||
className={classNames('mask', {
|
|
||||||
visible: visible
|
|
||||||
})}
|
|
||||||
onTap={handleClose}
|
|
||||||
catchtouchmove
|
|
||||||
></View>
|
|
||||||
<View
|
|
||||||
className={classNames('sp-picker-cnt', {
|
|
||||||
visible: visible
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<View className={classNames('sp-picker-hd')} catchtouchmove>
|
|
||||||
<Text className='center'>{isShare ? '分享' : '报名信息'}</Text>
|
|
||||||
<AtIcon onClick={handleClose} value='close' size={14} color='#000' ></AtIcon>
|
|
||||||
</View>
|
|
||||||
<View className='sp-picker-bd'>
|
|
||||||
{!isShare && formItem.map((item, index) => (
|
|
||||||
<View className="user-form-item" key={`userinfo-item__${index}`}>
|
|
||||||
<View className="user-form-item-title">{item.field_title}</View>
|
|
||||||
<View className="user-form-item-input">
|
|
||||||
{item.form_element === 'text' ? <Input
|
|
||||||
name={item.field_name}
|
|
||||||
value={formInfo[item.field_name]}
|
|
||||||
class='input-field-1'
|
|
||||||
placeholder={`请输入`}
|
|
||||||
onInput={(e) => onIptChange(e, item.field_name)}
|
|
||||||
/> : null}
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
{isShare ? <Button openType="share" className={"btn share"} onClick={handleClose} plain>发送给朋友</Button> :
|
|
||||||
<View onClick={handleSubmit} className={"btn"}>{'确认报名信息'}</View>}
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
</SpPage>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
||||||
.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
import React, { useEffect } from 'react'
|
import React, { useEffect } from 'react'
|
||||||
import { View, Text, Input, Image, Button } from '@tarojs/components'
|
import { View, Text, Input, Image } from '@tarojs/components'
|
||||||
import Taro, { getCurrentInstance, useDidShow, useShareAppMessage } from '@tarojs/taro'
|
import Taro, { getCurrentInstance, useDidShow } from '@tarojs/taro'
|
||||||
import { SpPage, SpHtml, SpCheckbox, SpLogin, SpImage } from '@/components'
|
import { SpPage, SpHtml, SpCheckbox } from '@/components'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
|
import { getActiveDetail } from '@/api/community'
|
||||||
import { useImmer } from 'use-immer'
|
import { useImmer } from 'use-immer'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { AtIcon } from 'taro-ui'
|
import { AtIcon } from 'taro-ui'
|
||||||
import { classNames, navigateTo } from '@/utils'
|
import { classNames, navigateTo } from '@/utils'
|
||||||
import { useLogin } from '@/hooks'
|
|
||||||
import './detail.scss'
|
import './detail.scss'
|
||||||
|
|
||||||
const initState = {
|
const initState = {
|
||||||
|
|
@ -17,126 +17,88 @@ const initState = {
|
||||||
visible: false,
|
visible: false,
|
||||||
checked: false,
|
checked: false,
|
||||||
formInfo: {},
|
formInfo: {},
|
||||||
status: '',
|
status: ''
|
||||||
isShare: false,
|
|
||||||
alwaysBackUrl: "/pages/index",
|
|
||||||
isSub: false,
|
|
||||||
changci: [],
|
|
||||||
applyStatus: false,
|
|
||||||
}
|
}
|
||||||
export default function detail () {
|
export default function detail () {
|
||||||
const $instance = getCurrentInstance()
|
const $instance = getCurrentInstance()
|
||||||
const [state, setState] = useImmer(initState)
|
const [state, setState] = useImmer(initState)
|
||||||
const { appName } = useSelector((_state) => _state.sys)
|
const { appName } = useSelector((_state) => _state.sys)
|
||||||
const { userInfo = {} } = useSelector((_state) => _state.user)
|
const { userInfo = {} } = useSelector((_state) => _state.user)
|
||||||
const { isLogin } = useLogin({
|
|
||||||
autoLogin: true,
|
|
||||||
})
|
|
||||||
|
|
||||||
// useDidShow(() => {
|
useDidShow(() => {
|
||||||
// }, [])
|
|
||||||
const getActiveDetail = async () => {
|
|
||||||
const { id: activity_id, alwaysBackUrl } = $instance.router.params
|
|
||||||
if (!activity_id) return
|
|
||||||
const { status, changci = [], activity_info = {}, total_count, user_code, recordList = {} } = await api.user.registrationActivity({ activity_id })
|
|
||||||
const _applyStatus = changci.some((item) => item.has_stauts == 1)
|
|
||||||
if (_applyStatus && !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
|
|
||||||
// MM-DD
|
|
||||||
draft.changci = changci.map((item, index) => ({ index: index + 1, start: dayjs(item.start_time).format('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.applyStatus = _applyStatus
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
getActiveDetail()
|
getActiveDetail()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isLogin && userInfo) {
|
setState(draft => {
|
||||||
setState(draft => {
|
draft.formInfo = {
|
||||||
draft.formInfo = {
|
username: userInfo.username,
|
||||||
username: userInfo.username,
|
mobile: userInfo.mobile,
|
||||||
mobile: userInfo.mobile,
|
}
|
||||||
|
})
|
||||||
|
}, [userInfo])
|
||||||
|
|
||||||
|
const getActiveDetail = async () => {
|
||||||
|
const { id: activity_id } = $instance.router.params
|
||||||
|
if (!activity_id) return
|
||||||
|
const { status, activity_info = {}, total_count, user_code } = await api.user.registrationActivity({ activity_id })
|
||||||
|
const _start = dayjs(activity_info.start_time * 1000)
|
||||||
|
const _end = dayjs(activity_info.end_time * 1000)
|
||||||
|
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,
|
||||||
|
isLoading: false
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
|
||||||
}, [userInfo, isLogin])
|
|
||||||
|
|
||||||
|
|
||||||
const { isLoading, activeInfo = {}, changci, visible, formInfo, checked, status, isShare, alwaysBackUrl, isSub, applyStatus } = 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 { isLoading, activeInfo = {}, visible, formInfo, checked, status } = state
|
||||||
|
|
||||||
const renderFooter = () => {
|
const renderFooter = () => {
|
||||||
if (isLoading || status === 'passed') {
|
if (isLoading || status === 'passed') {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
return <View className={"bottom"}>
|
return <View className={"bottom"}>
|
||||||
<View className='check-box'>
|
<View className='check-box'>
|
||||||
<SpCheckbox disabled={!!activeInfo.status} checked={checked} colors="#000" onChange={() => setState((draft) => { draft.checked = !checked })} />
|
<SpCheckbox checked={checked} colors="#000" onChange={() => setState((draft) => { draft.checked = !checked })} />
|
||||||
<View>
|
<View>
|
||||||
<Text onClick={() => !activeInfo.status && setState((draft) => { draft.checked = !checked })} >我已经阅读并同意</Text>
|
<Text onClick={() => setState((draft) => { draft.checked = !checked })} >我已经阅读并同意</Text>
|
||||||
<Text
|
<Text
|
||||||
onClick={() => Taro.navigateTo({ url: '/subpages/auth/reg-rule?type=activity_rule' })}
|
onClick={() => Taro.navigateTo({ url: '/subpages/auth/reg-rule?type=member_logout' })}
|
||||||
style={`color: #000000;text-decoration: underline;`}
|
style={`color: #000000;text-decoration: underline;`}
|
||||||
>
|
>
|
||||||
{`《${appName}活动细则》`}
|
{`《${appName}活动细则》`}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{/* <View onClick={handleConfirm} className={"btn"}>{!status ? '确认报名' : status === 'pending' ? '报名中' : '已报名'}</View> */}
|
<View onClick={async () => {
|
||||||
<SpLogin onChange={getActiveDetail}>
|
if (!checked) {
|
||||||
<View onClick={handleConfirm} className={"btn"}>{!activeInfo.status ? '确认报名' : '报名详情'}</View>
|
const res = await Taro.showModal({
|
||||||
</SpLogin>
|
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
|
||||||
|
})
|
||||||
|
}} className={"btn"}>{!status ? '确认报名' : status === 'pending' ? '报名中' : '已报名'}</View>
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -148,16 +110,6 @@ export default function detail () {
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
if (isSub) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
setState((draft) => {
|
|
||||||
draft.isSub = true
|
|
||||||
})
|
|
||||||
if (isShare) {
|
|
||||||
handeleShare()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!formInfo.username?.trim()) {
|
if (!formInfo.username?.trim()) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: '请输入姓名',
|
title: '请输入姓名',
|
||||||
|
|
@ -187,109 +139,49 @@ export default function detail () {
|
||||||
activity_id: activeInfo.activity_id
|
activity_id: activeInfo.activity_id
|
||||||
})
|
})
|
||||||
if (status) {
|
if (status) {
|
||||||
|
// Taro.showToast({
|
||||||
|
// title: '报名成功',
|
||||||
|
// icon: 'none'
|
||||||
|
// })
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
draft.visible = false
|
draft.visible = false
|
||||||
draft.status = status
|
draft.status = status
|
||||||
})
|
})
|
||||||
const templeparams = {
|
|
||||||
temp_name: 'yykweishop',
|
|
||||||
source_type: 'activity'
|
|
||||||
}
|
|
||||||
const { template_id } = await api.user.newWxaMsgTmpl(templeparams)
|
|
||||||
Taro.requestSubscribeMessage({
|
Taro.requestSubscribeMessage({
|
||||||
tmplIds: template_id,
|
tmplIds: ['tGJR7BS3HM9xLD4QUdBwtTAJkgzfl7cw_8-ngd74JM4'],
|
||||||
success: () => {
|
success: () => {
|
||||||
|
// onSubscribe()
|
||||||
|
console.log("🚀 ~ onSubscribe:", 'onSubscribe')
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
|
console.log("🚀 ~ err:", err)
|
||||||
|
// onSubscribe()
|
||||||
},
|
},
|
||||||
complete: () => {
|
complete: () => {
|
||||||
Taro.navigateTo({ url: '/pages/recommend/status?success=true&id=' + activeInfo.activity_id })
|
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 handleGoApply = (item) => {
|
|
||||||
if (item.has_stauts) {
|
|
||||||
navigateTo('/pages/recommend/status?id=' + activeInfo.activity_id + '&time=')
|
|
||||||
} else {
|
|
||||||
if (applyStatus) return
|
|
||||||
navigateTo('/pages/recommend/apply?id=' + activeInfo.activity_id + '&time=')
|
|
||||||
Taro.navigateTo({
|
|
||||||
url: '/pages/recommend/apply?id=' + activeInfo.activity_id,
|
|
||||||
success: (res) => {
|
|
||||||
res.eventChannel.emit('apply', item)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const formItem = activeInfo.formdata?.key_index || []
|
const formItem = activeInfo.formdata?.key_index || []
|
||||||
// !!activeInfo?.total_count ? <></> :
|
|
||||||
// renderFooter={!!activeInfo?.total_count ? <></> : renderFooter()}
|
|
||||||
return (
|
return (
|
||||||
<SpPage loading={isLoading} className='page-recommend-detail' alwaysBackUrl={alwaysBackUrl} isBlack>
|
<SpPage renderFooter={!!activeInfo?.total_count ? <></> : renderFooter()} loading={isLoading} className='page-recommend-detail' isBlack>
|
||||||
<View style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
<View className="activity_name">{activeInfo.activity_name}</View>
|
||||||
<SpImage src='member/logo-black.png' height={42} mode='heightFix' isNew ></SpImage>
|
<View className="activity_time">{activeInfo.start} - {activeInfo.end}</View>
|
||||||
<Image onClick={onClickShare} className="share_icon" src={require('../../assets/share.jpg')} mode='widthFix' ></Image>
|
|
||||||
</View>
|
|
||||||
<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_addr">
|
<View className="activity_addr">
|
||||||
<Image mode="widthFix" src={require('@/assets/icon/map.png')}></Image>
|
<Image mode="widthFix" src={require('@/assets/icon/map.png')}></Image>
|
||||||
<Text>{activeInfo.address}</Text>
|
<Text>{activeInfo.address}</Text>
|
||||||
</View>
|
</View>
|
||||||
<SpHtml content={activeInfo.intro} />
|
<SpHtml content={activeInfo.intro} />
|
||||||
|
|
||||||
<View className="activity_apply_tit">
|
|
||||||
<View className="big">选择活动时段报名</View>
|
|
||||||
<View className="small">(为确保您的体验,活动当天每场次仅限5人)</View>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<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}席可选`}</View>
|
|
||||||
</View>)}
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<View className="sp-picker">
|
<View className="sp-picker">
|
||||||
<View
|
<View
|
||||||
className={classNames('mask', {
|
className={classNames('mask', {
|
||||||
visible: visible
|
visible: visible
|
||||||
})}
|
})}
|
||||||
onTap={handleClose}
|
onTap={() => setState((draft) => {
|
||||||
|
draft.visible = false
|
||||||
|
})}
|
||||||
catchtouchmove
|
catchtouchmove
|
||||||
></View>
|
></View>
|
||||||
<View
|
<View
|
||||||
|
|
@ -298,11 +190,13 @@ export default function detail () {
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<View className={classNames('sp-picker-hd')} catchtouchmove>
|
<View className={classNames('sp-picker-hd')} catchtouchmove>
|
||||||
<Text className='center'>{isShare ? '分享' : '报名信息'}</Text>
|
<Text className='center'>{'报名信息'}</Text>
|
||||||
<AtIcon onClick={handleClose} value='close' size={14} color='#000' ></AtIcon>
|
<AtIcon onClick={() => setState((draft) => {
|
||||||
|
draft.visible = false
|
||||||
|
})} value='close' size={14} color='#000' ></AtIcon>
|
||||||
</View>
|
</View>
|
||||||
<View className='sp-picker-bd'>
|
<View className='sp-picker-bd'>
|
||||||
{!isShare && formItem.map((item, index) => (
|
{formItem.map((item, index) => (
|
||||||
<View className="user-form-item" key={`userinfo-item__${index}`}>
|
<View className="user-form-item" key={`userinfo-item__${index}`}>
|
||||||
<View className="user-form-item-title">{item.field_title}</View>
|
<View className="user-form-item-title">{item.field_title}</View>
|
||||||
<View className="user-form-item-input">
|
<View className="user-form-item-input">
|
||||||
|
|
@ -316,8 +210,7 @@ export default function detail () {
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
{isShare ? <Button openType="share" className={"btn share"} onClick={handleClose} plain>发送给朋友</Button> :
|
<View onClick={handleSubmit} className={"btn"}>确认报名信息</View>
|
||||||
<View onClick={handleSubmit} className={"btn"}>{'确认报名信息'}</View>}
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -2,30 +2,20 @@
|
||||||
.sp-page-body {
|
.sp-page-body {
|
||||||
padding: 30px 58px;
|
padding: 30px 58px;
|
||||||
}
|
}
|
||||||
.name-box {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
.share_icon {
|
|
||||||
height: 60px;
|
|
||||||
width: 40px;
|
|
||||||
padding: 10px 0 10px 20px;
|
|
||||||
}
|
|
||||||
.activity_name {
|
.activity_name {
|
||||||
font-size: 40px;
|
font-size: 40px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
.activity_time {
|
.activity_time {
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
// color: #999;
|
// color: #999;
|
||||||
margin-bottom: 50px;
|
margin-bottom: 60px;
|
||||||
}
|
}
|
||||||
.activity_addr {
|
.activity_addr {
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
// color: #999;
|
// color: #999;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 40px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
> image {
|
> image {
|
||||||
|
|
@ -129,9 +119,6 @@
|
||||||
&-disabled {
|
&-disabled {
|
||||||
background: #666;
|
background: #666;
|
||||||
}
|
}
|
||||||
&.share {
|
|
||||||
margin: 80px 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.user-form {
|
.user-form {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
|
|
@ -203,84 +190,46 @@
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.activity_apply_tit {
|
}
|
||||||
color: #000;
|
.sp-page-footer {
|
||||||
display: flex;
|
min-height: 200px;
|
||||||
align-items: baseline;
|
padding: 0 50px;
|
||||||
margin-bottom: 20rpx;
|
.check-box {
|
||||||
.big {
|
margin-top: 100px;
|
||||||
font-size: 30rpx;
|
width: 100%;
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
.small {
|
|
||||||
font-size: 20rpx;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.time-item {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: center;
|
||||||
border-radius: 6rpx;
|
margin: 10px auto;
|
||||||
background: #e1e1e1;
|
.icon-my {
|
||||||
padding: 16rpx 16rpx 16rpx 36rpx;
|
font-size: 36px;
|
||||||
color: #999;
|
}
|
||||||
margin-bottom: 16rpx;
|
view {
|
||||||
.btn {
|
font-size: 22px;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.sp-page-footer {
|
.bottom {
|
||||||
min-height: 200px;
|
// position: fixed;
|
||||||
padding: 0 50px;
|
// bottom: 80px;
|
||||||
.check-box {
|
// left: 0;
|
||||||
margin-top: 100px;
|
// right: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
margin-bottom: 50px;
|
||||||
|
.btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
height: 80px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: 10px auto;
|
font-size: 32px;
|
||||||
.icon-my {
|
line-height: 1;
|
||||||
font-size: 30px;
|
background: #000;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 6px;
|
||||||
|
&.notop {
|
||||||
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
view {
|
&-disabled {
|
||||||
font-size: 22px;
|
background: #666;
|
||||||
}
|
|
||||||
}
|
|
||||||
.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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,17 +96,17 @@ export default class RecommendList extends Component {
|
||||||
// this.setState({
|
// this.setState({
|
||||||
// list: []
|
// list: []
|
||||||
// })
|
// })
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
// this.nextPage()
|
// // this.nextPage()
|
||||||
// Taro.hideLoading()
|
// // Taro.hideLoading()
|
||||||
this.setState({
|
// this.setState({
|
||||||
page: {
|
// page: {
|
||||||
isLoading: false
|
// isLoading: false
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}, 300)
|
// }, 200)
|
||||||
// this.praiseNum()
|
// this.praiseNum()
|
||||||
// this.getActiveDetail()
|
this.getActiveDetail()
|
||||||
}
|
}
|
||||||
|
|
||||||
onShareAppMessage () {
|
onShareAppMessage () {
|
||||||
|
|
@ -615,11 +615,6 @@ export default class RecommendList extends Component {
|
||||||
url: url + activeInfo.activity_id
|
url: url + activeInfo.activity_id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
handleBackToIndex = () => {
|
|
||||||
Taro.redirectTo({
|
|
||||||
url: '/pages/index'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const {
|
const {
|
||||||
|
|
@ -647,7 +642,7 @@ export default class RecommendList extends Component {
|
||||||
const height = windowWidth * 9 / 17
|
const height = windowWidth * 9 / 17
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SpPage renderFooter={<SpTabbar />} loading={page.isLoading} className='has-nav' title="" isBlack >
|
<SpPage renderFooter={<SpTabbar />} loading={page.isLoading} className='has-nav' title="" isBlack isTop>
|
||||||
<View className='page-recommend-list'>
|
<View className='page-recommend-list'>
|
||||||
{false && <>
|
{false && <>
|
||||||
<View className='recommend-list__toolbar'>
|
<View className='recommend-list__toolbar'>
|
||||||
|
|
@ -782,9 +777,7 @@ export default class RecommendList extends Component {
|
||||||
)}
|
)}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</>}
|
</>}
|
||||||
|
{/* {page.isLoading ? <Loading></Loading> :
|
||||||
{/* 鞋床故事 */}
|
|
||||||
{page.isLoading ? <Loading></Loading> :
|
|
||||||
<View className="recommend-content">
|
<View className="recommend-content">
|
||||||
<Video
|
<Video
|
||||||
id="recommend-video"
|
id="recommend-video"
|
||||||
|
|
@ -823,14 +816,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/08.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
|
||||||
<SpImage height={height * 2} width={windowWidth * 2} mode="aspectFill" src='recommend/09.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
|
<SpImage height={height * 2} width={windowWidth * 2} mode="aspectFill" src='recommend/09.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
|
||||||
</View>
|
</View>
|
||||||
<View className="content-btn" onClick={this.handleBackToIndex} >
|
|
||||||
返回首页
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
}
|
} */}
|
||||||
|
{page.isLoading ? <Loading></Loading> :
|
||||||
{/* 活动部分 */}
|
|
||||||
{/* {page.isLoading ? <Loading></Loading> :
|
|
||||||
<View className="active-content">
|
<View className="active-content">
|
||||||
<Swiper
|
<Swiper
|
||||||
className={classNames('swiper')}
|
className={classNames('swiper')}
|
||||||
|
|
@ -892,7 +880,7 @@ export default class RecommendList extends Component {
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
} */}
|
}
|
||||||
<BackToTop show={showBackToTop} onClick={this.scrollBackToTop} />
|
<BackToTop show={showBackToTop} onClick={this.scrollBackToTop} />
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -38,26 +38,12 @@
|
||||||
.content-item {
|
.content-item {
|
||||||
margin-bottom: 50px;
|
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 {
|
.active-content {
|
||||||
position: relative;
|
position: relative;
|
||||||
.swiper {
|
.swiper {
|
||||||
--height: calc(var(--status-bar-height) + #{$tabbar-height} + var(--area-bottom-height));
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100vh - var(--height));
|
height: calc(100vh - #{$page-ipx-footer-height} - var(--status-bar-height));
|
||||||
transition: height 0.3s ease-in-out;
|
transition: height 0.3s ease-in-out;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect } from 'react'
|
||||||
import { View, Text, Input, Image, Button } from '@tarojs/components'
|
import { View, Text, Input, Image } from '@tarojs/components'
|
||||||
import Taro, { getCurrentInstance, useDidShow, useShareAppMessage } from '@tarojs/taro'
|
import Taro, { getCurrentInstance, useDidShow } from '@tarojs/taro'
|
||||||
import { SpPage, SpHtml, SpCheckbox, SpImage } from '@/components'
|
import { SpPage, SpHtml, SpCheckbox, SpImage } from '@/components'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import { getActiveDetail } from '@/api/community'
|
import { getActiveDetail } from '@/api/community'
|
||||||
import { useImmer } from 'use-immer'
|
import { useImmer } from 'use-immer'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { AtIcon, AtModal } from 'taro-ui'
|
import { AtIcon } from 'taro-ui'
|
||||||
import { classNames, navigateTo, isArray } from '@/utils'
|
import { classNames, navigateTo, isArray } from '@/utils'
|
||||||
import QRCode from 'qrcode'
|
import QRCode from 'qrcode'
|
||||||
import './status.scss'
|
import './status.scss'
|
||||||
|
|
@ -17,16 +17,12 @@ const initState = {
|
||||||
cur_activity_info: [],
|
cur_activity_info: [],
|
||||||
loading: true,
|
loading: true,
|
||||||
activeInfo: {},
|
activeInfo: {},
|
||||||
qrUrl: '',
|
qrUrl: ''
|
||||||
visible: false,
|
|
||||||
session: {},
|
|
||||||
record: {}
|
|
||||||
}
|
}
|
||||||
export default function status () {
|
export default function status () {
|
||||||
const $instance = getCurrentInstance()
|
const $instance = getCurrentInstance()
|
||||||
const [state, setState] = useImmer(initState)
|
const [state, setState] = useImmer(initState)
|
||||||
const [showModal, setShowModal] = useState(false)
|
const { cur_activity_info, loading, activeInfo, qrUrl } = state
|
||||||
const { cur_activity_info, loading, activeInfo, qrUrl, visible, session, record } = state
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getActiveDetail()
|
getActiveDetail()
|
||||||
|
|
@ -34,25 +30,23 @@ export default function status () {
|
||||||
|
|
||||||
const getActiveDetail = async () => {
|
const getActiveDetail = async () => {
|
||||||
const { id, success } = $instance.router.params
|
const { id, success } = $instance.router.params
|
||||||
const { activity_info = {}, changci = [], total_count, recordList = {} } = await api.user.registrationActivity({ activity_id: id })
|
const { activity_info = {}, total_count, user_code, recordList = {} } = await api.user.registrationActivity({ activity_id: id })
|
||||||
const _start = dayjs(activity_info.start_time * 1000)
|
const _start = dayjs(activity_info.start_time * 1000)
|
||||||
const _end = dayjs(activity_info.end_time * 1000)
|
const _end = dayjs(activity_info.end_time * 1000)
|
||||||
const _session = changci.find(item => item.has_stauts == 1) || {}
|
|
||||||
const _item = _session.recordList?.[0] || {}
|
|
||||||
let url = ''
|
let url = ''
|
||||||
const qrData = JSON.stringify({
|
const qrData = JSON.stringify({
|
||||||
activity_id: id,
|
activity_id: id,
|
||||||
user_code: _item.user_code || ''
|
user_code: user_code || ''
|
||||||
})
|
})
|
||||||
await QRCode.toDataURL(qrData).then((_url) => {
|
await QRCode.toDataURL(qrData).then((_url) => {
|
||||||
url = _url
|
url = _url
|
||||||
})
|
})
|
||||||
|
const _item = recordList.list?.[0] || {}
|
||||||
const list = _item.content?.[0]?.formdata || []
|
const list = _item.content?.[0]?.formdata || []
|
||||||
const record = {}
|
const record = {}
|
||||||
list.map((item) => {
|
list.map((item) => {
|
||||||
record[item.field_name] = item.answer || ''
|
record[item.field_name] = item.answer || ''
|
||||||
})
|
})
|
||||||
console.log("🚀 ~ file: status.js:52 ~ record:", _item)
|
|
||||||
setState(draft => {
|
setState(draft => {
|
||||||
draft.activeInfo = {
|
draft.activeInfo = {
|
||||||
...activity_info,
|
...activity_info,
|
||||||
|
|
@ -64,8 +58,6 @@ export default function status () {
|
||||||
}
|
}
|
||||||
draft.loading = false
|
draft.loading = false
|
||||||
draft.qrUrl = url
|
draft.qrUrl = url
|
||||||
draft.session = _session
|
|
||||||
draft.record = _item
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -118,58 +110,29 @@ export default function status () {
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleCancel = async () => {
|
const handleCancel = async () => {
|
||||||
setShowModal(false)
|
const res = await Taro.showModal({
|
||||||
// const res = await Taro.showModal({
|
title: '提示',
|
||||||
// title: '提示',
|
content: `确定要取消预约吗?`,
|
||||||
// content: `确定要取消预约吗?`,
|
showCancel: true,
|
||||||
// showCancel: true,
|
cancel: '取消',
|
||||||
// cancel: '取消',
|
cancelText: '取消',
|
||||||
// cancelText: '取消',
|
confirmText: '确认',
|
||||||
// confirmText: '确认',
|
cancelColor: '#a5a5a5',
|
||||||
// cancelColor: '#a5a5a5',
|
confirmColor: '#000'
|
||||||
// confirmColor: '#000'
|
})
|
||||||
// })
|
if (!res.confirm) return
|
||||||
// if (!res.confirm) return
|
|
||||||
const { id } = $instance.router.params
|
const { id } = $instance.router.params
|
||||||
await api.user.cancelRegistrationRecord({
|
await api.user.cancelRegistrationRecord({
|
||||||
activity_id: id,
|
activity_id: id
|
||||||
registration_session_id: session?.registration_session_id
|
|
||||||
})
|
})
|
||||||
navigateTo('/pages/index')
|
navigateTo('/pages/recommend/list')
|
||||||
}
|
}
|
||||||
|
|
||||||
const onClickShare = () => {
|
|
||||||
setState((draft) => {
|
|
||||||
draft.visible = true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const handleClose = () => {
|
|
||||||
setState((draft) => {
|
|
||||||
draft.visible = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
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`
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// {activeInfo.status === 'pending' ? '待审核' : '报名成功'}
|
|
||||||
return (
|
return (
|
||||||
<SpPage loading={loading} title="报名成功" className='page-recommend-status' alwaysBackUrl="/pages/index" isBlack>
|
<SpPage loading={loading} title={activeInfo.status === 'pending' ? '待审核' : '预约成功'} className='page-recommend-status' isBlack>
|
||||||
<View className="tit__label">
|
<View className="">
|
||||||
{/* <SpCheckbox checked={true} colors="#000" label={activeInfo.status === 'pending' ? '待审核' : activeInfo.status === 'done' ? '已签到' : "已预约"}></SpCheckbox> */}
|
<SpCheckbox checked={true} colors="#000" label={activeInfo.status === 'pending' ? '待审核' : activeInfo.status === 'done' ? '已签到' : "已预约"}></SpCheckbox>
|
||||||
{activeInfo.status === 'done' ? '已签到' : "待签到"}
|
|
||||||
</View>
|
|
||||||
<View style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
|
||||||
<SpImage src='member/logo-black.png' height={42} mode='heightFix' isNew ></SpImage>
|
|
||||||
<Image onClick={onClickShare} className="share_icon" src={require('../../assets/share.jpg')} mode='widthFix' ></Image>
|
|
||||||
</View>
|
|
||||||
<View className="name-box">
|
|
||||||
<View className="activity_name">{activeInfo.activity_name}</View>
|
|
||||||
</View>
|
</View>
|
||||||
|
<View className="activity_name">{activeInfo?.activity_name || ''}</View>
|
||||||
<View className="activity_info">
|
<View className="activity_info">
|
||||||
<View className="activity_info-item flex-col">
|
<View className="activity_info-item flex-col">
|
||||||
<Text className="title">姓名</Text>
|
<Text className="title">姓名</Text>
|
||||||
|
|
@ -180,22 +143,9 @@ export default function status () {
|
||||||
<Text className="value">{activeInfo?.mobile}</Text>
|
<Text className="value">{activeInfo?.mobile}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{activeInfo?.has_partner === '是' && <>
|
|
||||||
<View style={{ margin: '20px 0 14px' }}>同行朋友</View>
|
|
||||||
<View className="activity_info">
|
|
||||||
<View className="activity_info-item flex-col">
|
|
||||||
<Text className="title">姓名</Text>
|
|
||||||
<Text className="value">{activeInfo?.partner_name}</Text>
|
|
||||||
</View>
|
|
||||||
<View className="activity_info-item flex-col">
|
|
||||||
<Text className="title">手机号</Text>
|
|
||||||
<Text className="value">{activeInfo?.partner_mobile}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</>}
|
|
||||||
<View className="activity_time flex-col">
|
<View className="activity_time flex-col">
|
||||||
<Text className="title">活动时间</Text>
|
<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}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View className="activity_addr flex-col">
|
<View className="activity_addr flex-col">
|
||||||
<Text className="title">活动地点</Text>
|
<Text className="title">活动地点</Text>
|
||||||
|
|
@ -203,50 +153,15 @@ export default function status () {
|
||||||
<Image mode="widthFix" src={require('@/assets/icon/map.png')}></Image>
|
<Image mode="widthFix" src={require('@/assets/icon/map.png')}></Image>
|
||||||
<Text className='value'>{activeInfo?.address}</Text></View>
|
<Text className='value'>{activeInfo?.address}</Text></View>
|
||||||
</View>
|
</View>
|
||||||
<View className="activity_intro" onClick={() => Taro.navigateTo({ url: '/pages/recommend/detail?id=' + activeInfo?.activity_id + '&alwaysBackUrl=/pages/recommend/status' })}>活动介绍</View>
|
<View className="activity_intro" onClick={() => Taro.navigateTo({ url: '/pages/recommend/detail?id=' + activeInfo?.activity_id })}>活动介绍</View>
|
||||||
{activeInfo.status === 'passed' && activeInfo.status !== 'done' ? <View className="code-box flex-col">
|
{activeInfo.status === 'passed' && activeInfo.status !== 'done' ? <View className="code-box flex-col">
|
||||||
<SpImage src={`member/logo-lan.png`} height={40} mode='heightFix' isNew />
|
<SpImage src={`member/logo-lan.png`} height={40} mode='heightFix' isNew />
|
||||||
<View className="img-box">
|
<View className="img-box">
|
||||||
<Image className='member-code-box-qr' mode='aspectFit' src={qrUrl} />
|
<Image className='member-code-box-qr' mode='aspectFit' src={qrUrl} />
|
||||||
</View>
|
</View>
|
||||||
<View className="code-box-txt">入场请出示预约凭证</View>
|
<View className="code-box-txt">入场请出示预约凭证</View>
|
||||||
</View> : <View style={{ height: activeInfo.status === 'done' ? '0px' : '315px' }}></View>}
|
</View> : <View style={'height:315px;'}></View>}
|
||||||
{activeInfo.status !== 'done' && <View className="cancel-txt" onClick={() => setShowModal(true)}>取消预约</View>}
|
{activeInfo.status !== 'done' && <View className="cancel-txt" onClick={handleCancel}>取消预约</View>}
|
||||||
<View className="sp-picker">
|
|
||||||
<View
|
|
||||||
className={classNames('mask', {
|
|
||||||
visible: visible
|
|
||||||
})}
|
|
||||||
onTap={handleClose}
|
|
||||||
catchtouchmove
|
|
||||||
></View>
|
|
||||||
<View
|
|
||||||
className={classNames('sp-picker-cnt', {
|
|
||||||
visible: visible
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<View className={classNames('sp-picker-hd')} catchtouchmove>
|
|
||||||
<Text className='center'>{'分享'}</Text>
|
|
||||||
<AtIcon onClick={handleClose} value='close' size={14} color='#000' ></AtIcon>
|
|
||||||
</View>
|
|
||||||
<View className='sp-picker-bd'>
|
|
||||||
<Button openType="share" className={"btn share"} onClick={handleClose} plain>发送给朋友</Button>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<AtModal
|
|
||||||
isOpened={showModal}
|
|
||||||
title=''
|
|
||||||
cancelText='是,我要取消'
|
|
||||||
confirmText='否,我要保留'
|
|
||||||
onClose={() => setShowModal(false)}
|
|
||||||
onCancel={handleCancel}
|
|
||||||
onConfirm={() => {
|
|
||||||
setShowModal(false)
|
|
||||||
}}
|
|
||||||
content={'尊敬的用户:\n现场活动席位数量有限,如取消目前报名,\n可能导致您无法选择其他时间段活动,\n请问您确认要取消吗?'}
|
|
||||||
/>
|
|
||||||
</SpPage>
|
</SpPage>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
.page-recommend-status {
|
.page-recommend-status {
|
||||||
padding: 10px 58px;
|
padding: 10px 58px;
|
||||||
.sp-page-body {
|
|
||||||
padding-bottom: 50px;
|
|
||||||
}
|
|
||||||
.sp-checkbox-new {
|
.sp-checkbox-new {
|
||||||
padding: 30px 0;
|
padding: 30px 0;
|
||||||
.icon-checkbox-xuanzhong {
|
.icon-checkbox-xuanzhong {
|
||||||
|
|
@ -12,12 +9,6 @@
|
||||||
font-size: 40px;
|
font-size: 40px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.tit__label {
|
|
||||||
font-size: 40px;
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.activity_name {
|
.activity_name {
|
||||||
font-size: 40px;
|
font-size: 40px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
@ -58,14 +49,14 @@
|
||||||
.activity_time {
|
.activity_time {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
color: #999;
|
color: #999;
|
||||||
margin-bottom: 80px;
|
margin-bottom: 50px;
|
||||||
}
|
}
|
||||||
.activity_addr {
|
.activity_addr {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
.activity_intro {
|
.activity_intro {
|
||||||
font-size: 34px;
|
font-size: 30px;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
margin: 90px 0 50px;
|
margin: 90px 0 50px;
|
||||||
}
|
}
|
||||||
|
|
@ -100,195 +91,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.cancel-txt {
|
.cancel-txt {
|
||||||
font-size: 22px;
|
font-size: 18px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 20px;
|
margin-top: 30px;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.name-box {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
.share_icon {
|
|
||||||
height: 60px;
|
|
||||||
width: 40px;
|
|
||||||
padding: 10px 0 10px 20px;
|
|
||||||
}
|
|
||||||
.sp-picker {
|
|
||||||
.mask {
|
|
||||||
position: fixed;
|
|
||||||
z-index: 302;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background: rgba(0, 0, 0, 0.6);
|
|
||||||
visibility: hidden;
|
|
||||||
opacity: 0;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
// color: #fff;
|
|
||||||
&.visible {
|
|
||||||
visibility: visible;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-cnt {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
transition: all 0.3s ease-in-out;
|
|
||||||
transform: translateY(100%);
|
|
||||||
z-index: 503;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 30rpx 30rpx 0 0;
|
|
||||||
&.visible {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-hd {
|
|
||||||
padding: 30px 50px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
border-bottom: none;
|
|
||||||
position: relative;
|
|
||||||
font-size: 26px;
|
|
||||||
.center {
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
.at-icon-close {
|
|
||||||
padding: 20px 30px;
|
|
||||||
position: absolute;
|
|
||||||
right: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-bd {
|
|
||||||
padding: 0 50px 50px;
|
|
||||||
&-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
border-bottom: none;
|
|
||||||
padding: 0 90px;
|
|
||||||
view {
|
|
||||||
color: #000;
|
|
||||||
font-size: 26px;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
.tit {
|
|
||||||
padding: 28px 50px 28px 30px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
color: #000;
|
|
||||||
.icon-qianwang-01 {
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.btn {
|
|
||||||
margin-top: 130px;
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
&.share {
|
|
||||||
margin: 80px 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.user-form {
|
|
||||||
margin-top: 30px;
|
|
||||||
&-item {
|
|
||||||
margin-bottom: 50px;
|
|
||||||
&-title {
|
|
||||||
font-size: 24px;
|
|
||||||
color: #000;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
&-input {
|
|
||||||
background: #e5e5e5;
|
|
||||||
border-radius: 6px;
|
|
||||||
padding: 20px 40px;
|
|
||||||
color: #000;
|
|
||||||
position: relative;
|
|
||||||
.icon-arrowRight {
|
|
||||||
font-size: 34px;
|
|
||||||
position: absolute;
|
|
||||||
right: 30px;
|
|
||||||
top: 30%;
|
|
||||||
// transform: translateY(-50%);
|
|
||||||
color: #000;
|
|
||||||
rotate: 90deg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-phone {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.picker {
|
|
||||||
height: 40px;
|
|
||||||
width: 100%;
|
|
||||||
color: #a5a5a5;
|
|
||||||
&-value {
|
|
||||||
color: #000;
|
|
||||||
&.placeholder {
|
|
||||||
color: #a5a5a5 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ const initialState = {
|
||||||
market_price: false
|
market_price: false
|
||||||
},
|
},
|
||||||
item_page: {
|
item_page: {
|
||||||
market_price: true,
|
market_price: false,
|
||||||
member_price: false,
|
member_price: false,
|
||||||
svip_price: false
|
svip_price: false
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -193,8 +193,7 @@
|
||||||
/* prettier-ignore */
|
/* prettier-ignore */
|
||||||
// border: 1PX solid #E5E5E5;
|
// border: 1PX solid #E5E5E5;
|
||||||
// color: #444;
|
// color: #444;
|
||||||
/* prettier-ignore */
|
border: 1px solid #000;
|
||||||
border: 1PX solid #000;
|
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
&--default {
|
&--default {
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,6 @@
|
||||||
padding: 36px 0 37px;
|
padding: 36px 0 37px;
|
||||||
&-good {
|
&-good {
|
||||||
position: relative;
|
position: relative;
|
||||||
.sp-order-item {
|
|
||||||
&__bd {
|
|
||||||
width: 66%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// &__fix {
|
// &__fix {
|
||||||
// display: flex;
|
// display: flex;
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ export default class TradeItem extends Component {
|
||||||
// 修改地址
|
// 修改地址
|
||||||
clickToEditAddress () {
|
clickToEditAddress () {
|
||||||
const { choose } = this.props.info
|
const { choose } = this.props.info
|
||||||
|
console.log("🚀 ~ TradeItem ~ this.props.info:", this.props.info)
|
||||||
return
|
return
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/marketing/pages/member/address?isSelected=${choose}`
|
url: `/marketing/pages/member/address?isSelected=${choose}`
|
||||||
|
|
@ -173,18 +174,18 @@ export default class TradeItem extends Component {
|
||||||
<View className='trade-item__ft-actions'></View>
|
<View className='trade-item__ft-actions'></View>
|
||||||
<View className='trade-item__ft-bd'>
|
<View className='trade-item__ft-bd'>
|
||||||
{/* <Text className='trade-item__status'>{info.status_desc}</Text> */}
|
{/* <Text className='trade-item__status'>{info.status_desc}</Text> */}
|
||||||
{(info.order_status_des === 'PAYED' || info.order_status_des === 'NOTPAY') &&
|
{false && (info.order_status_des === 'PAYED' || info.order_status_des === 'NOTPAY') &&
|
||||||
info.can_apply_cancel != 0 &&
|
info.can_apply_cancel != 0 &&
|
||||||
!info.is_logistics &&
|
!info.is_logistics &&
|
||||||
(info.receipt_type !== 'dada' || (info.dada && info.dada.dada_status === 0)) ? (
|
(info.receipt_type !== 'dada' || (info.dada && info.dada.dada_status === 0)) ? (
|
||||||
<Button
|
<Button
|
||||||
className='btn-action'
|
className='btn-action'
|
||||||
style={`box-shadow: 0 0 0 1PX ${colors.data[0].primary}; color: ${colors.data[0].primary}`}
|
style={`box-shadow: 0 0 0 1PX ${colors.data[0].primary}; color: ${colors.data[0].primary}`}
|
||||||
onClick={this.handleClickBtn.bind(this, 'cancel')}
|
// onClick={this.handleClickBtn.bind(this, 'cancel')}
|
||||||
// onClick={this.clickToEditAddress.bind(this)}
|
onClick={this.clickToEditAddress.bind(this)}
|
||||||
>
|
>
|
||||||
取消订单
|
{/* 取消订单 */}
|
||||||
{/* 修改地址 */}
|
修改地址
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
{info.pay_status === 'PAYED' &&
|
{info.pay_status === 'PAYED' &&
|
||||||
|
|
@ -267,7 +268,7 @@ export default class TradeItem extends Component {
|
||||||
查看物流
|
查看物流
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{!info.aftersales_status ? <Button
|
{!info.aftersales_bn ? <Button
|
||||||
className='btn-action'
|
className='btn-action'
|
||||||
style={`background: ${colors.data[0].primary}`}
|
style={`background: ${colors.data[0].primary}`}
|
||||||
// onClick={this.handleClickBtn.bind(this, 'detail')}
|
// onClick={this.handleClickBtn.bind(this, 'detail')}
|
||||||
|
|
@ -313,7 +314,7 @@ export default class TradeItem extends Component {
|
||||||
</Button>
|
</Button>
|
||||||
) : null} */}
|
) : null} */}
|
||||||
{
|
{
|
||||||
info.can_apply_aftersales === 1 && (!info.aftersales_status) && info.is_rate != 1 && (
|
!info.aftersales_bn && (
|
||||||
<Button
|
<Button
|
||||||
className='btn-action'
|
className='btn-action'
|
||||||
style={`box-shadow: 0 0 0 1PX ${colors.data[0].primary}; color: ${colors.data[0].primary}`}
|
style={`box-shadow: 0 0 0 1PX ${colors.data[0].primary}; color: ${colors.data[0].primary}`}
|
||||||
|
|
@ -335,7 +336,7 @@ export default class TradeItem extends Component {
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{!customFooter && info.aftersales_status && info.status !== 'WAIT_BUYER_CONFIRM_GOODS' && (
|
{!customFooter && !!info.aftersales_bn && info.status !== 'WAIT_BUYER_CONFIRM_GOODS' && (
|
||||||
<View className='trade-item__ft'>
|
<View className='trade-item__ft'>
|
||||||
<View className='trade-item__ft-actions'></View>
|
<View className='trade-item__ft-actions'></View>
|
||||||
<View className='trade-item__ft-bd'>
|
<View className='trade-item__ft-bd'>
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ export default class TradeDetail extends Component {
|
||||||
delivery_time: 'delivery_time',
|
delivery_time: 'delivery_time',
|
||||||
aftersales_status: 'aftersales_status',
|
aftersales_status: 'aftersales_status',
|
||||||
pic_path: 'pic',
|
pic_path: 'pic',
|
||||||
title: ({ item_name, item_name_2 }) => item_name_2 || item_name,
|
title: ({ item_name }) => item_name,
|
||||||
type: 'type',
|
type: 'type',
|
||||||
delivery_status: 'delivery_status',
|
delivery_status: 'delivery_status',
|
||||||
origincountry_name: 'origincountry_name',
|
origincountry_name: 'origincountry_name',
|
||||||
|
|
@ -304,7 +304,6 @@ export default class TradeDetail extends Component {
|
||||||
tradeInfo,
|
tradeInfo,
|
||||||
distributor: data.distributor
|
distributor: data.distributor
|
||||||
})
|
})
|
||||||
console.log("🚀 ~ file: detail.js:307 ~ TradeDetail ~ info:", info)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleCopy = async () => {
|
handleCopy = async () => {
|
||||||
|
|
@ -469,12 +468,8 @@ export default class TradeDetail extends Component {
|
||||||
// Taro.navigateTo({
|
// Taro.navigateTo({
|
||||||
// url: `/subpage/pages/trade/after-sale-detail?id=${info.tid}`
|
// url: `/subpage/pages/trade/after-sale-detail?id=${info.tid}`
|
||||||
// })
|
// })
|
||||||
let url = `/subpages/trade/after-sale?id=${info.tid}`
|
|
||||||
if (info.status === "WAIT_SELLER_SEND_GOODS") {
|
|
||||||
url += '&type=ONLY_REFUND'
|
|
||||||
}
|
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url
|
url: `/subpages/trade/after-sale?id=${info.tid}`
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -761,7 +756,7 @@ export default class TradeDetail extends Component {
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<ScrollView scroll-y className='scroll-view' style={{ bottom: info.status === 'WAIT_BUYER_PAY' || info.can_apply_aftersales === 1 || info.status === 'WAIT_BUYER_CONFIRM_GOODS' || info.status === "WAIT_SELLER_SEND_GOODS" ? '150rpx' : '40rpx' }} scrollIntoView={scrollIntoView}>
|
<ScrollView scroll-y className='scroll-view' style={{ bottom: info.status === 'WAIT_BUYER_PAY' || info.can_apply_aftersales === 1 || info.status === 'WAIT_BUYER_CONFIRM_GOODS' ? '140rpx' : '40rpx' }} scrollIntoView={scrollIntoView}>
|
||||||
{false && <View className='trade-detail-header' id='order-0'>
|
{false && <View className='trade-detail-header' id='order-0'>
|
||||||
<View className='trade-detail-waitdeliver'>
|
<View className='trade-detail-waitdeliver'>
|
||||||
{info.is_logistics && <View className='oneline'>线上订单</View>}
|
{info.is_logistics && <View className='oneline'>线上订单</View>}
|
||||||
|
|
@ -1041,18 +1036,18 @@ export default class TradeDetail extends Component {
|
||||||
)}
|
)}
|
||||||
</View> */}
|
</View> */}
|
||||||
{/* {!info.is_logistics &&
|
{/* {!info.is_logistics &&
|
||||||
info.can_apply_cancel != 0 &&
|
info.can_apply_cancel != 0 &&
|
||||||
(info.status === 'WAIT_BUYER_PAY' ||
|
(info.status === 'WAIT_BUYER_PAY' ||
|
||||||
(info.status === 'WAIT_SELLER_SEND_GOODS' &&
|
(info.status === 'WAIT_SELLER_SEND_GOODS' &&
|
||||||
info.order_status_des !== 'PAYED_WAIT_PROCESS' &&
|
info.order_status_des !== 'PAYED_WAIT_PROCESS' &&
|
||||||
info.order_status_des !== 'PAYED_PARTAIL')) &&
|
info.order_status_des !== 'PAYED_PARTAIL')) &&
|
||||||
(info.receipt_type !== 'dada' || (info.dada && info.dada.dada_status === 0)) && (
|
(info.receipt_type !== 'dada' || (info.dada && info.dada.dada_status === 0)) && (
|
||||||
<View className='cancel__btn'>
|
<View className='cancel__btn'>
|
||||||
<View className='btn' onClick={this.handleClickBtn.bind(this, 'cancel')}>
|
<View className='btn' onClick={this.handleClickBtn.bind(this, 'cancel')}>
|
||||||
取消订单
|
取消订单
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
)} */}
|
||||||
)} */}
|
|
||||||
{/* </View> */}
|
{/* </View> */}
|
||||||
{/* {info.remark && (
|
{/* {info.remark && (
|
||||||
<View className='trade-detail-remark'>
|
<View className='trade-detail-remark'>
|
||||||
|
|
@ -1227,8 +1222,7 @@ export default class TradeDetail extends Component {
|
||||||
// !VERSION_IN_PURCHASE &&
|
// !VERSION_IN_PURCHASE &&
|
||||||
// !this.isPointitemGood() && (
|
// !this.isPointitemGood() && (
|
||||||
// 先禁止掉!!!
|
// 先禁止掉!!!
|
||||||
// info.status === 'WAIT_SELLER_SEND_GOODS' || 未发货的
|
info.can_apply_aftersales === 1 && (
|
||||||
(info.can_apply_aftersales === 1) ? (
|
|
||||||
<View
|
<View
|
||||||
className={`trade-detail__footer__btn ${info.is_logistics &&
|
className={`trade-detail__footer__btn ${info.is_logistics &&
|
||||||
'trade-detail__footer_active trade-detail__footer_allWidthBtn'
|
'trade-detail__footer_active trade-detail__footer_allWidthBtn'
|
||||||
|
|
@ -1237,21 +1231,8 @@ export default class TradeDetail extends Component {
|
||||||
>
|
>
|
||||||
申请售后
|
申请售后
|
||||||
</View>
|
</View>
|
||||||
) : <></>
|
)
|
||||||
}
|
}
|
||||||
{!info.is_logistics &&
|
|
||||||
info.can_apply_cancel != 0 &&
|
|
||||||
(info.status === 'WAIT_BUYER_PAY' ||
|
|
||||||
(info.status === 'WAIT_SELLER_SEND_GOODS' &&
|
|
||||||
info.order_status_des !== 'PAYED_WAIT_PROCESS' &&
|
|
||||||
info.order_status_des !== 'PAYED_PARTAIL')) &&
|
|
||||||
(info.receipt_type !== 'dada' || (info.dada && info.dada.dada_status === 0)) && (
|
|
||||||
<View className={`trade-detail__footer__btn ${info.is_logistics &&
|
|
||||||
'trade-detail__footer_active trade-detail__footer_allWidthBtn'
|
|
||||||
}`} onClick={this.handleClickBtn.bind(this, 'cancel')}>
|
|
||||||
取消订单
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
{
|
{
|
||||||
// 继续购物 先禁止掉!!!
|
// 继续购物 先禁止掉!!!
|
||||||
false && (info.status === 'WAIT_SELLER_SEND_GOODS' ||
|
false && (info.status === 'WAIT_SELLER_SEND_GOODS' ||
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ $paddingBottom: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.scroll-view {
|
.scroll-view {
|
||||||
@include page-scroll(calc(var(--nav-height) + 16px), 190px);
|
@include page-scroll(calc(var(--nav-height) + 16px), 140px);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.has-navbar {
|
&.has-navbar {
|
||||||
|
|
@ -456,14 +456,13 @@ $paddingBottom: 100px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 150px;
|
height: 100px;
|
||||||
// bottom: $edge-margin;
|
// bottom: $edge-margin;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
z-index: 10;
|
|
||||||
&__btn {
|
&__btn {
|
||||||
width: 338px;
|
width: 338px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
|
|
|
||||||
|
|
@ -77,13 +77,12 @@ const initState = {
|
||||||
title: '',
|
title: '',
|
||||||
totalFee: '',
|
totalFee: '',
|
||||||
toastShow: false,
|
toastShow: false,
|
||||||
invoiceInfo: {},
|
invoiceInfo: {}
|
||||||
oss_invoice_url: ''
|
|
||||||
}
|
}
|
||||||
function InvoiceInfo (props) {
|
function InvoiceInfo (props) {
|
||||||
const $instance = getCurrentInstance()
|
const $instance = getCurrentInstance()
|
||||||
const [state, setState] = useImmer(initState)
|
const [state, setState] = useImmer(initState)
|
||||||
const { formList, form, showModal, visible, showDetail, invoiceId, invoice, orderInfo, loading, title, totalFee, toastShow, invoiceInfo, oss_invoice_url } = state
|
const { formList, form, showModal, visible, showDetail, invoiceId, invoice, orderInfo, loading, title, totalFee, toastShow, invoiceInfo } = state
|
||||||
const pages = getCurrentPages()
|
const pages = getCurrentPages()
|
||||||
const current = pages[pages.length - 1]
|
const current = pages[pages.length - 1]
|
||||||
const eventChannel = current.getOpenerEventChannel()
|
const eventChannel = current.getOpenerEventChannel()
|
||||||
|
|
@ -97,13 +96,12 @@ function InvoiceInfo (props) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
|
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
|
||||||
eventChannel?.on('acceptDataFromOpenerPage', ({ data }) => {
|
eventChannel?.on('acceptDataFromOpenerPage', function ({ data }) {
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
draft.orderInfo = data.order || data || {}
|
draft.orderInfo = data.order || data || {}
|
||||||
draft.oss_invoice_url = data.oss_invoice_url || ''
|
|
||||||
draft.invoiceInfo = data.invoice || {}
|
draft.invoiceInfo = data.invoice || {}
|
||||||
draft.form = data.order?.invoice || data.paramsInfo?.invoice_content || {}
|
draft.form = data.order?.invoice || {}
|
||||||
draft.title = data.order ? data.order.title === 'unit' ? '个人' : '企业' : ''
|
draft.title = data.order?.title ? data.order.title === 'unit' ? '个人' : '企业' : ''
|
||||||
draft.totalFee = data.order?.total_fee ?? ''
|
draft.totalFee = data.order?.total_fee ?? ''
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
@ -185,20 +183,7 @@ function InvoiceInfo (props) {
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let invoice_parmas = {
|
eventChannel?.emit('acceptDataFromOpenedPage', { data: invoice })
|
||||||
invoice_type: 'normal',
|
|
||||||
invoice_content: {
|
|
||||||
...form
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const _invoice = {
|
|
||||||
invoiceTitle: content,
|
|
||||||
paramsInfo: invoice_parmas
|
|
||||||
}
|
|
||||||
setState((draft) => {
|
|
||||||
draft.invoice = _invoice
|
|
||||||
})
|
|
||||||
eventChannel?.emit('acceptDataFromOpenedPage', { data: _invoice })
|
|
||||||
Taro.navigateBack()
|
Taro.navigateBack()
|
||||||
}
|
}
|
||||||
const handleInvoiceClick = () => {
|
const handleInvoiceClick = () => {
|
||||||
|
|
@ -225,8 +210,7 @@ function InvoiceInfo (props) {
|
||||||
registration_number,
|
registration_number,
|
||||||
bankname,
|
bankname,
|
||||||
bankaccount,
|
bankaccount,
|
||||||
company_phone,
|
company_phone
|
||||||
email: form.email
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// console.log("🚀 ~ invoice_parmas:", invoice_parmas)
|
// console.log("🚀 ~ invoice_parmas:", invoice_parmas)
|
||||||
|
|
@ -243,23 +227,16 @@ function InvoiceInfo (props) {
|
||||||
|
|
||||||
// 预览文件
|
// 预览文件
|
||||||
const preview = (url, fileName) => {
|
const preview = (url, fileName) => {
|
||||||
console.log(invoiceInfo, 'invoiceInfoinvoiceInfoin')
|
|
||||||
if (!oss_invoice_url) {
|
|
||||||
Taro.showToast({
|
|
||||||
title: '暂无可预览发票',
|
|
||||||
icon: 'none',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
Taro.showLoading({ title: '正在加载中', mask: true })
|
Taro.showLoading({ title: '正在加载中', mask: true })
|
||||||
Taro.downloadFile({
|
Taro.downloadFile({
|
||||||
url: oss_invoice_url,
|
url: url,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log("下载:", res)
|
console.log("下载:", res)
|
||||||
var filePath = res.tempFilePath
|
var filePath = res.tempFilePath
|
||||||
Taro.hideLoading()
|
Taro.hideLoading()
|
||||||
Taro.openDocument({
|
Taro.openDocument({
|
||||||
filePath: filePath,
|
filePath: filePath,
|
||||||
fileType: getFileType(oss_invoice_url),
|
fileType: getFileType(url),
|
||||||
fileName: fileName,
|
fileName: fileName,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log("打开:", res)
|
console.log("打开:", res)
|
||||||
|
|
@ -280,19 +257,7 @@ function InvoiceInfo (props) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleReSubmit = () => {
|
|
||||||
const reg = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
||||||
if (!reg.test(form.email)) {
|
|
||||||
Taro.showToast({
|
|
||||||
title: '邮箱格式不正确!',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
setState((draft) => {
|
|
||||||
draft.visible = true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return <SpPage className='page-invoice-info has-navbar' loading={loading} navigationBarTitleText='开票信息'>
|
return <SpPage className='page-invoice-info has-navbar' loading={loading} navigationBarTitleText='开票信息'>
|
||||||
|
|
@ -304,7 +269,7 @@ function InvoiceInfo (props) {
|
||||||
<Text>电子发票</Text>
|
<Text>电子发票</Text>
|
||||||
{showDetail ? <View className='flex'>
|
{showDetail ? <View className='flex'>
|
||||||
{orderInfo.is_invoiced == 1 && <>
|
{orderInfo.is_invoiced == 1 && <>
|
||||||
<Text className='ck' onClick={() => preview(invoice.oss_invoice_url, invoiceInfo.invoice_title + invoiceInfo.invoice_no)}>查看</Text>
|
<Text className='ck' onClick={() => preview(invoiceInfo.pdf_info, invoiceInfo.invoice_title + invoiceInfo.invoice_no)}>查看</Text>
|
||||||
<Text className='iconfont icon-qianwang-01'></Text>
|
<Text className='iconfont icon-qianwang-01'></Text>
|
||||||
</>}
|
</>}
|
||||||
{/* <AtIcon value='chevron-right' size='18' color='#000'></AtIcon> */}
|
{/* <AtIcon value='chevron-right' size='18' color='#000'></AtIcon> */}
|
||||||
|
|
@ -360,7 +325,11 @@ function InvoiceInfo (props) {
|
||||||
// })
|
// })
|
||||||
}} className={classNames("btn", { "btn-disabled": !form.title || !form.content || !form.email })}>提交申请</View>
|
}} className={classNames("btn", { "btn-disabled": !form.title || !form.content || !form.email })}>提交申请</View>
|
||||||
</View> : orderInfo.is_invoiced == 1 && <View className={classNames("bottom")}>
|
</View> : orderInfo.is_invoiced == 1 && <View className={classNames("bottom")}>
|
||||||
<View onClick={handleReSubmit} className={classNames("btn")}>重发发票</View>
|
<View onClick={() => {
|
||||||
|
setState((draft) => {
|
||||||
|
draft.visible = true
|
||||||
|
})
|
||||||
|
}} className={classNames("btn")}>重发发票</View>
|
||||||
</View>}
|
</View>}
|
||||||
|
|
||||||
<View className="sp-picker">
|
<View className="sp-picker">
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,7 @@ export default class InvoiceList extends Component {
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
...this.state,
|
...this.state,
|
||||||
list: [],
|
list: []
|
||||||
isLoading: true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,7 +54,6 @@ export default class InvoiceList extends Component {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
order_id: 'order_id',
|
order_id: 'order_id',
|
||||||
status: 'status',
|
status: 'status',
|
||||||
oss_invoice_url: ({ send_params }) => send_params?.oss_invoice_url,
|
|
||||||
order: ({ order: { orderInfo }, order }) => {
|
order: ({ order: { orderInfo }, order }) => {
|
||||||
return order.orderInfo ? {
|
return order.orderInfo ? {
|
||||||
time: formatDateTime(orderInfo.create_time),
|
time: formatDateTime(orderInfo.create_time),
|
||||||
|
|
@ -72,8 +70,7 @@ export default class InvoiceList extends Component {
|
||||||
log.debug('[trade list] list fetched and processed: ', nList)
|
log.debug('[trade list] list fetched and processed: ', nList)
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
list: [...this.state.list, ...nList],
|
list: [...this.state.list, ...nList]
|
||||||
isLoading: false
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return { total }
|
return { total }
|
||||||
|
|
@ -148,12 +145,12 @@ export default class InvoiceList extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { list, page, isLoading } = this.state
|
const { list, page } = this.state
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SpPage className='page-invoice-info has-navbar' navigationBarTitleText='发票记录'>
|
<SpPage className='page-invoice-info has-navbar' navigationBarTitleText='发票记录'>
|
||||||
<ScrollView scrollY className='trade-list__scroll' onScrollToLower={this.nextPage}>
|
<ScrollView scrollY className='trade-list__scroll' onScrollToLower={this.nextPage}>
|
||||||
{list?.length ? list.map((item, idx) => {
|
{list.map((item, idx) => {
|
||||||
return (
|
return (
|
||||||
<View className='invoice-item' onClick={() => this.goDetail(item)} key={`invoice_item_${idx}`}>
|
<View className='invoice-item' onClick={() => this.goDetail(item)} key={`invoice_item_${idx}`}>
|
||||||
<View className="right-item">商品名称:{item.order?.title}</View>
|
<View className="right-item">商品名称:{item.order?.title}</View>
|
||||||
|
|
@ -175,9 +172,7 @@ export default class InvoiceList extends Component {
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}) : !isLoading && <SpNote isUrl img={`${process.env.APP_IMAGE_CDN_NEW}/cart/logo-hui.png`} height={144} width={144}>
|
})}
|
||||||
您的发票记录为空
|
|
||||||
</SpNote>}
|
|
||||||
{page.isLoading && <Loading>正在加载...</Loading>}
|
{page.isLoading && <Loading>正在加载...</Loading>}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</SpPage>
|
</SpPage>
|
||||||
|
|
|
||||||
|
|
@ -7,17 +7,6 @@
|
||||||
@include page-scroll(var(--nav-height), 10px);
|
@include page-scroll(var(--nav-height), 10px);
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
padding-bottom: 50px;
|
padding-bottom: 50px;
|
||||||
.sp-note {
|
|
||||||
.sp-image {
|
|
||||||
margin-top: 400px;
|
|
||||||
}
|
|
||||||
&__text {
|
|
||||||
margin-top: 24px;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 40px;
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.invoice-item {
|
.invoice-item {
|
||||||
|
|
|
||||||
|
|
@ -172,12 +172,6 @@ export default class TradeList extends Component {
|
||||||
aftersales_type: ({ aftersales }) => {
|
aftersales_type: ({ aftersales }) => {
|
||||||
return aftersales?.aftersales_type
|
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),
|
status: ({ order_status }) => resolveOrderStatus(order_status),
|
||||||
totalItems: ({ items }) => items?.reduce((acc, item) => +item.num + acc, 0),
|
totalItems: ({ items }) => items?.reduce((acc, item) => +item.num + acc, 0),
|
||||||
// payment: ({ item_fee_new }) => (item_fee_new / 100).toFixed(2),
|
// payment: ({ item_fee_new }) => (item_fee_new / 100).toFixed(2),
|
||||||
|
|
@ -213,7 +207,7 @@ export default class TradeList extends Component {
|
||||||
order_id: 'order_id',
|
order_id: 'order_id',
|
||||||
item_id: 'item_id',
|
item_id: 'item_id',
|
||||||
pic_path: 'pic',
|
pic_path: 'pic',
|
||||||
title: ({ item_name, item_name_2 }) => item_name_2 || item_name,
|
title: 'item_name',
|
||||||
origincountry_name: 'origincountry_name',
|
origincountry_name: 'origincountry_name',
|
||||||
origincountry_img_url: 'origincountry_img_url',
|
origincountry_img_url: 'origincountry_img_url',
|
||||||
type: 'type',
|
type: 'type',
|
||||||
|
|
@ -279,7 +273,6 @@ export default class TradeList extends Component {
|
||||||
|
|
||||||
handleClickItemBtn = async (trade, type) => {
|
handleClickItemBtn = async (trade, type) => {
|
||||||
console.log(trade)
|
console.log(trade)
|
||||||
// return this.handleClickDelivery(true, { delivery_id: 'SF1651636948873' })
|
|
||||||
const { tid, aftersales_bn } = trade
|
const { tid, aftersales_bn } = trade
|
||||||
|
|
||||||
let detailUrl = `/subpage/pages/trade/detail?id=${tid}`
|
let detailUrl = `/subpage/pages/trade/detail?id=${tid}`
|
||||||
|
|
@ -359,7 +352,6 @@ export default class TradeList extends Component {
|
||||||
title: 'AcceptStation',
|
title: 'AcceptStation',
|
||||||
content: ({ AcceptTime }) => AcceptTime ? AcceptTime.substring(5, 16) : ''
|
content: ({ AcceptTime }) => AcceptTime ? AcceptTime.substring(5, 16) : ''
|
||||||
})
|
})
|
||||||
console.log("🚀 ~ file: list.js:357 ~ TradeList ~ nList:", nList)
|
|
||||||
this.setState({
|
this.setState({
|
||||||
deliveryList: nList,
|
deliveryList: nList,
|
||||||
deliveryName: trade.delivery_corp_name,
|
deliveryName: trade.delivery_corp_name,
|
||||||
|
|
@ -412,7 +404,7 @@ export default class TradeList extends Component {
|
||||||
className={classNames('page-trade-list', {
|
className={classNames('page-trade-list', {
|
||||||
'has-navbar': true || isNavbar()
|
'has-navbar': true || isNavbar()
|
||||||
})}
|
})}
|
||||||
// showNavSearchIcon
|
showNavSearchIcon
|
||||||
>
|
>
|
||||||
<SpNavBar title='订单列表' leftIconType='chevron-left' fixed='true' />
|
<SpNavBar title='订单列表' leftIconType='chevron-left' fixed='true' />
|
||||||
<AtTabs
|
<AtTabs
|
||||||
|
|
|
||||||
|
|
@ -42,11 +42,7 @@ export default class RegRule extends Component {
|
||||||
})
|
})
|
||||||
data = registerContent + privacyContent
|
data = registerContent + privacyContent
|
||||||
navBarTitle = `${registerTitle}和${privactTitle}`
|
navBarTitle = `${registerTitle}和${privactTitle}`
|
||||||
} else if (type === 'activity_rule') {
|
} else if (type) {
|
||||||
data = 'xxxx'
|
|
||||||
navBarTitle = 'BIRKENSTOCK活动细则'
|
|
||||||
}
|
|
||||||
else if (type) {
|
|
||||||
// 隐私政策
|
// 隐私政策
|
||||||
const { content, title = '充值协议' } = await api.shop.getRuleInfo({
|
const { content, title = '充值协议' } = await api.shop.getRuleInfo({
|
||||||
type
|
type
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@ function CouponCenter (props) {
|
||||||
end_date: 1,
|
end_date: 1,
|
||||||
card_id,
|
card_id,
|
||||||
distributor_id,
|
distributor_id,
|
||||||
item_id: item_id || itemid,
|
item_id: item_id || itemid
|
||||||
receive: true
|
|
||||||
}
|
}
|
||||||
const {
|
const {
|
||||||
list,
|
list,
|
||||||
|
|
@ -60,14 +59,6 @@ function CouponCenter (props) {
|
||||||
showToast('积分不足')
|
showToast('积分不足')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (item.couponStatus == 0) {
|
|
||||||
showToast('优惠券已领完')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (item.couponStatus == 2) {
|
|
||||||
showToast('已领取该优惠券')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const res = await Taro.showModal({
|
const res = await Taro.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: `确定要领取该优惠券吗?`,
|
content: `确定要领取该优惠券吗?`,
|
||||||
|
|
@ -81,7 +72,9 @@ function CouponCenter (props) {
|
||||||
if (!res.confirm) {
|
if (!res.confirm) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (item.couponStatus == 1) {
|
if (item.couponStatus == 0) {
|
||||||
|
showToast('优惠券已领完')
|
||||||
|
} else if (item.couponStatus == 1) {
|
||||||
if (isWeixin) {
|
if (isWeixin) {
|
||||||
const templeparams = {
|
const templeparams = {
|
||||||
temp_name: 'yykweishop',
|
temp_name: 'yykweishop',
|
||||||
|
|
@ -104,11 +97,12 @@ function CouponCenter (props) {
|
||||||
} else {
|
} else {
|
||||||
getCoupon(item, index)
|
getCoupon(item, index)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
showToast('优惠券已领取完啦')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getCoupon = async ({ cardId }, index) => {
|
const getCoupon = async ({ cardId }, index) => {
|
||||||
Taro.showLoading({ title: '', mask: true })
|
|
||||||
const { status } = await api.member.getCardDetail({
|
const { status } = await api.member.getCardDetail({
|
||||||
card_id: cardId
|
card_id: cardId
|
||||||
})
|
})
|
||||||
|
|
@ -127,7 +121,6 @@ function CouponCenter (props) {
|
||||||
} else {
|
} else {
|
||||||
showToast('优惠券领取失败')
|
showToast('优惠券领取失败')
|
||||||
}
|
}
|
||||||
Taro.hideLoading()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const { point } = state
|
const { point } = state
|
||||||
|
|
|
||||||
|
|
@ -117,8 +117,7 @@
|
||||||
}
|
}
|
||||||
&-btn {
|
&-btn {
|
||||||
padding: 15px 20px;
|
padding: 15px 20px;
|
||||||
/* prettier-ignore */
|
border: 1px solid #fff;
|
||||||
border: 1PX solid #fff;
|
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ function CouponIndex () {
|
||||||
status: '1',
|
status: '1',
|
||||||
page: pageIndex,
|
page: pageIndex,
|
||||||
pageSize,
|
pageSize,
|
||||||
// card_type: couponType,
|
card_type: couponType,
|
||||||
scope_type: 'all'
|
scope_type: 'all'
|
||||||
}
|
}
|
||||||
const { list, total_count: total } = await api.member.getUserCardList(params)
|
const { list, total_count: total } = await api.member.getUserCardList(params)
|
||||||
|
|
|
||||||
|
|
@ -70,8 +70,7 @@
|
||||||
}
|
}
|
||||||
&-btn {
|
&-btn {
|
||||||
padding: 15px 20px;
|
padding: 15px 20px;
|
||||||
/* prettier-ignore */
|
border: 1px solid #fff;
|
||||||
border: 1PX solid #fff;
|
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,6 @@ function MemberIndex (props) {
|
||||||
const { pointName } = useSelector((state) => state.sys)
|
const { pointName } = useSelector((state) => state.sys)
|
||||||
// log.debug(`store userInfo: ${JSON.stringify(userInfo)}`)
|
// log.debug(`store userInfo: ${JSON.stringify(userInfo)}`)
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const { windowWidth } = Taro.getSystemInfoSync()
|
|
||||||
|
|
||||||
Taro.setNavigationBarColor({
|
Taro.setNavigationBarColor({
|
||||||
frontColor: '#000000',
|
frontColor: '#000000',
|
||||||
|
|
@ -469,7 +468,7 @@ function MemberIndex (props) {
|
||||||
// console.log('====config===', config.menu)
|
// console.log('====config===', config.menu)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SpPage loading={state.loading} className='pages-member-index has-navbar' renderFooter={<SpTabbar />} title='' showNavSearchIcon={false} showNavBackIcon={false} showNavLogo isBlack isTop>
|
<SpPage loading={state.loading} className='pages-member-index has-navbar' renderFooter={<SpTabbar />} isTop>
|
||||||
<View
|
<View
|
||||||
className='header-block'
|
className='header-block'
|
||||||
style={styleNames({
|
style={styleNames({
|
||||||
|
|
@ -552,12 +551,14 @@ function MemberIndex (props) {
|
||||||
|
|
||||||
{isLogin && <View className="header-code">
|
{isLogin && <View className="header-code">
|
||||||
<Text className="" onClick={() => {
|
<Text className="" onClick={() => {
|
||||||
// Taro.navigateTo({ url: '/subpages/member/member-level' })
|
Taro.navigateTo({ url: '/subpages/member/member-level' })
|
||||||
}}>{
|
}}>{
|
||||||
vipInfo.isVip ? vipInfo.grade_name || '会员' : userInfo?.gradeInfo?.grade_name || ''
|
{
|
||||||
|
true: vipInfo.grade_name || '会员',
|
||||||
|
false: userInfo?.gradeInfo?.grade_name || ''
|
||||||
|
}[vipInfo.isVip]
|
||||||
}</Text>
|
}</Text>
|
||||||
<Text></Text>
|
<SpImage onClick={handleClickLink.bind(this, '/marketing/pages/member/member-code')} src='member/qr-code.png' height={30} width={30} isNew />
|
||||||
{/* <SpImage onClick={handleClickLink.bind(this, '/marketing/pages/member/member-code')} src='member/qr-code.png' height={30} width={30} isNew /> */}
|
|
||||||
</View>}
|
</View>}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
@ -709,30 +710,26 @@ function MemberIndex (props) {
|
||||||
<View className="member_con_left">
|
<View className="member_con_left">
|
||||||
{/* /subpages/pointshop/list */}
|
{/* /subpages/pointshop/list */}
|
||||||
<View className="member_con_item" onClick={isLogin && handleClickLink.bind(this, '/subpages/marketing/coupon-center')}>
|
<View className="member_con_item" onClick={isLogin && handleClickLink.bind(this, '/subpages/marketing/coupon-center')}>
|
||||||
<SpImage className="member_con_item_img" src="member/jifen.png" height={windowWidth < 400 ? 200 : 220} mode='aspectFill' isNew />
|
<SpImage className="member_con_item_img" src="member/jifen.png" height={290} mode='aspectFill' isNew />
|
||||||
<View className="member_con_item_txt">卡券与兑换</View>
|
<View className="member_con_item_txt">积分兑换</View>
|
||||||
</View>
|
|
||||||
<View className="member_con_item" onClick={isLogin && handleClickLink.bind(this, '/subpages/member/qa-page')}>
|
|
||||||
<SpImage className="member_con_item_img" src="member/wenti.png" height={windowWidth < 400 ? 200 : 220} mode='aspectFill' isNew />
|
|
||||||
<View className="member_con_item_txt">常见问题</View>
|
|
||||||
</View>
|
</View>
|
||||||
<View className="member_con_item" onClick={isLogin && handleClickLink.bind(this, '/pages/member/item-fav')}>
|
<View className="member_con_item" onClick={isLogin && handleClickLink.bind(this, '/pages/member/item-fav')}>
|
||||||
<SpImage className="member_con_item_img" src="member/shoucang.png" height={windowWidth < 400 ? 200 : 220} mode='aspectFill' isNew />
|
<SpImage className="member_con_item_img" src="member/shoucang.png" height={290} mode='aspectFill' isNew />
|
||||||
<View className="member_con_item_txt">个人收藏</View>
|
<View className="member_con_item_txt">个人收藏</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className='gap'></View>
|
<View className='gap'></View>
|
||||||
<View className="member_con_right">
|
<View className="member_con_right">
|
||||||
<View className="member_con_item" onClick={isLogin && handleClickLink.bind(this, '/subpages/member/user-info')}>
|
<View className="member_con_item" onClick={isLogin && handleClickLink.bind(this, '/subpages/member/user-info')}>
|
||||||
<SpImage className="member_con_item_img" src="member/geren.png" height={windowWidth < 400 ? 200 : 220} mode='aspectFill' isNew />
|
<SpImage className="member_con_item_img" src="member/geren.png" height={190} mode='aspectFill' isNew />
|
||||||
<View className="member_con_item_txt">个人信息</View>
|
<View className="member_con_item_txt">个人信息</View>
|
||||||
</View>
|
</View>
|
||||||
<View className="member_con_item" onClick={handleClickLink.bind(this, '/marketing/pages/member/address')}>
|
<View className="member_con_item" onClick={handleClickLink.bind(this, '/marketing/pages/member/address')}>
|
||||||
<SpImage className="member_con_item_img" src="member/dizhi.png" height={windowWidth < 400 ? 200 : 220} mode='aspectFill' isNew />
|
<SpImage className="member_con_item_img" src="member/dizhi.png" height={190} mode='aspectFill' isNew />
|
||||||
<View className="member_con_item_txt">地址管理</View>
|
<View className="member_con_item_txt">地址管理</View>
|
||||||
</View>
|
</View>
|
||||||
<View className="member_con_item" onClick={isLogin && handleClickLink.bind(this, '/subpage/pages/trade/invoice-record')}>
|
<View className="member_con_item" onClick={isLogin && handleClickLink.bind(this, '/subpage/pages/trade/invoice-record')}>
|
||||||
<SpImage className="member_con_item_img" src="member/fapiao.png" height={windowWidth < 400 ? 200 : 220} mode='aspectFill' isNew />
|
<SpImage className="member_con_item_img" src="member/fapiao.png" height={190} mode='aspectFill' isNew />
|
||||||
<View className="member_con_item_txt">发票管理</View>
|
<View className="member_con_item_txt">发票管理</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -310,14 +310,14 @@
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
&_left {
|
&_left {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-rows: repeat(3, auto);
|
grid-template-rows: repeat(2, auto);
|
||||||
grid-gap: 10px;
|
grid-gap: 10px;
|
||||||
}
|
}
|
||||||
&_item {
|
&_item {
|
||||||
position: relative;
|
position: relative;
|
||||||
&_txt {
|
&_txt {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 20px;
|
left: 20px;
|
||||||
bottom: 30px;
|
bottom: 30px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
|
|
@ -406,8 +406,7 @@
|
||||||
line-height: 78rpx;
|
line-height: 78rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
/* prettier-ignore */
|
border: 1px solid #000;
|
||||||
border: 1PX solid #000;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
|
||||||
|
|
@ -1,111 +0,0 @@
|
||||||
const data = [{
|
|
||||||
title: "购物相关", isOpen: false, content: [{ subTit: "如何选择鞋子尺码?", subCon: "先量脚长,再看尺码会更准确喔。如果您平日穿着的鞋履是42码或42码以下,您可以按照正码选购;如果您平日穿着的鞋履是42码以上,建议您可选小一码。在此判断标准上,如您的脚背高、脚宽或者计划搭配袜子穿,建议您选择大一码的鞋子;或如您打算购买带有羊毛衬里的拖鞋搭配袜子穿着,也建议您选择大一码的鞋子。" },
|
|
||||||
{ subTit: "如何测量脚长?", subCon: "建议您赤脚,脚后紧靠墙面站立,脚下放一把卷尺;读取最长脚趾长度以(毫米为单位)做为依据来选鞋子尺码。" },
|
|
||||||
{ subTit: "鞋子的窄版和常规版是指什么?", subCon: "一般来说,我们40码以下的鞋子为窄版,40码以上的鞋子为常规版,从解剖学上来说,我们常规版的设计更加适合男性的足部构造,窄版设计更加适合女性的足部构造。除此之外,我们的部分款式39码也有常规版可选,您可以点击具体商品的详情页面查看相关信息进行选购。" },
|
|
||||||
{ subTit: "如何区分常规软木鞋床和软底软木鞋床?", subCon: `我们的软底鞋床印有"Soft-footbed"的蓝色标记,软底鞋床有特殊材料制成的填充物,该材料由数以百万计的微小气泡组成,可以有效缓解由行走或站立带来的疲劳感;常规款的鞋床标记为黑色或金色,环保鞋款鞋床标记则为绿色。` },
|
|
||||||
{ subTit: "所有BIRKENSTOCK鞋都是男女同款吗?", subCon: `视具体鞋款而定,我们的大多数鞋款是不分性别皆可穿着的(例如Arizona, Boston……),某些特定鞋款是在产品设计时就结合了女性的造型时尚和生理学特征(例如Mayari,Madrid……),详情可参考具体的产品页面。` },
|
|
||||||
{ subTit: '为什么一些鞋子看起来款式和颜色都一样,但是价格不同?', subCon: `同款同色的BIRKENSTOCK鞋履可能会因材质不同而有价格略有差异,视具体情况而定。` },
|
|
||||||
{ subTit: '什么是环保商品?所有款式都有环保材质的吗?', subCon: `BIRKENSTOCK 一直秉持环保生产的理念,环境保护一直是我们的的首要任务,我们使用的绝大部分原料皆为纯天然材料:软木、天然乳胶、黄麻等等。BIRKENSTOCK 环保鞋是指在生产过程中完全不使用任何动物性材料,而是有意识地只使用人工合成材料和天然材料,在保证 BIRKENSTOCK 鞋款的功能性和时尚性的同时,打造一个完全动物友好的产品系列。` },
|
|
||||||
{ subTit: `BIRKENSTOCK鞋防水吗?`, subCon: `我们有 EVA 材质制成的防水款式。但大多数款式都不能浸泡在水中,因为过度浸泡会损害密封材料的完整性。` },
|
|
||||||
{ subTit: `你网站上的所有商品在商店里也有售吗?`, subCon: `线上官方小程序的商品种类,与其他官方渠道可能略有不同,请以实际情况为准。` },
|
|
||||||
{ subTit: '有固定的促销活动和新品上架时间吗?', subCon: `建议您添加我们的微信官方小程序,关注BIRKENSTOCK微信公众号、小红书官方账号、新浪官方微博,及时掌握新品上架或促销活动第一手信息。` },
|
|
||||||
{ subTit: '港澳台及海外地区是否可以购买?', subCon: `我们的配送地址范围为中国大陆地区,暂不支持港澳台及海外地区的配送。` },
|
|
||||||
{ subTit: `可以使用哪些付款方式?`, subCon: `您可以使用微信支付,目前我们暂不支持其他支付方式。` },
|
|
||||||
{ subTit: `发货时效和发货快递`, subCon: `您的订单将通过顺丰快递从上海发出,顺丰快递服务范围不到的地区我们会为您选用其他的快递服务商。根据地点不同,配送所花费的时间也有所差异,一般送货周期为2-5天,偏远地区送货周期可能会有相应延长。由于物流配送中的不确定性,请您谅解我们无法承诺绝对准确的送达时间。` },
|
|
||||||
{ subTit: `我收到鞋子了,看起来都被刮伤了?`, subCon: `我们的部分特定皮革鞋面是经过油脂涂覆处理的,这能使皮革本身呈现出更加有质感的外观和丰富的色彩变化。经过油脂处理的皮革鞋面上出现表面划痕或看起来像的划痕是正常的,随着皮革在穿着过程中与您足部的磨合,它们会自行淡化。您也可以尝试用手指轻拭,因为您的自然体温可以帮助皮革重新分配其表面的油脂涂层,从而达到柔化痕迹的效果。如果您更喜欢带有统一颜色的外观,我们建议您可以选择磨毛皮、光滑皮革或合成材料制作的鞋履。` },
|
|
||||||
{ subTit: `怎样进行日常护理清洁?`, subCon: `不同材质的鞋履的护理方式均有所不同,建议您关注我们的官方微信公众号或小红书账号”BIRKENSTOCK"并查看相关鞋履的护理、清洁信息。` }]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: '订单相关', isOpen: false, content: [{ subTit: "我可以修改订单吗?", subCon: `如果您单次购买多件商品,可在购物车内勾选相关商品一并下单,我们将为你按照一笔订单同时发货。对于来自同一个账户的分时不同批次多订单,我们不能将多张订单进行合并,也不能将多张订单合并发货;另外您一旦点击确认并提交订单后,我们客服将无法修改订单内容,包括商品信息、总价金额等等。` },
|
|
||||||
{ subTit: '我未付款的订单可以保留多久?', subCon: `若您在提交订单后未在规定的时间内及时付款,则在该时限届满后,已提交的相关订单将被自动取消。除非本商城的商品详情页面另有不同的说明或该商品使用的销售规则或活动规则另有不同说明,如果我们在收到您确认提交订单后30分钟内没有收到全额付款,您的该笔订单将被自动取消。` },
|
|
||||||
{ subTit: `已经发货了,我能取消订单吗?`, subCon: `如果您的订单已经提交且尚未支付,您可以自行取消订单;对于已经发货的订单,您可以在收到商品后七天之内,且商品保持完好的情况下申请无理由退货。` },
|
|
||||||
{ subTit: `当天购物会当天发货吗?`, subCon: `一般情况下,当日15:00之前付款的订单可以当天发货,15:00之后的订单为您安排隔日发货。` },
|
|
||||||
{ subTit: `哪里可以看到发货?为什么很久没收到货品?`, subCon: `您可以登录BIRKENSTOCK微信小程序商城,在“我的订单”中找到需要查询的订单,订单详情中会有相关物流公司的物流信息。您可直接登陆到相关的物流公司网站查询物流信息,或联系在线客服为您进行物流查询服务。为了顾客能尽快收到货品,一般情况下,我们在您付款后24小时左右会为您安排发货,周六、周日均正常发货。而在大型促销活动期间,发货会有稍许延迟;在已发货的情况下如您长时间未收到货,请耐心等待或与物流公司联系。如遇到特殊情况(仓库盘点,节假日)、天气、人力等因素导致延迟发货或延长送货时间,我们将会提前以公告或其他形式告知。` },
|
|
||||||
{
|
|
||||||
subTit: `为什么我的订单没发货?`, subCon: `您的订单未发货可能有以下原因:
|
|
||||||
(1)您的订单中可能有尚待确认的信息,所以订单处于保留状态,通常在您下单后,我们的客服会第一时间与您取得联系,请您保持手机畅通,一旦确认后将马上进行发货处理;
|
|
||||||
(2)可能您的订单仓库正在发货,订单信息还没有更新成功,还请您耐心等待。`},
|
|
||||||
{ subTit: '商品已经发货了,但是我需要更改收货地址,可以吗?', subCon: `我们会联系快递尝试修改地址,已经发货的订单需要到中转站点后才能知晓修改是否成功,相对比较耗时,建议您可以安排拒收,我们也会通知物流进行包裹拦截。若您仍需要此款商品,建议重新下单,非常抱歉由此给您带来的不便,我们会尽快为您跟进处理新的订单。` },
|
|
||||||
{ subTit: '如果在收到商品时发现错发或者质量有问题的情况怎么办?', subCon: `"请与快递沟通在签收之前检查外包装是否破损以及打开包装验视商品本身,如果商品发生错发或有任何质量问题,请保留相关单据完整并第一时间联系我们 服人员帮您进行后续操作。"` },
|
|
||||||
{ subTit: '在BIRKENSTOCK小程序官方店购买的商品可以在实体店铺内退换货吗?', subCon: '非常抱歉,如您对BIRKENSTOCK小程序官方店购买的商品有任何问题请联系在线客服。实体店铺不受理在线上购买商品的退货,同样BIRKENSTOCK小程序官方店也不受理在实体店铺购买商品的退货。' },
|
|
||||||
{ subTit: '退换货政策', subCon: `所有退换商品的包装及鞋子在符合退换货的条件下可进行退换货。详情请查看BIRKENSTOCK勃肯退换货政策(word文档,加链接)` },
|
|
||||||
{ subTit: '收货后我还可以通过支付差价来换不同的款式吗?', subCon: `非常抱歉,我们只有只能对相同的商品更换不同的尺寸的服务。不提供不同款式的换货服务,如果您的订单已经提交且尚未支付,您可以自行取消订单,并重新下单您心仪的商品。` },
|
|
||||||
{ subTit: '我可以在同一个退货包中包含多个订单吗?', subCon: `为了能够及时处理您的退货和退款,我们建议您同一订单中的多件商品可以使用同一退货包裹退回; 多个订单中的商品请分别按照原订单中的数量及型号退回,请勿混合退回多个订单中的商品。` },
|
|
||||||
|
|
||||||
{ subTit: '我的退货跟踪显示已送达,但我尚未收到退款。我能做什么?', subCon: `我们在收到您的退货要求后会及时为您发起退款流程,通常所需时间为1-3周不定,如果超出该时间范围,请及时联系我们的在线客服。` },
|
|
||||||
{ subTit: `收到退款需要多长时间?`, subCon: `我们在收到您的退货后会及时为您处理退款流程,通常所需时间为1-3周,如果超出该时间范围,请联系我们的在线客服。` }]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: '发票相关', isOpen: false, content: [{ subTit: '可以开具发票吗?', subCon: `可以。如有需要,请您在订单结算时选择“开发票”并在备注栏中正确填写发票抬头,发票金额为您实际支付的商品金额。折扣与快递费用不开具发票,请您谅解。` },
|
|
||||||
{ subTit: '可以指定开票日期吗?', subCon: `很抱歉,根据税务相关规定我们不提供指定开票日期的服务。` },
|
|
||||||
{ subTit: `退货后发票怎么办?`, subCon: `订单发生退货,您原来的发票会自动作废,无法再下载使用。如您购买多件商品后申请退货,在退货完成后,您的电子发票信息将会自动更新,在您的历史订单中下载发票。` },
|
|
||||||
{ subTit: `可以补开发票吗?`, subCon: `可以,您可以通过联系我们的在线客服申请开具已完成订单的发票。` },
|
|
||||||
{ subTit: `发票抬头如何修改?`, subCon: `如您购买的商品还未付款,建议您在有库存的情况下,重新下单填并写正确的开票信息。如您购买的商品全部发货未满7天,客服查询到您的订单处于未完成状态,目前还不能为您更改发票相关信息。待您的订单发货时长达到7天后可联系客服办理。如您购买的商品发货时间达到7天,请您提供正确的相关信息给到客服,客服会在1-5个工作日为您修改正确的发票抬头,并更新在您的订单信息内。` }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '意见反馈', isOpen: false, content: [{ subTit: `如何反馈其他问题?`, subCon: '如果您对本平台显示的材料或者购物过程中又任何疑虑或异议,或希望提供建议和意见,您可以联系我们的客服:021-62716091,或者写信给我们:bscn_mp_store@birkenstock.com。' }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '退换货政策', isOpen: false, content: [
|
|
||||||
{ subTit: `BIRKENSTOCK官方网站退换货政策(中国大陆)`, subCon: '' },
|
|
||||||
{ subTit: `一、政策适用范围`, subCon: `诚挚欢迎您光临BIRKENSTOCK微信小程序官方店,以下是我们的退换货政策。` },
|
|
||||||
{ subTit: `二、退换货条件`, subCon: `为了确保您的购物体验顺利愉快,我们需要您注意以下退换货条件:`, subContents: [' 1.商品应保持完好,包括商品本身及其鞋盒、配件、吊牌等完整无损。', ' 2.请提供原始收银凭证或购物凭证以办理退换货。', ' 3.申请退换货应在签收之日起7天内进行。'] },
|
|
||||||
{ subTit: `三、退换货特别约定`, subCon: `针对特定情形的退换货特别处理:`, subContents: [' 1.鞋类商品的合格证及三包服务卡以鞋盒上粘贴的规定为准。', ' 2.退货仅限在原购买商品的微信小程序平台进行。', ' 3.不同渠道购买的商品暂不支持跨渠道退换货。', ' 4.在下单过程中使用优惠券、积分兑换券等折扣券,该笔订单如需退货,折扣券将不予返还。'] },
|
|
||||||
{
|
|
||||||
subTit: '四、鞋类商品质保规定',
|
|
||||||
subCon: '为了保障您的权益,敬请留意以下信息:',
|
|
||||||
subContents: [' 1.质保期限',
|
|
||||||
' 质保期限为自鞋类商品购买之日起90天。',
|
|
||||||
' 2.质保范围',
|
|
||||||
' 1)质保期内,如鞋类商品发生质量问题,可凭原始购物凭证办理退货或换货。BIRKENSTOCK暂不提供维修服务。如您购买的鞋类商品因质量问题需要维修,请按照下述退换货流程操作。',
|
|
||||||
' 2)如您购买的鞋类商品在正常穿着情况下存在以下任一质量问题,您可以选择退货或换货处理:',
|
|
||||||
' a.凡在第一个月内出现断底、断跟、断面、断帮质量问题之一者。',
|
|
||||||
' b.凡属包换的质量问题而因故无法调换者,可予以退货。',
|
|
||||||
` c.在第一个月内出现“包修”质量问题且无法予以调换者,可酌情按购买产品实际支付价格的每日0.5%收取折旧费,并予以退货。`,
|
|
||||||
` d.凡未经穿过的新鞋不成双,鞋子大小或鞋内出现开胶之一者。`,
|
|
||||||
` e.凡在第一周内胶黏皮鞋发生开胶(帮底结合处脱落或弹开长度2cm,深度0.5cm以上者)`,
|
|
||||||
` f.凡属“包修”的质量问题,在第一个月予以更换。`,
|
|
||||||
` g.包修:帮底结合处开胶脱落或弹出长度2cm深度0.5cm以下者;`,
|
|
||||||
` --第一周外胶黏皮皮鞋发生开胶;`,
|
|
||||||
` --胶粘鞋发生开胶;`,
|
|
||||||
` --出现断底、断跟、断面、断帮;`,
|
|
||||||
` h.两只鞋颜色明显不一、尺码不等或一边脚;`,
|
|
||||||
` i.其他法律规定的质量问题。`,
|
|
||||||
` 3)您在不同渠道 (微信小程序官方店、天猫官方旗舰店、京东官方旗舰店、抖音官方旗舰店、实体店) 购买的鞋类商品,暂不支持跨渠道办理退换货,敬请谅解。鞋类商品的退换货操作流程详见下述退换货流程。`,
|
|
||||||
|
|
||||||
' 3.质保例外',
|
|
||||||
` 以下情形不属于质保服务范围,敬请谅解:`,
|
|
||||||
` a.因穿着、保养、使用或保管不当等造成的损坏;`,
|
|
||||||
` b.因自行拆改或修理造成的损坏;`,
|
|
||||||
` c.超出质保期限的商品;`,
|
|
||||||
` d.无原始购物凭证的商品。`]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
subTit: '五、退换货流程',
|
|
||||||
subCon: `购买于BIRKENSTOCK微信小程序官方店的商品退换货流程如下:`,
|
|
||||||
subContents: [` 1.购买于微信小程序官方店的商品,若符合本政策约定的退换货条件,可按以下流程操作退货:`,
|
|
||||||
` a.请您在收到商品之日(以快递签收日期为准)7天内,联系微信小程序官方店的客服申请退货;`,
|
|
||||||
` b.在与客服确认符合退货条件后,可予退货。请在“我的订单”页面提交退货申请,并填写退货快递单号。`,
|
|
||||||
` 退货申请提交后,请将您的原始购物明细单随退货商品一并快递至以下地址及收件人:`,
|
|
||||||
` 退货地址:`,
|
|
||||||
` 上海市奉贤区 奉城镇东新市村(朝阳)1160号`,
|
|
||||||
` 奉城普洛斯物流园B1库1FU3单元圆具嘉 大叶公路靠申江南路`,
|
|
||||||
` 收件人:勃肯退货组(XCX) 19901781571`,
|
|
||||||
` 2.微信小程序官方店目前暂时仅提供相同商品不同尺寸的更换服务,不提供不同款式的换货服务。若您对购买的商品不满意,需要退换,请按照上述流程操作,或联系我们的在线客服询问详情。`,
|
|
||||||
` 3.退回商品的运费将由您承担,BIRKENSTOCK暂不接受到付、平邮、邮政小包退件。为了您的方便与顺利,建议您使用顺丰快递,以确保快速安全地退回商品。`,
|
|
||||||
` 4.如果您退货的商品享受了价格优惠,最终退款金额将以您实际支付的金额为准。退货退款的到账时间会根据您原始支付方式的不同而有所差异。如有任何疑问,请联系我们的在线客服。`]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
subTit: '六、售后客服时间',
|
|
||||||
subCon: '我们的售后客服团队随时为您提供支持,您可以通过在线客服咨询,或者电话联系我们。',
|
|
||||||
subContents: ['售后服务热线:021-62716091',
|
|
||||||
`在线客服服务时间:周一至周日9:00 - 24:00(法定节假日或大促期间的服务时间将另行通知)`,]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
export default data
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
export default {
|
|
||||||
navigationBarTitleText: '小程序自助服务Q&A',
|
|
||||||
}
|
|
||||||
|
|
@ -1,102 +0,0 @@
|
||||||
import React, { useEffect } from 'react'
|
|
||||||
import { View, Text, ScrollView } from '@tarojs/components'
|
|
||||||
import { AtAccordion, AtIcon } from 'taro-ui'
|
|
||||||
import { SpPage, SpHtml } from '@/components'
|
|
||||||
import { useImmer } from 'use-immer'
|
|
||||||
import introData from './qa-data'
|
|
||||||
import { classNames } from '@/utils'
|
|
||||||
|
|
||||||
import './qa-page.scss'
|
|
||||||
import { getCurrentInstance } from '@tarojs/taro'
|
|
||||||
|
|
||||||
|
|
||||||
const initState = {
|
|
||||||
introList: introData,
|
|
||||||
scrollTop: 0,
|
|
||||||
}
|
|
||||||
export default function qaPage () {
|
|
||||||
const [state, setState] = useImmer(initState)
|
|
||||||
const { introList, scrollTop } = state
|
|
||||||
const $instance = getCurrentInstance()
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const { index } = $instance.router.params
|
|
||||||
if (index) {
|
|
||||||
setState((draft) => {
|
|
||||||
draft.introList = draft.introList.map((v, i) => {
|
|
||||||
if (i == index) {
|
|
||||||
v.isOpen = true
|
|
||||||
} else {
|
|
||||||
v.isOpen = false
|
|
||||||
}
|
|
||||||
return v
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
|
||||||
<SpPage className="page-member-qa">
|
|
||||||
<ScrollView scrollY scrollWithAnimation showScrollbar={false} scrollTop={scrollTop} className="qa-page-scrool">
|
|
||||||
{introList.length ? introList.map((item, index) => <View className={classNames('sp-accordion')} key={`item__${index}`}>
|
|
||||||
<AtAccordion
|
|
||||||
open={item.isOpen}
|
|
||||||
isAnimation={false}
|
|
||||||
onClick={() => {
|
|
||||||
setState((draft) => {
|
|
||||||
draft.introList = draft.introList.map((v, i) => {
|
|
||||||
v.isOpen = false
|
|
||||||
return v
|
|
||||||
})
|
|
||||||
draft.introList[index].isOpen = !item.isOpen
|
|
||||||
draft.scrollTop = 0
|
|
||||||
})
|
|
||||||
// if (!item.isOpen) {
|
|
||||||
// setState((draft) => {
|
|
||||||
// draft.scrollTop = 1042 + Math.random() / 10
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
}}
|
|
||||||
title={item.title}
|
|
||||||
>
|
|
||||||
{/* <SpHtml content={item.content} /> */}
|
|
||||||
<View className="content">
|
|
||||||
{item.content.map((v, i) => (
|
|
||||||
<View className="content-item" key={i + '_content'}>
|
|
||||||
<View className="content-item-title" >
|
|
||||||
{v.subTit}
|
|
||||||
{/* <Text className="title"></Text> */}
|
|
||||||
</View>
|
|
||||||
{!!v.subCon && <View className="title-desc">
|
|
||||||
<View style={{ marginBottom: v.subContents ? '4px' : '0' }} >{v.subCon}</View>
|
|
||||||
{/* {v.subContents ? v.subContents.map(s => <View style={{ marginBottom: '4px' }} > {s}</View >) : null} */}
|
|
||||||
{v.subContents ? v.subContents.map(s => <SpHtml content={s} style={{ marginBottom: '4px' }} />) : null}
|
|
||||||
</View>}
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
</View>
|
|
||||||
</AtAccordion>
|
|
||||||
<View onClick={() => {
|
|
||||||
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 ? <AtIcon value='subtract' size='16' color='#000' /> :
|
|
||||||
<AtIcon value='add' size='16' color='#000' />}
|
|
||||||
{item.isOpen ? <></> : <View className="line"></View>}
|
|
||||||
</View>
|
|
||||||
</View>) : <View style={{ height: `calc(100% - 380px)` }}></View>}
|
|
||||||
</ScrollView>
|
|
||||||
</SpPage>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
.page-member-qa {
|
|
||||||
// height: 95vh;
|
|
||||||
// overflow: hidden;
|
|
||||||
.sp-page-body {
|
|
||||||
position: relative;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
/* prettier-ignore */
|
|
||||||
border-top: 1PX solid #9e9e9e80;
|
|
||||||
}
|
|
||||||
.scroll-box {
|
|
||||||
// @include page-scroll(calc(var(--nav-height) + 150px), 40px);
|
|
||||||
// height: calc(var(--nav-height) + 150px);
|
|
||||||
margin-bottom: 10px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
flex-direction: column;
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
|
||||||
.qa-page-scrool {
|
|
||||||
--height: calc(var(--status-bar-height) + #{$tabbar-height} + var(--area-bottom-height));
|
|
||||||
overflow: hidden;
|
|
||||||
height: calc(100vh - var(--height));
|
|
||||||
}
|
|
||||||
.sp-accordion {
|
|
||||||
position: relative;
|
|
||||||
&:last-child {
|
|
||||||
margin-bottom: 40rpx;
|
|
||||||
}
|
|
||||||
.at-accordion__header {
|
|
||||||
padding: 30px 40px;
|
|
||||||
color: #000;
|
|
||||||
&::after {
|
|
||||||
border: none;
|
|
||||||
// border-bottom: 1px solid #9e9e9e80;
|
|
||||||
}
|
|
||||||
.at-accordion__info__title {
|
|
||||||
font-size: 30px;
|
|
||||||
}
|
|
||||||
.at-accordion__arrow {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.at-accordion__content {
|
|
||||||
&::after {
|
|
||||||
border: none;
|
|
||||||
// border-bottom: 1px solid #9e9e9e80;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.at-accordion__body {
|
|
||||||
padding: 0 40px;
|
|
||||||
padding-bottom: 30px;
|
|
||||||
.content {
|
|
||||||
&-item {
|
|
||||||
&-title {
|
|
||||||
font-size: 30px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.title-desc {
|
|
||||||
margin-bottom: 40px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.at-icon {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 0;
|
|
||||||
right: 40px;
|
|
||||||
top: 54px;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
transition: all 0.2s ease-in-out;
|
|
||||||
}
|
|
||||||
.line {
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 1px;
|
|
||||||
background: #9e9e9e80;
|
|
||||||
top: 104px;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
transition: all 0.2s ease-in-out;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -60,8 +60,8 @@ export default function scan () {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRecords = async () => {
|
const getRecords = async () => {
|
||||||
const data = await api.user.getVerifyRegistrationRecordList({ activity_id: 2 })
|
const data = await api.user.registrationRecordList()
|
||||||
const _list = (data?.list || []).map(item => {
|
const _list = (data?.list || []).filter(n => n.is_write_off == 1).map(item => {
|
||||||
let formData = item.content?.[0]?.formdata || []
|
let formData = item.content?.[0]?.formdata || []
|
||||||
if (formData.length > 0) {
|
if (formData.length > 0) {
|
||||||
formData.forEach(_item => {
|
formData.forEach(_item => {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ const initialState = {
|
||||||
showCheckboxPicker: false,
|
showCheckboxPicker: false,
|
||||||
checkboxKey: '',
|
checkboxKey: '',
|
||||||
checkboxList: [],
|
checkboxList: [],
|
||||||
checked: true,
|
checked: false,
|
||||||
info: {},
|
info: {},
|
||||||
areaList: [],
|
areaList: [],
|
||||||
multiIndex: [],
|
multiIndex: [],
|
||||||
|
|
@ -450,10 +450,9 @@ function MemberUserInfo () {
|
||||||
const handleLogOff = async () => {
|
const handleLogOff = async () => {
|
||||||
const { status, msg } = await api.member.deleteMember({ is_delete: '0' })
|
const { status, msg } = await api.member.deleteMember({ is_delete: '0' })
|
||||||
if (!status) {
|
if (!status) {
|
||||||
Taro.showModal({
|
await Taro.showModal({
|
||||||
content: msg,
|
content: msg,
|
||||||
confirmText: '我知道了',
|
confirmText: '我知道了'
|
||||||
showCancel: false,
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
|
|
@ -618,28 +617,27 @@ function MemberUserInfo () {
|
||||||
<View className='block-container'>
|
<View className='block-container'>
|
||||||
<View className='check-box'>
|
<View className='check-box'>
|
||||||
{/* <Checkbox value='选中' checked={state.checked} >选中</Checkbox> */}
|
{/* <Checkbox value='选中' checked={state.checked} >选中</Checkbox> */}
|
||||||
<SpCheckbox checked={checked} disabled colors="#000" onChange={() => setState((draft) => { draft.checked = !checked })} />
|
<SpCheckbox checked={checked} colors="#000" onChange={() => setState((draft) => { draft.checked = !checked })} />
|
||||||
<View>
|
<View>
|
||||||
<Text onClick={() => false && setState((draft) => { draft.checked = !draft.checked })} >我已经阅读并同意</Text>
|
<Text onClick={() => setState((draft) => { draft.checked = !draft.checked })} >我已经阅读并同意</Text>
|
||||||
<Text
|
<Text
|
||||||
onClick={() => Taro.navigateTo({ url: '/subpages/auth/reg-rule?type=member_register' })}
|
onClick={() => Taro.navigateTo({ url: '/subpages/auth/reg-rule?type=member_logout' })}
|
||||||
style={`color: #000000`}
|
style={`color: #000000`}
|
||||||
>
|
>
|
||||||
{`《${appName}使用条款》`}
|
{`《${appName}使用条款》`}
|
||||||
</Text>
|
</Text>
|
||||||
及
|
及
|
||||||
<Text
|
<Text
|
||||||
onClick={() => Taro.navigateTo({ url: '/subpages/auth/reg-rule?type=privacy' })}
|
onClick={() => Taro.navigateTo({ url: '/subpages/auth/reg-rule?type=privacyAndregister' })}
|
||||||
style={`color: #000000`}
|
style={`color: #000000`}
|
||||||
>
|
>
|
||||||
《隐私政策》
|
《隐私政策》
|
||||||
</Text>
|
</Text>
|
||||||
{/* privacyAndregister */}
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{/* 注销账号 */}
|
{/* 注销账号 */}
|
||||||
<View className="cancel-account">
|
<View className="cancel-account">
|
||||||
{/* <View className="cancel-account-left" onClick={() => Taro.navigateTo({ url: '/subpages/auth/reg-rule?type=privacyAndregister' })}>会员规则</View> */}
|
<View className="cancel-account-left" onClick={() => Taro.navigateTo({ url: '/subpages/auth/reg-rule?type=privacyAndregister' })}>会员规则</View>
|
||||||
<View className="cancel-account-right" onClick={handleLogOff}>账户注销</View>
|
<View className="cancel-account-right" onClick={handleLogOff}>账户注销</View>
|
||||||
</View>
|
</View>
|
||||||
{/* <SpCell
|
{/* <SpCell
|
||||||
|
|
|
||||||
|
|
@ -278,8 +278,7 @@
|
||||||
}
|
}
|
||||||
&-btn {
|
&-btn {
|
||||||
padding: 15px 20px;
|
padding: 15px 20px;
|
||||||
/* prettier-ignore */
|
border: 1px solid #fff;
|
||||||
border: 2px solid #fff;
|
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
||||||
|
|
@ -57,12 +57,6 @@ function TradeAfterSale (props) {
|
||||||
refundStore, contact, mobile, afterSaleDesc, offlineAftersalesIsOpen, offlineAftersales, afterSaleTotalNum, allClicked, afterSaleTotalprice, loading, isOpened, isAddrOpened, aftersales, expressList, corpIndex, logi_no } = state
|
refundStore, contact, mobile, afterSaleDesc, offlineAftersalesIsOpen, offlineAftersales, afterSaleTotalNum, allClicked, afterSaleTotalprice, loading, isOpened, isAddrOpened, aftersales, expressList, corpIndex, logi_no } = state
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const { id, type } = $instance.router.params
|
|
||||||
if (type) {
|
|
||||||
setState(v => {
|
|
||||||
v.curTabIdx = tabList.findIndex(item => item.type == type)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
fetch()
|
fetch()
|
||||||
Taro.eventCenter.on('onEventPickerStore', (item) => {
|
Taro.eventCenter.on('onEventPickerStore', (item) => {
|
||||||
console.log('onEventPickerStore:', item)
|
console.log('onEventPickerStore:', item)
|
||||||
|
|
@ -143,6 +137,7 @@ function TradeAfterSale (props) {
|
||||||
// order_id
|
// order_id
|
||||||
})
|
})
|
||||||
const _aftersales = pickBy(resInfo, doc.trade.TRADE_AFTER_SALES_ITEM)
|
const _aftersales = pickBy(resInfo, doc.trade.TRADE_AFTER_SALES_ITEM)
|
||||||
|
console.log("🚀 ~ _aftersales:", _aftersales)
|
||||||
if (_aftersales.sendbackData) {
|
if (_aftersales.sendbackData) {
|
||||||
const { corp_code } = _aftersales.sendbackData
|
const { corp_code } = _aftersales.sendbackData
|
||||||
_aftersales.sendbackData.name = LOGISTICS_CODE[corp_code]
|
_aftersales.sendbackData.name = LOGISTICS_CODE[corp_code]
|
||||||
|
|
@ -233,7 +228,7 @@ function TradeAfterSale (props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
const { id, type } = $instance.router.params
|
const { id } = $instance.router.params
|
||||||
const checkedItems = info?.items.filter(item => !!item.checked)
|
const checkedItems = info?.items.filter(item => !!item.checked)
|
||||||
if (checkedItems.length == 0) {
|
if (checkedItems.length == 0) {
|
||||||
return showToast('请选择需要售后的商品')
|
return showToast('请选择需要售后的商品')
|
||||||
|
|
@ -242,7 +237,7 @@ function TradeAfterSale (props) {
|
||||||
if (!reasons?.[reasonIndex]) {
|
if (!reasons?.[reasonIndex]) {
|
||||||
return showToast('请选择退货原因')
|
return showToast('请选择退货原因')
|
||||||
}
|
}
|
||||||
let aftersales_type = tabList[curTabIdx].type
|
const aftersales_type = tabList[curTabIdx].type
|
||||||
const reason = reasons?.[reasonIndex]
|
const reason = reasons?.[reasonIndex]
|
||||||
let params = {
|
let params = {
|
||||||
detail: checkedItems.map(({ id: _id, refundNum, num }) => {
|
detail: checkedItems.map(({ id: _id, refundNum, num }) => {
|
||||||
|
|
@ -296,17 +291,13 @@ function TradeAfterSale (props) {
|
||||||
|
|
||||||
const handleClickCopy = (val) => {
|
const handleClickCopy = (val) => {
|
||||||
copyText(val)
|
copyText(val)
|
||||||
// Taro.showToast({
|
Taro.showToast({
|
||||||
// title: '复制成功',
|
title: '复制成功',
|
||||||
// icon: 'none'
|
icon: 'none'
|
||||||
// })
|
})
|
||||||
}
|
|
||||||
const handleClickCopyAddr = () => {
|
|
||||||
const addr = `收货人:${aftersales?.afterSalesContact || ''}; 联系电话:${aftersales?.afterSalesMobile || ''}; 收货地址:${aftersales?.afterSalesAddress || ''}; 邮编:${aftersales?.afterSalesZip || ''}`
|
|
||||||
copyText(addr)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return <SpPage ref={pageRef} loading={loading} title={!afterSaleTid ? '申请售后' : '售后进度'} className='page-trade-after-sale has-navbar' isBlack renderFooter={
|
return <SpPage ref={pageRef} loading={loading} className='page-trade-after-sale has-navbar' isBlack showNavSearchIcon renderFooter={
|
||||||
!loading && !afterSaleTid ? <View className='btn-wrap'>
|
!loading && !afterSaleTid ? <View className='btn-wrap'>
|
||||||
<AtButton type='primary' onClick={onSubmit}>提交售后申请</AtButton>
|
<AtButton type='primary' onClick={onSubmit}>提交售后申请</AtButton>
|
||||||
</View> : null
|
</View> : null
|
||||||
|
|
@ -649,7 +640,7 @@ function TradeAfterSale (props) {
|
||||||
<View className="receiver_name op">如商家拒绝,您可以修改申请后再次发起,商家会重新处理</View>
|
<View className="receiver_name op">如商家拒绝,您可以修改申请后再次发起,商家会重新处理</View>
|
||||||
<View className="receiver_name op" style={{ marginBottom: '50rpx' }}>如商家超时未处理,退货申请将达成,请按系统给出的退货地址退货</View>
|
<View className="receiver_name op" style={{ marginBottom: '50rpx' }}>如商家超时未处理,退货申请将达成,请按系统给出的退货地址退货</View>
|
||||||
<View className={`receiver_name ${[1, 2].includes(aftersales?.progress) && 'active'}`}>寄回商品</View>
|
<View className={`receiver_name ${[1, 2].includes(aftersales?.progress) && 'active'}`}>寄回商品</View>
|
||||||
<View className={`receiver_name ${((aftersales?.progress == 8 && aftersales?.aftersalesStatus == 1) || (aftersales?.progress == 4 && aftersales?.aftersalesStatus != 2)) && 'active'}`}>商家退款</View>
|
<View className={`receiver_name ${aftersales?.progress == 4 && aftersales?.aftersalesStatus != 2 && 'active'}`}>商家退款</View>
|
||||||
<View className={`receiver_name ${aftersales?.progress == 4 && aftersales?.aftersalesStatus == 2 && 'active'}`}>退款成功</View>
|
<View className={`receiver_name ${aftersales?.progress == 4 && aftersales?.aftersalesStatus == 2 && 'active'}`}>退款成功</View>
|
||||||
<View className="line"></View>
|
<View className="line"></View>
|
||||||
<View className="curtain_content_text">
|
<View className="curtain_content_text">
|
||||||
|
|
@ -691,7 +682,7 @@ function TradeAfterSale (props) {
|
||||||
<View className="addr_item_left">邮编</View>
|
<View className="addr_item_left">邮编</View>
|
||||||
<View className="addr_item_right">{aftersales?.afterSalesZip}</View>
|
<View className="addr_item_right">{aftersales?.afterSalesZip}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className="fuzhi" onClick={handleClickCopyAddr} >复制地址</View>
|
<View className="fuzhi">复制地址</View>
|
||||||
<View className="line" style={{ margin: '130rpx 0 110rpx 0' }}></View>
|
<View className="line" style={{ margin: '130rpx 0 110rpx 0' }}></View>
|
||||||
<View className="curtain_content_text">
|
<View className="curtain_content_text">
|
||||||
<View className="curtain_content_text_title">温馨提示</View>
|
<View className="curtain_content_text_title">温馨提示</View>
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.btn-wrap {
|
.btn-wrap {
|
||||||
padding: 20rpx 50px;
|
padding: 50px;
|
||||||
// margin-bottom: 100px;
|
// margin-bottom: 100px;
|
||||||
.at-button__text {
|
.at-button__text {
|
||||||
font-size: 36px;
|
font-size: 36px;
|
||||||
|
|
|
||||||
|
|
@ -429,8 +429,8 @@ export const meiqiaInit = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const redirectUrl = async (api, url, type = 'redirectTo') => {
|
const redirectUrl = async (api, url, type = 'redirectTo') => {
|
||||||
if (!browser?.weixin) {
|
if (!browser.weixin) {
|
||||||
typeof url === 'string' && Taro[type]({ url })
|
Taro[type]({ url })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let newUrl = getUrl(url)
|
let newUrl = getUrl(url)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue