register.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <view class="container">
  3. <view class="body">
  4. <!-- 访客姓名区域 -->
  5. <view class="body_box">
  6. <view class="box_key">
  7. <text class="key_icon">*</text>
  8. 访客姓名
  9. </view>
  10. <view class="box_value">
  11. <input class="value_input" type="text" placeholder="请输入访客姓名" placeholder-style="color:#CCCCCC;" />
  12. </view>
  13. </view>
  14. <!-- 访客手机号区域 -->
  15. <view class="body_box">
  16. <view class="box_key">
  17. <text class="key_icon">*</text>
  18. 访客手机号
  19. </view>
  20. <view class="box_value">
  21. <input class="value_input" type="text" placeholder="请输入访客手机号" placeholder-style="color:#CCCCCC;" />
  22. </view>
  23. </view>
  24. <!-- 来访时间区域 -->
  25. <view class="body_box">
  26. <view class="box_key">
  27. <text class="key_icon">*</text>
  28. 来访时间
  29. </view>
  30. <view class="box_value">
  31. <uni-datetime-picker>
  32. <view class="value_time">请选择来访时间 ></view>
  33. </uni-datetime-picker>
  34. </view>
  35. </view>
  36. <view class="body_box">
  37. <view class="box_key">
  38. <text class="key_icon">*</text>
  39. 来访结束时间
  40. </view>
  41. <view class="box_value">
  42. <uni-datetime-picker>
  43. <view class="value_time">请选择来访结束时间 ></view>
  44. </uni-datetime-picker>
  45. </view>
  46. </view>
  47. <!-- 证件号区域 -->
  48. <view class="body_box">
  49. <view class="box_key">
  50. <text class="key_icon">*</text>
  51. 证件号
  52. </view>
  53. <view class="box_value">
  54. <input class="value_input" type="text" placeholder="请输入访客证件号" placeholder-style="color:#CCCCCC;" />
  55. </view>
  56. </view>
  57. <!-- 访问事由区域 -->
  58. <view class="body_box">
  59. <view class="box_key">
  60. <text class="key_icon">*</text>
  61. 访问事由
  62. </view>
  63. <view class="box_value">
  64. <input class="value_input" type="text" placeholder="请输入访问事由" placeholder-style="color:#CCCCCC;" />
  65. </view>
  66. </view>
  67. <!-- 车牌号区域 -->
  68. <view class="body_box">
  69. <view class="box_key">车牌号</view>
  70. <view class="box_value">
  71. <input class="value_input" type="text" placeholder="(选填)驾车请填写车牌号" placeholder-style="color:#CCCCCC;" />
  72. </view>
  73. </view>
  74. <!-- 同行人数区域 -->
  75. <view class="body_box">
  76. <view class="box_key">同行人数</view>
  77. <view class="box_value">
  78. <input class="value_input" type="text" placeholder="请输入同行的人数" placeholder-style="color:#CCCCCC;" />
  79. <text class="value_text">人</text>
  80. </view>
  81. </view>
  82. <!-- 受访者姓名区域 -->
  83. <view class="body_box" v-if="type == 2">
  84. <view class="box_key">
  85. <text class="key_icon">*</text>
  86. 受访者姓名
  87. </view>
  88. <view class="box_value">
  89. <input class="value_input" type="text" placeholder="请输入受访者姓名" placeholder-style="color:#CCCCCC;" />
  90. </view>
  91. </view>
  92. <!-- 受访者电话区域 -->
  93. <view class="body_box" v-if="type == 2">
  94. <view class="box_key">
  95. <text class="key_icon">*</text>
  96. 受访者电话
  97. </view>
  98. <view class="box_value">
  99. <input class="value_input" type="text" placeholder="请输入受访者电话" placeholder-style="color:#CCCCCC;" />
  100. </view>
  101. </view>
  102. <!-- 选择受访学生区域 -->
  103. <view class="body_box no_border" v-if="type == 1">
  104. <view class="box_key">
  105. <text class="key_icon">*</text>
  106. 选择受访学生(可多选)
  107. </view>
  108. </view>
  109. <!-- 学生列表区域 -->
  110. <view class="student_list" v-if="type == 1">
  111. <!-- 每一个学生区域 -->
  112. <view class="student" v-for="item in list" :key="item.id" @click="handleClick(item)">
  113. <radio class="student_checked" color="#0061FF" :checked="item.isChecked" />
  114. <view class="student_info">{{ item.name }}({{ item.number }})</view>
  115. </view>
  116. </view>
  117. </view>
  118. <!-- 授权区域 -->
  119. <label class="auth" @click="handleAuth">
  120. <radio style="transform: scale(0.5)" color="#0061FF" :checked="authValue" />
  121. <text class="auth_text">同意授权证件号用于访客身份的验证</text>
  122. </label>
  123. <!-- 按钮区域 -->
  124. <view class="btn" :class="{ active: authValue }">访客预约</view>
  125. </view>
  126. </template>
  127. <script setup>
  128. import { ref } from 'vue'
  129. import { onLoad } from '@dcloudio/uni-app'
  130. // 判断是哪种身份 1为学生家长 2为其他访客
  131. const type = ref('')
  132. // 是否授权
  133. const authValue = ref(false)
  134. // 受访学生列表数据
  135. const list = ref([
  136. {
  137. id: 1,
  138. name: '张三',
  139. number: '145225225425',
  140. isChecked: false
  141. },
  142. {
  143. id: 2,
  144. name: '李四',
  145. number: '145225225425',
  146. isChecked: true
  147. }
  148. ])
  149. onLoad((options) => {
  150. type.value = options.type
  151. })
  152. // 点击每一个学生回调
  153. const handleClick = (item) => {
  154. item.isChecked = !item.isChecked
  155. }
  156. // 点击授权radio时的回调
  157. const handleAuth = () => {
  158. authValue.value = !authValue.value
  159. }
  160. </script>
  161. <style lang="scss" scoped>
  162. .container {
  163. display: flex;
  164. flex-direction: column;
  165. min-height: 100vh;
  166. background-color: #f1f6fe;
  167. .body {
  168. margin-top: 20rpx;
  169. padding-left: 20rpx;
  170. background-color: #fff;
  171. .body_box {
  172. display: flex;
  173. justify-content: space-between;
  174. align-items: center;
  175. padding-right: 20rpx;
  176. height: 85rpx;
  177. font-size: 28rpx;
  178. border-bottom: 1rpx solid #e6e6e6;
  179. .box_key {
  180. .key_icon {
  181. color: #d43030;
  182. }
  183. }
  184. .box_value {
  185. display: flex;
  186. justify-content: flex-end;
  187. align-items: center;
  188. width: 50%;
  189. .value_input {
  190. text-align: end;
  191. }
  192. .value_text {
  193. margin-left: 20rpx;
  194. }
  195. .value_time {
  196. text-align: end;
  197. color: #cccccc;
  198. }
  199. }
  200. }
  201. .no_border {
  202. border: none;
  203. }
  204. .student_list {
  205. .student {
  206. display: flex;
  207. align-items: center;
  208. margin-bottom: 30rpx;
  209. width: 710rpx;
  210. height: 110rpx;
  211. border-radius: 18rpx;
  212. background-color: #f2f4f9;
  213. .student_checked {
  214. margin-left: 48rpx;
  215. }
  216. .student_info {
  217. margin-left: 53rpx;
  218. font-size: 32rpx;
  219. }
  220. }
  221. }
  222. }
  223. .auth {
  224. display: flex;
  225. align-items: center;
  226. margin: 20rpx 0 40rpx 20rpx;
  227. font-size: 24rpx;
  228. .auth_text {
  229. height: 35rpx;
  230. }
  231. }
  232. .btn {
  233. display: flex;
  234. justify-content: center;
  235. align-items: center;
  236. margin: 0 auto 100rpx;
  237. width: 710rpx;
  238. height: 100rpx;
  239. color: #fff;
  240. font-size: 32rpx;
  241. border-radius: 8rpx;
  242. background-color: #95b8e6;
  243. }
  244. .active {
  245. background-color: #0061ff;
  246. }
  247. }
  248. </style>