personal-information.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <view>
  3. <view class="uni-list">
  4. <view class="uni-list-cell">
  5. <view class="uni-list-cell-left">
  6. 姓名<text>*</text>
  7. </view>
  8. <view class="uni-list-cell-db" @click="getStudentInformation()">
  9. <view class="uni-input">{{name}}</view>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="uni-list">
  14. <view class="uni-list-cell">
  15. <view class="uni-list-cell-left">
  16. 性别<text>*</text>
  17. </view>
  18. <view class="uni-list-cell-db" @click="getStudentInformation()">
  19. <!-- <picker @change="bindPickerChange" :value="index" :range="array"> -->
  20. <view class="uni-input">{{studentSex}}</view> <!-- <image src="../../static/右箭头.svg" mode=""> -->
  21. <!-- </picker> -->
  22. </view>
  23. </view>
  24. </view>
  25. <view class="uni-list">
  26. <view class="uni-list-cell">
  27. <view class="uni-list-cell-left">
  28. 手机号<text>*</text>
  29. </view>
  30. <view class="uni-list-cell-db">
  31. <!-- <picker @change="bindPickerChange" :value="index" :range="array"> -->
  32. <view class="uni-input">{{studentPhone}}</view> <!-- <image src="../../static/右箭头.svg" mode=""> -->
  33. <!-- </picker> -->
  34. </view>
  35. </view>
  36. </view>
  37. <view class="uni-list">
  38. <view class="uni-list-cell">
  39. <view class="uni-list-cell-left">
  40. 备选手机号<text>*</text>
  41. </view>
  42. <view class="uni-list-cell-db">
  43. <view class="uni-input">{{studentOtherPhone}}</view> <!-- <image src="../../static/右箭头.svg" mode=""> -->
  44. </view>
  45. </view>
  46. </view>
  47. <view class="uni-list">
  48. <view class="cuni-list-cell">
  49. <view class="uni-list-cell-left">
  50. 学生宿舍<text>*</text>
  51. </view>
  52. <view class="uni-list-cell-db">
  53. <view class="uni-input"><!-- {{multiArray[0][multiIndex[0]]}}{{multiArray[1][multiIndex[1]]}}{{multiArray[2][multiIndex[2]]}} -->
  54. {{studentDormitory}}
  55. <!-- <image src="../../static/右箭头.svg" mode=""> -->
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="uni-list">
  61. <view class="uni-list-cell">
  62. <view class="uni-list-cell-left">
  63. 学生校区<text>*</text>
  64. </view>
  65. <view class="uni-list-cell-db">
  66. <!-- <picker @change="bindPickerChange" :value="index" :range="array"> -->
  67. <view class="uni-input">{{school[index]}}</view> <!-- <image src="../../static/右箭头.svg" mode=""> -->
  68. <!-- </picker> -->
  69. </view>
  70. </view>
  71. </view>
  72. <button @click="getInformation()" type="default" style="position: absolute;top:345px;left: 24px;width: 328px;height: 47px;color: white;background-color: rgba(42, 130, 228, 1);">确认</button>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. name:'',
  80. studentSex:'',
  81. studentPhone:'',
  82. studentOtherPhone:'',
  83. studentDormitory:'',
  84. school:['黄家湖','墨轩湖'],
  85. index:0,
  86. homeUrl:"https://jtishfw.ncjti.edu.cn/baoxiu/repairApi"
  87. }
  88. },
  89. onLoad() {
  90. this.getStudentInformation()
  91. },
  92. methods: {
  93. getStudentInformation(){
  94. let that = this;
  95. uni.getStorage({
  96. key: 'student',
  97. success: function (result) {
  98. console.log('这是获取key中的内容',result)
  99. console.log(result.data.studentName)
  100. that.name = result.data.studentName
  101. console.log(result.data.studentSex)
  102. that.studentSex = result.data.studentSex
  103. console.log(that.studentSex)
  104. if(that.studentSex == 0){
  105. that.studentSex = '男'
  106. }else{
  107. that.studentSex = '女'
  108. }
  109. that.studentPhone = result.data.studentPhone
  110. that.studentOtherPhone = result.data.studentOtherPhone
  111. that.studentDormitory = result.data.studentDormitory
  112. }
  113. })
  114. that.name = that.name
  115. that.studentSex = that.studentSex
  116. that.studentPhone = that.studentPhone
  117. that.studentOtherPhone = that.studentOtherPhone
  118. that.studentDormitory = that.studentDormitory
  119. },
  120. bindPickerChange: function(e) {
  121. console.log('picker发送选择改变,携带值为', e.target.value)
  122. this.index = e.target.value
  123. },
  124. async getInformation(){
  125. this.$https.post(`${this.homeUrl}/student/queryByID`)
  126. .then(result=>{
  127. console.log(result.data)
  128. uni.reLaunch({
  129. url:'../index/index'
  130. })
  131. },err=>{})
  132. },
  133. }
  134. }
  135. </script>
  136. <style>
  137. .uni-list-cell-left{
  138. float: left;
  139. width: 22%;
  140. height: 47px;
  141. text-align: center;
  142. font-size: 14px;
  143. border-bottom: 1px solid rgba(200, 200, 205, 1);
  144. line-height: 47px;
  145. }
  146. .uni-list-cell-left text{
  147. color: red;
  148. }
  149. .uni-list-cell-db{
  150. float: right;
  151. width: 78%;
  152. height: 47px;
  153. border-bottom: 1px solid rgba(200, 200, 205, 1);
  154. }
  155. .uni-list-cell-db .name{
  156. float: right;
  157. }
  158. .uni-list{
  159. position: relative;
  160. font-size: 14px;
  161. }
  162. .uni-list-cell-db input{
  163. height: 47px;
  164. width: 78%;
  165. text-align: center;
  166. line-height: 47px;
  167. font-size: 14px;
  168. }
  169. .uni-list-cell-db .uni-input{
  170. float: right;
  171. margin-right: 36px;
  172. text-align: center;
  173. line-height: 47px;
  174. }
  175. .uni-list-cell-db uni-image{
  176. position: absolute;
  177. width: 26px;
  178. height: 26px;
  179. right: 3px;
  180. top:11px;
  181. }
  182. button{
  183. position: absolute;
  184. top:345px;
  185. left: 24px;
  186. width: 328px;
  187. height: 47px;
  188. color: white;
  189. }
  190. </style>