Commit 8908829a authored by wanghuan's avatar wanghuan

Merge branch 'c_client_taro-pack' of...

Merge branch 'c_client_taro-pack' of http://gitlab2.dui88.com/qinhaitao/taobao-mini-template into c_client_taro-pack
parents b3f52ed2 7c0fc16b
``` ```
taobao-mini-template taobao-mini-template
├─ .git
│ ├─ HEAD
│ ├─ config
│ ├─ description
│ ├─ hooks
│ │ ├─ applypatch-msg.sample
│ │ ├─ commit-msg.sample
│ │ ├─ fsmonitor-watchman.sample
│ │ ├─ post-update.sample
│ │ ├─ pre-applypatch.sample
│ │ ├─ pre-commit.sample
│ │ ├─ pre-merge-commit.sample
│ │ ├─ pre-push.sample
│ │ ├─ pre-rebase.sample
│ │ ├─ pre-receive.sample
│ │ ├─ prepare-commit-msg.sample
│ │ └─ update.sample
│ ├─ index
│ ├─ info
│ │ └─ exclude
│ ├─ logs
│ │ ├─ HEAD
│ │ └─ refs
│ │ ├─ heads
│ │ │ ├─ c_client_taro
│ │ │ └─ c_client_taro-pack
│ │ └─ remotes
│ │ └─ origin
│ │ └─ HEAD
│ ├─ objects
│ │ ├─ 2f
│ │ │ └─ 487f1f6678c0c8bdff4a4ca7e6891b282eda72
│ │ ├─ 69
│ │ │ └─ 2acc5b9d5055c47f8001b5e83553250e9cc0e7
│ │ ├─ 7a
│ │ │ └─ 1b61452a5b4e4d862338bb0519f2bfe0cf87b5
│ │ ├─ dd
│ │ │ └─ 3c8846e63fc1b968d5bca773e602109867e68f
│ │ ├─ e7
│ │ │ └─ f2857af41856483bb0663296756783671ebfaa
│ │ ├─ f0
│ │ │ └─ bc0499211ef47d6fe7687fd7108696e0446b67
│ │ ├─ info
│ │ └─ pack
│ │ ├─ pack-dcbf00005b3c8d9f7cd0a2991c1c6ff5e61496b9.idx
│ │ └─ pack-dcbf00005b3c8d9f7cd0a2991c1c6ff5e61496b9.pack
│ ├─ packed-refs
│ └─ refs
│ ├─ heads
│ │ ├─ c_client_taro
│ │ └─ c_client_taro-pack
│ ├─ remotes
│ │ └─ origin
│ │ └─ HEAD
│ └─ tags
├─ .gitignore
├─ ask.js
└─ c_client └─ c_client
├─ .editorconfig ├─ .editorconfig
├─ .eslintrc.js ├─ .eslintrc.js
...@@ -76,8 +19,7 @@ taobao-mini-template ...@@ -76,8 +19,7 @@ taobao-mini-template
├─ package-lock.json ├─ package-lock.json
├─ package.json ├─ package.json
├─ plugin ├─ plugin
│ ├─ changeAppJsonPlugin.js │ └─ changeAppJsonPlugin.js
│ └─ changeCompRoot.js
├─ project.config.json ├─ project.config.json
├─ src ├─ src
│ ├─ api.js │ ├─ api.js
...@@ -123,25 +65,52 @@ taobao-mini-template ...@@ -123,25 +65,52 @@ taobao-mini-template
│ │ │ ├─ CountDown │ │ │ ├─ CountDown
│ │ │ │ ├─ CountDown.jsx │ │ │ │ ├─ CountDown.jsx
│ │ │ │ └─ CountDown.less │ │ │ │ └─ CountDown.less
│ │ │ └─ Input │ │ │ ├─ GoodsList
│ │ │ │ ├─ GoodsList.jsx
│ │ │ │ └─ GoodsList.module.less
│ │ │ ├─ GoodsTitle
│ │ │ │ ├─ GoodsTitle.jsx
│ │ │ │ └─ GoodsTitle.module.less
│ │ │ ├─ Input
│ │ │ ├─ Progress
│ │ │ │ ├─ Progress.jsx
│ │ │ │ └─ Progress.module.less
│ │ │ ├─ RankList
│ │ │ │ ├─ RankList.jsx
│ │ │ │ └─ RankList.module.less
│ │ │ ├─ RankTitle
│ │ │ │ ├─ RankTitle.jsx
│ │ │ │ └─ RankTitle.module.less
│ │ │ ├─ ScrollXView
│ │ │ │ ├─ ScrollXView.jsx
│ │ │ │ └─ ScrollXView.module.less
│ │ │ └─ Swiper
│ │ │ ├─ Swiper.jsx
│ │ │ └─ Swiper.module.less
│ │ ├─ _tb_custom │ │ ├─ _tb_custom
│ │ │ └─ Test
│ │ │ ├─ Test.jsx
│ │ │ └─ Test.module.less
│ │ └─ _tb_modal │ │ └─ _tb_modal
│ │ ├─ DeliveryModal │ │ ├─ DeliveryModal
│ │ │ ├─ DeliveryModal.jsx │ │ │ ├─ DeliveryModal.jsx
│ │ │ └─ DeliveryModal.less │ │ │ └─ DeliveryModal.module.less
│ │ ├─ DoHelpModal │ │ ├─ DoHelpModal
│ │ │ ├─ DoHelpModal.jsx │ │ │ ├─ DoHelpModal.jsx
│ │ │ └─ DoHelpModal.module.less │ │ │ └─ DoHelpModal.module.less
│ │ ├─ GoodsPage │ │ ├─ PrizeModal
│ │ │ ├─ GoodsPage.jsx │ │ │ ├─ PrizeModal.jsx
│ │ │ └─ GoodsPage.less │ │ │ └─ PrizeModal.module.less
│ │ ├─ RuleModal │ │ ├─ RuleModal
│ │ │ ├─ RuleModal.jsx │ │ │ ├─ RuleModal.jsx
│ │ │ └─ RuleModal.module.less │ │ │ └─ RuleModal.module.less
│ │ └─ TasksModal │ │ ├─ TasksModal
│ │ ├─ TasksModal.config.js │ │ │ ├─ TasksModal.config.js
│ │ ├─ TasksModal.jsx │ │ │ ├─ TasksModal.jsx
│ │ └─ TasksModal.less │ │ │ └─ TasksModal.module.less
│ │ └─ ThanksModal
│ │ ├─ ThanksModal.jsx
│ │ └─ ThanksModal.module.less
│ ├─ config.js │ ├─ config.js
│ ├─ const.js │ ├─ const.js
│ ├─ hooks │ ├─ hooks
...@@ -155,6 +124,7 @@ taobao-mini-template ...@@ -155,6 +124,7 @@ taobao-mini-template
│ ├─ lottie │ ├─ lottie
│ │ ├─ index.js │ │ ├─ index.js
│ │ └─ lottieData.json │ │ └─ lottieData.json
│ ├─ mock.js
│ ├─ pages │ ├─ pages
│ │ ├─ index │ │ ├─ index
│ │ │ ├─ index.config.js │ │ │ ├─ index.config.js
...@@ -169,37 +139,29 @@ taobao-mini-template ...@@ -169,37 +139,29 @@ taobao-mini-template
│ │ │ ├─ browseGoods │ │ │ ├─ browseGoods
│ │ │ │ ├─ browseGoods.config.js │ │ │ │ ├─ browseGoods.config.js
│ │ │ │ ├─ browseGoods.jsx │ │ │ │ ├─ browseGoods.jsx
│ │ │ │ └─ browseGoods.less │ │ │ │ └─ browseGoods.module.less
│ │ │ ├─ cartGoods
│ │ │ │ ├─ cartGoods.config.js
│ │ │ │ ├─ cartGoods.jsx
│ │ │ │ └─ cartGoods.module.less
│ │ │ ├─ collectGoods │ │ │ ├─ collectGoods
│ │ │ │ ├─ collectGoods.config.js │ │ │ │ ├─ collectGoods.config.js
│ │ │ │ └─ collectGoods.jsx │ │ │ │ ├─ collectGoods.jsx
│ │ │ │ └─ collectGoods.module.less
│ │ │ └─ orderGoods │ │ │ └─ orderGoods
│ │ │ ├─ orderGoods.config.js │ │ │ ├─ orderGoods.config.js
│ │ │ └─ orderGoods.jsx │ │ │ ├─ orderGoods.jsx
│ │ │ └─ orderGoods.module.less
│ │ └─ packagePrize │ │ └─ packagePrize
│ │ └─ myPrize │ │ └─ myPrize
│ │ ├─ myPrize.config.js │ │ ├─ myPrize.config.js
│ │ ├─ myPrize.jsx │ │ ├─ myPrize.jsx
│ │ └─ myPrize.less │ │ └─ myPrize.module.less
│ ├─ store │ ├─ store
│ │ ├─ activityInfo.js │ │ ├─ activityInfo.js
│ │ ├─ index.js │ │ ├─ index.js
│ │ └─ loginInfo.js │ │ └─ loginInfo.js
│ ├─ styles │ ├─ styles
│ │ ├─ animate.less
│ │ ├─ border.less
│ │ ├─ flex.less
│ │ ├─ form.less
│ │ ├─ gap.less
│ │ ├─ image.less
│ │ ├─ index.less
│ │ ├─ layout.less
│ │ ├─ others.less
│ │ ├─ position.less
│ │ ├─ text.less
│ │ ├─ utils.less
│ │ └─ var.less
│ ├─ taro-ui.scss
│ └─ utils │ └─ utils
│ ├─ date.js │ ├─ date.js
│ ├─ mdProxy.js │ ├─ mdProxy.js
......
...@@ -17,8 +17,8 @@ export default { ...@@ -17,8 +17,8 @@ export default {
],// 引入cavas组件页面(更改canvas引用路径) ],// 引入cavas组件页面(更改canvas引用路径)
canvasComps: [// 拷贝相关页面和依赖到dist目录 canvasComps: [// 拷贝相关页面和依赖到dist目录
{ from: 'minigame/node_modules', to: 'dist/node_modules'}, { from: 'minigame/node_modules', to: 'dist/node_modules'},
{ from: 'src/lottie', to: 'dist/lottie'}, { from: 'src/components/_miniprogram/game', to: 'dist/components/_miniprogram/game'}, // 游戏组建引入
{ from: 'src/components/_miniprogram/game', to: 'dist/components/_miniprogram/game'}, { from: 'src/components/_miniprogram/lottieAnimation', to: 'dist/components/_miniprogram/lottieAnimation'}, // lottie 动画组件
{ from: 'src/components/_miniprogram/lottieAnimation', to: 'dist/components/_miniprogram/lottieAnimation'} { from: 'src/lottie', to: 'dist/lottie'},// lottie json文件
] ]
} }
\ No newline at end of file
import cloud from '@tbmp/mp-cloud-sdk' import cloud from '@tbmp/mp-cloud-sdk'
import tbccTs from 'tbcc-sdk-ts' import tbccTs from 'tbcc-sdk-ts'
import conifg from './config' import conifg from './config/index'
const { utils: { generateAPI }, request: tbccRequest, capi, capiFn } = tbccTs const { utils: { generateAPI }, request: tbccRequest, capi, capiFn } = tbccTs
const { cloudName, requestType } = conifg const { cloudName, requestType } = conifg
......
...@@ -4,7 +4,7 @@ import './app.less' ...@@ -4,7 +4,7 @@ import './app.less'
// 使用taro-ui 按需引入的组件样式 // 使用taro-ui 按需引入的组件样式
import './taro-ui.scss' import './taro-ui.scss'
import config from './config' import config from './config/index'
import './utils/mdProxy' import './utils/mdProxy'
const { env, tornadoAPI, defaultActivityId } = config const { env, tornadoAPI, defaultActivityId } = config
......
import { View } from '@tarojs/components'
import classnames from 'classnames'
import React, { useState } from 'react' import React, { useState } from 'react'
import Overlay from '../Overlay/Overlay' import Overlay from '../Overlay/Overlay'
import styles from './modal.module.less' import styles from './modal.module.less'
export default function Modal(props) { export default function Modal(props) {
const { closePostion = 'top-right', onClose = () => { }, top = '40%', hideCloseButton = false, closeOnClickOverlay = false } = props const { closePostion = 'top-right', onClose = () => { }, top = '40%', hideCloseButton = false, closeOnClickOverlay = false, closePos = { right: 0, top: -30 } } = props
const closeBtnClass = classnames(styles.closeButton, { const closeBtnClass = classnames(styles.closeButton, {
[`${styles.closeButton_bottom}`]: closePostion === 'bottom', [`${styles.closeButton_bottom}`]: closePostion === 'bottom',
...@@ -32,11 +30,12 @@ export default function Modal(props) { ...@@ -32,11 +30,12 @@ export default function Modal(props) {
return ( return (
<View className={modalClass}> <View className={modalClass}>
<Overlay onTap={onClickOverlay} /> <Overlay onClick={() => onClickOverlay()} />
<View className={`${styles.content} animate-zoom-in`} style={{ top }}> <View className={`${styles.content} animate-zoom-in`} style={{ top }}>
{!hideCloseButton && <View className={closeBtnClass} onTap={onCloseModal} />}
{props.children} {props.children}
{!hideCloseButton && <View className={closeBtnClass} onClick={() => onClose()} style={{ top: closePos.top / 100 + 'rem', right: closePos.right / 100 + 'rem' }} />}
</View> </View>
</View> </View>
) )
} }
import React, { useState } from 'react' import React, { useState } from 'react'
import { View, Image, ScrollView } from '@tarojs/components' import { View, Image } from '@tarojs/components'
import classnames from 'classnames' import classnames from 'classnames'
import styles from './Progress.module.less' import styles from './Progress.module.less'
import { PROGRESS_LIST } from '@/mock'
const PRO_ICON = { const PRO_ICON = {
icon: '//yun.duiba.com.cn/taobaomini/provideBeauty/total/progress_icon.png' icon: '//yun.duiba.com.cn/taobaomini/provideBeauty/total/progress_icon.png'
} }
function Progress(props) { function Progress(props) {
const { allHotValue = 0, level1 = 0, level2 = 0, level3 = 0, width = 576 } = props const { data = {}, width = 692, type = 1, hasIcon = false, hasTxt = true } = props
const { allHotValue = 0, levleList = PROGRESS_LIST } = data
const maxLevel = levleList[levleList.length -1]
const getProItm = classnames(styles['progress-box-com'],{ const getProItm = classnames(styles['progress-box-com'],{
[`${styles['progress-box-com-02']}`]: allHotValue === level3 [`${styles['progress-box-com-02']}`]: allHotValue === maxLevel
}) })
const tranHotValue = (value) => { const tranHotValue = (value) => {
const _num = parseInt(value / 10000) const _num = parseInt(value / 10000)
if(_num) return _num + '万' if(_num) return _num + '万'
return value return value
} }
const getTextStyle = classnames(styles['progress-box__txt'],{
[`${styles['progress-box__txt-bottom']}`]: type === 2
})
const getDescStyle = (itm) => {
return classnames(styles['progress-box__txt-item'],{
[`${styles['progress-txt-active']}`]: itm <= allHotValue
})
}
return ( return (
<View className={styles['progress-box']}> <View className={styles['progress-box']} style={{ width: width / 100 + 'rem'}}>
<View className={getProItm} style={{width: allHotValue >= level3 ? '100%' : (allHotValue / level3) * 100 +'%'}}></View> <View className={getProItm} style={{width: allHotValue >= maxLevel ? '100%' : (allHotValue / maxLevel) * 100 +'%'}}></View>
<View className={styles['progress-box__icon']}> {hasIcon && <View className={styles['progress-box__icon']}>
<Image className={styles['progress-box__icon-itm']} style={{left: (level1 / level3) * width / 100 + 'rem'}} src={PRO_ICON['icon']} /> { levleList.map((itm,i) => {
<Image className={styles['progress-box__icon-itm']} style={{left: (level2 / level3) * width / 100 + 'rem'}} src={PRO_ICON['icon']} /> return(
<Image className={styles['progress-box__icon-itm']} style={{right: -0.04 + 'rem'}} src={PRO_ICON['icon']} /> <Image className={styles['progress-box__icon-itm']}
</View> style={{left: (itm / maxLevel) * width / 100 + 'rem'}} src={PRO_ICON['icon']} />
<View className={styles['progress-box__txt']}> )
<View className={styles['progress-box__txt-item']} style={{left: (level1 / level3) * width / 100 + 'rem'}}>{tranHotValue(level1)}</View> })}
<View className={styles['progress-box__txt-item']} style={{left: (level2 / level3) * width / 100 + 'rem'}}>{tranHotValue(level2)}</View> </View>}
<View className={styles['progress-box__txt-item']} style={{left: width / 100 + 'rem'}}>{tranHotValue(level3)}</View> {hasTxt && <View className={getTextStyle}>
</View> { levleList.map((itm,i) => {
return(
<View className={getDescStyle(itm)}
style={{left: (itm / maxLevel) * width / 100 + 'rem'}}>{tranHotValue(itm)}</View>
)
})}
</View>}
</View> </View>
) )
} }
......
.progress-box { .progress-box {
width: 576px; width: 692px;
height: 24px; height: 20px;
border: 1px solid #EF9028; background: #371B15;
border-radius: 12px; border-radius: 4px;
position: relative; position: relative;
} }
.progress-box-com { .progress-box-com {
height: 24px; height: 20px;
background: linear-gradient(0deg, #FF8A00, #FFFAF4); background: linear-gradient(270deg, #FFDE8B 0%, #FFCE38 100%);
border-radius: 12px; border-radius: 4px;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
transition: all 0.5s cubic-bezier(0, 0.64, 0.36, 1);
} }
.progress-box__icon, .progress-box__txt { .progress-box__icon, .progress-box__txt {
.wh(100%,100%); .wh(100%,100%);
...@@ -28,17 +29,31 @@ ...@@ -28,17 +29,31 @@
.progress-box__icon-itm:last-child { .progress-box__icon-itm:last-child {
transform: none; transform: none;
} }
.progress-box__txt {
top: -8px;
}
.progress-box__txt-bottom {
top: 46px;
}
.progress-box__txt-item { .progress-box__txt-item {
.wh(78px,36px);
font-size: 30px; font-size: 30px;
font-family: FZLTHProGlobal; background-color: #3C1D17;
font-weight: 400; border-radius: 4px;
color: #1C1C1C; .flex-row-center();
font-size: 26px;
font-family: SourceHanSansCN;
font-weight: 500;
color: #FFF1CC;
position: absolute; position: absolute;
top: -46px;
text-align: center;
transform: translate(-50%,0); transform: translate(-50%,0);
top: 0;
white-space: nowrap; white-space: nowrap;
} }
.progress-box__txt-item:last-child { .progress-box__txt-item:last-child {
transform: translate(-100%,0); transform: translate(-100%,0);
} }
.progress-txt-active {
background-color: #FFD64D;
color: #302A28;
}
\ No newline at end of file
...@@ -5,12 +5,12 @@ import { RANK_LIST } from '@/mock' ...@@ -5,12 +5,12 @@ import { RANK_LIST } from '@/mock'
import styles from './RankList.module.less' import styles from './RankList.module.less'
const RANK_ICON = { const RANK_ICON = {
1: '', 1: '//yun.duiba.com.cn/taobaomini/pike_call/icon_06.png',
2: '', 2: '//yun.duiba.com.cn/taobaomini/pike_call/icon_07.png',
3: '' 3: '//yun.duiba.com.cn/taobaomini/pike_call/icon_08.png'
} }
function RankList(props) { function RankList(props) {
const { rankList = RANK_LIST } = props const { rankList = RANK_LIST, minNum = 2 } = props
return ( return (
<ScrollView scrollY className={styles['scroll-container']}> <ScrollView scrollY className={styles['scroll-container']}>
{ {
...@@ -18,13 +18,11 @@ function RankList(props) { ...@@ -18,13 +18,11 @@ function RankList(props) {
return( return(
<View className={`${styles['scroll-item']} ${styles['scroll-item'+(i+1)]}`}> <View className={`${styles['scroll-item']} ${styles['scroll-item'+(i+1)]}`}>
<View className={styles['scroll-item__rank']}> <View className={styles['scroll-item__rank']}>
{i <= 2 && <View className={styles['rank-icon']}> {i <= minNum && <Image className={styles['rank-icon']} src={RANK_ICON[i+1]} />}
<Image src={RANK_ICON[i+1]} /> <View className={styles['rank-num']}>{itm.rank}</View>
</View>}
<View>{itm.rank}</View>
</View> </View>
<View className={styles['scroll-item__user']}>{itm.userNick}</View> <View className={styles['scroll-item__user']}>{itm.userNick}</View>
<View className={styles['scroll-item__score']}>{itm.hotValue}</View> <View className={styles['scroll-item__score']}>{itm.rankValue}</View>
</View> </View>
) )
}) })
......
.scroll-container { .scroll-container {
.wh(100%,100%); .wh(100%,100%);
max-height: 700px;
}
.text-overflow-el() {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
} }
.scroll-item { .scroll-item {
.flex-row-space(); .flex-row-space();
.wh(100%,60px); .wh(100%,66px);
background-color: antiquewhite; background-color: #F7F0E6;
margin-bottom: 15px; border: 1px solid #ECDBC0;
} }
.scroll-item__rank { .scroll-item__rank {
width: 33%; width: 33%;
.flex-row-center(); .flex-row-center();
.text-overflow-el();
position: relative;
} }
.rank-icon { .rank-icon {
position: absolute;
left: 50%;
top: 50%;
.wh(30px,30px); .wh(30px,30px);
background-color: aqua; transform: translate(-50px,-50%);
border-radius: 100%; }
.rank-num {
// transform: translate(-40px,0);
font-size: 30px;
font-family: YouSheBiaoTiHei;
font-weight: 400;
color: #2D2B28;
font-weight: 600;
} }
.scroll-item__user { .scroll-item__user {
width: 34%; width: 34%;
.flex-row-center(); .flex-row-center();
.text-overflow-el();
font-size: 26px;
font-family: SourceHanSansCN;
font-weight: 400;
color: #666666;
} }
.scroll-item__score { .scroll-item__score {
width: 33%; width: 33%;
.flex-row-center(); .flex-row-center();
.text-overflow-el();
font-size: 28px;
font-family: WorkSans;
font-weight: 600;
color: #2D2B28;
} }
\ No newline at end of file
import React, { useState } from 'react'
import { View, Image, ScrollView } from '@tarojs/components'
import classnames from 'classnames'
import styles from './Test.module.less'
function Test(props) {
const { } = props
return (
<View className={styles['test-box']}>
</View>
)
}
export default Test
\ No newline at end of file
import { View } from '@tarojs/components' import { View, Text, Image } from '@tarojs/components'
import React, { useState } from 'react' import React, { useState } from 'react'
import { useThrottle } from '@/hooks/useThrottle' import { useThrottle } from '@/hooks/useThrottle'
import Modal from '@/components/_base/Modal/Modal' import Modal from '@/components/_base/Modal/Modal'
import styles from './DoHelpModal.module.less' import styles from './DoHelpModal.module.less'
import API from '@/api' import API from '@/api'
import { showToast } from '@tarojs/taro' import { useLoginInfoModel, useActivityInfoModel } from '@/store'
import { useLoginInfoModel } from '@/store'
import { checkIsMember } from 'tbcc-sdk-ts/lib/utils' import { checkIsMember } from 'tbcc-sdk-ts/lib/utils'
import { commonToast } from 'tbcc-sdk-ts/lib/core/tb' import { commonToast } from 'tbcc-sdk-ts/lib/core/tb'
import { HELP_MODAL_TYPE } from '@/const'
const helpConfig = {
1: {
width: 639,
height: 730,
bg: '//yun.dui88.com/taobaomini/pike_call/m_help_bg.png',
btnTxt: '//yun.dui88.com/taobaomini/pike_call/m_help_btn_01.png',
title: '您的好友正在参与XXXX\n快来一起参与吧~',
marginBottom: 80
},
2: {
width: 639,
height: 701,
bg: '//yun.dui88.com/taobaomini/pike_call/m_help_bg_02.png',
btnTxt: '//yun.dui88.com/taobaomini/pike_call/m_help_btn_02.png',
title: '您已是会员',
marginBottom: 80
},
3: {
width: 639,
height: 800,
bg: '//yun.dui88.com/taobaomini/pike_call/m_help_bg_03.png',
btnTxt: '//yun.dui88.com/taobaomini/pike_call/m_help_btn_02.png',
title: '',
marginBottom: 120
}
}
export default function RuleModal(props) { export default function RuleModal(props) {
const { bg = '', width = 300, height = 300, onClose = () => {}, closePostion, top = '40%', newVip = false } = props const { activityInfo } = useActivityInfoModel()
const { type = HELP_MODAL_TYPE.HELP, onClose = () => {}, newVip = true, helpInfo = {} } = props
const [ memberModalVisible, setMemberModalVisible ] = useState(false) const [ memberModalVisible, setMemberModalVisible ] = useState(false)
const { loginInfo: { inviteId } } = useLoginInfoModel() const { loginInfo: { inviteId } } = useLoginInfoModel()
const onAuthSuccess = async() => { const onAuthSuccess = async () => {
const helpRes = await API.doHelp({ inviteId }) const isVip = await checkIsMember()
const helpRes = await API.doHelp({ inviteId, isVip })
if (helpRes?.success) { if (helpRes?.success) {
showToast({ title: '助力成功' }) commonToast('助力成功')
} else { } else {
commonToast(helpRes?.message) commonToast(helpRes?.message)
} }
...@@ -30,23 +56,25 @@ export default function RuleModal(props) { ...@@ -30,23 +56,25 @@ export default function RuleModal(props) {
const onAuthFail = () => { const onAuthFail = () => {
setMemberModalVisible(false) setMemberModalVisible(false)
} }
const closeMemberModal = () => {
const onDoHelp = useThrottle(async() => { setMemberModalVisible(false)
}
const onHandleHelp = useThrottle(async () => {
const helpFn = {
[HELP_MODAL_TYPE.HELP]: async () => {
// 条件不是需要新会员的情况下,直接助力 // 条件不是需要新会员的情况下,直接助力
if (!newVip) { if (!newVip) {
const helpRes = await API.doHelp({ inviteId }) const helpRes = await API.doHelp({ inviteId, isVip })
if (helpRes?.success) { if (helpRes?.success) {
showToast({ title: '助力成功' }) commonToast('助力成功')
} else { } else {
commonToast(helpRes?.message) commonToast(helpRes?.message)
} }
onClose() onClose()
} }
// 助力条件为新会员 // 助力条件为新会员
const isVip = await checkIsMember() const isVip = await checkIsMember()
// 已经是会员 // 已经是会员
if (isVip) { if (isVip) {
commonToast('新会员才能助力哦~') commonToast('新会员才能助力哦~')
...@@ -54,22 +82,40 @@ export default function RuleModal(props) { ...@@ -54,22 +82,40 @@ export default function RuleModal(props) {
// 还不是会员,弹出会员弹窗 // 还不是会员,弹出会员弹窗
setMemberModalVisible(true) setMemberModalVisible(true)
} }
}, 2000) },
[HELP_MODAL_TYPE.FAIL]: async () => onClose(type),
const closeMemberModal = () => { [HELP_MODAL_TYPE.REWARDS]: async () => {
setMemberModalVisible(false) const { success, data } = await API.receiveTaskRewards({ taskType: 'invites' })
if(success && data) {
onClose(type)
}
}
}
helpFn[type]()
})
const onCloseModal = () => {
if(type === HELP_MODAL_TYPE.REWARDS) {
onHandleHelp()
return;
}
onClose && onClose()
} }
return ( return (
<View> <View>
<Modal onClose={onClose} closePostion={closePostion} top={top}> <Modal hideCloseButton={false} onClose={onCloseModal} top={'50%'} closePos={{ right: 0, top: 0 }}>
<View className={styles.content} style={{ width: `${width / 100}rem`, height: `${height / 100}rem`, backgroundImage: `url(${bg})` }}> <View className={styles.container} style={
<View className={styles.title}>接受邀请</View> { width: helpConfig[type].width / 100 + 'rem',
<View className={styles.image} /> height: helpConfig[type].height / 100 + 'rem',
<View className={styles.desc}>是一段描述</View> backgroundImage: `url(${helpConfig[type].bg})`
<View className={styles.help_button} onTap={onDoHelp}>助力按钮</View> }}>
<Text className={styles['help-title']}>{
type !== HELP_MODAL_TYPE.REWARDS ? helpConfig[type].title :
`恭喜你成功邀请${helpInfo.inviteCount}名好友\n获得XXX奖励` }
</Text>
<Image src={helpConfig[type].btnTxt}
style={{ marginBottom: helpConfig[type].marginBottom / 100 + 'rem' }}
className={styles['help-btn']} onClick={() => onHandleHelp()} />
</View> </View>
</Modal> </Modal>
{ {
memberModalVisible && memberModalVisible &&
......
.content { .container {
.wh(570px,398px);
position: relative;
.image-property(); .image-property();
background-color: #fff; .flex-col-bottom();
overflow: hidden;
padding: 30px;
display: flex;
flex-direction: column;
align-items: center; align-items: center;
} }
.title { .pos-row-center() {
font-size: 40px; position: absolute;
text-align: center; left: 50%;
.image-property(); transform: translate(-50%,0);
} }
.image { .help-title {
.wh(200px, 200px); font-size: 38px;
.image("//yun.duiba.com.cn/taobaomini/template/250x250.png"); font-family: SourceHanSansCN;
margin: 40px 0 0 0; font-weight: 500;
} color: #573F54;
.desc { line-height: 54px;
font-size: 24px; margin-bottom: 63px;
margin: 30px 0 0 0;
text-align: center; text-align: center;
} }
.help_button { .help-btn {
text-align: center; .wh(328px,76px);
.wh(150px, 40px); margin-bottom: 121px;
margin: 40px 0 0 0;
border: 1px solid #000;
} }
...@@ -10,9 +10,9 @@ import { receiveEnamePrize, receiveObjectPrize, receiveMemberEname } from '@/uti ...@@ -10,9 +10,9 @@ import { receiveEnamePrize, receiveObjectPrize, receiveMemberEname } from '@/uti
import config from '@/config' import config from '@/config'
export default function PrizeModal(props) { export default function PrizeModal(props) {
const { prizeData = {}, onClose = () => {}, } = props const { prize = {}, onClose = () => {}, } = props
const app = getApp() const app = getApp()
const { image = '', name = '', id = '', type = 1, benefitType = 1, ename = '' } = prizeData const { image = '', name = '', id = '', type = 1, benefitType = 1, ename = '' } = prize
const [ memberModalVisible, setMemberModalVisible ] = useState(false) const [ memberModalVisible, setMemberModalVisible ] = useState(false)
...@@ -57,23 +57,18 @@ export default function PrizeModal(props) { ...@@ -57,23 +57,18 @@ export default function PrizeModal(props) {
const closeMemberModal = () => { const closeMemberModal = () => {
setMemberModalVisible(false) setMemberModalVisible(false)
} }
const onCloseModal = () => {
onClose && onClose()
}
return ( return (
<> <>
<Modal hideCloseButton={true} top={'50%'}> <Modal hideCloseButton={false} onClose={onCloseModal} top={'50%'}>
<View className={styles['prize-container']}> <View className={styles['prize-container']}>
<Image className={styles['prize-title']} src={'//yun.duiba.com.cn/taobaomini/provideBeauty/prize/invite_title_01.png'} />
<View className={styles['prize-name']}>{'获得'+name+'奖品'}</View> <View className={styles['prize-name']}>{'获得'+name+'奖品'}</View>
<View className={styles['prize-name_box']}> <View className={styles['prize-icon']}>
<Image src={'//yun.duiba.com.cn/taobaomini/provideBeauty/prize/m_prize_bg_01.png'} className={styles['prize-name_box-top']} /> <Image src={image} className={styles['prize-icon-img']} />
<View className={styles['prize-name_box-icon']}>
<Image src={image} className={styles['prize-name_box-icon-img']} />
</View>
<Image src={'//yun.duiba.com.cn/taobaomini/provideBeauty/prize/m_prize_bg_02.png'} className={styles['prize-name_box-bottom']} />
</View> </View>
<Image className={styles['prize-fenwei']} src={'//yun.duiba.com.cn/taobaomini/provideBeauty/prize/fenwei.png'} /> <Image src={'//yun.duiba.com.cn/taobaomini/pike_call/prize_btn.png'} onClick={() => onRecivePrize()} className={styles['prize-btn']} />
<Image src={'//yun.duiba.com.cn/taobaomini/provideBeauty/prize/btn_02.png'} onClick={() => onRecivePrize()} className={styles['prize-btn']} />
<View className={styles['prize-desc']}>奖品可在我的奖品中查看</View> <View className={styles['prize-desc']}>奖品可在我的奖品中查看</View>
</View> </View>
</Modal> </Modal>
......
.prize-container { .prize-container {
.wh(500px,488px); .wh(636px,890px);
.image('//yun.duiba.com.cn/taobaomini/pike_call/prize_bg.png');
position: relative; position: relative;
} .flex-col-bottom();
.prize-fenwei { align-items: center;
.wh(500px,488px);
position: absolute;
top: 0;
left: 0;
} }
.pos-row-center() { .pos-row-center() {
position: absolute; position: absolute;
...@@ -14,58 +11,32 @@ ...@@ -14,58 +11,32 @@
left: 50%; left: 50%;
transform: translate(-50%,0); transform: translate(-50%,0);
} }
.prize-title {
.wh(132px,43px);
.pos-row-center();
}
.prize-name_box {
.wh(426px,370px);
.pos-row-center();
top: 100px;
}
.prize-name_box-top {
.wh(426px,142px);
.pos-row-center();
}
.prize-name_box-bottom {
.wh(296px,170px);
.pos-row-center();
top: 200px;
}
.prize-name { .prize-name {
font-size: 40px; font-size: 40px;
font-family: FZLTHProGlobal; font-family: SourceHanSansSC;
font-weight: 400; font-weight: bold;
color: #FFBC6E; color: #473F39;
.pos-row-center(); margin-bottom: 13px;
top: 54px; }
white-space: nowrap .prize-icon {
} width: 287px;
.prize-name_box-icon { height: 175px;
.wh(140px,140px); // background: #F2D6D3;
.pos-row-center(); border-radius: 12px;
top: 150rpx; margin-bottom: 36px;
} .flex-row-center();
.prize-name_box-icon-img { }
.wh(120px,120px); .prize-icon-img {
.wh(175px,175px);
} }
.prize-btn { .prize-btn {
.wh(218px,54px); .wh(437px,101px);
position: absolute; margin-bottom: 11px;
left: 50%;
transform: translate(-50%,0);
bottom: 40rpx;
} }
.prize-desc{ .prize-desc{
width: 500rpx; font-size: 20px;
position: absolute; font-family: SourceHanSansSC;
left: 50%; font-weight: bold;
transform: translate(-50%,0); color: #676E6E;
bottom: -40rpx; margin-bottom: 60px;
font-size: 23px;
font-family: FZLTHProGlobal;
font-weight: 400;
// color: #8A3C00;
color: #FFBC6E;
text-align: center;
} }
\ No newline at end of file
...@@ -3,10 +3,10 @@ import React, { useState, useEffect, useRef } from 'react' ...@@ -3,10 +3,10 @@ import React, { useState, useEffect, useRef } from 'react'
import { noopFn } from '@/utils/util' import { noopFn } from '@/utils/util'
import tbccTs from 'tbcc-sdk-ts' import tbccTs from 'tbcc-sdk-ts'
import API from '@/api' import API from '@/api'
import config from '@/config' import config from '@/config/index'
import { useThrottle } from '@/hooks/useThrottle' import { useThrottle } from '@/hooks/useThrottle'
import Popup from '@/components/_base/Popup/Popup' import Popup from '@/components/_base/Popup/Popup'
import { TASK_STATUS, TASK_CONFIG, SHOP_ID, BROSE_GOOD_TYPE } from '@/const' import { TASK_STATUS, TASK_CONFIG, SHOP_ID, BROSE_GOOD_TYPE, ORDER_GOOD_TYPE } from '@/const'
import styles from './TasksModal.module.less' import styles from './TasksModal.module.less'
import { useDidShow } from '@tarojs/taro' import { useDidShow } from '@tarojs/taro'
import { TASK_DATA } from '@/mock' import { TASK_DATA } from '@/mock'
......
...@@ -5,10 +5,11 @@ import { useThrottle } from '@/hooks/useThrottle' ...@@ -5,10 +5,11 @@ import { useThrottle } from '@/hooks/useThrottle'
import classnames from 'classnames' import classnames from 'classnames'
import styles from './ThanksModal.module.less' import styles from './ThanksModal.module.less'
const thanksText = { const thanksConfig = {
1: { 1: {
title: '很遗憾,未抽中奖品\n再接再厉', title: '很遗憾,未抽中奖品\n再接再厉',
btnTxt: '再抽一次', btnTxt: '再抽一次',
btnImg: '//yun.duiba.com.cn/taobaomini/pike_call/thanks_btn.png',
icon: '//yun.duiba.com.cn/taobaomini/provideBeauty/close_btn.png', icon: '//yun.duiba.com.cn/taobaomini/provideBeauty/close_btn.png',
desc: '奖品可在我的奖品中查看' desc: '奖品可在我的奖品中查看'
}, },
...@@ -20,7 +21,7 @@ const thanksText = { ...@@ -20,7 +21,7 @@ const thanksText = {
} }
} }
export default function ThanksModal(props) { export default function ThanksModal(props) {
const { onHandle = () => {}, type = 1, hasClose = false, hasDesc = false } = props const { onHandle = () => {}, onClose, type = 1, hasClose = false, hasDesc = false } = props
const getContainerStyle = classnames(styles['thanks-container'],{ const getContainerStyle = classnames(styles['thanks-container'],{
[`${styles['thanks-container-02']}`]: type === 2 [`${styles['thanks-container-02']}`]: type === 2
...@@ -33,13 +34,15 @@ export default function ThanksModal(props) { ...@@ -33,13 +34,15 @@ export default function ThanksModal(props) {
const getBtnStyle = classnames(styles['thanks-btn'],{ const getBtnStyle = classnames(styles['thanks-btn'],{
[`${styles['thanks-btn-02']}`]: type === 2 [`${styles['thanks-btn-02']}`]: type === 2
}) })
const onCloseModal = () => {
onClose && onClose()
}
return ( return (
<Modal hideCloseButton={true} top={'50%'}> <Modal hideCloseButton={false} onClose={onCloseModal} top={'50%'}>
<View className={getContainerStyle}> <View className={getContainerStyle}>
<Text className={getTitleStyle}>{thanksText[type].title}</Text> <Text className={getTitleStyle}>{thanksConfig[type].title}</Text>
<View className={getBtnStyle} onClick={()=> onHandle(type)}>{thanksText[type].btnTxt}</View> <Image src={thanksConfig[type].btnImg} className={getBtnStyle} onClick={()=> onHandle(type)} />
{hasClose && <Image className={styles['thanks-close']} onClick={()=> onHandle(2)} src={thanksText[type].icon} />} {hasDesc && <View className={styles['thanks-desc']}>{thanksConfig[type].desc}</View>}
{hasDesc && <View className={styles['thanks-desc']}>{thanksText[type].desc}</View>}
</View> </View>
</Modal> </Modal>
) )
......
.thanks-container { .thanks-container {
.wh(450px,305px); .wh(636px,826px);
position: relative; position: relative;
.image('//yun.dui88.com/taobaomini/provideBeauty/prize/prize_bg_02.png'); .flex-col-bottom();
align-items: center;
.image('//yun.duiba.com.cn/taobaomini/pike_call/thanks_bg.png');
} }
.thanks-container-02 { .thanks-container-02 {
.wh(570px,398px); .wh(570px,398px);
position: relative; .image('//yun.duiba.com.cn/taobaomini/provideBeauty/prize/prize_bg_01.png');
.image('//yun.dui88.com/taobaomini/provideBeauty/prize/prize_bg_01.png');
} }
.pos-row-center() { .pos-row-center() {
position: absolute; position: absolute;
...@@ -14,40 +15,24 @@ ...@@ -14,40 +15,24 @@
transform: translate(-50%,0); transform: translate(-50%,0);
} }
.thanks-title { .thanks-title {
width: 300px; font-size: 40px;
.pos-row-center(); font-family: SourceHanSansSC;
bottom: 30px; font-weight: bold;
top: 110px; color: #473F39;
font-size: 25px; line-height: 58px;
font-family: FZLTHProGlobal;
font-weight: 400;
color: #1C1C1C;
text-align: center; text-align: center;
margin-bottom: 46px;
} }
.thanks-title-02 { .thanks-title-02 {
width: 442px; font-size: 40px;
position: absolute; font-family: SourceHanSansSC;
left: 41px; font-weight: bold;
bottom: 30px; color: #473F39;
top: 87px; line-height: 58px;
font-size: 25px;
font-family: FZLTHProGlobal;
font-weight: 400;
line-height: 33px;
color: #1C1C1C;
text-align: center;
} }
.thanks-btn { .thanks-btn {
.wh(162px,37px); .wh(437px,101px);
.pos-row-center(); margin-bottom: 133px;
bottom: 38px;
background: linear-gradient(0deg, #FFBC6E, #FFDFB4);
border-radius: 18px;
.flex-row-center();
font-size: 31px;
font-family: FZLTHProGlobal;
font-weight: 400;
color: #1C1C1C;
} }
.thanks-btn-02 { .thanks-btn-02 {
width: 172px; width: 172px;
......
export default {
env: 'test', // 云函数环境 test 测试环境 online 线上环境
requestType: 'yapi', // cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
cloudName: 'CommonToC', // 主云函数项目名 CommonToC
sellerId: '2207644377875',
tornadoAPI: 'https://tornado.duibadev.com.cn/tbServer/api?db=db3000000038851072&proxyIp=172.16.130.158', // 新增:当requestType: 'tornadoAPI'时,找服务端提供地址
defaultActivityId: '60642aafc752d118247c2a2d' // 默认活动id
}
export default {
env: 'test', // 云函数环境 test 测试环境 online 线上环境
requestType: 'yapi', // cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
cloudName: 'CommonToC', // 主云函数项目名 CommonToC
sellerId: '2207644377875',
tornadoAPI: 'https://tornado.duibadev.com.cn/tbServer/api?db=db3000000038851072&proxyIp=172.16.130.158', // 新增:当requestType: 'tornadoAPI'时,找服务端提供地址
defaultActivityId: '60642aafc752d118247c2a2d' // 默认活动id
}
\ No newline at end of file
...@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' ...@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'
import { useRouter } from '@tarojs/taro' import { useRouter } from '@tarojs/taro'
import { useLoginInfoModel } from '../store/loginInfo' import { useLoginInfoModel } from '../store/loginInfo'
import API from '../api' import API from '../api'
import config from '../config' import config from '@/config/index'
import { useAuth } from './useAuth' import { useAuth } from './useAuth'
import { noopFn } from '@/utils/util' import { noopFn } from '@/utils/util'
import { checkShopFavoredStatus } from 'tbcc-sdk-ts/lib/core/tb' import { checkShopFavoredStatus } from 'tbcc-sdk-ts/lib/core/tb'
......
...@@ -121,3 +121,6 @@ export const RANK_LIST = [ ...@@ -121,3 +121,6 @@ export const RANK_LIST = [
hotValue: 98882892 hotValue: 98882892
} }
] ]
// 档次
export const PROGRESS_LIST = [10000,30000,50000,100000]
\ No newline at end of file
...@@ -8,4 +8,3 @@ export default { ...@@ -8,4 +8,3 @@ export default {
'canvas-comp': '../../../components/_miniprogram/lottieBlank/lottieBlank' 'canvas-comp': '../../../components/_miniprogram/lottieBlank/lottieBlank'
} }
} }
\ No newline at end of file
...@@ -10,7 +10,7 @@ import { dateFormatter } from '@/utils/date' ...@@ -10,7 +10,7 @@ import { dateFormatter } from '@/utils/date'
import styles from './myPrize.module.less' import styles from './myPrize.module.less'
import { getApp } from '@tarojs/taro' import { getApp } from '@tarojs/taro'
import { receiveEnamePrize, receiveObjectPrize, receiveMemberEname } from '@/utils/util' import { receiveEnamePrize, receiveObjectPrize, receiveMemberEname } from '@/utils/util'
import config from '@/config' import config from '@/config/index'
const { commonToast, getUserAddress, navigateToOutside, setClipboard } = tbccTs.tb const { commonToast, getUserAddress, navigateToOutside, setClipboard } = tbccTs.tb
const { getMyPrizeList } = API const { getMyPrizeList } = API
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment