index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="app-content">
  3. <view class="header"><view class="log" @tap="clickOrder"></view>{{ navname }}<view class="up">完成</view></view>
  4. <view class="cont">
  5. <view class="photograph">
  6. <!-- <view class="log" @click="clk(0)"></view> -->
  7. <!-- <image :src="urls[0]" @click="clk(0)"></image>
  8. <image :src="urls[1]" @click="clk(1)"></image> -->
  9. <!-- <button @click="clk(0)">按钮触发</button> -->
  10. <avatar selWidth="200px" selHeight="400upx" @upload="myUpload" :avatarSrc="url"
  11. avatarStyle="width: 200upx; height: 200upx; border-radius: 100%;"></avatar>
  12. </view>
  13. </view>
  14. <view class="content">
  15. <view class="list">
  16. <p>名称</p>
  17. <input class="input" name="yonghuming" type="text" value="" placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);" placeholder="请输入名称" />
  18. </view>
  19. <view class="list">
  20. <p>工号</p>
  21. <input class="input" name="yonghuming" type="text" value="" placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);" placeholder="请输入工号" />
  22. </view>
  23. </view>
  24. <view class="butele">退出登录</view>
  25. </view>
  26. </template>
  27. <script>
  28. import Nav from '../../components/header/nav.vue'
  29. import avatar from "../../components/yq-avatar/yq-avatar.vue";
  30. export default {
  31. data() {
  32. return {
  33. navname: '个人信息',
  34. url: []
  35. }
  36. },
  37. created(option) {
  38. },
  39. onLoad(){
  40. },
  41. onUnload() {
  42. },
  43. onShow() {
  44. },
  45. mounted() {
  46. },
  47. components: {
  48. Nav,
  49. avatar
  50. },
  51. methods: {
  52. clickOrder () {
  53. uni.switchTab({
  54. url: "/pages/mypage/index"
  55. })
  56. },
  57. myUpload(rsp) {
  58. this.$set(this.urls, rsp.index, rsp.path);
  59. },
  60. clk(index) {
  61. this.$refs.avatar.fChooseImg(index,{
  62. selWidth: "300upx", selHeight: "300upx",
  63. expWidth: '260upx', expHeight: '260upx'
  64. });
  65. },
  66. myUpload(rsp) {
  67. this.url = rsp.path; //更新头像方式一
  68. //rsp.avatar.imgSrc = rsp.path; //更新头像方式二
  69. }
  70. },
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .app-content{
  75. >.header{
  76. width: 100%;
  77. height: 4.375rem;
  78. display: flex;
  79. justify-content: center;
  80. align-items: center;
  81. // background: rgba(49,85,99,1);
  82. color: rgb(16, 17, 22);
  83. font-family: Noto Sans SC;
  84. font-size: 1rem;
  85. position: relative;
  86. >.log{
  87. width: .375rem;
  88. height: .75rem;
  89. font-size: .75rem;
  90. position: absolute;
  91. left: 1.5rem;
  92. background: url('../../static/ico@1x.png') no-repeat;
  93. background-size: 100% 100%;
  94. }
  95. >.up{
  96. position: absolute;
  97. right: 1.5rem;
  98. color: rgb(37, 121, 160);
  99. font-family: Noto Sans SC;
  100. font-size: .875rem;
  101. font-weight: 500;
  102. }
  103. }
  104. >.cont{
  105. >.photograph{
  106. width: 6rem;
  107. height: 6rem;
  108. background: rgb(197, 207, 211);
  109. // background: red;
  110. border-radius: 50%;
  111. margin: 0 auto;
  112. margin-top: .625rem;
  113. display: flex;
  114. align-items: center;
  115. justify-content: center;
  116. >.log{
  117. width: 1.75rem;
  118. height: 1.75rem;
  119. background: url('../../static/shi.png') no-repeat;
  120. background-size: 100% 100%;
  121. }
  122. }
  123. }
  124. >.content{
  125. margin-left: 1.5rem;
  126. margin-top: 2.125rem;
  127. margin-bottom: 3rem;
  128. >.list{
  129. height: 3.375rem;
  130. display: flex;
  131. align-items: center;
  132. border-bottom: 1px solid rgb(238, 238, 238);
  133. >p{
  134. color: rgb(0, 0, 0);
  135. font-family: Noto Sans SC;
  136. font-size: .8125rem;
  137. font-weight: 500;
  138. margin-right: 2.1875rem;
  139. }
  140. }
  141. }
  142. >.butele{
  143. width: 20.5625rem;
  144. height: 2.75rem;
  145. background: linear-gradient(165.96deg, rgba(248.17,101.23,53.02,1) -34%,rgba(231.09,13.66,13.66,1) 166%);
  146. border-radius: 4px;
  147. margin: 0 auto;
  148. display: flex;
  149. align-items: center;
  150. justify-content: center;
  151. color: rgb(255, 255, 255);
  152. font-family: Noto Sans SC;
  153. font-size: 1rem;
  154. font-weight: 700;
  155. }
  156. }
  157. </style>