signup.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. <!--
  2. [报名] 样式3 - 报名
  3. http://localhost:5173/card/#/pages/bm/style4/signup
  4. https://oss-mbh5.colormaprun.com/card/#/pages/bm/style4/signup
  5. -->
  6. <template>
  7. <view class="body">
  8. <view v-if="pageReady" class="content uni-column">
  9. <view class="uni-column" :class="cssTop">
  10. <my-topbar :mcName="mcName" :class="cssTopbarColor" @btnBackClick="btnBack"
  11. @btnInfoClick="btnInfo"></my-topbar>
  12. <view class="topcontent uni-column uni-jcsa">
  13. <view class="logo"></view>
  14. <text v-if="configParam.subTitle.length > 0" class="top-acttime">{{configParam.subTitle}}</text>
  15. <text v-else class="top-acttime">{{fmtMcTime2(beginSecond, endSecond)}}</text>
  16. </view>
  17. </view>
  18. <view class="timebar uni-row">
  19. <image mode="aspectFit" class="clock" src="/static/default/clock.png"></image>
  20. <text class="acttime">{{acttime}}</text>
  21. </view>
  22. <view class="main uni-column uni-jct">
  23. <input class="uni-input" maxlength="12" :placeholder="'请填写'+configParam.labelName" placeholder-style="font-size: 14px;" v-model="nickName" @click="nickNameClick" />
  24. <e-select v-model="coiId" :options="coiRs" :props="eSelectionProps" clearable
  25. maxHeight="40vh" :placeholder="'请选择'+configParam.labelOrg+'(可输入关键字)'" @getText="getESelectText"
  26. @change="eSelectChange"></e-select>
  27. <view class="introduce uni-column">
  28. <text class="introduce-title">{{introduce.title}}</text>
  29. <text class="introduce-content" v-html="introduce.content"></text>
  30. </view>
  31. <view v-if="activityRules.content.length > 0" class="activityRules uni-column">
  32. <text class="activityRules-title">{{activityRules.title}}</text>
  33. <text class="activityRules-content" v-html="activityRules.content"></text>
  34. </view>
  35. <button class="btnSignup btnSignup-enable" v-if="mcState<=1" @click="btnSignup">报 名</button>
  36. <button class="btnSignup btnSignup-disable" v-if="mcState==2">活动已结束</button>
  37. </view>
  38. <my-popup ref="mypopup" :config="popupRuleConfig" :dataList="popupDataList" :acttime="acttime"></my-popup>
  39. <!-- <uni-popup ref="alertDialog" type="dialog">
  40. <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="您填写的姓名:" @confirm="dialogConfirm"
  41. @close="dialogClose">
  42. <view class="dialog-content uni-column">
  43. <text class="dialog-content-1">{{nickName}}</text>
  44. </view>
  45. </uni-popup-dialog>
  46. </uni-popup> -->
  47. <uni-popup ref="alertDialog" type="dialog">
  48. <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="你的报名信息:" @confirm="dialogConfirm"
  49. @close="dialogClose">
  50. <view class="dialog-content uni-column">
  51. <text class="dialog-content-1">{{mcName}}</text>
  52. <view class="uni-column uni-ais">
  53. <text class="dialog-content-2">{{configParam.labelName}}: {{nickName}}</text>
  54. <text class="dialog-content-2">{{configParam.labelOrg}}: {{coiName}}</text>
  55. <!-- <text class="dialog-content-2">{{teamName}}</text> -->
  56. </view>
  57. </view>
  58. </uni-popup-dialog>
  59. </uni-popup>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. import tools from '../../../common/tools';
  65. import {
  66. defaultPopUpDataList,
  67. defaultPopUpDataList2
  68. } from '../../../common/define';
  69. import {
  70. token,
  71. apiCardDetailQuery,
  72. apiOnlineMcSignUpDetail,
  73. apiOnlineMcSignUp,
  74. apiCardConfigQuery,
  75. apiMatchRsDetailQuery,
  76. checkResCode,
  77. checkToken
  78. } from '../../../common/api';
  79. export default {
  80. data() {
  81. return {
  82. pageReady: false,
  83. pageName: "signup",
  84. firstEnterKey: 'firstEnter-bm-style4',
  85. rankKey: "rank-bm-style4",
  86. queryObj: {},
  87. queryString: "",
  88. from: "", // 来源页面
  89. token: "",
  90. ecId: 0, // 卡片id
  91. mcId: 0, // 赛事id
  92. mcType: 0, // 赛事类型 1 普通活动 2 线下赛 3 线上赛
  93. mcName: "", // 赛事名称
  94. acttime: "", // 活动时间
  95. beginSecond: null, // 活动或赛事开始时间戳,单位秒
  96. endSecond: null, // 活动或赛事结束时间戳,单位秒
  97. coiId: 0, // 已报名单位id
  98. coiName: "", // 已报名单位名称,可为空
  99. teamNum: 0, // 已报名队伍编号,可为0
  100. nickName: "", // 昵称
  101. coiRs: [], // 组织信息集合
  102. // orgList: [], // 分组下拉列表数据源
  103. // teamList: [], //
  104. interval: null,
  105. mcState: 0, // 赛事/活动状态 0: 未开始 1: 进行中 2: 已结束
  106. // teamType: 0, // 队伍类型 0: 红黄蓝紫 1: 学生/家长
  107. cssTop: "",
  108. cssTopbarColor: "",
  109. cssLogo: "",
  110. introduce: {
  111. title: "",
  112. content: ""
  113. },
  114. activityRules: {
  115. title: "",
  116. content: ""
  117. },
  118. popupRuleConfig: {}, // 规则弹窗配置
  119. popupDataList: [],
  120. configParam: {
  121. labelName: "昵称",
  122. labelOrg: "组织",
  123. subTitle: ""
  124. },
  125. eSelectionProps: {
  126. text: 'coiName',
  127. value: 'coiId',
  128. // disabled: 'noallowed'
  129. },
  130. }
  131. },
  132. computed: {},
  133. onLoad(query) { // 类型非必填,可自动推导
  134. // console.log(query);
  135. this.queryObj = query;
  136. this.queryString = tools.objectToQueryString(this.queryObj);
  137. // console.log(queryString);
  138. this.from = query["from"] ?? "";
  139. this.token = query["token"] ?? token;
  140. this.ecId = query["id"] ?? 0;
  141. this.firstEnterKey += "-" + this.ecId;
  142. console.log("firstEnterKey:", this.firstEnterKey);
  143. this.rankKey += "-" + this.ecId;
  144. console.log("rankKey:", this.rankKey);
  145. tools.removeCssCode();
  146. this.getCardConfigQuery();
  147. this.getCardDetailQuery();
  148. this.matchRsDetailQuery();
  149. },
  150. // 页面初次渲染完成,此时组件已挂载完成,DOM 树($el)已可用
  151. onReady() {
  152. // this.dealFirstEnter();
  153. },
  154. onUnload() {
  155. this.clear();
  156. },
  157. methods: {
  158. dealNotice(rank) {
  159. // console.log('[dealNotice]');
  160. let that = this;
  161. uni.getStorage({
  162. key: that.rankKey,
  163. success: (res) => {
  164. console.log('[getStorage]', that.rankKey, res.data);
  165. const oldRank = res.data;
  166. if (oldRank != rank) {
  167. // that.notice = true;
  168. that.setRankValue(rank);
  169. }
  170. },
  171. fail: (e) => {
  172. console.log('[getStorage] fail', that.rankKey, e);
  173. // that.notice = false;
  174. that.setRankValue(rank);
  175. },
  176. })
  177. },
  178. setRankValue(data) {
  179. let that = this;
  180. uni.setStorage({
  181. key: that.rankKey,
  182. data: data,
  183. success: () => {
  184. console.log('[setStorage] success', that.rankKey, data);
  185. },
  186. fail: (e) => {
  187. console.log('[setStorage] fail', that.rankKey, e);
  188. },
  189. })
  190. },
  191. dealFirstEnter() {
  192. // console.log('[dealFirstEnter]');
  193. let that = this;
  194. uni.getStorage({
  195. key: that.firstEnterKey,
  196. success: (res) => {
  197. console.log('[getStorage]', that.firstEnterKey, res.data);
  198. },
  199. fail: (e) => {
  200. console.log('[getStorage] fail', that.firstEnterKey, e);
  201. that.btnInfo();
  202. that.setFirstEnterValue(true);
  203. },
  204. })
  205. },
  206. setFirstEnterValue(data) {
  207. let that = this;
  208. uni.setStorage({
  209. key: that.firstEnterKey,
  210. data: data,
  211. success: () => {
  212. console.log('[setStorage] success', that.firstEnterKey, data);
  213. },
  214. fail: (e) => {
  215. console.log('[setStorage] fail', that.firstEnterKey, e);
  216. },
  217. })
  218. },
  219. clear() {
  220. if (this.interval != null) {
  221. clearInterval(this.interval);
  222. this.interval = null;
  223. }
  224. },
  225. loadConfig(config) {
  226. // console.log("config", config);
  227. // 加载CSS样式
  228. const css = config.css;
  229. if (css != undefined && css.length > 0) {
  230. tools.loadCssCode(css);
  231. if (css.indexOf(".top{") >= 0) {
  232. this.cssTop = "top";
  233. }
  234. if (css.indexOf(".topbar-color{") >= 0) {
  235. this.cssTopbarColor = "topbar-color";
  236. }
  237. }
  238. if (this.cssTop == "") {
  239. this.cssTop = "top-default";
  240. }
  241. if (this.cssTopbarColor == "") {
  242. this.cssTopbarColor = "topbar-color-default";
  243. }
  244. console.log("[loadConfig] cssTop:", this.cssTop);
  245. console.log("[loadConfig] cssTopbarColor:", this.cssTopbarColor);
  246. // 加载队伍类型 0: 红黄蓝紫 1: 学生/家长
  247. /* if (config.teamType != undefined && config.teamType >= 0) {
  248. this.teamType = config.teamType;
  249. } */
  250. // 加载介绍内容
  251. const introduce = config.introduce;
  252. if (introduce != undefined) {
  253. if (introduce.title != undefined) {
  254. this.introduce.title = introduce.title;
  255. }
  256. if (introduce.content != undefined) {
  257. this.introduce.content = introduce.content;
  258. }
  259. }
  260. // 加载活动规则
  261. const activityRules = config.activityRules;
  262. if (activityRules != undefined) {
  263. if (activityRules.title != undefined) {
  264. this.activityRules.title = activityRules.title;
  265. }
  266. if (activityRules.content != undefined) {
  267. this.activityRules.content = activityRules.content;
  268. }
  269. }
  270. // 加载规则弹窗配置
  271. const popupRuleConfig = config.popupRuleConfig;
  272. if (popupRuleConfig != undefined) {
  273. this.popupRuleConfig = popupRuleConfig;
  274. }
  275. // console.log("[loadConfig] popupRuleConfig:", this.popupRuleConfig);
  276. // 加载弹窗数据
  277. const popupDataList = config.popupDataList;
  278. // console.log("[loadConfig] popupDataList:", popupDataList);
  279. if (popupDataList != undefined && popupDataList.length > 0) {
  280. for (var i = 0; i < popupDataList.length; i++) {
  281. // console.log("[loadConfig] popupDataList", i, popupDataList[i]);
  282. if (popupDataList[i] == 'default') {
  283. for (var j = 0; j < defaultPopUpDataList.length; j++) {
  284. this.popupDataList.push(defaultPopUpDataList[j]);
  285. }
  286. } else if (popupDataList[i] == 'default2') {
  287. for (var j = 0; j < defaultPopUpDataList2.length; j++) {
  288. this.popupDataList.push(defaultPopUpDataList2[j]);
  289. }
  290. } else {
  291. this.popupDataList.push(popupDataList[i]);
  292. }
  293. }
  294. } else {
  295. this.popupDataList = defaultPopUpDataList;
  296. console.log("[loadConfig] popupDataList 加载默认列表");
  297. }
  298. // console.log("[loadConfig] popupDataList:", this.popupDataList);
  299. // 加载页面参数
  300. const param = config.param;
  301. if (param != undefined) {
  302. if (param.labelName != undefined && param.labelName.length > 0) {
  303. this.configParam.labelName = param.labelName;
  304. }
  305. if (param.labelOrg != undefined && param.labelOrg.length > 0) {
  306. this.configParam.labelOrg = param.labelOrg;
  307. }
  308. if (param.subTitle != undefined && param.subTitle.length > 0) {
  309. this.configParam.subTitle = param.subTitle;
  310. }
  311. }
  312. // console.log("[loadConfig] param:", this.configParam);
  313. this.pageReady = true;
  314. },
  315. fmtMcTime(timestamp) {
  316. return tools.fmtMcTime(timestamp);
  317. },
  318. // 获取倒计时
  319. getActtime() {
  320. this.acttime = tools.getActtime(this.beginSecond, this.endSecond);
  321. },
  322. fmtMcTime2(timestamp1, timestamp2) {
  323. return tools.fmtMcTime2(timestamp1, timestamp2);
  324. },
  325. getCardConfigQuery() {
  326. uni.request({
  327. url: apiCardConfigQuery,
  328. header: {
  329. "Content-Type": "application/x-www-form-urlencoded",
  330. "token": this.token,
  331. },
  332. method: "POST",
  333. data: {
  334. ecId: this.ecId,
  335. pageName: this.pageName
  336. },
  337. success: (res) => {
  338. // console.log("getCardConfigQuery", res)
  339. const data = res.data.data;
  340. const config = data.configJson != "" ? JSON.parse(data.configJson) : "";
  341. // console.log("configJson", data.configJson);
  342. /* const config = {
  343. "css": `
  344. .top{
  345. width: 100%;
  346. height: 220px;
  347. padding-top: 36px;
  348. justify-content: space-between;
  349. background-image: url('static/backgroud/top_bg_sddx2.png');
  350. background-repeat: no-repeat;
  351. background-position: center;
  352. background-size: cover;
  353. }
  354. .topbar-rule {
  355. color: #FFFFFF;
  356. border-radius: 4px;
  357. background: #FF870D;
  358. }
  359. .logo{
  360. width: 180.5px !important;
  361. height: 130.5px !important;
  362. background-image: url('static/logo/sddx_jjyjy.png');
  363. }
  364. .top-acttime{
  365. display: flex !important;
  366. font-size: 20px !important;
  367. line-height: 30px !important;
  368. }
  369. .topbar-color{
  370. color: #ffffff;
  371. }
  372. .btnSignup-enable {
  373. background-color: #a43a07 !important;
  374. }
  375. .swiper-item-button {
  376. background-color: #a43a07 !important;
  377. }
  378. .uni-swiper-dot-active {
  379. background: #a43a07 !important;
  380. }
  381. `,
  382. "popupRuleConfig": {
  383. "height": "530px"
  384. },
  385. "popupDataList": [
  386. {
  387. "type": 7,
  388. "data": {
  389. "topLogo": {
  390. "src": "/static/logo/sddx.png",
  391. "width": "80px",
  392. "height": "80px"
  393. },
  394. "title": "“筑梦宿州·创赢未来 ”特训营",
  395. "content": "<span style='display:block; text-align: center; margin: 20px; font-weight: bold;'>欢乐定向赛</span>  欢迎加入“筑梦宿州·创赢未来”特训营定向赛!在这里,你将亲历百年奥运精英运动——定向运动,体验个人与团队目标的完美融合,过程中运动与智慧并重。完赛即享奖励,最佳团队更享奖上奖!让我们携手加油吧!<br><br><span style='display:block; text-align: right;'>山东大学经济研究院</span>",
  396. "imageList": []
  397. }
  398. },
  399. {
  400. "type": 7,
  401. "data": {
  402. "topLogo": {
  403. "src": "/static/logo/sddx.png",
  404. "width": "80px",
  405. "height": "80px"
  406. },
  407. "title": "活动流程",
  408. "content": "<span style='line-height: 30px;'>① 选择战队赛事报名 ↓ <br>② 选择场地导航至起点 ↓ <br>③ 进入活动起点打点 ↓ <br>④ 按序号依次打点 ↓ <br>⑤ 知识问答 ↓ <br>⑥ 终点打点 ↓ <br>⑦ 查看成绩 ↓ <br>⑧ 获得奖励</span>",
  409. "imageList": []
  410. }
  411. },
  412. {
  413. "type": 7,
  414. "data": {
  415. "topLogo": {
  416. "src": "/static/logo/sddx.png",
  417. "width": "80px",
  418. "height": "80px"
  419. },
  420. "title": "定向运动怎么玩?",
  421. "content": "",
  422. "imageList": [{
  423. "src": "/static/common/qrcode_spjc.png",
  424. "width": "140.5px",
  425. "height": "163.5px"
  426. }]
  427. }
  428. },
  429. {
  430. "type": 7,
  431. "data": {
  432. "topLogo": {
  433. "src": "/static/logo/sddx.png",
  434. "width": "80px",
  435. "height": "80px"
  436. },
  437. "title": "赛事规则及奖励",
  438. "content": "<br><span style='line-height: 22px;'>规则:<br>1. 选择心仪战队,共筑个人与战队荣耀。<br>2. 在规定的时间内,<span style='color: #FF8D1A;'>不限完赛次数</span>,最终成绩以完赛累计积分计算。<br>3. 途经点成功打点1积分,正确答题1积分。<br>4. 未成功完赛(未打结束点)积分不计入。<br><br>奖励:<br><span style='color: #FF8D1A;'>完赛奖、最佳战队奖、个人前三名</span></span>",
  439. "imageList": []
  440. }
  441. },
  442. "default2"
  443. ],
  444. "introduce": {
  445. "title": "介绍:",
  446. "content": "  欢迎加入“筑梦宿州·创赢未来”特训营定向赛!在这里,你将亲历百年奥运精英运动——定向运动,体验个人与团队目标的完美融合,过程中运动与智慧并重。完赛即享奖励,最佳团队更享奖上奖!让我们携手加油吧!<br><br><span style='display:block; text-align: right;'>山东大学经济研究院</span>"
  447. },
  448. "param": {
  449. "labelName": "姓名",
  450. "labelOrg": "战队",
  451. "subTitle": "“筑梦宿州·创赢未来 ”特训营"
  452. }
  453. }; */
  454. this.loadConfig(config);
  455. setTimeout(this.dealFirstEnter, 500);
  456. },
  457. fail: (err) => {
  458. console.log("getCardConfigQuery err", err)
  459. },
  460. });
  461. },
  462. // 卡片信息查询
  463. getCardDetailQuery() {
  464. uni.request({
  465. url: apiCardDetailQuery,
  466. header: {
  467. "Content-Type": "application/x-www-form-urlencoded",
  468. "token": this.token
  469. },
  470. method: "POST",
  471. data: {
  472. ecId: this.ecId
  473. },
  474. success: (res) => {
  475. // console.log("getCardDetailQuery", res);
  476. const data = res.data.data;
  477. this.mcType = data.mcType;
  478. this.mcId = data.mcId;
  479. this.mcName = data.mcName;
  480. this.beginSecond = data.beginSecond;
  481. this.endSecond = data.endSecond;
  482. this.coiId = data.coiId;
  483. this.coiName = data.coiName;
  484. this.teamNum = data.teamNum;
  485. this.nickName = data.nickName;
  486. this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
  487. this.getActtime();
  488. this.getOnlineMcSignUpDetail();
  489. this.clear();
  490. this.interval = setInterval(this.getActtime, 60000);
  491. },
  492. fail: (err) => {
  493. console.log("getCardDetailQuery err", err)
  494. },
  495. });
  496. },
  497. // 卡片对应线上赛多个活动查询
  498. matchRsDetailQuery() {
  499. uni.request({
  500. url: apiMatchRsDetailQuery,
  501. header: {
  502. "Content-Type": "application/x-www-form-urlencoded",
  503. "token": this.token,
  504. },
  505. method: "POST",
  506. data: {
  507. ecId: this.ecId
  508. },
  509. success: (res) => {
  510. // console.log("matchRsDetailQuery", res);
  511. if (res.data.code == 0) {
  512. const data = res.data.data;
  513. const rank = JSON.stringify(data);
  514. this.dealNotice(rank);
  515. }
  516. },
  517. fail: (err) => {
  518. console.log("matchRsDetailQuery err", err)
  519. },
  520. });
  521. },
  522. // 卡片用户当前排名查询
  523. // getUserCurrentRankNumQuery() {
  524. // uni.request({
  525. // url: apiUserCurrentRankNumQuery,
  526. // header: {
  527. // "Content-Type": "application/x-www-form-urlencoded",
  528. // "token": this.token,
  529. // },
  530. // method: "POST",
  531. // data: {
  532. // ecId: this.ecId
  533. // },
  534. // success: (res) => {
  535. // // console.log("getUserCurrentRankNumQuery", res)
  536. // if (res.data.code == 0) {
  537. // const data = res.data.data;
  538. // const rankNum = data.rankNum;
  539. // this.dealNotice(rankNum);
  540. // }
  541. // },
  542. // fail: (err) => {
  543. // console.log("getUserCurrentRankNumQuery err", err)
  544. // },
  545. // });
  546. // },
  547. // 线上赛报名页面信息详情
  548. getOnlineMcSignUpDetail() {
  549. uni.request({
  550. url: apiOnlineMcSignUpDetail,
  551. header: {
  552. "Content-Type": "application/x-www-form-urlencoded",
  553. "token": this.token,
  554. },
  555. method: "POST",
  556. data: {
  557. mcId: this.mcId,
  558. },
  559. success: (res) => {
  560. // console.log("getOnlineMcSignUpDetail", res);
  561. this.coiRs = res.data.data.coiRs;
  562. if (this.nickName == undefined || this.nickName == '') {
  563. this.nickName = res.data.data.name;
  564. }
  565. /* const rsNum = this.coiRs.length;
  566. this.orgList = [];
  567. for (let i = 0; i < rsNum; i++) {
  568. this.orgList[i] = {};
  569. this.orgList[i].value = this.coiRs[i].coiId;
  570. this.orgList[i].text = this.coiRs[i].coiName;
  571. this.orgList[i].teamNum = this.coiRs[i].teamNum;
  572. }
  573. // console.log("orgList", this.orgList);
  574. if (this.coiId > 0) {
  575. this.orgChange(this.coiId, false);
  576. } */
  577. },
  578. fail: (err) => {
  579. console.log("getOnlineMcSignUpDetail err", err)
  580. },
  581. });
  582. },
  583. // 线上赛报名
  584. onlineMcSignUp() {
  585. uni.request({
  586. url: apiOnlineMcSignUp,
  587. header: {
  588. "Content-Type": "application/x-www-form-urlencoded",
  589. "token": this.token,
  590. },
  591. method: "POST",
  592. data: {
  593. mcId: this.mcId,
  594. coiId: this.coiId,
  595. selectTeam: this.teamNum,
  596. nickName: this.nickName
  597. },
  598. success: (res) => {
  599. // console.log("onlineMcSignUp", res);
  600. if (checkResCode(res)) {
  601. uni.showToast({
  602. title: '比赛报名成功!',
  603. icon: 'none',
  604. duration: 3000
  605. });
  606. // uni.navigateTo({
  607. // // url: '/pages/bm/style4/rankOverview?' + this.queryString
  608. // url: '/pages/bm/style4/rankList?' + this.queryString
  609. // });
  610. const url = '/pages/bm/style4/rankList?' + this.queryString;
  611. tools.appAction(url, "uni.navigateTo");
  612. }
  613. },
  614. fail: (err) => {
  615. console.log("onlineMcSignUp err", err);
  616. uni.showToast({
  617. title: '出错了,报名失败',
  618. icon: 'none',
  619. duration: 3000
  620. });
  621. },
  622. });
  623. },
  624. btnBack() {
  625. // console.log("from:", this.from)
  626. if (this.from != '') {
  627. // window.history.back();
  628. // uni.navigateTo({
  629. // url: '/pages/bm/style4/' + this.from + '?' + this.queryString
  630. // });
  631. const url = '/pages/bm/style4/' + this.from + '?' + this.queryString;
  632. tools.appAction(url, "uni.navigateTo");
  633. } else {
  634. const url = `action://to_home/`;
  635. tools.appAction(url);
  636. }
  637. },
  638. btnInfo() {
  639. this.$refs.mypopup.popupOpen();
  640. },
  641. nickNameClick() {
  642. checkToken(this.token);
  643. },
  644. btnSignup() {
  645. if (!checkToken(this.token)) {
  646. return;
  647. }
  648. if (!(this.nickName.trim().length > 0)) {
  649. uni.showToast({
  650. title: `请填写${this.configParam.labelName}`,
  651. icon: 'none',
  652. duration: 2000
  653. });
  654. return;
  655. }
  656. if (!(this.coiId > 0)) {
  657. uni.showToast({
  658. title: `请选择${this.configParam.labelOrg}`,
  659. icon: 'none',
  660. duration: 2000
  661. });
  662. return;
  663. }
  664. this.nickName = this.nickName.trim();
  665. // this.coiName = tools.getSelectedText(this.orgList, this.coiId);
  666. // this.teamName = tools.getSelectedText(this.teamList, this.teamNum);
  667. this.$refs.alertDialog.open();
  668. },
  669. dialogConfirm() {
  670. this.onlineMcSignUp();
  671. },
  672. dialogClose() {},
  673. // 获取输入框中值
  674. getESelectText(data) {
  675. // console.log("getESelectText:", data);
  676. this.coiName = data;
  677. },
  678. // 获取选择选项值
  679. eSelectChange(data) {
  680. // console.log("eSelectChange:", data);
  681. },
  682. }
  683. }
  684. </script>
  685. <style scoped>
  686. .content {
  687. width: 100vw;
  688. min-height: 100vh;
  689. }
  690. .top-default {
  691. width: 100%;
  692. height: 220px;
  693. padding-top: 36px;
  694. justify-content: space-between;
  695. background-image: url('static/backgroud/top_bg_sddx.png');
  696. background-repeat: no-repeat;
  697. background-position: center;
  698. background-size: cover;
  699. }
  700. .topbar-color-default {
  701. color: #333333;
  702. }
  703. .topcontent {
  704. height: 90%;
  705. margin-bottom: 30px;
  706. }
  707. .logo {
  708. width: 80px;
  709. height: 80px;
  710. margin-top: 10px;
  711. /* background-image: url('/static/logo/sddx.png'); */
  712. background-repeat: no-repeat;
  713. background-position-x: center;
  714. background-position-y: center;
  715. background-size: contain;
  716. }
  717. .top-acttime {
  718. display: none;
  719. text-shadow: 3px 3px 0px #640008;
  720. font-family: YouSheBiaoTiHei;
  721. /* font-family: Arial, Helvetica, sans-serif; */
  722. font-weight: bold;
  723. color: #ffee0b;
  724. font-size: 26px;
  725. }
  726. .mcName {
  727. font-size: 40rpx;
  728. font-weight: 550;
  729. }
  730. .main {
  731. width: 76%;
  732. /* min-height: 800rpx; */
  733. /* margin-top: 20rpx; */
  734. /* justify-content: space-around; */
  735. flex-grow: 1;
  736. }
  737. .timebar {
  738. min-width: 68%;
  739. height: 32px;
  740. margin-top: -17px;
  741. padding: 0 15px;
  742. justify-content: center;
  743. background: #ffffff;
  744. border: 0.5px solid;
  745. border-color: #e7e7e7;
  746. border-radius: 20px;
  747. box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.13);
  748. }
  749. .acttime {
  750. font-weight: 550;
  751. color: #333333;
  752. font-size: 14px;
  753. text-wrap: nowrap;
  754. }
  755. .clock {
  756. width: 15px;
  757. height: 15px;
  758. margin-right: 10px;
  759. }
  760. .uni-input {
  761. width: 90%;
  762. height: 34px;
  763. margin-top: 15px;
  764. margin-bottom: 15px;
  765. padding: 0 13px;
  766. /* background: #f1f1f1; */
  767. border: 1px solid #dcdfe6;
  768. border-radius: 4px;
  769. font-size: 14px;
  770. }
  771. .input-placeholder {
  772. color: #333333;
  773. font-size: 16px;
  774. }
  775. .introduce {
  776. width: 100%;
  777. margin-top: 12px;
  778. margin-bottom: 10px;
  779. align-items: flex-start;
  780. justify-content: space-around;
  781. }
  782. .introduce-title {
  783. color: #333333;
  784. font-size: 15px;
  785. line-height: 30px;
  786. font-family: Source Han Sans CN;
  787. }
  788. .introduce-content {
  789. color: #333333;
  790. font-size: 14px;
  791. line-height: 23px;
  792. font-family: Source Han Sans CN;
  793. }
  794. .activityRules {
  795. width: 100%;
  796. margin-top: 5px;
  797. margin-bottom: 10px;
  798. padding: 10px 15px;
  799. align-items: flex-start;
  800. justify-content: space-around;
  801. border-radius: 9px;
  802. background: #EBEBEB;
  803. }
  804. .activityRules-title {
  805. color: #333333;
  806. font-size: 14px;
  807. line-height: 25px;
  808. font-weight: 500;
  809. font-family: Source Han Sans CN;
  810. }
  811. .activityRules-content {
  812. color: #333333;
  813. font-size: 13px;
  814. line-height: 23px;
  815. font-family: Source Han Sans CN;
  816. }
  817. .btnSignup {
  818. width: 100%;
  819. height: 100rpx;
  820. margin-top: 30rpx;
  821. margin-bottom: 30rpx;
  822. color: white;
  823. font-weight: bold;
  824. line-height: 100rpx;
  825. border-radius: 55rpx;
  826. }
  827. .btnSignup-enable {
  828. background-color: #81cd00;
  829. }
  830. .btnSignup-disable {
  831. background-color: #c3c3c3;
  832. }
  833. .dialog-content {
  834. width: 280px;
  835. height: 110px;
  836. padding: 0 20px;
  837. background: #f1f1f1;
  838. border-radius: 9px;
  839. justify-content: center;
  840. text-align: center;
  841. font-weight: 550;
  842. color: #333333;
  843. }
  844. .dialog-content-1 {
  845. font-size: 34rpx;
  846. margin-bottom: 30rpx;
  847. }
  848. .dialog-content-2 {
  849. font-size: 28rpx;
  850. margin-bottom: 10rpx;
  851. text-align: left;
  852. }
  853. </style>