signup.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938
  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 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. } from '../../../common/define';
  68. import {
  69. token,
  70. apiCardDetailQuery,
  71. apiOnlineMcSignUpDetail,
  72. apiOnlineMcSignUp,
  73. apiCardConfigQuery,
  74. apiMatchRsDetailQuery,
  75. checkResCode,
  76. checkToken
  77. } from '../../../common/api';
  78. export default {
  79. data() {
  80. return {
  81. pageName: "signup",
  82. firstEnterKey: 'firstEnter-bm-style4',
  83. rankKey: "rank-bm-style4",
  84. queryObj: {},
  85. queryString: "",
  86. from: "", // 来源页面
  87. token: "",
  88. ecId: 0, // 卡片id
  89. mcId: 0, // 赛事id
  90. mcType: 0, // 赛事类型 1 普通活动 2 线下赛 3 线上赛
  91. mcName: "", // 赛事名称
  92. acttime: "", // 活动时间
  93. beginSecond: null, // 活动或赛事开始时间戳,单位秒
  94. endSecond: null, // 活动或赛事结束时间戳,单位秒
  95. coiId: 0, // 已报名单位id
  96. coiName: "", // 已报名单位名称,可为空
  97. teamNum: 0, // 已报名队伍编号,可为0
  98. nickName: "", // 昵称
  99. coiRs: [], // 组织信息集合
  100. // orgList: [], // 分组下拉列表数据源
  101. // teamList: [], //
  102. interval: null,
  103. mcState: 0, // 赛事/活动状态 0: 未开始 1: 进行中 2: 已结束
  104. // teamType: 0, // 队伍类型 0: 红黄蓝紫 1: 学生/家长
  105. cssTop: "",
  106. cssTopbarColor: "",
  107. cssLogo: "",
  108. introduce: {
  109. title: "",
  110. content: ""
  111. },
  112. activityRules: {
  113. title: "",
  114. content: ""
  115. },
  116. popupRuleConfig: {}, // 规则弹窗配置
  117. popupDataList: [],
  118. configParam: {
  119. labelName: "昵称",
  120. labelOrg: "组织",
  121. subTitle: ""
  122. },
  123. eSelectionProps: {
  124. text: 'coiName',
  125. value: 'coiId',
  126. // disabled: 'noallowed'
  127. },
  128. }
  129. },
  130. computed: {},
  131. onLoad(query) { // 类型非必填,可自动推导
  132. // console.log(query);
  133. this.queryObj = query;
  134. this.queryString = tools.objectToQueryString(this.queryObj);
  135. // console.log(queryString);
  136. this.from = query["from"] ?? "";
  137. this.token = query["token"] ?? token;
  138. this.ecId = query["id"] ?? 0;
  139. this.firstEnterKey += "-" + this.ecId;
  140. console.log("firstEnterKey:", this.firstEnterKey);
  141. this.rankKey += "-" + this.ecId;
  142. console.log("rankKey:", this.rankKey);
  143. tools.removeCssCode();
  144. this.getCardConfigQuery();
  145. this.getCardDetailQuery();
  146. this.matchRsDetailQuery();
  147. },
  148. // 页面初次渲染完成,此时组件已挂载完成,DOM 树($el)已可用
  149. onReady() {
  150. // this.dealFirstEnter();
  151. },
  152. onUnload() {
  153. this.clear();
  154. },
  155. methods: {
  156. dealNotice(rank) {
  157. // console.log('[dealNotice]');
  158. let that = this;
  159. uni.getStorage({
  160. key: that.rankKey,
  161. success: (res) => {
  162. console.log('[getStorage]', that.rankKey, res.data);
  163. const oldRank = res.data;
  164. if (oldRank != rank) {
  165. // that.notice = true;
  166. that.setRankValue(rank);
  167. }
  168. },
  169. fail: (e) => {
  170. console.log('[getStorage] fail', that.rankKey, e);
  171. // that.notice = false;
  172. that.setRankValue(rank);
  173. },
  174. })
  175. },
  176. setRankValue(data) {
  177. let that = this;
  178. uni.setStorage({
  179. key: that.rankKey,
  180. data: data,
  181. success: () => {
  182. console.log('[setStorage] success', that.rankKey, data);
  183. },
  184. fail: (e) => {
  185. console.log('[setStorage] fail', that.rankKey, e);
  186. },
  187. })
  188. },
  189. dealFirstEnter() {
  190. // console.log('[dealFirstEnter]');
  191. let that = this;
  192. uni.getStorage({
  193. key: that.firstEnterKey,
  194. success: (res) => {
  195. console.log('[getStorage]', that.firstEnterKey, res.data);
  196. },
  197. fail: (e) => {
  198. console.log('[getStorage] fail', that.firstEnterKey, e);
  199. that.btnInfo();
  200. that.setFirstEnterValue(true);
  201. },
  202. })
  203. },
  204. setFirstEnterValue(data) {
  205. let that = this;
  206. uni.setStorage({
  207. key: that.firstEnterKey,
  208. data: data,
  209. success: () => {
  210. console.log('[setStorage] success', that.firstEnterKey, data);
  211. },
  212. fail: (e) => {
  213. console.log('[setStorage] fail', that.firstEnterKey, e);
  214. },
  215. })
  216. },
  217. clear() {
  218. if (this.interval != null) {
  219. clearInterval(this.interval);
  220. this.interval = null;
  221. }
  222. },
  223. loadConfig(config) {
  224. // console.log("config", config);
  225. // 加载CSS样式
  226. const css = config.css;
  227. if (css != undefined && css.length > 0) {
  228. tools.loadCssCode(css);
  229. if (css.indexOf(".top{") >= 0) {
  230. this.cssTop = "top";
  231. }
  232. if (css.indexOf(".topbar-color{") >= 0) {
  233. this.cssTopbarColor = "topbar-color";
  234. }
  235. }
  236. if (this.cssTop == "") {
  237. this.cssTop = "top-default";
  238. }
  239. if (this.cssTopbarColor == "") {
  240. this.cssTopbarColor = "topbar-color-default";
  241. }
  242. console.log("[loadConfig] cssTop:", this.cssTop);
  243. console.log("[loadConfig] cssTopbarColor:", this.cssTopbarColor);
  244. // 加载队伍类型 0: 红黄蓝紫 1: 学生/家长
  245. /* if (config.teamType != undefined && config.teamType >= 0) {
  246. this.teamType = config.teamType;
  247. } */
  248. // 加载介绍内容
  249. const introduce = config.introduce;
  250. if (introduce != undefined) {
  251. if (introduce.title != undefined) {
  252. this.introduce.title = introduce.title;
  253. }
  254. if (introduce.content != undefined) {
  255. this.introduce.content = introduce.content;
  256. }
  257. }
  258. // 加载活动规则
  259. const activityRules = config.activityRules;
  260. if (activityRules != undefined) {
  261. if (activityRules.title != undefined) {
  262. this.activityRules.title = activityRules.title;
  263. }
  264. if (activityRules.content != undefined) {
  265. this.activityRules.content = activityRules.content;
  266. }
  267. }
  268. // 加载规则弹窗配置
  269. const popupRuleConfig = config.popupRuleConfig;
  270. if (popupRuleConfig != undefined) {
  271. this.popupRuleConfig = popupRuleConfig;
  272. }
  273. // console.log("[loadConfig] popupRuleConfig:", this.popupRuleConfig);
  274. // 加载弹窗数据
  275. const popupDataList = config.popupDataList;
  276. // console.log("[loadConfig] popupDataList:", popupDataList);
  277. if (popupDataList != undefined && popupDataList.length > 0) {
  278. for (var i = 0; i < popupDataList.length; i++) {
  279. // console.log("[loadConfig] popupDataList", i, popupDataList[i]);
  280. if (popupDataList[i] == 'default') {
  281. for (var j = 0; j < defaultPopUpDataList.length; j++) {
  282. this.popupDataList.push(defaultPopUpDataList[j]);
  283. }
  284. } else {
  285. this.popupDataList.push(popupDataList[i]);
  286. }
  287. }
  288. } else {
  289. this.popupDataList = defaultPopUpDataList;
  290. console.log("[loadConfig] popupDataList 加载默认列表");
  291. }
  292. // console.log("[loadConfig] popupDataList:", this.popupDataList);
  293. // 加载页面参数
  294. const param = config.param;
  295. if (param != undefined) {
  296. if (param.labelName != undefined && param.labelName.length > 0) {
  297. this.configParam.labelName = param.labelName;
  298. }
  299. if (param.labelOrg != undefined && param.labelOrg.length > 0) {
  300. this.configParam.labelOrg = param.labelOrg;
  301. }
  302. if (param.subTitle != undefined && param.subTitle.length > 0) {
  303. this.configParam.subTitle = param.subTitle;
  304. }
  305. }
  306. // console.log("[loadConfig] param:", this.configParam);
  307. },
  308. fmtMcTime(timestamp) {
  309. return tools.fmtMcTime(timestamp);
  310. },
  311. // 获取倒计时
  312. getActtime() {
  313. this.acttime = tools.getActtime(this.beginSecond, this.endSecond);
  314. },
  315. fmtMcTime2(timestamp1, timestamp2) {
  316. return tools.fmtMcTime2(timestamp1, timestamp2);
  317. },
  318. getCardConfigQuery() {
  319. uni.request({
  320. url: apiCardConfigQuery,
  321. header: {
  322. "Content-Type": "application/x-www-form-urlencoded",
  323. "token": this.token,
  324. },
  325. method: "POST",
  326. data: {
  327. ecId: this.ecId,
  328. pageName: this.pageName
  329. },
  330. success: (res) => {
  331. // console.log("getCardConfigQuery", res)
  332. const data = res.data.data;
  333. const config = data.configJson != "" ? JSON.parse(data.configJson) : "";
  334. // console.log("configJson", data.configJson);
  335. /* const config = {
  336. "css": `
  337. .top{
  338. width: 100%;
  339. height: 150px;
  340. padding-top: 36px;
  341. justify-content: space-between;
  342. background-image: url('static/backgroud/top_bg_dengshanjie.png');
  343. background-repeat: no-repeat;
  344. background-position: center;
  345. background-size: cover;
  346. }
  347. .topbar-color{
  348. color: #333333;
  349. }
  350. .timebar {
  351. margin-top: 25px !important;
  352. margin-bottom: 10px;
  353. }
  354. .btnSignup-enable {
  355. background-color: #ff870e !important;
  356. }
  357. .swiper-item-button {
  358. background-color: #ff870e !important;
  359. }
  360. .uni-swiper-dot-active {
  361. background: #ff870e !important;
  362. }
  363. `,
  364. "popupRuleConfig": {
  365. "height": "530px"
  366. },
  367. "popupDataList": [
  368. {
  369. "type": 7,
  370. "data": {
  371. "title": "活动规则",
  372. "content": "<br>① 任何人、任何时间均可体验参赛。<br><br>② 6个场地任意选,比赛时间内,不限次数参赛。<br><br>③ 1次成功打点,获取1个百味豆。<br><br>④ 1次正确答题,获取1个百味豆。"
  373. }
  374. },
  375. {
  376. "type": 7,
  377. "data": {
  378. "title": "活动奖励",
  379. "content": "<br><li>活动: 20个百味豆兑换一个鸡蛋<br><span style='font-size: 12px; color:#999999;'>(限本次活动百味豆,兑换以“蛋叔券”为准)</style><li>百味豆越多,“蛋叔”给你的鸡蛋 越多,上不封顶!<li>随时可以兑换哦~<li>能不能吃上自己挣的鸡蛋,就看你的了!<li style='color:#FF870E;'><span style='color:#FF870E;'>同时,参赛即可获取合作机构的奖励!</span><br><br>",
  380. "imageList": [{
  381. "src": "/static/common/danshu.png",
  382. "width": "183px",
  383. "height": "81px"
  384. }]
  385. }
  386. },
  387. {
  388. "type": 7,
  389. "data": {
  390. "title": "合作机构",
  391. "logo": {
  392. "src": "/static/logo/xxhpgy.png",
  393. "width": "120px",
  394. "height": "120px",
  395. "memo": "星星和蒲公英双语阅读馆"
  396. },
  397. "content": "星星和蒲公英双语阅读馆,济南儿童阅读网红圣地!馆藏2W+册正版图书,涵盖中英文大奖绘本、桥梁书、自然科学与文学社科名著,以及艺术画册和摄影图集。开展面向4-12岁孩子的中文阅读读书会&中英双语阅读课。<br><br><span style='color:#FF870E;'>礼品一:到店阅读权限一年<br>礼品二:店内饮品五折券一张</span>",
  398. "pointList": [
  399. {
  400. "name": "电话:<a href='tel:18765812082' style='color: #333333;'>18765812082</a>",
  401. "longitude": 117.075174,
  402. "latitude": 36.654108
  403. }
  404. ]
  405. }
  406. },
  407. {
  408. "type": 7,
  409. "data": {
  410. "title": "合作机构",
  411. "logo": {
  412. "src": "/static/logo/wensiyu.png",
  413. "width": "120px",
  414. "height": "120px",
  415. "memo": "文思语少年读书会"
  416. },
  417. "content": "文思语少年读书会,专注于为4-15岁儿童和家庭提供阅读素养发展解决方案和产品。读书会以整本书精读伴读为核心,塑造良好的读书习惯,训练阅读理解能力,培养创意作文能力。<br><br><span style='color:#FF870E;'>礼品:《山海经》精装套系书<br>书籍原价158元,仅需19.9元/套,不限领取次数,多余权限可赠送他人使用!</span>",
  418. "pointList": [
  419. {
  420. "name": "电话:<a href='tel:17663733631' style='color: #333333;'>17663733631</a>",
  421. "longitude": 117.075174,
  422. "latitude": 36.654108
  423. }
  424. ]
  425. }
  426. },
  427. {
  428. "type": 7,
  429. "data": {
  430. "title": "合作机构",
  431. "logo": {
  432. "src": "/static/logo/lezhigu.png",
  433. "width": "120px",
  434. "height": "120px",
  435. "memo": "乐知谷"
  436. },
  437. "content": "乐知谷是济南科学类口碑最好的机构,主做面向4-12岁儿童,内容涵盖工程科技、自然科学、生命科学、地球太空、PBL综合项目等五大板块,室内&户外相结合,真正将实验、动手、探究融于生活,培养独立思考、永存好奇、敢于创造的未来型孩子。<br><span style='color:#FF870E;'>礼品:乐知谷经典工程体验课《建造一座斜拉桥》一堂,感受力学结构的科技含量课程每人限参与1次,多余权限可赠送他人使用</span>",
  438. "pointList": [
  439. {
  440. "name": "电话:<a href='tel:19100652564' style='color: #333333;'>19100652564</a>",
  441. "longitude": 117.075174,
  442. "latitude": 36.654108
  443. }
  444. ]
  445. }
  446. },
  447. {
  448. "type": 7,
  449. "data": {
  450. "title": "合作机构",
  451. "logo": {
  452. "src": "/static/logo/kusentiyu.png",
  453. "width": "120px",
  454. "height": "120px",
  455. "memo": "酷森体育俱乐部"
  456. },
  457. "content": "酷森体育俱乐部包含少儿篮球、体能训练、跳绳,三大课程。拥有二十年以上资深学院派专家教练团队,制定系统的少儿运动训练体系,结合不同年龄及能力的孩子进行定制化教学,使其更符合不同孩子的综合能力提升。<br><br><span style='color:#FF870E;'>礼品:手机全年影视会员卡</span>",
  458. "pointList": [
  459. {
  460. "name": "电话:<a href='tel:15621875115' style='color: #333333;'>15621875115</a>",
  461. "longitude": 117.075174,
  462. "latitude": 36.654108
  463. }
  464. ]
  465. }
  466. }
  467. ],
  468. "introduce": {
  469. "title": "介绍:",
  470. "content": "<li>小飞龙定向赛再次来袭!这次有6个场地哟~<li>神秘“蛋叔”闪亮登场~<li>蛋叔放大招,百味豆换鸡蛋!<li>时不可待!冲鸭!<br><br><li>能不能把蛋叔整郁闷,就看你的啦~<li>还等啥?火速报名吧!"
  471. },
  472. "param": {
  473. "labelName": "姓名",
  474. "labelOrg": "分组",
  475. "subTitle": ""
  476. }
  477. }; */
  478. this.loadConfig(config);
  479. setTimeout(this.dealFirstEnter, 500);
  480. },
  481. fail: (err) => {
  482. console.log("getCardConfigQuery err", err)
  483. },
  484. });
  485. },
  486. // 卡片信息查询
  487. getCardDetailQuery() {
  488. uni.request({
  489. url: apiCardDetailQuery,
  490. header: {
  491. "Content-Type": "application/x-www-form-urlencoded",
  492. "token": this.token
  493. },
  494. method: "POST",
  495. data: {
  496. ecId: this.ecId
  497. },
  498. success: (res) => {
  499. // console.log("getCardDetailQuery", res);
  500. const data = res.data.data;
  501. this.mcType = data.mcType;
  502. this.mcId = data.mcId;
  503. this.mcName = data.mcName;
  504. this.beginSecond = data.beginSecond;
  505. this.endSecond = data.endSecond;
  506. this.coiId = data.coiId;
  507. this.coiName = data.coiName;
  508. this.teamNum = data.teamNum;
  509. this.nickName = data.nickName;
  510. this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
  511. this.getActtime();
  512. this.getOnlineMcSignUpDetail();
  513. this.clear();
  514. this.interval = setInterval(this.getActtime, 60000);
  515. },
  516. fail: (err) => {
  517. console.log("getCardDetailQuery err", err)
  518. },
  519. });
  520. },
  521. // 卡片对应线上赛多个活动查询
  522. matchRsDetailQuery() {
  523. uni.request({
  524. url: apiMatchRsDetailQuery,
  525. header: {
  526. "Content-Type": "application/x-www-form-urlencoded",
  527. "token": this.token,
  528. },
  529. method: "POST",
  530. data: {
  531. ecId: this.ecId
  532. },
  533. success: (res) => {
  534. // console.log("matchRsDetailQuery", res);
  535. if (res.data.code == 0) {
  536. const data = res.data.data;
  537. const rank = JSON.stringify(data);
  538. this.dealNotice(rank);
  539. }
  540. },
  541. fail: (err) => {
  542. console.log("matchRsDetailQuery err", err)
  543. },
  544. });
  545. },
  546. // 卡片用户当前排名查询
  547. // getUserCurrentRankNumQuery() {
  548. // uni.request({
  549. // url: apiUserCurrentRankNumQuery,
  550. // header: {
  551. // "Content-Type": "application/x-www-form-urlencoded",
  552. // "token": this.token,
  553. // },
  554. // method: "POST",
  555. // data: {
  556. // ecId: this.ecId
  557. // },
  558. // success: (res) => {
  559. // // console.log("getUserCurrentRankNumQuery", res)
  560. // if (res.data.code == 0) {
  561. // const data = res.data.data;
  562. // const rankNum = data.rankNum;
  563. // this.dealNotice(rankNum);
  564. // }
  565. // },
  566. // fail: (err) => {
  567. // console.log("getUserCurrentRankNumQuery err", err)
  568. // },
  569. // });
  570. // },
  571. // 线上赛报名页面信息详情
  572. getOnlineMcSignUpDetail() {
  573. uni.request({
  574. url: apiOnlineMcSignUpDetail,
  575. header: {
  576. "Content-Type": "application/x-www-form-urlencoded",
  577. "token": this.token,
  578. },
  579. method: "POST",
  580. data: {
  581. mcId: this.mcId,
  582. },
  583. success: (res) => {
  584. // console.log("getOnlineMcSignUpDetail", res);
  585. this.coiRs = res.data.data.coiRs;
  586. if (this.nickName == undefined || this.nickName == '') {
  587. this.nickName = res.data.data.name;
  588. }
  589. /* const rsNum = this.coiRs.length;
  590. this.orgList = [];
  591. for (let i = 0; i < rsNum; i++) {
  592. this.orgList[i] = {};
  593. this.orgList[i].value = this.coiRs[i].coiId;
  594. this.orgList[i].text = this.coiRs[i].coiName;
  595. this.orgList[i].teamNum = this.coiRs[i].teamNum;
  596. }
  597. // console.log("orgList", this.orgList);
  598. if (this.coiId > 0) {
  599. this.orgChange(this.coiId, false);
  600. } */
  601. },
  602. fail: (err) => {
  603. console.log("getOnlineMcSignUpDetail err", err)
  604. },
  605. });
  606. },
  607. // 线上赛报名
  608. onlineMcSignUp() {
  609. uni.request({
  610. url: apiOnlineMcSignUp,
  611. header: {
  612. "Content-Type": "application/x-www-form-urlencoded",
  613. "token": this.token,
  614. },
  615. method: "POST",
  616. data: {
  617. mcId: this.mcId,
  618. coiId: this.coiId,
  619. selectTeam: this.teamNum,
  620. nickName: this.nickName
  621. },
  622. success: (res) => {
  623. // console.log("onlineMcSignUp", res);
  624. if (checkResCode(res)) {
  625. uni.showToast({
  626. title: '比赛报名成功!',
  627. icon: 'none',
  628. duration: 3000
  629. });
  630. // uni.navigateTo({
  631. // // url: '/pages/bm/style4/rankOverview?' + this.queryString
  632. // url: '/pages/bm/style4/rankList?' + this.queryString
  633. // });
  634. const url = '/pages/bm/style4/rankList?' + this.queryString;
  635. tools.appAction(url, "uni.navigateTo");
  636. }
  637. },
  638. fail: (err) => {
  639. console.log("onlineMcSignUp err", err);
  640. uni.showToast({
  641. title: '出错了,报名失败',
  642. icon: 'none',
  643. duration: 3000
  644. });
  645. },
  646. });
  647. },
  648. btnBack() {
  649. // console.log("from:", this.from)
  650. if (this.from != '') {
  651. // window.history.back();
  652. // uni.navigateTo({
  653. // url: '/pages/bm/style4/' + this.from + '?' + this.queryString
  654. // });
  655. const url = '/pages/bm/style4/' + this.from + '?' + this.queryString;
  656. tools.appAction(url, "uni.navigateTo");
  657. } else {
  658. const url = `action://to_home/`;
  659. tools.appAction(url);
  660. }
  661. },
  662. btnInfo() {
  663. this.$refs.mypopup.popupOpen();
  664. },
  665. btnSignup() {
  666. if (!checkToken(this.token)) {
  667. return;
  668. }
  669. if (!(this.nickName.trim().length > 0)) {
  670. uni.showToast({
  671. title: `请填写${this.configParam.labelName}`,
  672. icon: 'none',
  673. duration: 2000
  674. });
  675. return;
  676. }
  677. if (!(this.coiId > 0)) {
  678. uni.showToast({
  679. title: `请选择${this.configParam.labelOrg}`,
  680. icon: 'none',
  681. duration: 2000
  682. });
  683. return;
  684. }
  685. this.nickName = this.nickName.trim();
  686. // this.coiName = tools.getSelectedText(this.orgList, this.coiId);
  687. // this.teamName = tools.getSelectedText(this.teamList, this.teamNum);
  688. this.$refs.alertDialog.open();
  689. },
  690. dialogConfirm() {
  691. this.onlineMcSignUp();
  692. },
  693. dialogClose() {},
  694. // 获取输入框中值
  695. getESelectText(data) {
  696. // console.log("getESelectText:", data);
  697. this.coiName = data;
  698. },
  699. // 获取选择选项值
  700. eSelectChange(data) {
  701. // console.log("eSelectChange:", data);
  702. },
  703. }
  704. }
  705. </script>
  706. <style scoped>
  707. .content {
  708. width: 100vw;
  709. min-height: 100vh;
  710. }
  711. .top-default {
  712. width: 100%;
  713. height: 220px;
  714. padding-top: 36px;
  715. justify-content: space-between;
  716. background-image: url('static/backgroud/top_bg_sddx.png');
  717. background-repeat: no-repeat;
  718. background-position: center;
  719. background-size: cover;
  720. }
  721. .topbar-color-default {
  722. color: #333333;
  723. }
  724. .topcontent {
  725. height: 90%;
  726. margin-bottom: 30px;
  727. }
  728. .logo {
  729. width: 80px;
  730. height: 80px;
  731. margin-top: 10px;
  732. /* background-image: url('/static/logo/sddx.png'); */
  733. background-repeat: no-repeat;
  734. background-position-x: center;
  735. background-position-y: center;
  736. background-size: contain;
  737. }
  738. .top-acttime {
  739. display: none;
  740. text-shadow: 3px 3px 0px #640008;
  741. font-family: YouSheBiaoTiHei;
  742. /* font-family: Arial, Helvetica, sans-serif; */
  743. font-weight: bold;
  744. color: #ffee0b;
  745. font-size: 26px;
  746. }
  747. .mcName {
  748. font-size: 40rpx;
  749. font-weight: 550;
  750. }
  751. .main {
  752. width: 76%;
  753. /* min-height: 800rpx; */
  754. /* margin-top: 20rpx; */
  755. /* justify-content: space-around; */
  756. flex-grow: 1;
  757. }
  758. .timebar {
  759. min-width: 68%;
  760. height: 32px;
  761. margin-top: -17px;
  762. padding: 0 15px;
  763. justify-content: center;
  764. background: #ffffff;
  765. border: 0.5px solid;
  766. border-color: #e7e7e7;
  767. border-radius: 20px;
  768. box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.13);
  769. }
  770. .acttime {
  771. font-weight: 550;
  772. color: #333333;
  773. font-size: 14px;
  774. text-wrap: nowrap;
  775. }
  776. .clock {
  777. width: 15px;
  778. height: 15px;
  779. margin-right: 10px;
  780. }
  781. .uni-input {
  782. width: 90%;
  783. height: 34px;
  784. margin-top: 15px;
  785. margin-bottom: 15px;
  786. padding: 0 13px;
  787. /* background: #f1f1f1; */
  788. border: 1px solid #dcdfe6;
  789. border-radius: 4px;
  790. font-size: 14px;
  791. }
  792. .input-placeholder {
  793. color: #333333;
  794. font-size: 16px;
  795. }
  796. .introduce {
  797. width: 100%;
  798. margin-top: 12px;
  799. margin-bottom: 10px;
  800. align-items: flex-start;
  801. justify-content: space-around;
  802. }
  803. .introduce-title {
  804. color: #333333;
  805. font-size: 15px;
  806. line-height: 30px;
  807. font-family: Source Han Sans CN;
  808. }
  809. .introduce-content {
  810. color: #333333;
  811. font-size: 14px;
  812. line-height: 23px;
  813. font-family: Source Han Sans CN;
  814. }
  815. .activityRules {
  816. width: 100%;
  817. margin-top: 5px;
  818. margin-bottom: 10px;
  819. padding: 10px 15px;
  820. align-items: flex-start;
  821. justify-content: space-around;
  822. border-radius: 9px;
  823. background: #EBEBEB;
  824. }
  825. .activityRules-title {
  826. color: #333333;
  827. font-size: 14px;
  828. line-height: 25px;
  829. font-weight: 500;
  830. font-family: Source Han Sans CN;
  831. }
  832. .activityRules-content {
  833. color: #333333;
  834. font-size: 13px;
  835. line-height: 23px;
  836. font-family: Source Han Sans CN;
  837. }
  838. .btnSignup {
  839. width: 100%;
  840. height: 100rpx;
  841. margin-top: 30rpx;
  842. margin-bottom: 30rpx;
  843. color: white;
  844. font-weight: bold;
  845. line-height: 100rpx;
  846. border-radius: 55rpx;
  847. }
  848. .btnSignup-enable {
  849. background-color: #81cd00;
  850. }
  851. .btnSignup-disable {
  852. background-color: #c3c3c3;
  853. }
  854. .dialog-content {
  855. width: 280px;
  856. height: 110px;
  857. padding: 0 20px;
  858. background: #f1f1f1;
  859. border-radius: 9px;
  860. justify-content: center;
  861. text-align: center;
  862. font-weight: 550;
  863. color: #333333;
  864. }
  865. .dialog-content-1 {
  866. font-size: 34rpx;
  867. margin-bottom: 30rpx;
  868. }
  869. .dialog-content-2 {
  870. font-size: 28rpx;
  871. margin-bottom: 10rpx;
  872. text-align: left;
  873. }
  874. </style>