123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <template>
- <g-toast :is-show="isShowToast">
- <view class="challenge-num">
- <view class="challenage-num-top">
- <view class="challenage-num-body">
- <view class="challenge-num-item">
- <view>
- <text class="label">参加挑战:</text>
- <text class="spec">
- {{ userServerInfo.challenge_result.data.challenge_num || 0 }}
- </text>
- <text class="label">场</text>
- </view>
- <view>
- <text class="label">参加竞猜:</text>
- <text class="spec">
- {{ userServerInfo.challenge_result.data.guessing_num || 0 }}
- </text>
- <text class="label">场</text>
- </view>
- </view>
- <view class="challenge-num-item">
- <view>
- <text class="label">挑战成功:</text>
- <text class="spec">
- {{ userServerInfo.challenge_result.data.challenge_success || 0 }}
- </text>
- <text class="label">场</text>
- </view>
- <view>
- <text class="label">挑战失败:</text>
- <text class="spec">
- {{ userServerInfo.challenge_result.data.challenge_fail || 0 }}
- </text>
- <text class="label">场</text>
- </view>
- </view>
- <view class="challenge-num-item">
- <view>
- <text class="label">猜赢了:</text>
- <text class="spec">
- {{ userServerInfo.challenge_result.data.guessing_success || 0 }}
- </text>
- <text class="label">场</text>
- </view>
- <view>
- <text class="label">猜输了:</text>
- <text class="spec">
- {{ userServerInfo.challenge_result.data.guessing_fail || 0 }}
- </text>
- <text class="label">场</text>
- </view>
- </view>
- </view>
- </view>
- <view class="challenge-num-btn" @click="toChallenge">查看详情</view>
- </view>
- </g-toast>
- </template>
- <script>
- import { toClieckedToast } from "../../utils/api/toast.js"
- import GToast from "../../components/global/toast.vue"
- export default {
- components: {
- GToast
- },
- data() {
- return {
- serverUserInfo: uni.getStorageSync("serverUserInfo"),
- initToast: true
- }
- },
- computed: {
- isShowToast() {
- let { challenge_result } = this.serverUserInfo
- return this.initToast && challenge_result && challenge_result.type === 1
- }
- },
- methods: {
- toChallenge() {
- let { challenge_result } = this.serverUserInfo
- toClieckedToast({
- id: challenge_result.id
- }).then(res => {
- this.serverUserInfo.challenge_result = {}
- uni.setStorage({
- key: "serverUserInfo",
- data: this.serverUserInfo,
- success() {
- uni.navigateTo({
- url: "../../pages/challenge/index"
- })
- }
- })
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .challenge-num {
- display: flex;
- flex-direction: column;
- align-items: center;
- .challenage-num-top{
- width: 626rpx;
- height: 612rpx;
- background: url(https://api.jiuweiyun.cn/public/uploads/weapp/icon/challenge_res.png) center no-repeat;
- background-size: 100%;
- margin: 0 auto 94rpx auto;
- position: relative;
- .challenage-num-body {
- width: 570rpx;
- height: 385rpx;
- position: absolute;
- bottom: 28rpx;
- left: 28rpx;
- border-radius: 24rpx;
- padding: 84rpx 30rpx 44rpx 30rpx;
- display: flex;
- justify-content: space-between;
- flex-direction: column;
- box-sizing: border-box;
- .challenge-num-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .label {
- color: #5D330D;
- font-size: 32rpx;
- margin-right: 10rpx;
- }
- .spec {
- color: #DD372D;
- font-size: 48rpx;
- }
- }
- }
- }
- .challenge-num-btn {
- width: 502rpx;
- height: 96rpx;
- border-radius: 96rpx;
- background: linear-gradient(180deg, #FEEB71 0%, #F89018 100%);
- color: #984100;
- font-size: 32rpx;
- font-weight: bold;
- line-height: 96rpx;
- text-align: center;
- }
- }
- </style>
|