studyUp.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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: function(res) {
  111. if (res.confirm) {
  112. console.log('用户点击确定');
  113. uni.navigateTo({
  114. url: '/pages/public/login'
  115. })
  116. } else if (res.cancel) {
  117. console.log('用户点击取消');
  118. }
  119. }
  120. })
  121. return
  122. }
  123. if (!this.form.applyName) {
  124. uni.showToast({
  125. title: '请输入真实姓名',
  126. icon: 'none',
  127. duration: 1000
  128. })
  129. return;
  130. }
  131. if (!this.form.applyAge) {
  132. uni.showToast({
  133. title: '请输入年龄',
  134. icon: 'none',
  135. duration: 1000
  136. })
  137. return;
  138. }
  139. if (!this.form.applyPhone) {
  140. uni.showToast({
  141. title: '请输入联系电话',
  142. icon: 'none',
  143. duration: 1000
  144. })
  145. return;
  146. }
  147. if (!this.form.applyContent) {
  148. uni.showToast({
  149. title: '请输入报考证书',
  150. icon: 'none',
  151. duration: 1000
  152. })
  153. return;
  154. }
  155. if(this.form.status ==1||this.form.status==3){
  156. this.$Request.postJson('/app/apply/updateApply', this.form).then(res => {
  157. if (res.code == 0) {
  158. uni.showToast({
  159. title: '修改成功!',
  160. icon: 'none'
  161. })
  162. setTimeout(function() {
  163. uni.switchTab({
  164. url:'/pages/index/index'
  165. })
  166. }, 1000)
  167. }
  168. })
  169. }else{
  170. this.$Request.postJson('/app/apply/insertApply', this.form).then(res => {
  171. if (res.code == 0) {
  172. uni.showToast({
  173. title: '提交成功!',
  174. icon: 'none'
  175. })
  176. setTimeout(function() {
  177. uni.switchTab({
  178. url:'/pages/index/index'
  179. })
  180. }, 1000)
  181. }
  182. })
  183. }
  184. }
  185. }
  186. }
  187. </script>
  188. <style lang="less">
  189. page{
  190. background-color: #82a9fe;
  191. }
  192. .text{
  193. margin-top: 50rpx;
  194. width: 100%;
  195. .text-box{
  196. width: 686rpx;
  197. text-align: center;
  198. }
  199. }
  200. .pagebg {
  201. width: 100%;
  202. }
  203. .pagebg image {
  204. width: 100%;
  205. height: 100%;
  206. }
  207. .content {
  208. z-index: 99;
  209. margin: 30upx 30upx;
  210. }
  211. .box {
  212. background: #FFFFFF;
  213. border: 4upx solid #000000;
  214. border-radius: 20upx;
  215. padding: 30upx;
  216. }
  217. .inutline {
  218. border-bottom: 1rpx solid #E9E9E9;
  219. }
  220. .btn{
  221. background: #FFFFFF;
  222. border-radius: 10upx;
  223. text-align: center;
  224. margin-top: 30upx;
  225. padding: 30upx;
  226. color: #000000;
  227. font-weight: bold;
  228. letter-spacing: 2rpx;
  229. }
  230. </style>