平安校园
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

index.vue 5.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <view style="padding: 0 30rpx;">
  3. <view class="header">
  4. <view style="padding-top: 44rpx;" class="headerContent">
  5. <u-avatar src="/static/image/test/test.png" size="180rpx"></u-avatar>
  6. <view class="right">
  7. <view class="name">
  8. 张云
  9. </view>
  10. <view class="des">
  11. <image src="/static/image/school.png" mode=""></image>
  12. 山西科技大学 | 校长
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="whiteCard">
  18. <view class="title">
  19. 个人信息
  20. </view>
  21. <u-cell title="账号" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false">
  22. <view slot="value" class="valueBox disabled">
  23. 543asd25a1
  24. </view>
  25. </u-cell>
  26. <u-cell title="姓名" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink
  27. @click="cellClick('修改姓名')">
  28. <view slot="value" class="valueBox">
  29. 杨云
  30. </view>
  31. </u-cell>
  32. <u-cell title="手机" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink
  33. @click="cellClick('修改手机号')">
  34. <view slot="value" class="valueBox">
  35. 18633460001
  36. </view>
  37. </u-cell>
  38. <u-cell title="昵称" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink
  39. @click="cellClick('设置昵称')">
  40. <view slot="value" class="valueBox">
  41. 未设置
  42. </view>
  43. </u-cell>
  44. <picker mode="date" :value="date" @change="dateChange">
  45. <u-cell title="出生日期" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink>
  46. <view slot="value" class="valueBox">
  47. {{date}}
  48. </view>
  49. </u-cell>
  50. </picker>
  51. </view>
  52. <view class="btn" @click="loginOut">
  53. 退出登录
  54. </view>
  55. <u-popup :show="show" mode="center" :round="10">
  56. <view class="popupInfo">
  57. <view class="title">
  58. {{this.action}}
  59. </view>
  60. <u--input v-model="inputValue" :customStyle="{height: '84rpx',boxSizing:'border-box'}" placeholder="请输入" border="surround" clearable></u--input>
  61. <view class="bottom">
  62. <view class="cancel" @click="cancel">
  63. 取消
  64. </view>
  65. <view class="confirm" @click="confirm">
  66. 确定
  67. </view>
  68. </view>
  69. </view>
  70. </u-popup>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. show: false,
  78. action: '',
  79. inputValue: '',
  80. date: '1990-06-15',
  81. }
  82. },
  83. mounted() {},
  84. methods: {
  85. cellClick(action) {
  86. this.action = action
  87. this.inputValue = ''
  88. this.show = true
  89. },
  90. confirm() {
  91. switch (this.action) {
  92. case '修改姓名':
  93. if (!this.inputValue) {
  94. this.TOAST('请输入姓名')
  95. return
  96. }
  97. break
  98. case '修改手机号':
  99. if (!this.inputValue) {
  100. this.TOAST('请输入手机号')
  101. return
  102. }
  103. if (!
  104. /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[1589]))\d{8}$/
  105. .test(this.inputValue)) {
  106. this.TOAST('请输入正确的手机号')
  107. return
  108. }
  109. break
  110. case '设置昵称':
  111. if (!this.inputValue) {
  112. this.TOAST('请输入昵称')
  113. return
  114. }
  115. break
  116. }
  117. },
  118. cancel() {
  119. this.show = false
  120. },
  121. dateChange(e) {
  122. this.date = e.detail.value
  123. },
  124. loginOut() {
  125. this.CONFIRM('您是否确认退出登录?').then(()=>{
  126. this.CLEAR_STORAGE()
  127. this.JUMP_TO('/pages/login')
  128. })
  129. }
  130. }
  131. }
  132. </script>
  133. <style scoped lang="scss">
  134. uni-page-body {
  135. /* #ifdef H5*/
  136. background-image: url('/static/image/mybgh5.png');
  137. /* #endif */
  138. /* #ifndef H5*/
  139. background-image: url('/static/image/mybg.png');
  140. /* #endif */
  141. background-position: top;
  142. background-size: 100% auto;
  143. background-repeat: no-repeat;
  144. }
  145. .header {
  146. /* #ifdef H5*/
  147. padding-top: 40rpx;
  148. /* #endif */
  149. /* #ifndef H5*/
  150. padding-top: 88rpx;
  151. /* #endif */
  152. color: #333;
  153. .headerContent {
  154. display: flex;
  155. }
  156. .right {
  157. flex: 1;
  158. padding-top: 24rpx;
  159. padding-left: 36rpx;
  160. .name {
  161. font-size: 46rpx;
  162. font-weight: 700;
  163. }
  164. .des {
  165. display: flex;
  166. font-size: 28rpx;
  167. margin-top: 30rpx;
  168. uni-image {
  169. width: 34rpx;
  170. height: 34rpx;
  171. margin-right: 12rpx;
  172. }
  173. }
  174. }
  175. }
  176. .whiteCard {
  177. background-color: #fff;
  178. border-radius: 20rpx;
  179. margin-top: 50rpx;
  180. // padding: 0 30rpx;
  181. .title {
  182. font-family: 'Alimama ShuHeiTi';
  183. font-weight: 700;
  184. color: #2388FF;
  185. font-size: 42rpx;
  186. line-height: 42rpx;
  187. padding: 60rpx 30rpx 30rpx;
  188. }
  189. }
  190. .u-cell {
  191. height: 90rpx;
  192. position: relative;
  193. &:not(&:last-child)::after {
  194. content: '';
  195. display: block;
  196. position: absolute;
  197. height: 1rpx;
  198. background-color: rgba(0, 0, 0, 0.1);
  199. width: calc(100% - 60rpx);
  200. left: 30rpx;
  201. bottom: 0rpx;
  202. }
  203. .valueBox {
  204. color: #333;
  205. font-size: 30rpx;
  206. font-weight: 700;
  207. &.disabled {
  208. font-weight: unset;
  209. }
  210. }
  211. }
  212. .btn {
  213. height: 98rpx;
  214. background-color: #fff;
  215. line-height: 98rpx;
  216. border-radius: 20rpx;
  217. text-align: center;
  218. color: #333;
  219. margin-top: 30rpx;
  220. font-size: 32rpx;
  221. }
  222. .popupInfo {
  223. padding: 30rpx 30rpx 0rpx;
  224. width: 540rpx;
  225. box-sizing: border-box;
  226. .title {
  227. font-size: 34rpx;
  228. font-weight: 700;
  229. text-align: center;
  230. margin-bottom: 30rpx;
  231. margin-top: 16rpx;
  232. }
  233. .bottom {
  234. margin-top: 30rpx;
  235. display: flex;
  236. line-height: 88rpx;
  237. border-top: 1rpx solid rgba(0, 0, 0, 0.1);
  238. margin-left: -30rpx;
  239. margin-right: -30rpx;
  240. position: relative;
  241. &::after {
  242. content: '';
  243. background-color: rgba(0, 0, 0, 0.1);
  244. display: block;
  245. position: absolute;
  246. width: 1rpx;
  247. height: 100%;
  248. left: 50%;
  249. top: 0;
  250. }
  251. &>* {
  252. width: 50%;
  253. text-align: center;
  254. color: #165DFF;
  255. font-weight: 32rpx;
  256. }
  257. }
  258. }
  259. </style>