| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922 |
- <!--
- [模板] 样式2 - 排名列表
- http://localhost:5173/card/#/pages/tpl/style2/rankList
- https://oss-mbh5.colormaprun.com/card/#/pages/tpl/style2/rankList
- -->
- <template>
- <view class="body">
- <view v-if="pageReady" class="content uni-column">
- <view class="uni-column page-top">
- <my-topbar :mcName="mcName" class="topbar-color" :showMessage="cardConfigData.popupMessageList.length > 0"
- @btnBackClick="btnBack" @btnInfoClick="btnInfo" @btnMessageClick="btnMessage"></my-topbar>
- <view class="topcontent uni-column uni-jcsa">
- <view class="tcview uni-row uni-jcsb">
- <view class="tcbox uni-column uni-jcc">
- <text class="tcbox-label">赛事总里程</text>
- <text class="tcbox-value">{{fmtDistanct(all_totalDistance)}} 千米</text>
- </view>
- <view class="tcbox uni-column uni-jcc">
- <text class="tcbox-label">{{configParam.labelRightAnswerNum}}</text>
- <text class="tcbox-value">{{all_totalAnswerNum}} 次</text>
- </view>
- </view>
- <text class="today" :data-content="today">{{today}}</text>
- </view>
-
- <view class="topcontent2 uni-column uni-jcsa">
- <view class="logo"></view>
- <text v-if="configParam.subTitle && configParam.subTitle.length > 0" class="top-acttime">{{configParam.subTitle}}</text>
- </view>
- <!-- <view class="topcontent uni-column uni-jcsa">
- <view class="logo"></view>
- <view class="tcbar uni-row uni-jcsb">
- <text class="tcbar-text">赛事总里程:{{fmtDistanct(all_totalDistance)}} 千米</text>
- <text class="tcbar-text">{{configParam.labelRightAnswerNum}}:{{all_totalAnswerNum}} 次</text>
- </view>
- </view> -->
- <view class="topbtm uni-row">
- <view class="topbtm-egg" @click="btnMyEgg">{{configParam.labelTicketName}}</view>
- <text class="topbtm-name">{{nickName}}</text>
- <view class="topbtm-egg" v-if="configParam.labelGoodsList && configParam.labelGoodsList.length > 0" @click="btnGoodsList">{{configParam.labelGoodsList}}</view>
- <view class="topbtm-egg" v-else @click="btnExchg">{{configParam.labelAwardAddress}}</view>
- </view>
- </view>
- <view class="main uni-column">
- <view class="main-bar uni-row uni-jcse">
- <text>题目输出:{{all_totalAnswerNum}}</text>
- <text>总里程:{{fmtDistanct(all_totalDistance)}}km</text>
- <text>总打点:{{all_totalCp}}</text>
- <text>总百味豆:{{all_totalSysPoint}}</text>
- </view>
-
- <my-tab ref="tab1" :tabItems="tab1Items" :type="1" @onTabClick="onTab1Click"
- :initActIndex=configParam.tab1InitActIndex @onSelectChange="onSelectChange" :fontSize="14"></my-tab>
- <my-tab ref="tab2" :tabItems="tab2Items" :tabItemsMark="tab2ItemsMark" :type="0"
- :initActIndex=configParam.tab2InitActIndex @onTabClick="onTab2Click" :fontSize="12"></my-tab>
- <view class="tab-view uni-column">
- <!-- 个人成绩总排名列表 -->
- <template v-if="tab1Current==0" v-for="(item, index) in rank1List" :key="index">
- <my-ranklist v-show="tab2Current === index" :rankRs="rankList[item]"
- :rank-type="rankTypeList[index]"></my-ranklist>
- </template>
- <!-- 个人成绩区域排名列表 -->
- <template v-if="tab1Current==1" v-for="(item, index) in rank2List" :key="index">
- <my-ranklist v-show="tab2Current === index" :rankRs="rankList[item]"
- :rank-type="rankTypeList[index]"></my-ranklist>
- </template>
- </view>
- <button class="btnBack bgcolor-main" @click="btnStartGame">{{btnStartGameText}}</button>
- </view>
- <my-popup ref="mypopup" :config="cardConfigData.popupRuleConfig" :dataList="cardConfigData.popupRuleList" :acttime="acttime"></my-popup>
- <my-popup ref="mypopupExchg" :config="cardConfigData.popupExchgConfig" :dataList="cardConfigData.popupExchgList"></my-popup>
- <my-popup ref="mypopupMessage" :config="cardConfigData.popupMessageConfig" :dataList="cardConfigData.popupMessageList" @noMoreRemindersClick="onNoMoreRemindersClick"></my-popup>
- <my-popup ref="mypopupWarn" :config="cardConfigData.popupWarnConfig" :dataList="cardConfigData.popupWarnList"></my-popup>
-
- </view>
- </view>
- </template>
- <script>
- import tools from '/common/tools';
- import cardfunc from '../../../common/cardfunc';
- import { localCardConfig } from "./cardconfig/test.js";
- import { teamName } from '/common/define';
- import {
- token,
- apiMatchRsDetailQuery,
- apiCardRankDetailQuery,
- apiUserCurrentRankNumQuery,
- apiIsAllowMcSignUp,
- apiUserJoinCardQuery,
- apiMapListQuery,
- apiCompStatisticQuery,
- checkResCode
- } from '/common/api';
- export default {
- data() {
- return {
- cardConfigData: cardfunc.cardConfigData,
- pageReady: false,
- pageName: "rankList",
- firstEnterKey: 'firstEnter-tpl-style2',
- rankKey: "rank-tpl-style2",
- mapKey: "rank-tpl-style2-map",
- messageKey: "message-tpl-style2",
- queryObj: {},
- queryString: "",
- token: "",
- ovtype: "",
- ecId: 0, // 卡片id
- mcId: 0, // 赛事id
- mcType: 0, // 赛事类型 1 普通活动 2 线下赛 3 线上赛
- mcName: "", // 赛事名称
- acttime: "", // 活动时间
- beginSecond: null, // 活动或赛事开始时间戳,单位秒
- endSecond: null, // 活动或赛事结束时间戳,单位秒
- ocaId: 0, // 关联id,带入到App活动详情页面
- nickName: "", // 昵称
-
- isJoin: null, // 是否报名
- btnStartGameText: "",
- today: "",
- mapList: [], // 卡片对应地图列表详情
- all_totalDistance: 0, // 赛事所有人累计里程,单位米
- all_totalRightAnswerNum: 0, // 赛事所有人正确答题数(校园文化输出)
- all_totalAnswerNum: 0, // 赛事所有人答题数(校园文化输出)
- all_totalCp: 0, // 赛事中所有人打点数
- all_totalSysPoint: 0, // 赛事中所有人百味豆
- mcState: 0, // 赛事/活动状态 0: 未开始 1: 进行中 2: 已结束
- allowMcSignUp: false, // 是否允许重新分组
- countdown: "", // 倒计时
- rankList: { // 排名列表
- // totalDistanceRs: [],
- // totalCpRs: [],
- // totalSysPointRs: [],
- // fastPaceRs: []
- },
- interval: null,
- teamType: 0, // 队伍类型
- // dispArrStr: "totalDistance,totalCp,totalSysPoint,fastPace",
- dispArrStr: "teamCp,teamTodayCp,teamDistance,teamRightAnswerPer,teamTodayPace,regionCp,regionTodayCp,regionDistance,regionRightAnswerPer,regionTodayPace", // 要显示的集合范围
- tab1Current: 0,
- tab2Current: 0,
- tab1Items: ["个人(总排名)"],
- // tab1Items: ["团体", {
- // selectValue: 1,
- // data: [
- // {text: "个人(中心校区)", value: 1},
- // {text: "个人(千佛山校区南区)", value: 2},
- // {text: "个人(兴隆校区)", value: 3}
- // ]}
- // ],
- tab2Items: [],
- tab2Items_person_total: ["总积分", "今日积分", "总里程", "校园文化", "今日配速"],
- tab2Items_person_region: ["总积分", "今日积分", "总里程", "校园文化", "今日配速"],
- tab2ItemsMark: [{
- textColor: "#ff6203",
- icon: "static/common/award.png"
- }],
- tabActiveColor: "#81cd00",
- rankTypeList: [],
- // 团队成绩类型列表
- rankTypeList_person_total: ["totalScore", "totalScore", "totalDistance", "rightAnswerPer", "fastPace"],
- // 个人成绩类型列表
- rankTypeList_person_region: ["totalScore", "totalScore", "totalDistance", "rightAnswerPer", "fastPace"],
- // 团体成绩列表
- rank1List: ["teamCpRs", "teamTodayCpRs", "teamDistanceRs", "teamRightAnswerPerRs", "teamTodayPaceRs"],
- // 个人成绩列表
- rank2List: ["regionCpRs", "regionTodayCpRs", "regionDistanceRs", "regionRightAnswerPerRs", "regionTodayPaceRs"],
- configParam: {
- subTitle: "",
- labelRightAnswerNum: "文化输出",
- labelTicketName: "我的奖券",
- labelAwardAddress: "兑奖地址",
- // labelGoodsList: "兑换商品",
- tab1InitActIndex: 0,
- tab2InitActIndex: 0
- },
- // selectedMapId: 0, // 用户选择的地图ID
- }
- },
- computed: {},
- onLoad(query) { // 类型非必填,可自动推导
- // console.log(query);
- this.queryObj = query;
- this.queryString = tools.objectToQueryString(this.queryObj);
- // console.log(queryString);
- this.token = query["token"] ?? token;
- this.ecId = query["id"] ?? 0;
- this.ovtype = query["ovtype"] ?? "";
- this.firstEnterKey += "-" + this.ecId;
- console.log("firstEnterKey:", this.firstEnterKey);
- this.rankKey += "-" + this.ecId;
- console.log("rankKey:", this.rankKey);
- this.mapKey += "-" + this.ecId;
- console.log("mapKey:", this.mapKey);
- this.messageKey += "-" + this.ecId;
- console.log("messageKey:", this.messageKey);
-
- this.today = tools.timestampToTime(null, 2);
- const mapValue = uni.getStorageSync(this.mapKey);
- if (mapValue) {
- console.log("mapValue:", mapValue);
- // this.selectedMapId = mapValue;
- this.ocaId = mapValue;
- }
-
- cardfunc.init(this, this.token, this.ecId);
- cardfunc.getCardConfig(this.cardConfigQueryCallback, localCardConfig);
- },
- // 页面初次渲染完成,此时组件已挂载完成,DOM 树($el)已可用
- onReady() {
- // this.dealFirstEnter();
- // this.tab2Items = this.tab2Items_person_total;
- },
- onShow() {
- this.getUserJoinCardQuery();
- },
- onUnload() {
- this.clear();
- },
- methods: {
- initTab() {
- if (this.tab1Current == 0) {
- this.rankTypeList = this.rankTypeList_person_total;
- this.tab2Items = this.tab2Items_person_total;
- } else {
- this.rankTypeList = this.rankTypeList_person_region;
- this.tab2Items = this.tab2Items_person_region;
- }
- },
- dealNotice(rank) {
- // console.log('[dealFirstEnter]');
- let that = this;
- uni.getStorage({
- key: that.rankKey,
- success: (res) => {
- // console.log('[getStorage]', that.rankKey, res.data);
- const oldRank = res.data;
- if (oldRank != rank) {
- // that.notice = true;
- that.setRankValue(rank);
- }
- },
- fail: (e) => {
- console.log('[getStorage] fail', that.rankKey, e);
- // that.notice = false;
- that.setRankValue(rank);
- },
- })
- },
- setRankValue(data) {
- let that = this;
- uni.setStorage({
- key: that.rankKey,
- data: data,
- success: () => {
- console.log('[setStorage] success', that.rankKey, data);
- },
- fail: (e) => {
- console.log('[setStorage] fail', that.rankKey, e);
- },
- })
- },
- dealFirstEnter() {
- // console.log('[dealFirstEnter]');
- let that = this;
- uni.getStorage({
- key: that.firstEnterKey,
- success: (res) => {
- console.log('[getStorage]', that.firstEnterKey, res.data);
- },
- fail: (e) => {
- console.log('[getStorage] fail', that.firstEnterKey, e);
- that.btnInfo();
- that.setFirstEnterValue(true);
- },
- })
- },
- setFirstEnterValue(data) {
- let that = this;
- uni.setStorage({
- key: that.firstEnterKey,
- data: data,
- success: () => {
- console.log('[setStorage] success', that.firstEnterKey, data);
- },
- fail: (e) => {
- console.log('[setStorage] fail', that.firstEnterKey, e);
- },
- })
- },
- clear() {
- if (this.interval != null) {
- clearInterval(this.interval);
- this.interval = null;
- }
- },
- cardConfigQueryCallback(cardconfig) {
- this.loadConfig(cardconfig);
- cardfunc.unReadMessageQuery(this.unReadMessageQueryCallback);
- cardfunc.warnMessageQuery(this.warnMessageQueryCallback);
- this.matchRsDetailQuery();
- setTimeout(this.dealFirstEnter, 500);
- },
- unReadMessageQueryCallback(unReadMessage, mqIdListStr) {
- // console.log("[unReadMessageQueryCallback] unReadMessage", unReadMessage);
- if (unReadMessage.length > 0) {
- this.messageKey += mqIdListStr;
- // console.log("[unReadMessageQueryCallback] messageKey:", this.messageKey);
- const messageValue = uni.getStorageSync(this.messageKey);
- // console.log("[unReadMessageQueryCallback] messageValue:", messageValue);
- if (!messageValue) {
- this.$refs.mypopupMessage.popupOpen();
- // uni.setStorageSync(this.messageKey, true);
- }
- }
- },
- warnMessageQueryCallback(warnMessage) {
- // console.log("[warnMessageQueryCallback] warnMessage", warnMessage);
- if (warnMessage.length > 0) {
- this.$refs.mypopupWarn.popupOpen();
- }
- },
- loadConfig(cardconfig) {
- cardconfig = cardfunc.parseCardConfig(cardconfig);
- // console.log("[loadCardConfig] cardconfig:", cardconfig);
-
- // 加载卡片通用配置
- if (cardconfig.common != undefined) {
- cardfunc.loadCardCommonConfig(cardconfig.common);
- }
-
- // -------- 加载当前页面的配置 --------
-
- const config = cardfunc.parseCardConfig(cardconfig[this.pageName]);
- // console.log("[loadConfig] config_page:", config);
if (config == undefined || config == null) {
- this.pageReady = true;
return;
}
-
- // 加载CSS样式
- const css = config.css;
- if (css != undefined && css.length > 0) {
- tools.loadCssCode(css);
- }
- // 加载成绩参数
- const rankParam = config.rankParam;
- if (rankParam != undefined) {
- if (rankParam.tab2ItemsMark != undefined) {
- this.tab2ItemsMark = rankParam.tab2ItemsMark;
- }
- if (rankParam.dispArrStr != undefined && rankParam.dispArrStr.length > 0) {
- this.dispArrStr = rankParam.dispArrStr;
- // console.log("[loadConfig] dispArrStr:", rankParam.dispArrStr);
- }
- if (rankParam.tab2Items_person_total != undefined && rankParam.tab2Items_person_total.length > 0) {
- this.tab2Items_person_total = rankParam.tab2Items_person_total;
- // console.log("[loadConfig] tab2Items_person_total:", rankParam.tab2Items_person_total);
- }
- if (rankParam.tab2Items_person_region != undefined && rankParam.tab2Items_person_region.length > 0) {
- this.tab2Items_person_region = rankParam.tab2Items_person_region;
- }
- if (rankParam.rankTypeList_person_total != undefined && rankParam.rankTypeList_person_total.length > 0) {
- this.rankTypeList_person_total = rankParam.rankTypeList_person_total;
- }
- if (rankParam.rankTypeList_person_region != undefined && rankParam.rankTypeList_person_region.length > 0) {
- this.rankTypeList_person_region = rankParam.rankTypeList_person_region;
- }
- if (rankParam.rank1List != undefined && rankParam.rank1List.length > 0) {
- this.rank1List = rankParam.rank1List;
- }
- if (rankParam.rank2List != undefined && rankParam.rank2List.length > 0) {
- this.rank2List = rankParam.rank2List;
- }
- }
- // console.log("[loadConfig] rankParam:", rankParam);
-
- // 加载页面参数
- const param = config.param;
- if (param != undefined) {
- if (param.subTitle != undefined && param.subTitle.length > 0) {
- this.configParam.subTitle = param.subTitle;
- }
- if (param.labelRightAnswerNum != undefined && param.labelRightAnswerNum.length > 0) {
- this.configParam.labelRightAnswerNum = param.labelRightAnswerNum;
- }
- if (param.labelTicketName != undefined && param.labelTicketName.length > 0) {
- this.configParam.labelTicketName = param.labelTicketName;
- }
- if (param.labelAwardAddress != undefined && param.labelAwardAddress.length > 0) {
- this.configParam.labelAwardAddress = param.labelAwardAddress;
- }
- if (param.labelGoodsList != undefined && param.labelGoodsList.length > 0) {
- this.configParam.labelGoodsList = param.labelGoodsList;
- }
- if (param.tab1InitActIndex != undefined && param.tab1InitActIndex >= 0) {
- this.configParam.tab1InitActIndex = param.tab1InitActIndex;
- this.tab1Current = param.tab1InitActIndex;
- }
- if (param.tab2InitActIndex != undefined && param.tab2InitActIndex >= 0) {
- this.configParam.tab2InitActIndex = param.tab2InitActIndex;
- this.tab2Current = param.tab2InitActIndex;
- }
- }
- this.initTab();
- // console.log("[loadConfig] param:", this.configParam);
-
- this.pageReady = true;
- },
- // 获取倒计时
- getCountdown() {
- // console.log(this.endSecond)
- if (this.endSecond > 0) {
- const now = Date.now() / 1000;
- const dif = this.endSecond - now;
- // const dif = 3600*24 - 60;
- if (dif > 0) {
- this.countdown = '距结束 ' + tools.convertSecondsToDHM(dif);
- } else {
- this.countdown = "活动已结束";
- }
- // this.countdown = tools.convertSecondsToHMS(dif);
- } else {
- this.countdown = "距结束 --天--小时";
- }
- },
- // 格式化 距离
- fmtDistanct(val) {
- // return Math.round(val * 100 / 1000) / 100;
- if (val < 10000)
- return Math.round(val * 100 / 1000) / 100;
- else
- return Math.round(val / 1000);
- },
- fmtMcTime(timestamp) {
- return tools.fmtMcTime(timestamp);
- },
- // 获取活动时间
- getActtime() {
- this.acttime = tools.getActtime(this.beginSecond, this.endSecond);
- },
- getTeamName(teamType, teamIndex) {
- return teamName[teamType][teamIndex];
- },
- // 卡片对应线上赛多个活动查询
- matchRsDetailQuery() {
- uni.request({
- url: apiMatchRsDetailQuery,
- header: {
- "Content-Type": "application/x-www-form-urlencoded",
- "token": this.token,
- },
- method: "POST",
- data: {
- ecId: this.ecId
- },
- success: (res) => {
- // console.log("matchRsDetailQuery", res);
- if (checkResCode(res)) {
- const data = res.data.data;
- this.mcType = data.mcType;
- this.mcId = data.mcId;
- this.mcName = data.mcName;
- this.beginSecond = data.beginSecond;
- this.endSecond = data.endSecond;
- this.nickName = data.nickName;
- this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
- this.getCountdown();
- this.getActtime();
- this.mapListQuery();
- this.compStatisticQuery();
- // this.getCardRankDetailQuery();
- this.clear();
- this.interval = setInterval(this.getCountdown, 60000);
- }
- },
- fail: (err) => {
- console.log("matchRsDetailQuery err", err)
- },
- });
- },
- // 卡片对应地图列表详情查询
- mapListQuery() {
- uni.request({
- url: apiMapListQuery,
- header: {
- "Content-Type": "application/x-www-form-urlencoded",
- "token": this.token,
- },
- method: "POST",
- data: {
- mcId: this.mcId
- },
- success: (res) => {
- // console.log("mapListQuery", res);
- if (res.data.code == 0) {
- const data = res.data.data;
- this.mapList = data;
- let mapItems = {
- // selectValue: this.selectedMapId,
- selectValue: this.ocaId,
- data: []
- };
- for (var i = 0; i < data.length; i++) {
- if (mapItems.selectValue == 0 && i == 0) {
- mapItems.selectValue = data[i].ocaId;
- // this.selectedMapId = data[i].ocaId;
- this.ocaId = data[i].ocaId;
- }
- let map = {};
- map.text = "个人(" + data[i].mapName + ")";
- map.value = data[i].ocaId;
- mapItems.data.push(map);
- }
- this.tab1Items.push(mapItems);
- this.getCardRankDetailQuery();
- }
- },
- fail: (err) => {
- console.log("mapListQuery err", err);
- },
- });
- },
- // 赛事总成绩统计查询
- compStatisticQuery() {
- uni.request({
- url: apiCompStatisticQuery,
- header: {
- "Content-Type": "application/x-www-form-urlencoded",
- "token": this.token,
- },
- method: "POST",
- data: {
- mcId: this.mcId
- },
- success: (res) => {
- // console.log("compStatisticQuery", res);
- if (res.data.code == 0) {
- const data = res.data.data;
- this.all_totalDistance = data.totalDistance;
- this.all_totalRightAnswerNum = data.totalRightAnswerNum;
- this.all_totalAnswerNum = data.totalAnswerNum;
- this.all_totalCp = data.totalCp;
- this.all_totalSysPoint = data.totalSysPoint;
- }
- },
- fail: (err) => {
- console.log("compStatisticQuery err", err);
- },
- });
- },
- // 排名查询
- getCardRankDetailQuery() {
- uni.request({
- url: apiCardRankDetailQuery,
- header: {
- "Content-Type": "application/x-www-form-urlencoded",
- "token": this.token,
- },
- method: "POST",
- data: {
- mcIdListStr: this.mcId,
- mcType: this.mcType,
- ocaId: this.ocaId,
- dispArrStr: this.dispArrStr
- },
- success: (res) => {
- // console.log("getCardRankDetailQuery", res);
- const rankdata = res.data.data;
- this.rankList = rankdata;
- },
- fail: (err) => {
- console.log("getCardRankDetailQuery err", err);
- },
- });
- },
- // 是否允许重新分组(报名)
- isAllowMcSignUp() {
- uni.request({
- url: apiIsAllowMcSignUp,
- header: {
- "Content-Type": "application/x-www-form-urlencoded",
- "token": this.token,
- },
- method: "POST",
- data: {
- ecId: this.ecId
- },
- success: (res) => {
- // console.log("isAllowMcSignUp", res)
- if (res.data.code == 0) {
- const data = res.data.data;
- this.allowMcSignUp = data.allowSignUp;
- }
- },
- fail: (err) => {
- console.log("isAllowMcSignUp err", err)
- },
- });
- },
- // 用户是否已经报名卡片对应赛事查询
- getUserJoinCardQuery() {
- uni.request({
- url: apiUserJoinCardQuery,
- header: {
- "Content-Type": "application/x-www-form-urlencoded",
- "token": this.token
- },
- method: "POST",
- data: {
- ecId: this.ecId
- },
- success: (res) => {
- // console.log("getUserJoinCardQuery", res)
- const code = res.data.code;
- const data = res.data.data;
- if (code == 0) {
- this.isJoin = data.isJoin;
- if (this.isJoin) { // 已报名
- // this.btnStartGameText = "我要比赛";
- this.btnStartGameText = "选择场地";
- } else { // 未报名
- this.btnStartGameText = "我要报名";
- }
- }
- },
- fail: (err) => {
- console.log("getUserJoinCardQuery err", err)
- },
- });
- },
- onNoMoreRemindersClick() {
- this.$refs.mypopupMessage.popupClose();
- uni.setStorageSync(this.messageKey, true);
- },
- btnBack() {
- // window.history.back();
- const url = `action://to_home/`;
- tools.appAction(url);
- },
- btnStartGame() {
- if (this.isJoin) { // 已报名
- const url = "/pages/tpl/style2/rankOverview?" + this.queryString;
- tools.appAction(url, "uni.navigateTo");
- } else { // 未报名
- const url = "/pages/tpl/style2/signup?" + this.queryString;
- tools.appAction(url, "uni.navigateTo");
- }
- },
- btnInfo() {
- // console.log(this.$refs.mypopup);
- this.$refs.mypopup.popupOpen();
- },
- btnMessage() {
- // console.log(this.$refs.mypopup);
- this.$refs.mypopupMessage.popupOpen();
- },
- btnMyEgg() {
- const url = "/pages/achievement/index2?tabCurrent=2&" + this.queryString;
- tools.appAction(url, "uni.navigateTo");
- },
- btnExchg() {
- this.$refs.mypopupExchg.popupOpen();
- },
- btnGoodsList() {
- this.queryObj.from = "/pages/tpl/style2/rankList";
- this.queryString = tools.objectToQueryString(this.queryObj);
- const url = "/pages/exchange/style1/goodsList?" + this.queryString;
- tools.appAction(url, "uni.navigateTo");
- },
- onTab1Click(val) {
- console.log("onTab1Click: ", val);
- this.tab1Current = val;
- this.initTab();
- },
- onTab2Click(val) {
- // console.log("onTab2Click: ", val);
- this.tab2Current = val;
- },
- onSelectChange(val) {
- // console.log("onSelectChange: ", val);
- this.ocaId = val.value;
- this.getCardRankDetailQuery();
- uni.setStorageSync(this.mapKey, this.ocaId);
- },
- }
- }
- </script>
- <style scoped>
- .content {
- width: 100vw;
- height: 100vh;
- }
- .page-top {
- width: 100%;
- height: 170px;
- padding-top: 36px;
- justify-content: space-between;
- background-image: url('static/backgroud/top_bg_sddx.png');
- background-repeat: no-repeat;
- background-position: center;
- background-size: cover;
- }
- .topcontent {
- width: 90%;
- /* height: 90%; */
- /* margin-bottom: 20px; */
- }
- .topcontent2 {
- width: 90%;
- display: none;
- }
-
- .logo {
- width: 80px;
- height: 80px;
- margin-top: 10px;
- margin-bottom: 10px;
- /* background-image: url('/static/logo/sddx.png'); */
- background-repeat: no-repeat;
- background-position-x: center;
- background-position-y: center;
- background-size: contain;
- }
- .top-acttime {
- text-shadow: 3px 3px 0px #640008;
- font-family: YouSheBiaoTiHei;
- /* font-family: Arial, Helvetica, sans-serif; */
- font-weight: bold;
- color: #ffee0b;
- font-size: 20px;
- }
-
- .tcview {
- width: 90%;
- /* height: 100px; */
- }
- .tcbox {
- width: 121px;
- height: 63px;
- opacity: 1;
- border-radius: 6px;
- background: #9A300E;
- border: 1px solid #D3A254;
- }
- .tcbox-label {
- font-size: 12px;
- font-weight: 500;
- line-height: 23px;
- color: #f3d809;
- }
- .tcbox-value {
- font-size: 16px;
- font-weight: 500;
- line-height: 26px;
- color: #f3d809;
- }
-
- .today {
- margin-top: 8px;
- color: #751f00;
- font-size: 16px;
- /* font-family: "黑体", sans-serif; */
- font-weight: 3700;
- position: relative;
- z-index: 0;
- }
- .today::after {
- content: attr(data-content);
- -webkit-text-stroke: 3px #DCA452;
- /* font-family: "黑体", sans-serif; */
- position: absolute;
- left: 0;
- top: 0;
- z-index: -1;
- }
- .tcbar {
- display: none;
- width: 92%;
- padding: 6px 12px;
- background: #9a300e;
- border-radius: 6px;
- }
- .tcbar-text {
- font-family: Source Han Sans CN;
- font-weight: 500;
- color: #f3d809;
- font-size: 13px;
- }
- .mcName {
- font-size: 40rpx;
- font-weight: 550;
- }
- .topbtm {
- width: 100%;
- margin-bottom: 5px;
- justify-content: space-around;
- }
- .topbtm-name {
- padding: 3px 12px;
- background-color: #9A300E;
- border: 1px solid #D3A254;
- border-radius: 6px;
- text-align: center;
- font-weight: 500;
- color: #ffffff;
- font-size: 14px;
- }
- .topbtm-egg {
- width: 60px;
- padding: 3px 12px;
- background-color: #9A300E;
- border: 1px solid #D3A254;
- border-radius: 6px;
- text-align: center;
- color: #ffffff;
- font-size: 14px;
- }
- .topbtm-null {
- width: 60px;
- padding: 3px 12px;
- }
- .cal {
- width: 46rpx;
- height: 46rpx;
- margin-right: 20rpx;
- }
- .main {
- width: 100%;
- /* height: 70vh; */
- flex-grow: 1;
- justify-content: space-around;
- /* justify-content: space-between; */
- }
-
- .main-bar {
- display: none;
- width: 100%;
- height: 21px;
- background-color: #d8e8c6;
-
- font-size: 10px;
- font-weight: 500;
- color: #3d6706;
- }
- /* /deep/ .tab-active {
- background-color: #a43a07 !important;
- } */
- .main-tab {
- width: 90%;
- margin-top: 20rpx;
- }
- .tab-view {
- width: 100%;
- /* height: 69vh; */
- flex-grow: 1;
- }
- .btnBack {
- width: 70%;
- height: 80rpx;
- margin-bottom: 20rpx;
- /* font-weight: bold; */
- color: white;
- font-size: 32rpx;
- line-height: 80rpx;
- border-radius: 27px;
- background-color: #2e85ec;
- }
- /* .swiper-item-button {
- background-color: #ff870e !important;
- }
-
- .uni-swiper-dot-active {
- background: #ff870e !important;
- } */
- </style>
|