Commit e381c295 authored by hewenhao's avatar hewenhao

feat: 发起PK、埋点优化

parent 25b40f02
......@@ -130,5 +130,83 @@
"w": 32,
"h": 32,
"ossName": "/pk-math/2iYKx8hQzXQQgwD5DSjHuQGV97LA/32x32"
},
"pk-bottom.png": {
"u": "https://cdn.jkwljy.com/pk-math/3kzbNhjG5vbP4X7xJUX2Ev9igXz8/750x1072",
"w": 750,
"h": 1072,
"ossName": "/pk-math/3kzbNhjG5vbP4X7xJUX2Ev9igXz8/750x1072"
},
"pk-top.png": {
"u": "https://cdn.jkwljy.com/pk-math/2Zy98sFKXJ8bjSw5jup9co3DrYK8/750x1072",
"w": 750,
"h": 1072,
"ossName": "/pk-math/2Zy98sFKXJ8bjSw5jup9co3DrYK8/750x1072"
},
"challenge-2.png": {
"u": "https://cdn.jkwljy.com/pk-math/2mAZAhhjbUdtUmxf1kzv9jcxndzk/248x248",
"w": 248,
"h": 248,
"ossName": "/pk-math/2mAZAhhjbUdtUmxf1kzv9jcxndzk/248x248"
},
"challenge-avatar.png": {
"u": "https://cdn.jkwljy.com/pk-math/2nMFKXuJYZNiAdazWSrKXt7yAAV4/248x248",
"w": 248,
"h": 248,
"ossName": "/pk-math/2nMFKXuJYZNiAdazWSrKXt7yAAV4/248x248"
},
"pk-close.png": {
"u": "https://cdn.jkwljy.com/pk-math/43aDcPmuHSx1a8wnknD1nQ4mxUb5/60x60",
"w": 60,
"h": 60,
"ossName": "/pk-math/43aDcPmuHSx1a8wnknD1nQ4mxUb5/60x60"
},
"pk-history-arrow.png": {
"u": "https://cdn.jkwljy.com/pk-math/4Rh485fLWQwMDhxyRjpTmu1HoNeM/20x20",
"w": 20,
"h": 20,
"ossName": "/pk-math/4Rh485fLWQwMDhxyRjpTmu1HoNeM/20x20"
},
"pk-logo.png": {
"u": "https://cdn.jkwljy.com/pk-math/26jmURCSDdqEeH9r9yAnGDP1KsDn/310x200",
"w": 310,
"h": 200,
"ossName": "/pk-math/26jmURCSDdqEeH9r9yAnGDP1KsDn/310x200"
},
"pk-slogen.png": {
"u": "https://cdn.jkwljy.com/pk-math/3irz12bKeQTxjRcqR2FXPCWG4Kgd/520x80",
"w": 520,
"h": 80,
"ossName": "/pk-math/3irz12bKeQTxjRcqR2FXPCWG4Kgd/520x80"
},
"pk-bottom-1.svg": {
"u": "https://cdn.jkwljy.com/pk-math/HcBCe8fNnWpWUT82mGX7CTNFSMx/375x536",
"w": 375,
"h": 536,
"ossName": "/pk-math/HcBCe8fNnWpWUT82mGX7CTNFSMx/375x536"
},
"pk-top-1.svg": {
"u": "https://cdn.jkwljy.com/pk-math/h1FCTbWs35oYVWJySKmQsafqaVF/375x536",
"w": 375,
"h": 536,
"ossName": "/pk-math/h1FCTbWs35oYVWJySKmQsafqaVF/375x536"
},
"pk-flash.png": {
"u": "https://cdn.jkwljy.com/pk-math/2Pn5w15DGomcubB8mwx4MSE5Bwit/360x200",
"w": 360,
"h": 200,
"ossName": "/pk-math/2Pn5w15DGomcubB8mwx4MSE5Bwit/360x200"
},
"pk-flash-right.png": {
"u": "https://cdn.jkwljy.com/pk-math/dqjsw9n5oJnuNrF9MYqXqTVnwsF/360x200",
"w": 360,
"h": 200,
"ossName": "/pk-math/dqjsw9n5oJnuNrF9MYqXqTVnwsF/360x200"
},
"pk-wechat-logo.png": {
"u": "https://cdn.jkwljy.com/pk-math/hKPvXfVYCPjrLcH5FdY3kUZM35m/80x80",
"w": 80,
"h": 80,
"ossName": "/pk-math/hKPvXfVYCPjrLcH5FdY3kUZM35m/80x80"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<svg width="375px" height="536px" viewBox="0 0 375 536" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>底部背景</title>
<defs>
<rect id="path-1" x="0" y="0" width="375" height="536"></rect>
<polygon id="path-3" points="-3.33160876e-15 60 375 -1.25662548e-12 375 536 6.73289549e-14 536"></polygon>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-5">
<stop stop-color="#6149B9" offset="0%"></stop>
<stop stop-color="#6149B9" offset="51.4040647%"></stop>
<stop stop-color="#6149B9" offset="100%"></stop>
</linearGradient>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-6">
<stop stop-color="#6149B9" offset="0%"></stop>
<stop stop-color="#6149B9" offset="100%"></stop>
</linearGradient>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-7">
<stop stop-color="#6851BC" offset="0%"></stop>
<stop stop-color="#6651BC" offset="100%"></stop>
</linearGradient>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-8">
<stop stop-color="#6149B9" offset="0%"></stop>
<stop stop-color="#5134A9" offset="46.5854458%"></stop>
<stop stop-color="#6149B9" offset="100%"></stop>
</linearGradient>
<polygon id="path-9" points="-3.57786717e-15 60 375 -1.25662548e-12 375 137 6.73289549e-14 137"></polygon>
<filter x="-0.8%" y="-2.2%" width="101.6%" height="104.4%" filterUnits="objectBoundingBox" id="filter-11">
<feOffset dx="0" dy="6" in="SourceAlpha" result="shadowOffsetInner1"></feOffset>
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
<feColorMatrix values="0 0 0 0 0.525490196 0 0 0 0 0.431372549 0 0 0 0 0.890196078 0 0 0 1 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
</filter>
</defs>
<g id="定稿" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="背景切图" transform="translate(-87.000000, -586.000000)">
<g id="底部背景" transform="translate(87.000000, 586.000000)">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<g id="蒙版"></g>
<g id="编组-82备份" mask="url(#mask-2)">
<g id="矩形-+-矩形-+-矩形-+-矩形-+-矩形-+-矩形-+-矩形-+-矩形-+-矩形-+-矩形-+-矩形蒙版">
<mask id="mask-4" fill="white">
<use xlink:href="#path-3"></use>
</mask>
<use id="蒙版" fill="#644FBC" xlink:href="#path-3"></use>
<polygon id="矩形" fill="url(#linearGradient-5)" mask="url(#mask-4)" points="49 30 66 30 66 543 49 543"></polygon>
<polygon id="矩形" fill="url(#linearGradient-6)" mask="url(#mask-4)" points="66 30 85 30 85 551 66 551"></polygon>
<polygon id="矩形" fill="url(#linearGradient-7)" mask="url(#mask-4)" points="85 30 102 30 102 551 85 551"></polygon>
<polygon id="矩形" fill="url(#linearGradient-8)" mask="url(#mask-4)" points="102 30 119 30 119 551 102 551"></polygon>
<polygon id="矩形" fill="#6C55C0" mask="url(#mask-4)" points="201 0 275 0 275 543 201 543"></polygon>
<polygon id="矩形" fill="#6753BD" mask="url(#mask-4)" points="275 0 286 0 286 558 275 558"></polygon>
<polygon id="矩形" fill="#7763C3" mask="url(#mask-4)" points="286 0 294 0 294 539 286 539"></polygon>
<polygon id="矩形" fill="#6753BD" mask="url(#mask-4)" points="294 -10 307 -10 307 543 294 543"></polygon>
<polygon id="矩形" fill="#6149B9" mask="url(#mask-4)" points="307 -10 333 -10 333 551 307 551"></polygon>
<polygon id="矩形" fill="#7763C3" mask="url(#mask-4)" points="333 -10 339 -10 339 543 333 543"></polygon>
<polygon id="矩形" fill="#6149B9" mask="url(#mask-4)" points="339 -10 356 -10 356 543 339 543"></polygon>
</g>
<mask id="mask-10" fill="white">
<use xlink:href="#path-9"></use>
</mask>
<g id="蒙版" fill="black" fill-opacity="1">
<use filter="url(#filter-11)" xlink:href="#path-9"></use>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="375px" height="536px" viewBox="0 0 375 536" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>顶部背景</title>
<defs>
<rect id="path-1" x="0" y="0" width="375" height="536"></rect>
<polygon id="path-3" points="-3.57786717e-15 60 375 -1.25662548e-12 375 536 -5.48064198e-14 536"></polygon>
<linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="linearGradient-5">
<stop stop-color="#FFD130" offset="0%"></stop>
<stop stop-color="#FFD244" offset="100%"></stop>
</linearGradient>
<linearGradient x1="50%" y1="0%" x2="50%" y2="95.6448608%" id="linearGradient-6">
<stop stop-color="#FFDB66" offset="0%"></stop>
<stop stop-color="#FFDE6D" offset="100%"></stop>
</linearGradient>
<linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="linearGradient-7">
<stop stop-color="#FFD138" offset="0%"></stop>
<stop stop-color="#FFE07B" offset="100%"></stop>
</linearGradient>
<linearGradient x1="50%" y1="0%" x2="50%" y2="62.7832163%" id="linearGradient-8">
<stop stop-color="#FFC800" offset="0%"></stop>
<stop stop-color="#FFC201" offset="100%"></stop>
</linearGradient>
<linearGradient x1="50%" y1="0%" x2="50%" y2="116.862413%" id="linearGradient-9">
<stop stop-color="#FFC800" offset="0%"></stop>
<stop stop-color="#FFC201" offset="100%"></stop>
</linearGradient>
<polygon id="path-10" points="-3.57786717e-15 450 375 390 375 536 -5.48064198e-14 536"></polygon>
<filter x="-0.8%" y="-2.1%" width="101.6%" height="104.1%" filterUnits="objectBoundingBox" id="filter-11">
<feOffset dx="0" dy="6" in="SourceAlpha" result="shadowOffsetInner1"></feOffset>
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
<feColorMatrix values="0 0 0 0 1 0 0 0 0 0.933421178 0 0 0 0 0.679211128 0 0 0 0.699901661 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
</filter>
</defs>
<g id="定稿" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="背景切图" transform="translate(-87.000000, -110.000000)">
<g id="顶部背景" transform="translate(87.000000, 110.000000)">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<g id="蒙版"></g>
<g id="编组-50备份" mask="url(#mask-2)">
<g id="矩形-+-矩形-+-矩形-+-矩形-+-矩形-+-矩形-+-矩形蒙版">
<mask id="mask-4" fill="white">
<use xlink:href="#path-3" transform="translate(187.500000, 268.000000) scale(-1, -1) translate(-187.500000, -268.000000) "></use>
</mask>
<use id="蒙版" fill="#FFC201" transform="translate(187.500000, 268.000000) scale(-1, -1) translate(-187.500000, -268.000000) " xlink:href="#path-3"></use>
<polygon id="矩形" fill="url(#linearGradient-5)" mask="url(#mask-4)" points="28 -13 47 -13 47 555 28 555"></polygon>
<polygon id="矩形" fill="url(#linearGradient-6)" mask="url(#mask-4)" points="47 -13 82 -13 82 549 47 549"></polygon>
<polygon id="矩形" fill="#FFCE00" mask="url(#mask-4)" points="82 -8 119 -8 119 555 82 555"></polygon>
<polygon id="矩形" fill="url(#linearGradient-7)" mask="url(#mask-4)" points="172 -8 259 -8 259 549 172 549"></polygon>
<polygon id="矩形" fill="#FFC803" mask="url(#mask-4)" points="280 -8 292 -8 292 512 280 512"></polygon>
<polygon id="矩形" fill="url(#linearGradient-8)" mask="url(#mask-4)" points="301 -13 317 -13 317 529 301 529"></polygon>
<polygon id="矩形" fill="url(#linearGradient-9)" mask="url(#mask-4)" points="331 -13 361 -13 361 529 331 529"></polygon>
</g>
<g id="蒙版" transform="translate(187.500000, 463.000000) scale(-1, -1) translate(-187.500000, -463.000000) " fill="black" fill-opacity="1">
<use filter="url(#filter-11)" xlink:href="#path-10"></use>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
......@@ -20,7 +20,7 @@
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.7.7",
"@geek/skynet-client-wxmini": "^1.1.11",
"@geek/skynet-client-wxmini": "^1.1.12",
"@tarojs/components": "3.6.2",
"@tarojs/helper": "3.6.2",
"@tarojs/plugin-framework-react": "3.6.2",
......
......@@ -15,6 +15,7 @@ const types = {
oda: 'application/oda',
pdf: 'application/pdf',
ai: 'application/postscript',
svg: ' image/svg+xml',
eps: 'application/postscript',
ps: 'application/postscript',
smi: 'application/smil',
......
......@@ -110,5 +110,70 @@ export default {
"u": "https://cdn.jkwljy.com/pk-math/2iYKx8hQzXQQgwD5DSjHuQGV97LA/32x32",
"w": 32,
"h": 32
},
"pk-bottom.png": {
"u": "https://cdn.jkwljy.com/pk-math/3kzbNhjG5vbP4X7xJUX2Ev9igXz8/750x1072",
"w": 750,
"h": 1072
},
"pk-top.png": {
"u": "https://cdn.jkwljy.com/pk-math/2Zy98sFKXJ8bjSw5jup9co3DrYK8/750x1072",
"w": 750,
"h": 1072
},
"challenge-2.png": {
"u": "https://cdn.jkwljy.com/pk-math/2mAZAhhjbUdtUmxf1kzv9jcxndzk/248x248",
"w": 248,
"h": 248
},
"challenge-avatar.png": {
"u": "https://cdn.jkwljy.com/pk-math/2nMFKXuJYZNiAdazWSrKXt7yAAV4/248x248",
"w": 248,
"h": 248
},
"pk-close.png": {
"u": "https://cdn.jkwljy.com/pk-math/43aDcPmuHSx1a8wnknD1nQ4mxUb5/60x60",
"w": 60,
"h": 60
},
"pk-history-arrow.png": {
"u": "https://cdn.jkwljy.com/pk-math/4Rh485fLWQwMDhxyRjpTmu1HoNeM/20x20",
"w": 20,
"h": 20
},
"pk-logo.png": {
"u": "https://cdn.jkwljy.com/pk-math/26jmURCSDdqEeH9r9yAnGDP1KsDn/310x200",
"w": 310,
"h": 200
},
"pk-slogen.png": {
"u": "https://cdn.jkwljy.com/pk-math/3irz12bKeQTxjRcqR2FXPCWG4Kgd/520x80",
"w": 520,
"h": 80
},
"pk-bottom-1.svg": {
"u": "https://cdn.jkwljy.com/pk-math/HcBCe8fNnWpWUT82mGX7CTNFSMx/375x536",
"w": 375,
"h": 536
},
"pk-top-1.svg": {
"u": "https://cdn.jkwljy.com/pk-math/h1FCTbWs35oYVWJySKmQsafqaVF/375x536",
"w": 375,
"h": 536
},
"pk-flash.png": {
"u": "https://cdn.jkwljy.com/pk-math/2Pn5w15DGomcubB8mwx4MSE5Bwit/360x200",
"w": 360,
"h": 200
},
"pk-flash-right.png": {
"u": "https://cdn.jkwljy.com/pk-math/dqjsw9n5oJnuNrF9MYqXqTVnwsF/360x200",
"w": 360,
"h": 200
},
"pk-wechat-logo.png": {
"u": "https://cdn.jkwljy.com/pk-math/hKPvXfVYCPjrLcH5FdY3kUZM35m/80x80",
"w": 80,
"h": 80
}
} as const
.wrap {
position: fixed;
z-index: 2199999;
left: 0;
top: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, .5);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.top, .bottom {
flex: 1;
position: relative;
width: 100%;
animation-timing-function: ease-out;
animation-duration: .5s;
animation-fill-mode: backwards;
}
.top {
margin-bottom: -62px;
animation-name: stepDown;
}
.bottom {
margin-top: -62px;
animation-name: stepUp;
}
@keyframes stepDown {
0% {
transform: translate3d(0, -100%, 0);
}
100% {
transform: translate3d(0, 0, 0);
}
}
@keyframes stepUp {
0% {
transform: translate3d(0, 100%, 0);
}
100% {
transform: translate3d(0, 0, 0);
}
}
.bg_top {
position: absolute;
left: 0;
right: 0;
bottom: 0;
width: 100%;
}
.pk_logo {
width: 310px;
height: 200px;
position: absolute;
bottom: -100px;
z-index: 21;
left: 50%;
margin-left: -155px;
}
.pk_flash {
width: 750px;
height: 200px;
display: flex;
align-items: center;
justify-content: space-between;
position: absolute;
left: 0;
right: 0;
bottom: -100px;
z-index: 20;
}
.pk_slogan {
top: 144px;
right: 114px;
width: 520px;
height: 80px;
position: absolute;
z-index: 22;
}
.center {
position: absolute;
left: 0;
right: 0;
top: 50%;
}
.pk_flash_left, .pk_flash_right {
width: 360px;
height: 200px;
}
.bg_bottom {
position: absolute;
left: 0;
right: 0;
top: 0;
width: 100%;
}
.bottom_content {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 224px;
display: flex;
flex-direction: column;
align-items: center;
}
.tips {
font-size: 28px;
font-weight: 400;
color: #FFFFFF;
line-height: 40px;
margin-top: 34px;
flex-shrink: 0;
padding-bottom: 30px;
}
@supports (padding-bottom: constant(safe-area-inset-bottom)) or (padding-bottom: env(safe-area-inset-bottom)) {
.bottom_content {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom : env(safe-area-inset-bottom);
}
}
.challenge_2 {
width: 248px;
height: 248px;
flex-shrink: 0;
}
.share_btn {
display: flex;
align-items: center;
justify-content: center;
background-color: #04AE0F;
height: 100px;
border-radius: 50px;
border: 6px solid #FFFFFF;
font-size: 40px;
font-weight: 600;
color: #FFFFFF;
padding: 0 30px;
flex-shrink: 0;
}
.wechat_logo {
width: 80px;
height: 80px;
display: block;
margin-right: 8px;
}
.top_content {
position: absolute;
left: 0;
top: 0;
bottom: 160px;
right: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
padding-bottom: 56px;
}
.me_info {
padding: 12px 70px;
background: linear-gradient(270deg, rgba(255,171,0,0) 0%, #FFAB00 48%, rgba(255,171,0,0) 100%);
font-size: 32px;
font-weight: 600;
color: #FFFFFF;
line-height: 44px;
margin-top: 36px;
text-align: center;
}
.info_detail {
font-size: 28px;
font-weight: 500;
line-height: 40px;
margin-top: 4px;
display: flex;
align-items: center;
justify-content: center;
}
.pk_level {
width: 60px;
height: 60px;
display: block;
margin-right: 4px;
}
import { View, Image, Button } from '@tarojs/components'
import assetsPk from '@/assets/oss/assets-pk'
import assetsMainNext from '@/assets/oss/assets-main-next'
import { cs } from '@/styles'
import { useStoreState } from '@/store/hooks'
import styles from './create-pk.module.scss'
type CreatePkProps = {
visible: boolean;
}
const CreatePk = (props: CreatePkProps) => {
const userInfo = useStoreState(states => states.userModel.userInfo)
if (props.visible) {
return null
}
return (
<View className={styles.wrap}>
<View className={styles.top}>
<Image src={assetsMainNext['pk-top.png'].u} className={styles.bg_top} mode="widthFix"></Image>
<View className={styles.top_content}>
<Image src={assetsMainNext['challenge-avatar.png'].u} className={styles.challenge_2} />
<View className={styles.me_info}>
<View>{userInfo.nickName}</View>
<View className={styles.info_detail}><Image src={assetsPk['bronze-small.png'].u} className={styles.pk_level} />青铜Ⅰ</View>
<View className={styles.info_detail}>本关战绩:胜 2 负 3</View>
<View className={styles.info_detail}>最佳表现:全对丨29.3s</View>
</View>
</View>
</View>
<View className={styles.bottom}>
<Image src={assetsMainNext['pk-slogen.png'].u} className={styles.pk_slogan}></Image>
<Image src={assetsMainNext['pk-bottom.png'].u} className={styles.bg_bottom} mode="widthFix"></Image>
<View className={styles.bottom_content}>
<View className={cs.flex__item}></View>
<Image src={assetsMainNext['challenge-2.png'].u} className={styles.challenge_2} mode="heightFix"></Image>
<View className={cs.flex__item}></View>
<Button openType="share" className={styles.share_btn}>
<Image src={assetsMainNext['pk-wechat-logo.png'].u} className={styles.wechat_logo}></Image>
<View>发给同学好友进行Pk</View>
</Button>
<View className={styles.tips}>会以你的最佳表现与对方答题数据进行PK</View>
</View>
</View>
<View className={styles.center}>
<View className={styles.pk_flash}>
<Image src={assetsMainNext['pk-flash.png'].u} className={styles.pk_flash_left}></Image>
<Image src={assetsMainNext['pk-flash-right.png'].u} className={styles.pk_flash_right}></Image>
</View>
<Image src={assetsMainNext['pk-logo.png'].u} className={styles.pk_logo} />
</View>
</View>
)
}
export default CreatePk
......@@ -20,6 +20,7 @@ import MainShortCut from '../components/short-cut'
import ShareModal from '../components/share-modal'
import styles from './main-component.module.scss'
import CreatePk from './create-pk'
const MainPage = () => {
const page = useMemo(() => getCurrentInstance().page, [])
......@@ -27,6 +28,7 @@ const MainPage = () => {
const fetchStage = useStoreActions(actions => actions.mainModel.fetchStage)
const stageList = useStoreState(state => state.mainModel.stageList)
const player = useStoreState(state => state.mainModel.player)
const isCreatePkShow = useStoreState(state => state.mainModel.isCreatePkShow)
const isReady = useStoreState(state => state.mainModel.isReady)
const isGroupGuideComplete = useStoreState(state => state.guideModel.isGroupGuideComplete)
const isMainGuideComplete = useStoreState(state => state.guideModel.isMainGuideComplete)
......@@ -128,6 +130,7 @@ const MainPage = () => {
)}
<ShareModal />
<Tutorial />
<CreatePk visible={isCreatePkShow} />
</>
)
}
......
......@@ -128,6 +128,7 @@ const StageComp = (props: StageProps) => {
const completeMainGuide = useStoreActions(actions => actions.guideModel.completeMainGuide)
const isReady = useStoreState(state => state.mainModel.isReady)
const player = useStoreState(state => state.mainModel.player)
const updateMainModelState = useStoreActions(state => state.mainModel.updateState)
const mainGuideActive = useStoreState(state => state.guideModel.mainGuideActive)
const handleClick = () => {
......@@ -139,6 +140,10 @@ const StageComp = (props: StageProps) => {
}
}
const handleLongPress = () => {
updateMainModelState({ isCreatePkShow: true })
}
const handleCompleteGuide = () => {
handleClick()
completeMainGuide()
......@@ -204,6 +209,8 @@ const StageComp = (props: StageProps) => {
hoverClass={cs.bounce_btn_hover}
id={stage.status === StageStatus.CURRENT ? CurrentRoundId : undefined}
onClick={handleClick}
data-name={`关卡-${stage.id}`}
onLongPress={handleLongPress}
>
{renderRound(isReady)}
<View className={styles.roundName}>
......
......@@ -23,11 +23,14 @@ export interface MainModel {
updateReady: Action<MainModel, boolean>;
updateStageList: Action<MainModel, Stage[]>;
fetchStage: Thunk<MainModel, void, void, AppStoreModel, Promise<[Stage[], Stage[]]>>;
isCreatePkShow: boolean;
}
const mainModel: MainModel = {
isReady: false,
player: getPlayer(),
isCreatePkShow: false,
stageList: [],
updateState: action((state, payload) => {
for (const k in payload) {
......
import {
register, report as _report, setOpenId, setProfile as _setProfile
register, report as _report, setOpenId, setProfile as _setProfile, listenTaroEvent, initialize
} from '@geek/skynet-client-wxmini'
import { SkynetConfig } from '@/config/skynet'
......@@ -8,10 +8,14 @@ import { TaroElement } from '@tarojs/runtime'
const dispatchEvent = TaroElement.prototype.dispatchEvent
TaroElement.prototype.dispatchEvent = function (event) {
// console.log('taro event', event)
listenTaroEvent(event)
return dispatchEvent.call(this, event)
}
initialize({
useTaroEvent: true,
})
export enum SkynetEvent {
PageView = 'PageView',
PageLeave = 'PageLeave',
......@@ -25,7 +29,18 @@ export function configSkynet () {
app_name: SkynetConfig.appName,
project: SkynetConfig.project,
url: SkynetConfig.url,
version: SkynetConfig.version
version: SkynetConfig.version,
useTaroEvent: true,
createEvent (event) {
try {
const mpEvent = event.mpEvent
const nativeCurrentTarget = event.currentTarget
mpEvent.currentTarget.dataset = { ...mpEvent.currentTarget.dataset, ...nativeCurrentTarget.dataset }
return mpEvent
} catch (err) {
return event.mpEvent
}
}
})
}
......
......@@ -1499,10 +1499,10 @@
resolved "https://registry.npmmirror.com/@eslint/js/-/js-8.36.0.tgz"
integrity sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==
"@geek/skynet-client-wxmini@^1.1.11":
version "1.1.11"
resolved "http://git.jksxb.cn:8081/repository/geek/@geek/skynet-client-wxmini/-/skynet-client-wxmini-1.1.11.tgz#739aabf6f5de1d08654a6fbd4f173e0ac8e2c7fe"
integrity sha512-75SRBZ6XpozTpijNq3a4daOLdqhYFkjRU0O4E9bZ1ugA2VHKf04FXIZNOj0jDp/NrawvROHsfdUsCF+hIH+HLg==
"@geek/skynet-client-wxmini@^1.1.12":
version "1.1.12"
resolved "http://git.jksxb.cn:8081/repository/geek/@geek/skynet-client-wxmini/-/skynet-client-wxmini-1.1.12.tgz#828917f0aaf4307756222fdcbd20a9e3f2b221f1"
integrity sha512-iD3jxqV96DilZDzP/4wNUDNAHNiUGobWUirFqKTv6wvkTQzWgLOs9O0/+7P49eF2f7Vbp6tRAkLQV1oRoiTWkQ==
"@hapi/hoek@^9.0.0":
version "9.3.0"
......
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