移动端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

204 rindas
5.3 KiB

  1. <template>
  2. <div class="home_wrapper">
  3. <div class="header_main">
  4. 个人信息
  5. <div class="return_btn" @click="onClickLeft"></div>
  6. <div class="add_btn" @click="send">保存</div>
  7. </div>
  8. <van-form @submit="onSubmit" ref="formData">
  9. <div class="list_main">
  10. <van-field required label="用户昵称" :rules="[{ required: true , message:'请输入用户昵称' }]" v-model="user.nickName" placeholder="请输入用户昵称" input-align="right" :border="false" />
  11. <van-field required label="手机号码" :rules="[{ required: true , message:'请输入手机号码'},{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/ , message:'请输入手机号码'}]" v-model="user.phonenumber" placeholder="请输入手机号码" input-align="right" :border="false" />
  12. <van-field required label="邮箱" :rules="[{ required: true, message: '邮箱地址不能为空' }]" prop="email" v-model="user.email" placeholder="请输入邮箱" input-align="right" :border="false" />
  13. <van-field name="radio" label="性别" input-align="right" :border="false">
  14. <template #input>
  15. <van-radio-group v-model="user.sex" direction="horizontal">
  16. <van-radio name="0">男</van-radio>
  17. <van-radio name="1">女</van-radio>
  18. </van-radio-group>
  19. </template>
  20. </van-field>
  21. </div>
  22. <!-- <div style="margin: 16px;">-->
  23. <!-- <van-button round block type="primary" native-type="submit">-->
  24. <!-- 保存-->
  25. <!-- </van-button>-->
  26. <!-- </div>-->
  27. </van-form>
  28. </div>
  29. </template>
  30. <script>
  31. import { addOddjob , getUserProfile , updateUserProfile } from "@/api/sunVillage_info/fixedAssets";
  32. import Cookies from "js-cookie";
  33. import request from '@/utils/request'
  34. export default {
  35. name: "certificateList",
  36. data() {
  37. return {
  38. user:{
  39. sex:0
  40. },
  41. };
  42. },
  43. created() {
  44. this.getUser();
  45. },
  46. methods: {
  47. getUser() {
  48. getUserProfile().then(response => {
  49. this.user = response.data;
  50. });
  51. },
  52. send(){
  53. this.$refs.formData.submit();
  54. },
  55. onSubmit(){
  56. var that = this;
  57. updateUserProfile(this.user).then(response => {
  58. that.$notify({ type: 'success', message: '修改成功!' });
  59. setTimeout(function(){
  60. history.back(-1);
  61. },2000)
  62. });
  63. },
  64. onConfirmOpenNy(data){
  65. this.form.jobTime = this.format(data,'yyyy-MM-dd');
  66. this.jobTime = data;
  67. this.showBuildTime = false;
  68. },
  69. },
  70. }
  71. </script>
  72. <style scoped lang="scss">
  73. .home_wrapper{
  74. background: #e9e9e9;
  75. min-height: 100vh;
  76. width: 100vw;
  77. .header_main {
  78. height: 116px;
  79. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  80. background-size: 100% 100%;
  81. position: fixed;
  82. top: 0;
  83. left: 0;
  84. width: 100%;
  85. font-size: 36px;
  86. line-height: 116px;
  87. text-align: center;
  88. color: #fff;
  89. position: relative;
  90. .return_btn {
  91. width: 24px;
  92. height: 43.2px;
  93. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  94. background-size: 20px 36px;
  95. position: absolute;
  96. left: 38px;
  97. top: 36px;
  98. }
  99. .add_btn{
  100. height: 40.8px;
  101. font-size: 14PX;
  102. position: absolute;
  103. right: 38px;
  104. top: 36px;
  105. line-height: 40.8px;
  106. }
  107. }
  108. .release_head{
  109. height: 90px;
  110. padding:0 23px;
  111. display: flex;
  112. align-items: center;
  113. font-size: 26px;
  114. color: #929292;
  115. .people{
  116. flex: 1;
  117. display: flex;
  118. align-items: center;
  119. .icon{
  120. width: 24px;
  121. height: 21px;
  122. background: url('../../assets/images/sunVillage_info/details_icon_1.png') no-repeat;
  123. background-size: 100% 100%;
  124. display: block;
  125. margin-right: 8px;
  126. }
  127. }
  128. .time{
  129. flex: 1;
  130. display: flex;
  131. align-items: center;
  132. justify-content:flex-end;
  133. .icon{
  134. width: 25px;
  135. height: 25px;
  136. background: url('../../assets/images/sunVillage_info/details_icon_2.png') no-repeat;
  137. background-size: 100% 100%;
  138. display: block;
  139. margin-right: 8px;
  140. }
  141. }
  142. }
  143. .release_conetnt{
  144. padding:0 22px;
  145. font-size: 32px;
  146. color: #252525;
  147. line-height: 44px;
  148. img{
  149. max-width: 100%;
  150. margin-bottom: 16px;
  151. }
  152. p{
  153. margin-bottom: 16px;
  154. }
  155. }
  156. .list_main{
  157. padding:25px;
  158. background: #ffffff;
  159. width: 94%;
  160. margin: 25px auto 0;
  161. border-radius: 15PX;
  162. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  163. }
  164. .titBox{
  165. display: flex;
  166. align-items: center;
  167. }
  168. .tit{
  169. font-size: 36px;
  170. font-weight: bold;
  171. }
  172. /deep/ .van-cell{
  173. padding-left: 0!important;
  174. padding-right: 0!important;
  175. padding-bottom: 0!important;
  176. &:first-child{
  177. padding-top: 0;
  178. }
  179. }
  180. /deep/ .van-field__label{
  181. padding-left: 10PX;
  182. width: auto;
  183. display: flex;
  184. align-items: center;
  185. }
  186. /deep/ .van-cell--required::before{
  187. left: 0PX;
  188. }
  189. /deep/ .van-field__error-message{
  190. display: none;
  191. }
  192. }
  193. </style>