studyUp.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view style="padding-bottom: 50rpx;">
  3. <view class="pagebg">
  4. <view class="" style="width: 100%;height: 400rpx;">
  5. <swiper :indicator-dots="false" :autoplay="true" :interval="3000" :duration="500" style="width: 100%;height: 100%;">
  6. <swiper-item v-for="(item,index) in swiperList" :key="index">
  7. <image :src="item.imageUrl" style="width: 100%;height: 100%;" mode=""></image>
  8. </swiper-item>
  9. </swiper>
  10. </view>
  11. <view class="content">
  12. <view class="box">
  13. <view>
  14. <view class="text-bold" style="color: #333333;">您的姓名</view>
  15. <view class="inutline">
  16. <u-input v-model="form.applyName" type="text" placeholder="请输入真实姓名"
  17. inputAlign="text-align:left" />
  18. </view>
  19. </view>
  20. <view class="margin-top">
  21. <view class="text-bold" style="color: #333333;">您的年龄</view>
  22. <view class="inutline">
  23. <u-input v-model="form.applyAge" type="text" placeholder="请输入年龄"
  24. inputAlign="text-align:left" />
  25. </view>
  26. </view>
  27. <view class="margin-top">
  28. <view class="text-bold" style="color: #333333;">联系电话</view>
  29. <view class="inutline">
  30. <u-input v-model="form.applyPhone" type="text" placeholder="请输入联系电话"
  31. inputAlign="text-align:left" />
  32. </view>
  33. </view>
  34. <view class="margin-top">
  35. <view class="text-bold" style="color: #333333;">报考课程</view>
  36. <view class="">
  37. <u-input v-model="form.applyContent" type="text" placeholder="请输入报考课程"
  38. inputAlign="text-align:left" />
  39. </view>
  40. </view>
  41. </view>
  42. <view v-if="form.status==3&&form.auditContent">拒绝理由:{{form.auditContent}}</view>
  43. <view class="btn" v-if="form.status==1||form.status==3" @click="submit()">修改</view>
  44. <view class="btn" v-else @click="submit()">提交</view>
  45. </view>
  46. </view>
  47. <view class="text flex justify-center">
  48. <view class="text-box" v-html="value">
  49. <!-- {{value}} -->
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. form: {
  59. applyName: '',
  60. applyPhone: '',
  61. applyAge: '',
  62. applyContent: '',
  63. classify:1
  64. },
  65. userId: '',
  66. value:'',
  67. swiperList:[]
  68. }
  69. },
  70. onLoad() {
  71. this.userId = uni.getStorageSync('userId')
  72. this.getSwiperList();
  73. if(this.userId){
  74. this.getDetails()
  75. this.$Request.get('/app/common/type/316').then(res => {
  76. if (res.code == 0) {
  77. this.value = res.data.value
  78. }
  79. });
  80. }
  81. },
  82. onShow() {
  83. },
  84. methods: {
  85. //获取轮播图
  86. getSwiperList() {
  87. this.$Request.get("/app/banner/selectBannerList", {
  88. classify: 7
  89. }).then(res => {
  90. if (res.code == 0) {
  91. this.swiperList = res.data
  92. }
  93. });
  94. },
  95. getDetails() {
  96. let data = {
  97. classify: 1
  98. }
  99. this.$Request.get('/app/apply/selectApplyByUserIdAndClassify', data).then(res => {
  100. if (res.code == 0 && res.data) {
  101. this.form = res.data
  102. }
  103. })
  104. },
  105. submit() {
  106. if(this.userId==''){
  107. uni.showModal({
  108. title: '提示',
  109. content: '您还未登录,请先登录',
  110. success: (res) => {
  111. if (res.confirm) {
  112. console.log('用户点击确定');
  113. this.$queue.toLogin('navigateTo')
  114. } else if (res.cancel) {
  115. console.log('用户点击取消');
  116. }
  117. }
  118. })
  119. return
  120. }
  121. if (!this.form.applyName) {
  122. uni.showToast({
  123. title: '请输入真实姓名',
  124. icon: 'none',
  125. duration: 1000
  126. })
  127. return;
  128. }
  129. if (!this.form.applyAge) {
  130. uni.showToast({
  131. title: '请输入年龄',
  132. icon: 'none',
  133. duration: 1000
  134. })
  135. return;
  136. }
  137. if (!this.form.applyPhone) {
  138. uni.showToast({
  139. title: '请输入联系电话',
  140. icon: 'none',
  141. duration: 1000
  142. })
  143. return;
  144. }
  145. if (!this.form.applyContent) {
  146. uni.showToast({
  147. title: '请输入报考证书',
  148. icon: 'none',
  149. duration: 1000
  150. })
  151. return;
  152. }
  153. if(this.form.status ==1||this.form.status==3){
  154. this.$Request.postJson('/app/apply/updateApply', this.form).then(res => {
  155. if (res.code == 0) {
  156. uni.showToast({
  157. title: '修改成功!',
  158. icon: 'none'
  159. })
  160. setTimeout(function() {
  161. uni.switchTab({
  162. url:'/pages/index/index'
  163. })
  164. }, 1000)
  165. }
  166. })
  167. }else{
  168. this.$Request.postJson('/app/apply/insertApply', this.form).then(res => {
  169. if (res.code == 0) {
  170. uni.showToast({
  171. title: '提交成功!',
  172. icon: 'none'
  173. })
  174. setTimeout(function() {
  175. uni.switchTab({
  176. url:'/pages/index/index'
  177. })
  178. }, 1000)
  179. }
  180. })
  181. }
  182. }
  183. }
  184. }
  185. </script>
  186. <style lang="less">
  187. page{
  188. background-color: #82a9fe;
  189. }
  190. .text{
  191. margin-top: 50rpx;
  192. width: 100%;
  193. .text-box{
  194. width: 686rpx;
  195. text-align: center;
  196. }
  197. }
  198. .pagebg {
  199. width: 100%;
  200. }
  201. .pagebg image {
  202. width: 100%;
  203. height: 100%;
  204. }
  205. .content {
  206. z-index: 99;
  207. margin: 30upx 30upx;
  208. }
  209. .box {
  210. background: #FFFFFF;
  211. border: 4upx solid #000000;
  212. border-radius: 20upx;
  213. padding: 30upx;
  214. }
  215. .inutline {
  216. border-bottom: 1rpx solid #E9E9E9;
  217. }
  218. .btn{
  219. background: #FFFFFF;
  220. border-radius: 10upx;
  221. text-align: center;
  222. margin-top: 30upx;
  223. padding: 30upx;
  224. color: #000000;
  225. font-weight: bold;
  226. letter-spacing: 2rpx;
  227. }
  228. </style>