conference-offline-en-other.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. <template>
  2. <view class="bigbox">
  3. <uni-nav-bar status-bar=true fixed=true left-icon="back" background-color="#3387ff" color="#ffffff"
  4. @clickLeft="navigateBack">
  5. <text slot="default" style="text-align: center; flex: 1; font-size: 18px; font-weight: bold;">Sign Up</text>
  6. <button slot="right" size="mini" @click="submitForm" class="sunmit-btn" type="submit"
  7. hover-class="button-hover">submit</button>
  8. </uni-nav-bar>
  9. <!-- 背景装饰物 -->
  10. <view class="decorate">
  11. <!-- <view class="decorates"></view> -->
  12. </view>
  13. <!-- 表单部分 -->
  14. <uni-list :border="false"
  15. style="width: 686rpx;margin: 100rpx 32rpx;border-radius: 12rpx;overflow: hidden;box-shadow: 0px 3px 6px #000000;">
  16. <uni-list-item clickable>
  17. <text slot="header" class="text_style text_style_s label">Invitation Code</text>
  18. <input placeholder="Please enter your Invitation Code or '000000'" slot="body"
  19. class="uni-input-info text_style_s" v-model="meetingApply.invitationCode" />
  20. </uni-list-item>
  21. <uni-list-item clickable>
  22. <text slot="header" class="text_style text_style_s label">Given Name</text>
  23. <input placeholder="Please enter your Given Name" slot="body" class="uni-input-info text_style_s"
  24. v-model="meetingApply.givenName" />
  25. </uni-list-item>
  26. <uni-list-item clickable>
  27. <text slot="header" class="text_style text_style_s" style="margin-left: 12rpx;">Middle Name</text>
  28. <input placeholder="Please enter your Middle Name" slot="body" class="uni-input-info text_style_s"
  29. v-model="meetingApply.middleName" />
  30. </uni-list-item>
  31. <uni-list-item clickable>
  32. <text slot="header" class="text_style text_style_s label">Surname</text>
  33. <input placeholder="Please enter your Surname" slot="body" class="uni-input-info text_style_s"
  34. v-model="meetingApply.sumame" />
  35. </uni-list-item>
  36. <uni-list-item clickable>
  37. <text slot="header" class="text_style text_style_s label">E-mail</text>
  38. <input placeholder="Please enter your E-mail" slot="body" class="uni-input-info text_style_s"
  39. v-model="meetingApply.mail" />
  40. </uni-list-item>
  41. <uni-list-item showArrow clickable @click="toUnitCountryDict">
  42. <view slot="header" class="text_style" style="line-height: 100rpx; font-weight: bold;">
  43. <text class="label" style="margin-left: 10rpx;">Country/Region</text>
  44. </view>
  45. <text slot="footer" style="margin-top: -42px;">{{unitCountry}}</text>
  46. </uni-list-item>
  47. <uni-list-item clickable>
  48. <text slot="header" class="text_style text_style_s label">Name of Company/Organization</text>
  49. <input placeholder="Please enter your Company/Organization" slot="body"
  50. class="uni-input-info text_style_s" v-model="meetingApply.filmName" />
  51. </uni-list-item>
  52. <uni-list-item showArrow>
  53. <view class="" slot="header">
  54. <text class="text_style text_style_s label">Company/Organization Type</text>
  55. </view>
  56. <view slot="body" class="uni-list select-view text_style_s">
  57. <view class="uni-list-cell" v-if="UnitTypeDictRange.length">
  58. <view class="uni-list-cell-db">
  59. <picker @change="bindUnitTypePickerChange" :value="unitTypeIndex" :range="UnitTypeDictRange"
  60. range-key="label">
  61. <view class="uni-input"
  62. style="text-align:left; padding-left:28rpx;line-height: 192rpx;">
  63. {{UnitTypeDictRange[unitTypeIndex].label}}
  64. </view>
  65. </picker>
  66. </view>
  67. </view>
  68. </view>
  69. </uni-list-item>
  70. <uni-list-item clickable>
  71. <text slot="header" class="text_style text_style_s label">Title</text>
  72. <input placeholder="Please enter your Title" slot="body" class="uni-input-info text_style_s"
  73. v-model="meetingApply.title" />
  74. </uni-list-item>
  75. </uni-list>
  76. <activities-select v-if="baseInfo!= {} && baseInfo.isShowEnOnlineIntention=='Yes'"
  77. :meetingId="meetingApply.meetingId" @getcheckedIds="getActivityIds" @getcheckDetermine="getdetermine"></activities-select>
  78. </view>
  79. </template>
  80. <script>
  81. import {
  82. addIntegral,
  83. addGrowth
  84. } from '@/components/addPointDetailByTaskDict.js'
  85. import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue";
  86. import informationInput from "@/pages/conference/conferenceOfflineZh/information.vue";
  87. import activitiesSelect from "@/pages/conference/activitiesSelectEN.vue";
  88. export default {
  89. components: {
  90. uniNavBar,
  91. informationInput,
  92. activitiesSelect,
  93. addIntegral,
  94. addGrowth
  95. },
  96. data() {
  97. return {
  98. unitCountry: '',
  99. genderRange: [{
  100. value: 'M',
  101. label: 'Male'
  102. },
  103. {
  104. value: 'F',
  105. label: 'Female'
  106. },
  107. {
  108. value: 'O',
  109. label: 'Other'
  110. },
  111. ],
  112. genderIndex: 0,
  113. unitTypeIndex: 0,
  114. languageIndex: 1,
  115. UnitTypeDictRange: [],
  116. languageDictEns: [],
  117. baseInfo: {}, //邀请码集合
  118. invitationCodePrefix: [], //邀请码集合
  119. invitationCodeArr: [], //邀请码集合
  120. meetingApply: {
  121. meetingId: '',
  122. applyWay: 'en',
  123. unitCountryDict: 'china',
  124. invitationCode: '',
  125. name: '',
  126. middleName: '',
  127. givenName: '',
  128. sumame: '',
  129. filmName: '',
  130. filmType: '',
  131. filmTypeDict: '01',
  132. title: '',
  133. mail: '',
  134. },
  135. approverId: '',
  136. checkedIds: '',
  137. checkDetermine: true,
  138. }
  139. },
  140. mounted() {
  141. // this.getUnitTypeDict();
  142. this.getLanguageDictEn();
  143. },
  144. onLoad(option) {
  145. if (option && option.id) {
  146. this.meetingApply.meetingId = option.id;
  147. const myId = option.id
  148. this.getConfrenceDetail(myId)
  149. // console.log(option.id)
  150. } else {
  151. let that = this;
  152. const eventChannel = this.getOpenerEventChannel()
  153. eventChannel.on('reapply', function(data) {
  154. that.meetingApply = data.data;
  155. that.getConfrenceDetail(data.data.meetingId);
  156. // console.log('2222',that.meetingApply)
  157. })
  158. that.initDicts()
  159. }
  160. },
  161. // watch:{
  162. // 'meetingApply.givenName'(val){
  163. // this.meetingApply.givenName = val
  164. // this.meetingApply.contactPersonName = val + ' ' + this.meetingApply.middleName + ' ' + this.meetingApply.surname
  165. // this.meetingApply.nameEn = val + ' ' + this.meetingApply.middleName + ' ' + this.meetingApply.surname
  166. // },
  167. // 'meetingApply.middleName'(val){
  168. // this.meetingApply.middleName = val
  169. // this.meetingApply.contactPersonName = this.meetingApply.givenName + ' ' + val + ' ' + this.meetingApply.surname
  170. // this.meetingApply.nameEn = this.meetingApply.givenName + ' ' + val + ' ' + this.meetingApply.surname
  171. // },
  172. // 'meetingApply.surname'(val){
  173. // this.meetingApply.surname = val
  174. // this.meetingApply.contactPersonName = this.meetingApply.givenName + ' ' + this.meetingApply.middleName + ' ' + val
  175. // this.meetingApply.nameEn = this.meetingApply.givenName + ' ' + this.meetingApply.middleName + ' ' + val
  176. // },
  177. // 'meetingApply.email'(val){
  178. // this.meetingApply.contactEmail = val
  179. // },
  180. // 'meetingApply.tel'(val){
  181. // this.meetingApply.contactCellphone = val
  182. // },
  183. // },
  184. methods: {
  185. getActivityIds(ids) {
  186. console.log('ids', ids)
  187. this.checkedIds = ids;
  188. },
  189. getdetermine(checkDetermine) {
  190. this.checkDetermine = checkDetermine;
  191. console.log('checkDetermine', this.checkDetermine)
  192. },
  193. async initDicts() {
  194. const res = await this.$myRequest({
  195. url: '/sys/sysDicts',
  196. data: {
  197. type: 'unit_country_dict_en,meeting_unit_type_dict_en'
  198. }
  199. })
  200. res.data[0].forEach(item => {
  201. // console.log(item)
  202. if (this.meetingApply.unitCountryDict == item.value) {
  203. this.unitCountry = item.label
  204. }
  205. })
  206. res.data[1].forEach((item, i) => {
  207. // console.log(item)
  208. if (this.meetingApply.filmTypeDict == item.value) {
  209. this.unitTypeIndex = i
  210. }
  211. })
  212. this.genderRange.forEach((item, i) => {
  213. if (this.meetingApply.genderDict == item.value) {
  214. this.genderIndex = i
  215. }
  216. })
  217. },
  218. async submitForm() {
  219. // uni.navigateTo({
  220. // url: '/pages/conference/conferenceOfflineEn/successfully'
  221. // });
  222. // return
  223. //把英文的三个名字拼接一下
  224. this.meetingApply.name = this.meetingApply.givenName + this.meetingApply.middleName + this.meetingApply
  225. .sumame
  226. //必填项验证
  227. if (!this.checkContent(this.meetingApply.invitationCode)) {
  228. uni.showToast({
  229. title: 'Invitation code not filled in',
  230. icon: 'none'
  231. });
  232. return;
  233. } else if (!this.invitationCodeArr.includes(this.meetingApply.invitationCode)) {
  234. uni.showToast({
  235. title: 'Invitation code error',
  236. icon: 'none'
  237. });
  238. return;
  239. } else if (!this.checkContent(this.meetingApply.givenName)) {
  240. uni.showToast({
  241. title: 'GivenName not filled in',
  242. icon: 'none'
  243. });
  244. return;
  245. } else if (!this.checkContent(this.meetingApply.sumame)) {
  246. uni.showToast({
  247. title: 'SurName not filled in',
  248. icon: 'none'
  249. });
  250. return;
  251. } else if (!this.checkContent(this.meetingApply.mail)) {
  252. uni.showToast({
  253. title: 'Email not filled in',
  254. icon: 'none'
  255. });
  256. return;
  257. } else if (!this.checkEmail(this.meetingApply.mail)) {
  258. uni.showToast({
  259. title: 'Email format error',
  260. icon: 'none'
  261. });
  262. return;
  263. } else if (!this.checkContent(this.meetingApply.filmName)) {
  264. uni.showToast({
  265. title: 'Name of Company/Organization is not filled in',
  266. icon: 'none'
  267. });
  268. return;
  269. } else if (!this.checkContent(this.meetingApply.title)) {
  270. uni.showToast({
  271. title: 'Title not filled in',
  272. icon: 'none'
  273. });
  274. return;
  275. }else if (!this.checkDetermine) {
  276. uni.showToast({
  277. title: 'Kind Reminder: participants can only register for one parallel session. Hope you enjoy the conference.',
  278. icon: 'none'
  279. });
  280. return;
  281. }
  282. // 点击确定时,对手机邮箱进行验证
  283. if (this.meetingApply.auditStatusDict == '') {
  284. this.meetingApply.auditStatusDict = '4';
  285. } else {
  286. this.meetingApply.auditStatusDict = this.meetingApply.auditStatusDict;
  287. }
  288. var res = await this.$myRequest({
  289. url: '/meeting/meetingApplys/getApproverId',
  290. data: {
  291. invitationCode: this.meetingApply.invitationCode
  292. },
  293. });
  294. res = res.data; //20210401添加此行代码
  295. var str = "";
  296. for (var i = 0; i < res.length; i++) {
  297. str += res[i].userId + ",";
  298. }
  299. if (str.length > 0) {
  300. str = str.substr(0, str.length - 1);
  301. }
  302. this.approverId = str;
  303. console.log('approverId', this.approverId)
  304. const token = await this.$myRequest({
  305. url: '/sys/token',
  306. data: {}
  307. });
  308. console.log('meetingApply', this.meetingApply)
  309. await this.$myRequest({
  310. url: '/meeting/meetingApplyOnlines',
  311. method: (this.meetingApply.id ? 'PUT' : 'POST'),
  312. data: {
  313. meetingApplyOnline: JSON.stringify(this.meetingApply),
  314. token: token.data,
  315. activityIds: this.checkedIds
  316. },
  317. }).then(result => {
  318. console.log(result)
  319. if (result.data.isRepeat) {
  320. uni.showToast({
  321. title: 'please do not fill in again',
  322. icon: 'none'
  323. })
  324. return
  325. }
  326. addIntegral('meeting_registration_successful', '10')
  327. addGrowth('meeting_registration_successful', '10')
  328. uni.navigateTo({
  329. url: '/pages/conference/conferenceOfflineEn/successfully'
  330. });
  331. });
  332. },
  333. bindPickerChange(e) {
  334. this.meetingApply.genderDict = this.genderRange[e.target.value].value;
  335. this.genderIndex = e.target.value;
  336. },
  337. bindUnitTypePickerChange(e) {
  338. console.log(this.UnitTypeDictRange[e.target.value].value)
  339. this.meetingApply.filmTypeDict = this.UnitTypeDictRange[e.target.value].value;
  340. this.unitTypeIndex = e.target.value;
  341. },
  342. bindLanguageChange(e) {
  343. this.meetingApply.languageDictEn = this.languageDictEns[e.target.value].value;
  344. this.languageIndex = e.target.value;
  345. },
  346. async getDict(rand) {
  347. const res = await this.$myRequest({
  348. url: '/sys/sysDicts',
  349. data: {
  350. type: 'geidco_dept_dict,meeting_unit_type_dict_en'
  351. }
  352. })
  353. if (res.data) {
  354. this.UnitTypeDictRange = res.data[1];
  355. // this.invitationCodePrefix = res.data
  356. res.data[0].forEach(item => {
  357. // console.log(item)
  358. this.invitationCodeArr.push(item.value + '' + rand)
  359. })
  360. this.invitationCodeArr.push("000000")
  361. console.log(this.invitationCodeArr)
  362. }
  363. },
  364. async getConfrenceDetail(myId) {
  365. const res = await this.$myRequest({
  366. url: '/meeting/meetingOutInfos/findMeetingDetail/',
  367. data: {
  368. id: myId
  369. }
  370. });
  371. this.baseInfo = res.data.basicInfo;
  372. this.getDict(res.data.basicInfo.meetingRand)
  373. },
  374. async getLanguageDictEn() {
  375. const res = await this.$myRequest({
  376. url: '/sys/sysDicts',
  377. data: {
  378. type: 'language_dict_en'
  379. }
  380. })
  381. if (res.data) {
  382. this.languageDictEns = res.data[0];
  383. }
  384. },
  385. toMobileAreaCode(mark) {
  386. uni.navigateTo({
  387. url: 'MobileAreaCodeDict',
  388. events: {
  389. watchMobileAreaCode: data => {
  390. this.meetingApply[mark] = data.code;
  391. if (mark == 'mobileAreaCodeDictEn') {
  392. this.meetingApply.contactMobileAreacodeDictEn = data.code;
  393. }
  394. }
  395. },
  396. })
  397. },
  398. toUnitCountryDict() {
  399. uni.navigateTo({
  400. url: 'CountryDict',
  401. events: {
  402. acceptSelectedCountry: data => {
  403. this.unitCountry = data.country;
  404. this.meetingApply.unitCountryDict = data.code;
  405. }
  406. },
  407. })
  408. },
  409. toUpload() {
  410. uni.navigateTo({
  411. url: '/pages/conference/conferenceOfflineZh/uni-list-item-upload',
  412. events: {
  413. acceptImageUrl: data => {
  414. this.meetingApply.photoUrl = data.url;
  415. }
  416. },
  417. })
  418. },
  419. navigateBack() {
  420. uni.navigateBack()
  421. },
  422. checkEmail(email) {
  423. return RegExp(/^\w+.*\w+@[a-zA-Z0-9]+.*[a-zA-Z0-9]+\.[a-zA-Z]{2,4}$/).test(email);
  424. },
  425. checkMobile(mobile) {
  426. return RegExp(/^1[34578]\d{9}$/).test(mobile);
  427. },
  428. checkContent(content) {
  429. return RegExp(/^[\s\S]*.*[^\s][\s\S]*$/).test(content);
  430. },
  431. }
  432. }
  433. </script>
  434. <style lang="scss" scoped>
  435. .bigbox {
  436. background-color: #FFFFFF;
  437. padding-bottom: 20px;
  438. }
  439. /deep/.uni-list--border::after {
  440. background-color: #FFFFFF;
  441. }
  442. .uni-list-item {
  443. height: 144rpx;
  444. line-height: 104rpx;
  445. border-bottom: 1px solid #dadada;
  446. }
  447. /deep/.uni-list-item__container {
  448. flex-wrap: wrap;
  449. }
  450. .decorate {
  451. width: 100%;
  452. height: 170px;
  453. background-color: #3387ff;
  454. position: absolute;
  455. border-radius: 0 0 50px 50px
  456. }
  457. .decorates {
  458. width: 323px;
  459. height: 30px;
  460. background-color: rgb(255, 255, 255);
  461. opacity: 0.5;
  462. border-radius: 5px;
  463. position: absolute;
  464. top: 60rpx;
  465. left: 52rpx;
  466. }
  467. .text_style {
  468. width: 100%;
  469. font-weight: bold;
  470. font-size: 14px;
  471. display: flex;
  472. align-items: center;
  473. margin-bottom: 10rpx;
  474. }
  475. .text_style_s {
  476. padding-left: 14rpx;
  477. }
  478. .uni-common-mt {
  479. // margin-left: 90rpx;
  480. }
  481. .uni-list {
  482. width: auto;
  483. background-color: #d7d7d7;
  484. }
  485. .uni-list:after,
  486. .uni-list:before {
  487. height: 0px;
  488. }
  489. .select-view {
  490. position: absolute;
  491. width: 100%;
  492. height: 100%;
  493. text-align: right;
  494. top: 0;
  495. left: 0;
  496. background-color: transparent;
  497. }
  498. .select-view .uni-input {
  499. line-height: 140rpx;
  500. }
  501. .sunmit-btn {
  502. width: 57px;
  503. height: 30px;
  504. color: #FFFFFF;
  505. background-color: #2d79e5;
  506. padding: 0 10px;
  507. border-radius: 18px;
  508. }
  509. .button-hover[type=submit] {
  510. opacity: .75;
  511. transform: scale(0.95, 0.95);
  512. }
  513. .uni-input-info {
  514. height: 54rpx;
  515. width: 650rpx;
  516. font-size: 30rpx;
  517. // border-bottom: 1px solid #dadada;
  518. // background: #E4E7ED;
  519. }
  520. .uni-input-placeholder {
  521. font-size: 28rpx;
  522. padding-left: 10rpx;
  523. }
  524. .label:before {
  525. content: '* ';
  526. color: red;
  527. }
  528. </style>