signup.vue 27 KB

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