signup.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950
  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: 150px;
  347. padding-top: 36px;
  348. justify-content: space-between;
  349. background-image: url('static/backgroud/top_bg_dengshanjie.png');
  350. background-repeat: no-repeat;
  351. background-position: center;
  352. background-size: cover;
  353. }
  354. .topbar-color{
  355. color: #333333;
  356. }
  357. .timebar {
  358. margin-top: 25px !important;
  359. margin-bottom: 10px;
  360. }
  361. .btnSignup-enable {
  362. background-color: #ff870e !important;
  363. }
  364. .swiper-item-button {
  365. background-color: #ff870e !important;
  366. }
  367. .uni-swiper-dot-active {
  368. background: #ff870e !important;
  369. }
  370. `,
  371. "popupRuleConfig": {
  372. "height": "530px"
  373. },
  374. "popupDataList": [
  375. {
  376. "type": 7,
  377. "data": {
  378. "title": "活动规则",
  379. "content": "<br>① 任何人、任何时间均可体验参赛。<br><br>② 6个场地任意选,比赛时间内,不限次数参赛。<br><br>③ 1次成功打点,获取1个百味豆。<br><br>④ 1次正确答题,获取1个百味豆。"
  380. }
  381. },
  382. {
  383. "type": 7,
  384. "data": {
  385. "title": "活动奖励",
  386. "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>",
  387. "imageList": [{
  388. "src": "/static/common/danshu.png",
  389. "width": "183px",
  390. "height": "81px"
  391. }]
  392. }
  393. },
  394. {
  395. "type": 7,
  396. "data": {
  397. "title": "合作机构",
  398. "logo": {
  399. "src": "/static/logo/xxhpgy.png",
  400. "width": "120px",
  401. "height": "120px",
  402. "memo": "星星和蒲公英双语阅读馆"
  403. },
  404. "content": "星星和蒲公英双语阅读馆,济南儿童阅读网红圣地!馆藏2W+册正版图书,涵盖中英文大奖绘本、桥梁书、自然科学与文学社科名著,以及艺术画册和摄影图集。开展面向4-12岁孩子的中文阅读读书会&中英双语阅读课。<br><br><span style='color:#FF870E;'>礼品一:到店阅读权限一年<br>礼品二:店内饮品五折券一张</span>",
  405. "pointList": [
  406. {
  407. "name": "星星和蒲公英双语阅读馆",
  408. "tel": "电话:<a href='tel:18765812082' style='color: #333333;'>18765812082</a>",
  409. "longitude": 117.075174,
  410. "latitude": 36.654108
  411. }
  412. ]
  413. }
  414. },
  415. {
  416. "type": 7,
  417. "data": {
  418. "title": "合作机构",
  419. "logo": {
  420. "src": "/static/logo/wensiyu.png",
  421. "width": "120px",
  422. "height": "120px",
  423. "memo": "文思语少年读书会"
  424. },
  425. "content": "文思语少年读书会,专注于为4-15岁儿童和家庭提供阅读素养发展解决方案和产品。读书会以整本书精读伴读为核心,塑造良好的读书习惯,训练阅读理解能力,培养创意作文能力。<br><br><span style='color:#FF870E;'>礼品:《山海经》精装套系书<br>书籍原价158元,仅需19.9元/套,不限领取次数,多余权限可赠送他人使用!</span>",
  426. "pointList": [
  427. {
  428. "name": "文思语少年读书会",
  429. "tel": "电话:<a href='tel:17663733631' style='color: #333333;'>17663733631</a>",
  430. "longitude": 117.075174,
  431. "latitude": 36.654108
  432. }
  433. ]
  434. }
  435. },
  436. {
  437. "type": 7,
  438. "data": {
  439. "title": "合作机构",
  440. "logo": {
  441. "src": "/static/logo/lezhigu.png",
  442. "width": "120px",
  443. "height": "120px",
  444. "memo": "乐知谷"
  445. },
  446. "content": "乐知谷是济南科学类口碑最好的机构,主做面向4-12岁儿童,内容涵盖工程科技、自然科学、生命科学、地球太空、PBL综合项目等五大板块,室内&户外相结合,真正将实验、动手、探究融于生活,培养独立思考、永存好奇、敢于创造的未来型孩子。<br><span style='color:#FF870E;'>礼品:乐知谷经典工程体验课《建造一座斜拉桥》一堂,感受力学结构的科技含量课程每人限参与1次,多余权限可赠送他人使用</span>",
  447. "pointList": [
  448. {
  449. "name": "乐知谷",
  450. "tel": "电话:<a href='tel:19100652564' style='color: #333333;'>19100652564</a>",
  451. "longitude": 117.075174,
  452. "latitude": 36.654108
  453. }
  454. ]
  455. }
  456. },
  457. {
  458. "type": 7,
  459. "data": {
  460. "title": "合作机构",
  461. "logo": {
  462. "src": "/static/logo/kusentiyu.png",
  463. "width": "120px",
  464. "height": "120px",
  465. "memo": "酷森体育俱乐部"
  466. },
  467. "content": "酷森体育俱乐部包含少儿篮球、体能训练、跳绳,三大课程。拥有二十年以上资深学院派专家教练团队,制定系统的少儿运动训练体系,结合不同年龄及能力的孩子进行定制化教学,使其更符合不同孩子的综合能力提升。<br><br><span style='color:#FF870E;'>礼品:手机全年影视会员卡</span>",
  468. "pointList": [
  469. {
  470. "name": "酷森体育俱乐部",
  471. "tel": "电话:<a href='tel:15621875115' style='color: #333333;'>15621875115</a>",
  472. "longitude": 117.075174,
  473. "latitude": 36.654108
  474. }
  475. ]
  476. }
  477. }
  478. ],
  479. "introduce": {
  480. "title": "介绍:",
  481. "content": "<li>小飞龙定向赛再次来袭!这次有6个场地哟~<li>神秘“蛋叔”闪亮登场~<li>蛋叔放大招,百味豆换鸡蛋!<li>时不可待!冲鸭!<br><br><li>能不能把蛋叔整郁闷,就看你的啦~<li>还等啥?火速报名吧!"
  482. },
  483. "param": {
  484. "labelName": "姓名",
  485. "labelOrg": "分组",
  486. "subTitle": ""
  487. }
  488. }; */
  489. this.loadConfig(config);
  490. setTimeout(this.dealFirstEnter, 500);
  491. },
  492. fail: (err) => {
  493. console.log("getCardConfigQuery err", err)
  494. },
  495. });
  496. },
  497. // 卡片信息查询
  498. getCardDetailQuery() {
  499. uni.request({
  500. url: apiCardDetailQuery,
  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("getCardDetailQuery", res);
  511. const data = res.data.data;
  512. this.mcType = data.mcType;
  513. this.mcId = data.mcId;
  514. this.mcName = data.mcName;
  515. this.beginSecond = data.beginSecond;
  516. this.endSecond = data.endSecond;
  517. this.coiId = data.coiId;
  518. this.coiName = data.coiName;
  519. this.teamNum = data.teamNum;
  520. this.nickName = data.nickName;
  521. this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
  522. this.getActtime();
  523. this.getOnlineMcSignUpDetail();
  524. this.clear();
  525. this.interval = setInterval(this.getActtime, 60000);
  526. },
  527. fail: (err) => {
  528. console.log("getCardDetailQuery err", err)
  529. },
  530. });
  531. },
  532. // 卡片对应线上赛多个活动查询
  533. matchRsDetailQuery() {
  534. uni.request({
  535. url: apiMatchRsDetailQuery,
  536. header: {
  537. "Content-Type": "application/x-www-form-urlencoded",
  538. "token": this.token,
  539. },
  540. method: "POST",
  541. data: {
  542. ecId: this.ecId
  543. },
  544. success: (res) => {
  545. // console.log("matchRsDetailQuery", res);
  546. if (res.data.code == 0) {
  547. const data = res.data.data;
  548. const rank = JSON.stringify(data);
  549. this.dealNotice(rank);
  550. }
  551. },
  552. fail: (err) => {
  553. console.log("matchRsDetailQuery err", err)
  554. },
  555. });
  556. },
  557. // 卡片用户当前排名查询
  558. // getUserCurrentRankNumQuery() {
  559. // uni.request({
  560. // url: apiUserCurrentRankNumQuery,
  561. // header: {
  562. // "Content-Type": "application/x-www-form-urlencoded",
  563. // "token": this.token,
  564. // },
  565. // method: "POST",
  566. // data: {
  567. // ecId: this.ecId
  568. // },
  569. // success: (res) => {
  570. // // console.log("getUserCurrentRankNumQuery", res)
  571. // if (res.data.code == 0) {
  572. // const data = res.data.data;
  573. // const rankNum = data.rankNum;
  574. // this.dealNotice(rankNum);
  575. // }
  576. // },
  577. // fail: (err) => {
  578. // console.log("getUserCurrentRankNumQuery err", err)
  579. // },
  580. // });
  581. // },
  582. // 线上赛报名页面信息详情
  583. getOnlineMcSignUpDetail() {
  584. uni.request({
  585. url: apiOnlineMcSignUpDetail,
  586. header: {
  587. "Content-Type": "application/x-www-form-urlencoded",
  588. "token": this.token,
  589. },
  590. method: "POST",
  591. data: {
  592. mcId: this.mcId,
  593. },
  594. success: (res) => {
  595. // console.log("getOnlineMcSignUpDetail", res);
  596. this.coiRs = res.data.data.coiRs;
  597. if (this.nickName == undefined || this.nickName == '') {
  598. this.nickName = res.data.data.name;
  599. }
  600. /* const rsNum = this.coiRs.length;
  601. this.orgList = [];
  602. for (let i = 0; i < rsNum; i++) {
  603. this.orgList[i] = {};
  604. this.orgList[i].value = this.coiRs[i].coiId;
  605. this.orgList[i].text = this.coiRs[i].coiName;
  606. this.orgList[i].teamNum = this.coiRs[i].teamNum;
  607. }
  608. // console.log("orgList", this.orgList);
  609. if (this.coiId > 0) {
  610. this.orgChange(this.coiId, false);
  611. } */
  612. },
  613. fail: (err) => {
  614. console.log("getOnlineMcSignUpDetail err", err)
  615. },
  616. });
  617. },
  618. // 线上赛报名
  619. onlineMcSignUp() {
  620. uni.request({
  621. url: apiOnlineMcSignUp,
  622. header: {
  623. "Content-Type": "application/x-www-form-urlencoded",
  624. "token": this.token,
  625. },
  626. method: "POST",
  627. data: {
  628. mcId: this.mcId,
  629. coiId: this.coiId,
  630. selectTeam: this.teamNum,
  631. nickName: this.nickName
  632. },
  633. success: (res) => {
  634. // console.log("onlineMcSignUp", res);
  635. if (checkResCode(res)) {
  636. uni.showToast({
  637. title: '比赛报名成功!',
  638. icon: 'none',
  639. duration: 3000
  640. });
  641. // uni.navigateTo({
  642. // // url: '/pages/bm/style4/rankOverview?' + this.queryString
  643. // url: '/pages/bm/style4/rankList?' + this.queryString
  644. // });
  645. const url = '/pages/bm/style4/rankList?' + this.queryString;
  646. tools.appAction(url, "uni.navigateTo");
  647. }
  648. },
  649. fail: (err) => {
  650. console.log("onlineMcSignUp err", err);
  651. uni.showToast({
  652. title: '出错了,报名失败',
  653. icon: 'none',
  654. duration: 3000
  655. });
  656. },
  657. });
  658. },
  659. btnBack() {
  660. // console.log("from:", this.from)
  661. if (this.from != '') {
  662. // window.history.back();
  663. // uni.navigateTo({
  664. // url: '/pages/bm/style4/' + this.from + '?' + this.queryString
  665. // });
  666. const url = '/pages/bm/style4/' + this.from + '?' + this.queryString;
  667. tools.appAction(url, "uni.navigateTo");
  668. } else {
  669. const url = `action://to_home/`;
  670. tools.appAction(url);
  671. }
  672. },
  673. btnInfo() {
  674. this.$refs.mypopup.popupOpen();
  675. },
  676. btnSignup() {
  677. if (!checkToken(this.token)) {
  678. return;
  679. }
  680. if (!(this.nickName.trim().length > 0)) {
  681. uni.showToast({
  682. title: `请填写${this.configParam.labelName}`,
  683. icon: 'none',
  684. duration: 2000
  685. });
  686. return;
  687. }
  688. if (!(this.coiId > 0)) {
  689. uni.showToast({
  690. title: `请选择${this.configParam.labelOrg}`,
  691. icon: 'none',
  692. duration: 2000
  693. });
  694. return;
  695. }
  696. this.nickName = this.nickName.trim();
  697. // this.coiName = tools.getSelectedText(this.orgList, this.coiId);
  698. // this.teamName = tools.getSelectedText(this.teamList, this.teamNum);
  699. this.$refs.alertDialog.open();
  700. },
  701. dialogConfirm() {
  702. this.onlineMcSignUp();
  703. },
  704. dialogClose() {},
  705. // 获取输入框中值
  706. getESelectText(data) {
  707. // console.log("getESelectText:", data);
  708. this.coiName = data;
  709. },
  710. // 获取选择选项值
  711. eSelectChange(data) {
  712. // console.log("eSelectChange:", data);
  713. },
  714. }
  715. }
  716. </script>
  717. <style scoped>
  718. .content {
  719. width: 100vw;
  720. min-height: 100vh;
  721. }
  722. .top-default {
  723. width: 100%;
  724. height: 220px;
  725. padding-top: 36px;
  726. justify-content: space-between;
  727. background-image: url('static/backgroud/top_bg_sddx.png');
  728. background-repeat: no-repeat;
  729. background-position: center;
  730. background-size: cover;
  731. }
  732. .topbar-color-default {
  733. color: #333333;
  734. }
  735. .topcontent {
  736. height: 90%;
  737. margin-bottom: 30px;
  738. }
  739. .logo {
  740. width: 80px;
  741. height: 80px;
  742. margin-top: 10px;
  743. /* background-image: url('/static/logo/sddx.png'); */
  744. background-repeat: no-repeat;
  745. background-position-x: center;
  746. background-position-y: center;
  747. background-size: contain;
  748. }
  749. .top-acttime {
  750. display: none;
  751. text-shadow: 3px 3px 0px #640008;
  752. font-family: YouSheBiaoTiHei;
  753. /* font-family: Arial, Helvetica, sans-serif; */
  754. font-weight: bold;
  755. color: #ffee0b;
  756. font-size: 26px;
  757. }
  758. .mcName {
  759. font-size: 40rpx;
  760. font-weight: 550;
  761. }
  762. .main {
  763. width: 76%;
  764. /* min-height: 800rpx; */
  765. /* margin-top: 20rpx; */
  766. /* justify-content: space-around; */
  767. flex-grow: 1;
  768. }
  769. .timebar {
  770. min-width: 68%;
  771. height: 32px;
  772. margin-top: -17px;
  773. padding: 0 15px;
  774. justify-content: center;
  775. background: #ffffff;
  776. border: 0.5px solid;
  777. border-color: #e7e7e7;
  778. border-radius: 20px;
  779. box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.13);
  780. }
  781. .acttime {
  782. font-weight: 550;
  783. color: #333333;
  784. font-size: 14px;
  785. text-wrap: nowrap;
  786. }
  787. .clock {
  788. width: 15px;
  789. height: 15px;
  790. margin-right: 10px;
  791. }
  792. .uni-input {
  793. width: 90%;
  794. height: 34px;
  795. margin-top: 15px;
  796. margin-bottom: 15px;
  797. padding: 0 13px;
  798. /* background: #f1f1f1; */
  799. border: 1px solid #dcdfe6;
  800. border-radius: 4px;
  801. font-size: 14px;
  802. }
  803. .input-placeholder {
  804. color: #333333;
  805. font-size: 16px;
  806. }
  807. .introduce {
  808. width: 100%;
  809. margin-top: 12px;
  810. margin-bottom: 10px;
  811. align-items: flex-start;
  812. justify-content: space-around;
  813. }
  814. .introduce-title {
  815. color: #333333;
  816. font-size: 15px;
  817. line-height: 30px;
  818. font-family: Source Han Sans CN;
  819. }
  820. .introduce-content {
  821. color: #333333;
  822. font-size: 14px;
  823. line-height: 23px;
  824. font-family: Source Han Sans CN;
  825. }
  826. .activityRules {
  827. width: 100%;
  828. margin-top: 5px;
  829. margin-bottom: 10px;
  830. padding: 10px 15px;
  831. align-items: flex-start;
  832. justify-content: space-around;
  833. border-radius: 9px;
  834. background: #EBEBEB;
  835. }
  836. .activityRules-title {
  837. color: #333333;
  838. font-size: 14px;
  839. line-height: 25px;
  840. font-weight: 500;
  841. font-family: Source Han Sans CN;
  842. }
  843. .activityRules-content {
  844. color: #333333;
  845. font-size: 13px;
  846. line-height: 23px;
  847. font-family: Source Han Sans CN;
  848. }
  849. .btnSignup {
  850. width: 100%;
  851. height: 100rpx;
  852. margin-top: 30rpx;
  853. margin-bottom: 30rpx;
  854. color: white;
  855. font-weight: bold;
  856. line-height: 100rpx;
  857. border-radius: 55rpx;
  858. }
  859. .btnSignup-enable {
  860. background-color: #81cd00;
  861. }
  862. .btnSignup-disable {
  863. background-color: #c3c3c3;
  864. }
  865. .dialog-content {
  866. width: 280px;
  867. height: 110px;
  868. padding: 0 20px;
  869. background: #f1f1f1;
  870. border-radius: 9px;
  871. justify-content: center;
  872. text-align: center;
  873. font-weight: 550;
  874. color: #333333;
  875. }
  876. .dialog-content-1 {
  877. font-size: 34rpx;
  878. margin-bottom: 30rpx;
  879. }
  880. .dialog-content-2 {
  881. font-size: 28rpx;
  882. margin-bottom: 10rpx;
  883. text-align: left;
  884. }
  885. </style>