signup.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915
  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" />
  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. btnSignup() {
  642. if (!checkToken(this.token)) {
  643. return;
  644. }
  645. if (!(this.nickName.trim().length > 0)) {
  646. uni.showToast({
  647. title: `请填写${this.configParam.labelName}`,
  648. icon: 'none',
  649. duration: 2000
  650. });
  651. return;
  652. }
  653. if (!(this.coiId > 0)) {
  654. uni.showToast({
  655. title: `请选择${this.configParam.labelOrg}`,
  656. icon: 'none',
  657. duration: 2000
  658. });
  659. return;
  660. }
  661. this.nickName = this.nickName.trim();
  662. // this.coiName = tools.getSelectedText(this.orgList, this.coiId);
  663. // this.teamName = tools.getSelectedText(this.teamList, this.teamNum);
  664. this.$refs.alertDialog.open();
  665. },
  666. dialogConfirm() {
  667. this.onlineMcSignUp();
  668. },
  669. dialogClose() {},
  670. // 获取输入框中值
  671. getESelectText(data) {
  672. // console.log("getESelectText:", data);
  673. this.coiName = data;
  674. },
  675. // 获取选择选项值
  676. eSelectChange(data) {
  677. // console.log("eSelectChange:", data);
  678. },
  679. }
  680. }
  681. </script>
  682. <style scoped>
  683. .content {
  684. width: 100vw;
  685. min-height: 100vh;
  686. }
  687. .top-default {
  688. width: 100%;
  689. height: 220px;
  690. padding-top: 36px;
  691. justify-content: space-between;
  692. background-image: url('static/backgroud/top_bg_sddx.png');
  693. background-repeat: no-repeat;
  694. background-position: center;
  695. background-size: cover;
  696. }
  697. .topbar-color-default {
  698. color: #333333;
  699. }
  700. .topcontent {
  701. height: 90%;
  702. margin-bottom: 30px;
  703. }
  704. .logo {
  705. width: 80px;
  706. height: 80px;
  707. margin-top: 10px;
  708. /* background-image: url('/static/logo/sddx.png'); */
  709. background-repeat: no-repeat;
  710. background-position-x: center;
  711. background-position-y: center;
  712. background-size: contain;
  713. }
  714. .top-acttime {
  715. display: none;
  716. text-shadow: 3px 3px 0px #640008;
  717. font-family: YouSheBiaoTiHei;
  718. /* font-family: Arial, Helvetica, sans-serif; */
  719. font-weight: bold;
  720. color: #ffee0b;
  721. font-size: 26px;
  722. }
  723. .mcName {
  724. font-size: 40rpx;
  725. font-weight: 550;
  726. }
  727. .main {
  728. width: 76%;
  729. /* min-height: 800rpx; */
  730. /* margin-top: 20rpx; */
  731. /* justify-content: space-around; */
  732. flex-grow: 1;
  733. }
  734. .timebar {
  735. min-width: 68%;
  736. height: 32px;
  737. margin-top: -17px;
  738. padding: 0 15px;
  739. justify-content: center;
  740. background: #ffffff;
  741. border: 0.5px solid;
  742. border-color: #e7e7e7;
  743. border-radius: 20px;
  744. box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.13);
  745. }
  746. .acttime {
  747. font-weight: 550;
  748. color: #333333;
  749. font-size: 14px;
  750. text-wrap: nowrap;
  751. }
  752. .clock {
  753. width: 15px;
  754. height: 15px;
  755. margin-right: 10px;
  756. }
  757. .uni-input {
  758. width: 90%;
  759. height: 34px;
  760. margin-top: 15px;
  761. margin-bottom: 15px;
  762. padding: 0 13px;
  763. /* background: #f1f1f1; */
  764. border: 1px solid #dcdfe6;
  765. border-radius: 4px;
  766. font-size: 14px;
  767. }
  768. .input-placeholder {
  769. color: #333333;
  770. font-size: 16px;
  771. }
  772. .introduce {
  773. width: 100%;
  774. margin-top: 12px;
  775. margin-bottom: 10px;
  776. align-items: flex-start;
  777. justify-content: space-around;
  778. }
  779. .introduce-title {
  780. color: #333333;
  781. font-size: 15px;
  782. line-height: 30px;
  783. font-family: Source Han Sans CN;
  784. }
  785. .introduce-content {
  786. color: #333333;
  787. font-size: 14px;
  788. line-height: 23px;
  789. font-family: Source Han Sans CN;
  790. }
  791. .activityRules {
  792. width: 100%;
  793. margin-top: 5px;
  794. margin-bottom: 10px;
  795. padding: 10px 15px;
  796. align-items: flex-start;
  797. justify-content: space-around;
  798. border-radius: 9px;
  799. background: #EBEBEB;
  800. }
  801. .activityRules-title {
  802. color: #333333;
  803. font-size: 14px;
  804. line-height: 25px;
  805. font-weight: 500;
  806. font-family: Source Han Sans CN;
  807. }
  808. .activityRules-content {
  809. color: #333333;
  810. font-size: 13px;
  811. line-height: 23px;
  812. font-family: Source Han Sans CN;
  813. }
  814. .btnSignup {
  815. width: 100%;
  816. height: 100rpx;
  817. margin-top: 30rpx;
  818. margin-bottom: 30rpx;
  819. color: white;
  820. font-weight: bold;
  821. line-height: 100rpx;
  822. border-radius: 55rpx;
  823. }
  824. .btnSignup-enable {
  825. background-color: #81cd00;
  826. }
  827. .btnSignup-disable {
  828. background-color: #c3c3c3;
  829. }
  830. .dialog-content {
  831. width: 280px;
  832. height: 110px;
  833. padding: 0 20px;
  834. background: #f1f1f1;
  835. border-radius: 9px;
  836. justify-content: center;
  837. text-align: center;
  838. font-weight: 550;
  839. color: #333333;
  840. }
  841. .dialog-content-1 {
  842. font-size: 34rpx;
  843. margin-bottom: 30rpx;
  844. }
  845. .dialog-content-2 {
  846. font-size: 28rpx;
  847. margin-bottom: 10rpx;
  848. text-align: left;
  849. }
  850. </style>