prosecution_service.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <template>
  2. <view class="main">
  3. <view class="u-padding-left-40 u-padding-right-40" style="background: #fff;">
  4. <u-form :model="form" ref="uForm" label-width="130">
  5. <u-form-item label="姓名" prop="name" required>
  6. <u-input placeholder="请输入您的姓名" v-model="form.name" />
  7. </u-form-item>
  8. <u-form-item label="联系方式" prop="phone" required>
  9. <u-input type="number" maxlength="11" placeholder="请输入您的联系方式" v-model="form.phone" />
  10. <u-button open-type="getPhoneNumber" :custom-style="customBtn" @getphonenumber="getPhone"
  11. slot="right" type="success" hover-class="none" size="mini">获取手机号</u-button>
  12. </u-form-item>
  13. </u-form>
  14. </view>
  15. <view class="u-padding-left-40 u-padding-right-40 u-margin-top-20" style="background: #fff;">
  16. <u-form label-width="130">
  17. <u-form-item label="申请事项" required label-position="top">
  18. <u-radio-group wrap v-model="value" active-color="#1721F4">
  19. <u-radio @change="radioChange" v-for="(item, index) in list" :key="index" :name="item.name"
  20. :disabled="item.disabled">
  21. <text class="u-font-28 u-margin-left-12"
  22. style="color: #333;font-weight: 400;">{{item.name}}</text>
  23. <text class="u-font-28" style="color:#B1B2B1;font-weight: 400;">{{item.name_right}}</text>
  24. </u-radio>
  25. </u-radio-group>
  26. </u-form-item>
  27. </u-form>
  28. </view>
  29. <view class="u-padding-left-40 u-padding-right-40 u-margin-top-20" style="background: #fff;">
  30. <u-form label-width="130">
  31. <u-form-item label="预约时间" required>
  32. <u-input @click="selectCalendar = true" :disabled="true" placeholder="请选择预约时间" v-model="seleDate" />
  33. </u-form-item>
  34. </u-form>
  35. </view>
  36. <u-button hover-class="none" @click="submitForm" :custom-style="customStyle">提交</u-button>
  37. <calendar :is-show="selectCalendar" :transition="'slide'" :theme-color="'#1721F4'" @callback="getDate" />
  38. <lyg-popup @popupState="popupState" :nodeContent="nodeContent" title="使用须知"></lyg-popup>
  39. </view>
  40. </template>
  41. <script>
  42. import util from '@/common/util.js'
  43. import Calendar from '@/components/mobile-calendar-simple/Calendar.vue'
  44. import lyg_popup from '@/components/lyg-popup/lyg-popup.vue';
  45. export default {
  46. components: {
  47. Calendar,
  48. lyg_popup
  49. },
  50. data() {
  51. return {
  52. seleDate: '',
  53. selectCalendar: false,
  54. customBtn: {
  55. backgroundColor: '#1721F4',
  56. color: '#fff'
  57. },
  58. customStyle: {
  59. width: '694rpx',
  60. height: '88rpx',
  61. backgroundColor: '#1721F4',
  62. color: '#fff',
  63. marginTop: '130rpx',
  64. marginBottom: '30rpx'
  65. },
  66. form: {
  67. name: '',
  68. phone: ''
  69. },
  70. value: '申请阅卷',
  71. list: [{
  72. name: '申请阅卷',
  73. disabled: false,
  74. name_right: '(限辩护人或诉讼代理人)'
  75. }, {
  76. name: '申请收集(调取)证据材料',
  77. disabled: false,
  78. name_right: '(限辩护律师)'
  79. },
  80. {
  81. name: '申请自行收集证据材料',
  82. disabled: false,
  83. name_right: '(限辩护律师)'
  84. },
  85. {
  86. name: '申请羁押必要性审查',
  87. disabled: false,
  88. name_right: ''
  89. },
  90. {
  91. name: '提供证据材料',
  92. disabled: false,
  93. name_right: ''
  94. },
  95. {
  96. name: '要求听取意见',
  97. disabled: false,
  98. name_right: ''
  99. },
  100. {
  101. name: '预约视频接访',
  102. disabled: false,
  103. name_right: ''
  104. },
  105. {
  106. name: '预约检察长接访',
  107. disabled: false,
  108. name_right: ''
  109. },
  110. {
  111. name: '预约律师接访',
  112. disabled: false,
  113. name_right: ''
  114. },
  115. {
  116. name: '申请会见',
  117. disabled: false,
  118. name_right: '(限辩护人)'
  119. }
  120. ],
  121. rules: {
  122. name: [{
  123. required: true,
  124. message: '请输入您的姓名',
  125. // 可以单个或者同时写两个触发验证方式
  126. trigger: ['change', 'blur'],
  127. }, {
  128. validator: (rule, value, callback) => {
  129. return this.$u.test.chinese(value);
  130. },
  131. message: '请输入汉字',
  132. trigger: ['change', 'blur'],
  133. }],
  134. phone: [{
  135. required: true,
  136. min: 11,
  137. message: '请输入联系方式',
  138. trigger: ['change', 'blur'],
  139. },
  140. {
  141. validator: (rule, value, callback) => {
  142. return this.$u.test.mobile(value);
  143. },
  144. message: '手机号码不正确',
  145. trigger: ['change', 'blur'],
  146. }
  147. ],
  148. },
  149. nodeContent:''
  150. }
  151. },
  152. onReady() {
  153. this.$refs.uForm.setRules(this.rules);
  154. },
  155. onLoad() {
  156. this.getServiceContent()
  157. },
  158. methods: {
  159. popupState(value) {
  160. if (!value) {
  161. uni.navigateBack()
  162. return false
  163. }
  164. },
  165. async getServiceContent() {
  166. let res = await this.$u.get('/home/xieyi', {
  167. id: 8
  168. })
  169. this.nodeContent = res.content
  170. },
  171. getPhone(e) {
  172. uni.login({
  173. success: (res) => {
  174. util.getPhoneData(res.code, e.detail).then(data => {
  175. this.form.phone = data
  176. })
  177. }
  178. })
  179. },
  180. radioChange(e) {
  181. this.value = e
  182. },
  183. getDate(data) {
  184. if (data.startStr.week == '周六' || data.startStr.week == '周日') {
  185. uni.showToast({
  186. title: "请选择工作日预约",
  187. icon: "none"
  188. })
  189. return false
  190. }
  191. this.seleDate = data.startStr.dateStr
  192. this.selectCalendar = false
  193. },
  194. submitForm() {
  195. this.$refs.uForm.validate(valid => {
  196. if (valid) {
  197. if (this.value == '') {
  198. uni.showToast({
  199. title: "请选择申请事项",
  200. icon: "none"
  201. })
  202. return false
  203. }
  204. if (this.seleDate == '') {
  205. uni.showToast({
  206. title: "请选择预约时间",
  207. icon: "none"
  208. })
  209. return false
  210. }
  211. this.submitServiceForm()
  212. }
  213. });
  214. },
  215. async submitServiceForm() {
  216. let res = await this.$u.post("/form-input/services", {
  217. name: this.form.name,
  218. contact: this.form.phone,
  219. content: this.value,
  220. y_time: this.seleDate
  221. })
  222. uni.showModal({
  223. title: "温馨提示",
  224. content: "您的预约我们已经收悉,将尽快安排工作人员办理",
  225. showCancel: false,
  226. success: (res) => {
  227. if (res.confirm) {
  228. uni.navigateBack()
  229. }
  230. }
  231. })
  232. }
  233. }
  234. }
  235. </script>
  236. <style>
  237. .main {
  238. min-height: 100vh;
  239. /* padding-bottom: 36rpx; */
  240. }
  241. .u-radio-group {
  242. margin-left: 26rpx;
  243. }
  244. .u-dropdown__menu__item {
  245. justify-content: flex-end !important;
  246. }
  247. .u-dropdown__content {
  248. width: 100% !important;
  249. height: 530rpx !important;
  250. }
  251. </style>