personal_information.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <template>
  2. <view>
  3. <view class="top">
  4. <view class="avatar">
  5. <image v-if="info.avatar" :src="info.avatar" mode="aspectFill"></image>
  6. <view class="avatar" v-if="!info.avatar && !info" :style="{backgroundColor:bgColor[1]}">
  7. {{info.name.split('').pop()}}
  8. </view>
  9. </view>
  10. <view class="info">
  11. <view class="name">{{info.name}}</view>
  12. <view class="box">
  13. <view class="item">
  14. <view class="label">部门</view>
  15. <view class="text">{{info.section_fullname}}</view>
  16. </view>
  17. <view class="item">
  18. <view class="label">职务</view>
  19. <view class="text">{{info.duty_num}}</view>
  20. </view>
  21. <view class="item">
  22. <view class="label">员工编号</view>
  23. <view class="text">{{info.staff_num}}</view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="content">
  29. <view class="box">
  30. <view class="item" @click="change_active(1)">
  31. <view class="text" :style="{color:active == 1?'#333':'#8e8e8e'}">个人信息</view>
  32. <view class="line" v-if="active == 1"></view>
  33. </view>
  34. <view class="item" @click="change_active(2)">
  35. <view class="text" :style="{color:active == 2?'#333':'#8e8e8e'}">工作经历</view>
  36. <view class="line" v-if="active == 2"></view>
  37. </view>
  38. <view class="item" @click="change_active(3)">
  39. <view class="text" :style="{color:active == 3?'#333':'#8e8e8e'}">荣誉及证书</view>
  40. <view class="line" v-if="active == 3"></view>
  41. </view>
  42. </view>
  43. <!-- 个人信息 -->
  44. <view class="list_1" v-if="active == 1">
  45. <view class="item" @click="binding_phone()">
  46. <view class="label">手机号</view>
  47. <view class="text">12345678</view>
  48. <view class="right">
  49. <uni-icons type="arrowright" size="20" color="#999"></uni-icons>
  50. </view>
  51. </view>
  52. <view class="item" @click="go_signature()">
  53. <view class="label">手写签名</view>
  54. <view class="text"> </view>
  55. <view class="right">
  56. <uni-icons type="arrowright" size="20" color="#999"></uni-icons>
  57. </view>
  58. </view>
  59. <view class="item">
  60. <view class="label">岗位分类</view>
  61. <view class="text">{{info.job_classify}}</view>
  62. <view class="right"></view>
  63. </view>
  64. <!-- <view class="item">
  65. <view class="label">岗位</view>
  66. <view class="text">{{info.position.title}}</view>
  67. <view class="right"></view>
  68. </view> -->
  69. <view class="item">
  70. <view class="label">民族</view>
  71. <view class="text">{{info.nation}}</view>
  72. <view class="right"></view>
  73. </view>
  74. <view class="item">
  75. <view class="label">出生日期</view>
  76. <view class="text">{{info.birthday}}</view>
  77. <view class="right"></view>
  78. </view>
  79. </view>
  80. <!-- 工作经历 -->
  81. <view class="list_2" v-if="active == 2">
  82. <view class="item">
  83. <view class="text_1">任职时间</view>
  84. <view class="text_2">工作单位</view>
  85. <view class="text_3">职务</view>
  86. </view>
  87. <view class="item" v-for="item in 3">
  88. <view class="text_1">2008-06-23至1010-05-14</view>
  89. <view class="text_2">公司名称公司名称公司名称</view>
  90. <view class="text_3">工程师</view>
  91. </view>
  92. </view>
  93. <!-- 荣誉及证书 -->
  94. <view class="list_3" v-if="active == 3">
  95. <view class="item" v-for="item in 4">
  96. <view class="img">
  97. <image
  98. src="https://cdn.colorhub.me/7X-46x4lrKMmT8Tyo5qNMRFN0p1R-nMEzlYx-XvdZiw/rs:auto:280:0:0/g:ce/bG9jYWw6Ly8vMTgv/NzUvOGFkNWU4NmZj/Mzc2NWJjYTBiYzAw/YTY1N2JiNWE5ZmMz/MjAyMTg3NS5qcGc.jpg"
  99. mode="aspectFill"></image>
  100. </view>
  101. <view class="text">奖项名称奖项名称奖项名称</view>
  102. </view>
  103. <view class="item">
  104. <view class="img">
  105. <view class="add" @click="add()">+</view>
  106. </view>
  107. <view class="text"></view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. </template>
  113. <script>
  114. export default {
  115. data() {
  116. return {
  117. // 当前煤矿编码
  118. mine_code: "",
  119. // 基础请求路径
  120. base_url: " ",
  121. active: 1,
  122. info: {},
  123. // 头像随机色
  124. bgColor: [],
  125. };
  126. },
  127. onLoad() {
  128. // 设置头像
  129. for (let i = 0; i < 2; i++) {
  130. // 获取随机色
  131. let r = parseInt(Math.random() * 256)
  132. let g = parseInt(Math.random() * 256)
  133. let b = parseInt(Math.random() * 256)
  134. // ES6 字符串拼接
  135. // this.bgColor = `rgba(${r},${g},${b},0.3)`
  136. let color = "rgba(" + r + "," + g + "," + b + "," + 0.3 + ")"
  137. // console.log(color)
  138. this.bgColor.push(color)
  139. }
  140. // 初始化当前煤矿编码
  141. this.mine_code = uni.getStorageSync('mine_code')
  142. // 根据矿编码切换首页接口不同的请求基础路径
  143. switch (this.mine_code) {
  144. case 'ningdongyunying':
  145. this.base_url = "http://ningdongyunying.nxjiewei.com:8011/api"
  146. break;
  147. case 'meihuajing':
  148. this.base_url = "http://meihuajing.nxjiewei.com:8011/api"
  149. break;
  150. case 'zaoquan':
  151. this.base_url = "http://zaoquan.nxjiewei.com:8011/api"
  152. break;
  153. default:
  154. this.base_url = ""
  155. }
  156. this.get_info()
  157. },
  158. methods: {
  159. change_active(index) {
  160. this.active = index
  161. },
  162. // 绑定手机
  163. binding_phone() {
  164. uni.navigateTo({
  165. url: "../../my/setPhone/setPhone"
  166. })
  167. },
  168. // 手写签名
  169. go_signature() {
  170. uni.navigateTo({
  171. url: "../../my/signature/signature"
  172. })
  173. },
  174. get_info() {
  175. this.$api.user_getUinfo({
  176. staff_num: uni.getStorageSync('user').staff_num
  177. }).then((res) => {
  178. console.log(res.data.data)
  179. this.info = res.data.data
  180. })
  181. },
  182. add(){
  183. uni.chooseImage({
  184. count: 1,
  185. success: (chooseImageRes) => {
  186. const tempFilePaths = chooseImageRes.tempFilePaths;
  187. console.log(chooseImageRes.tempFiles[0]);
  188. }
  189. })
  190. }
  191. }
  192. }
  193. </script>
  194. <style lang="scss">
  195. page {
  196. background-color: #F5F8F8;
  197. }
  198. .top {
  199. background-color: #FFFFFF;
  200. width: 750rpx;
  201. height: 440rpx;
  202. background-image: url(./icon/top.png);
  203. background-size: 100% 100%;
  204. background-position: 0 -110rpx;
  205. background-repeat: no-repeat;
  206. .avatar {
  207. padding-top: 34rpx;
  208. text-align: center;
  209. image {
  210. width: 200rpx;
  211. height: 200rpx;
  212. border-radius: 50%;
  213. }
  214. }
  215. .info {
  216. margin-top: 20rpx;
  217. .name {
  218. text-align: center;
  219. font-size: 40rpx;
  220. font-weight: 700;
  221. }
  222. .box {
  223. margin-top: 30rpx;
  224. display: flex;
  225. justify-content: space-around;
  226. .item {
  227. width: 250rpx;
  228. text-align: center;
  229. .label {
  230. font-size: 30rpx;
  231. color: #009FE8;
  232. margin-bottom: 10rpx;
  233. }
  234. .text {
  235. font-size: 32rpx;
  236. }
  237. }
  238. }
  239. }
  240. margin-bottom: 20rpx;
  241. }
  242. .content {
  243. background-color: #FFFFFF;
  244. .box {
  245. display: flex;
  246. justify-content: space-around;
  247. align-items: center;
  248. border-bottom: 2rpx solid #F5F8F8;
  249. .item {
  250. height: 95rpx;
  251. width: 230rpx;
  252. text-align: center;
  253. position: relative;
  254. .text {
  255. font-size: 34rpx;
  256. line-height: 95rpx;
  257. }
  258. .line {
  259. margin: -6rpx auto 0;
  260. width: 80rpx;
  261. height: 6rpx;
  262. background-color: #009FE8;
  263. }
  264. }
  265. }
  266. .list_1 {
  267. box-sizing: border-box;
  268. padding: 0 50rpx;
  269. .item {
  270. border-bottom: 2rpx solid #F5F8F8;
  271. height: 95rpx;
  272. display: flex;
  273. justify-content: space-between;
  274. align-items: center;
  275. font-size: 32rpx;
  276. .label {
  277. width: 200rpx;
  278. text-align: left;
  279. }
  280. .text {
  281. width: 350rpx;
  282. text-align: left;
  283. color: #8e8e8e;
  284. }
  285. .right {
  286. width: 100rpx;
  287. text-align: right;
  288. }
  289. }
  290. }
  291. .list_2 {
  292. box-sizing: border-box;
  293. padding: 0 50rpx;
  294. .item {
  295. border-bottom: 2rpx solid #F5F8F8;
  296. height: 95rpx;
  297. display: flex;
  298. justify-content: space-between;
  299. align-items: center;
  300. font-size: 30rpx;
  301. text-align: center;
  302. color: #8e8e8e;
  303. .text_1 {
  304. width: 190rpx;
  305. }
  306. .text_2 {
  307. width: 240rpx;
  308. }
  309. .text_3 {
  310. width: 160rpx;
  311. }
  312. }
  313. .item:first-child {
  314. font-size: 32rpx;
  315. color: #333;
  316. }
  317. }
  318. .list_3 {
  319. box-sizing: border-box;
  320. padding: 50rpx;
  321. overflow: hidden;
  322. .item {
  323. float: left;
  324. margin-right: 25rpx;
  325. margin-bottom: 30rpx;
  326. width: 200rpx;
  327. text-align: center;
  328. .img{
  329. image{
  330. width: 200rpx;
  331. height: 140rpx;
  332. }
  333. .add{
  334. font-size: 110rpx;
  335. color: #DCDCDC;
  336. text-align: center;
  337. height: 140rpx;
  338. line-height: 140rpx;
  339. background-color: #EEEEEE;
  340. }
  341. }
  342. .text{
  343. width: 180rpx;
  344. font-size: 24rpx;
  345. color: #8e8e8e;
  346. }
  347. }
  348. .item:nth-child(3n){
  349. margin-right: 0;
  350. }
  351. }
  352. }
  353. </style>