sign.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <view class="content">
  3. <view class="team">
  4. <image class="top-image" :src="baseURL + list.image"></image>
  5. <!-- <view class="box">
  6. <jyf-parser :html="description" ref="article"></jyf-parser>
  7. </view> -->
  8. <view class="top-title canten">免费报名</view>
  9. <view class="sign-tip">完成信息填写,即可参加红十字会救护员培训</view>
  10. <view class="form-box">
  11. <view class="label">
  12. 姓名/企业姓名
  13. <text>*</text>
  14. </view>
  15. <input type="text" v-model="name" placeholder="请填写姓名" />
  16. <view class="label">
  17. 联系方式
  18. <text>*</text>
  19. </view>
  20. <input type="number" v-model="phone" placeholder="请输入联系方式" />
  21. <view class="label">
  22. 参加培训人数
  23. <text>*</text>
  24. </view>
  25. <input type="number" v-model="num" placeholder="请输入参加培训人数" />
  26. </view>
  27. <view class="top-title">免费报名</view>
  28. <view class="text-box" v-html="description">
  29. <view class="text">请参训学员在培训当天携带身份证复印件1张,一寸证件照2张。</view>
  30. <view class="text">报名咨询电话:0716-4163849</view>
  31. </view>
  32. <view class="submit" @click="submit">立即报名</view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import { get_training, sign_training, detail_training } from '@/api/train.js';
  38. import jyfParser from '@/components/jyf-parser/jyf-parser';
  39. import { weixindata, weixinlocation } from '@/utils/wxAuthorized.js';
  40. import { userinfo } from '@/api/user.js';
  41. import { mapState, mapMutations } from 'vuex';
  42. export default {
  43. components: {
  44. jyfParser
  45. },
  46. data() {
  47. return {
  48. id: '',
  49. description: '',
  50. list: '',
  51. //个人
  52. name: '',
  53. phone: '',
  54. //团队
  55. num: '',
  56. size: 180
  57. };
  58. },
  59. onLoad(option) {
  60. this.type = option.type;
  61. this.id = option.id;
  62. if (option.uid) {
  63. this.uid = option.uid;
  64. } else {
  65. this.uid = this.userInfo.uid;
  66. }
  67. this.loadData();
  68. },
  69. onReady() {},
  70. computed: {
  71. ...mapState('user', ['hasLogin', 'userInfo']),
  72. ...mapState(['baseURL'])
  73. },
  74. methods: {
  75. ...mapMutations('user', ['setUserInfo']),
  76. // 分享
  77. async loadData() {
  78. let obj = this;
  79. get_training({
  80. id: obj.id
  81. // uid:uid
  82. }).then(({ data }) => {
  83. obj.list = data;
  84. console.log(9988, obj.list);
  85. if (obj.list.content != null) {
  86. obj.description = obj.list.content.replace(/<img/g, "<img style='max-width:100%;height:auto;'");
  87. }
  88. });
  89. },
  90. submit() {
  91. let obj = this;
  92. let data = {};
  93. if (!obj.name) {
  94. obj.$api.msg('请填写姓名/企业名!');
  95. return;
  96. }
  97. if (!obj.phone) {
  98. obj.$api.msg('请输入联系方式!');
  99. return;
  100. }
  101. if (!obj.num) {
  102. obj.$api.msg('请输入培训人数!');
  103. return;
  104. }
  105. data = {
  106. training_id:obj.id,
  107. name: obj.name,
  108. Phone: obj.phone,
  109. num:obj.num
  110. };
  111. sign_training(data)
  112. .then(function(e) {
  113. console.log(data.type);
  114. let type = data.type;
  115. uni.setStorageSync('type', type);
  116. obj.$api.msg(e.msg);
  117. setTimeout(function() {
  118. uni.navigateTo({
  119. url: '/pages/train/index'
  120. });
  121. }, 1000);
  122. })
  123. .catch(e => {
  124. obj.$api.msg(e.message);
  125. setTimeout(function() {
  126. uni.navigateTo({
  127. url: '/pages/train/index'
  128. });
  129. }, 1000);
  130. });
  131. },
  132. getRecTime(timestamp, fmt) {
  133. let d = new Date(timestamp * 1000),
  134. // f = fmt || 'yyyy/MM/dd',
  135. f = fmt || 'yyyy.MM.dd hh:mm:ss',
  136. o = {
  137. 'M+': d.getMonth() + 1, //月份
  138. 'd+': d.getDate(), //日
  139. 'h+': d.getHours(), //小时
  140. 'm+': d.getMinutes(), //分
  141. 's+': d.getSeconds(), //秒
  142. 'q+': Math.floor((d.getMonth() + 3) / 3), //季度
  143. S: d.getMilliseconds() //毫秒
  144. };
  145. if (/(y+)/.test(f)) {
  146. f = f.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length));
  147. }
  148. for (let k in o) {
  149. if (new RegExp('(' + k + ')').test(f)) {
  150. f = f.replace(RegExp.$1, RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length));
  151. }
  152. }
  153. return f;
  154. console.log(f);
  155. }
  156. }
  157. };
  158. </script>
  159. <style lang="scss">
  160. page {
  161. background: #ffffff;
  162. width: 100%;
  163. height: 100%;
  164. .content {
  165. height: 100%;
  166. }
  167. }
  168. .box {
  169. padding: 0rpx 25rpx;
  170. width: 100%;
  171. }
  172. .top-image {
  173. width: 100%;
  174. height: 300rpx;
  175. }
  176. .top-title {
  177. width: 100%;
  178. text-align: center;
  179. padding: 25rpx 0rpx;
  180. font-size: 34rpx;
  181. border-bottom: 1rpx dashed #b5b5b5;
  182. }
  183. .canten {
  184. text-align: center !important;
  185. }
  186. .addr {
  187. color: #222222;
  188. font-size: 28rpx;
  189. padding: 25rpx 35rpx;
  190. }
  191. .text-box {
  192. padding: 25rpx 25rpx;
  193. padding-bottom: 0rpx !important;
  194. }
  195. .text {
  196. color: #222222;
  197. font-size: 28rpx;
  198. padding-bottom: 15rpx;
  199. }
  200. .weixin-icon {
  201. width: 100%;
  202. text-align: center;
  203. padding-top: 45rpx;
  204. image {
  205. width: 248rpx;
  206. height: 248rpx;
  207. }
  208. }
  209. .tip {
  210. color: #222222;
  211. font-size: 28rpx;
  212. width: 100%;
  213. text-align: center;
  214. padding-bottom: 50rpx;
  215. }
  216. .sign-tip {
  217. padding: 25rpx 0rpx;
  218. text-align: center;
  219. color: #222222;
  220. font-size: 28rpx;
  221. }
  222. .form-box {
  223. padding: 0rpx 35rpx;
  224. .label {
  225. font-size: 34rpx;
  226. padding: 25rpx 0rpx;
  227. text {
  228. color: #e62129;
  229. padding-left: 5rpx;
  230. }
  231. }
  232. input {
  233. font-size: 28rpx;
  234. color: #222222;
  235. border: 2rpx solid #979797;
  236. padding: 0rpx 15rpx;
  237. border-radius: 15rpx;
  238. height: 80rpx;
  239. }
  240. }
  241. .submit {
  242. width: 70%;
  243. margin: 0rpx auto;
  244. margin-top: 80rpx;
  245. margin-bottom: 80rpx;
  246. padding: 25rpx 0;
  247. text-align: center;
  248. background-color: #e62129;
  249. color: #ffffff;
  250. font-size: 32rpx;
  251. border-radius: 10rpx;
  252. }
  253. .grey {
  254. background-color: #9b9b9b !important;
  255. }
  256. .certificates {
  257. // padding: 24rpx;
  258. width: 100%;
  259. height: 100vh;
  260. }
  261. .tki-qrcode-canvas {
  262. // width: 700rpx;
  263. // height: 1245rpx;
  264. width: 750rpx;
  265. // padding: 32rpx;
  266. height: 1350rpx;
  267. margin: 0 auto;
  268. }
  269. .bgimg {
  270. width: 100%;
  271. height: 100%;
  272. image {
  273. width: 100%;
  274. height: 100%;
  275. }
  276. }
  277. .box-mian {
  278. width: 100%;
  279. height: 100%;
  280. position: absolute;
  281. padding: 380rpx 94rpx 200rpx 94rpx;
  282. color: #333;
  283. left: 0;
  284. top: 0;
  285. display: flex;
  286. flex-direction: column;
  287. justify-content: center;
  288. // align-items: center;
  289. .name {
  290. display: flex;
  291. font-size: 32rpx;
  292. .name-left {
  293. text-align: center;
  294. // padding: 0 24rpx;
  295. width: 150rpx;
  296. border-bottom: 2rpx solid #333;
  297. }
  298. }
  299. .info {
  300. margin-top: 68rpx;
  301. text-indent: 64rpx;
  302. line-height: 58rpx;
  303. }
  304. .signName {
  305. margin-top: 32rpx;
  306. display: flex;
  307. .signName-left {
  308. line-height: 34rpx;
  309. .signName-1 {
  310. }
  311. .signName-2 {
  312. font-size: 28rpx;
  313. }
  314. }
  315. .signName-right {
  316. text-align: left;
  317. // width: 100%;
  318. padding: 0 12rpx;
  319. margin-left: 12rpx;
  320. // width: 288rpx;
  321. border-bottom: 2rpx solid #333;
  322. // margin-bottom: 12rpx;
  323. .list-input {
  324. width: 100%;
  325. padding: 0 12rpx;
  326. height: 70rpx;
  327. font-size: 32rpx;
  328. text-align: left;
  329. }
  330. .signDate {
  331. display: flex;
  332. align-items: center;
  333. }
  334. }
  335. }
  336. .signDate {
  337. margin-top: 22rpx;
  338. display: flex;
  339. .signName-left {
  340. line-height: 34rpx;
  341. .signName-1 {
  342. }
  343. .signName-2 {
  344. font-size: 28rpx;
  345. }
  346. }
  347. .signName-right {
  348. text-align: left;
  349. padding-left: 12rpx;
  350. margin-left: 12rpx;
  351. width: 288rpx;
  352. border-bottom: 2rpx solid #333;
  353. .list-input {
  354. height: 70rpx;
  355. font-size: 32rpx;
  356. text-align: left;
  357. }
  358. // margin-bottom: 12rpx;
  359. }
  360. }
  361. // background-color: pink;
  362. }
  363. .imgbox {
  364. height: 1350rpx;
  365. width: 750rpx;
  366. }
  367. </style>