|
|
@@ -1,5 +1,5 @@
|
|
|
<!--
|
|
|
-http://localhost:5173/custom/#/pages/shanda/challenge/index?pagetype=challenge_result&distance=1320&status=success&name=天生我材必有用&cal=13500100&duration=3600&accuracy=50&syscount=25
|
|
|
+http://localhost:5173/custom/#/pages/shanda/challenge/index?actId=18&matchType=3&pagetype=challenge_result&distance=1320&status=success&name=天生我材必有用&cal=13500100&duration=3600&accuracy=50&syscount=25
|
|
|
https://oss-mbh5.colormaprun.com/custom/#/pages/shanda/challenge/index?pagetype=challenge_result&distance=1320&status=success&name=天生我材必有用&cal=13500100&duration=3600&accuracy=50&syscount=25
|
|
|
-->
|
|
|
<template>
|
|
|
@@ -50,18 +50,30 @@ https://oss-mbh5.colormaprun.com/custom/#/pages/shanda/challenge/index?pagetype=
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import tools from '../../../common/tools';
|
|
|
+ import tools from '/common/tools';
|
|
|
+ import {
|
|
|
+ token,
|
|
|
+ apiCardUrlQuery,
|
|
|
+ checkResCode
|
|
|
+ } from '/common/api';
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ token: "",
|
|
|
+ matchType: 0, // 游戏类型 1 普通活动 2 线下赛 3 线上赛
|
|
|
+ ecId: 0, // 卡片id
|
|
|
+
|
|
|
status: "", // success: 挑战成功, ok: 挑战完成(没在规定时间完成,但打了所有点), fail: 挑战结束
|
|
|
name: "", // 用户名
|
|
|
duration: 0, // 总用时,秒
|
|
|
distance: 0, // 总里程,米
|
|
|
cal: 0, // 卡路里,卡 int
|
|
|
accuracy: 0, // 脑力值百分比
|
|
|
- syscount: 0 // 点数
|
|
|
+ syscount: 0 ,// 点数
|
|
|
+
|
|
|
+ actId: 0, // 活动或关联id
|
|
|
+ urlRs: [], // Url集合
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -88,6 +100,11 @@ https://oss-mbh5.colormaprun.com/custom/#/pages/shanda/challenge/index?pagetype=
|
|
|
},
|
|
|
onLoad(event) { // 类型非必填,可自动推导
|
|
|
console.log('[challenge result] onLoad');
|
|
|
+
|
|
|
+ this.token = event["token"] ?? token;
|
|
|
+ this.actId = event["actId"] ?? 0;
|
|
|
+ this.matchType = event["matchType"] ?? 0;
|
|
|
+
|
|
|
this.status = event["status"] ?? "";
|
|
|
this.name = event["name"] ?? "";
|
|
|
this.duration = event["duration"] ?? 0;
|
|
|
@@ -95,12 +112,55 @@ https://oss-mbh5.colormaprun.com/custom/#/pages/shanda/challenge/index?pagetype=
|
|
|
this.cal = event["cal"] ?? 0;
|
|
|
this.accuracy = event["accuracy"] ?? 0;
|
|
|
this.syscount = event["syscount"] ?? 0;
|
|
|
+
|
|
|
+ this.cardUrlQuery();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 根据游戏id查询卡片信息
|
|
|
+ cardUrlQuery() {
|
|
|
+ uni.request({
|
|
|
+ url: apiCardUrlQuery,
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/x-www-form-urlencoded",
|
|
|
+ "token": this.token,
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ data: {
|
|
|
+ actId: this.actId,
|
|
|
+ matchType: this.matchType
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ // console.log("cardUrlQuery", res);
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ const data = res.data.data;
|
|
|
+ this.ecId = data.ecId;
|
|
|
+ this.urlRs = data.urlRs;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log("cardUrlQuery err", err);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
btnRankList() {
|
|
|
- // uni.navigateTo({
|
|
|
- // url: '/pages/bm/style1/rankList?' + this.queryString
|
|
|
- // });
|
|
|
+ // console.log("urlRs", this.urlRs);
|
|
|
+ // const rankListUrl = this.urlRs.find(item => item.name === 'rankListUrl');
|
|
|
+ const rankListUrl = this.urlRs.rankListUrl;
|
|
|
+ // console.log("rankListUrl", rankListUrl);
|
|
|
+ if (rankListUrl != null) {
|
|
|
+ const url = rankListUrl + '?token=' + this.token + '&id=' + this.ecId;
|
|
|
+ console.log("url", url);
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: url
|
|
|
+ // });
|
|
|
+ window.location.href = url;
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: '网址错误:' + rankListUrl,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 3000
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|