sign.vue 7.1 KB

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