personal_information - 副本.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  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" :key="item">
  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" :key="item">
  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. token:"",
  122. active: 1,
  123. info: {},
  124. // 头像随机色
  125. bgColor: [],
  126. };
  127. },
  128. onLoad() {
  129. // 设置头像
  130. for (let i = 0; i < 2; i++) {
  131. // 获取随机色
  132. let r = parseInt(Math.random() * 256)
  133. let g = parseInt(Math.random() * 256)
  134. let b = parseInt(Math.random() * 256)
  135. // ES6 字符串拼接
  136. // this.bgColor = `rgba(${r},${g},${b},0.3)`
  137. let color = "rgba(" + r + "," + g + "," + b + "," + 0.3 + ")"
  138. // console.log(color)
  139. this.bgColor.push(color)
  140. }
  141. // 初始化当前煤矿编码
  142. this.mine_code = uni.getStorageSync('mine_code')
  143. // 根据矿编码切换首页接口不同的请求基础路径
  144. switch (this.mine_code) {
  145. case 'ningdongyunying':
  146. this.base_url = "http://ningdongyunying.nxjiewei.com:8011/api"
  147. break;
  148. case 'meihuajing':
  149. this.base_url = "http://meihuajing.nxjiewei.com:8011/api"
  150. break;
  151. case 'zaoquan':
  152. this.base_url = "http://zaoquan.nxjiewei.com:8011/api"
  153. break;
  154. default:
  155. this.base_url = ""
  156. }
  157. this.token = "Bearer " + uni.getStorageSync('Authorization')
  158. this.get_info()
  159. },
  160. methods: {
  161. change_active(index) {
  162. this.active = index
  163. },
  164. // 绑定手机
  165. binding_phone() {
  166. uni.navigateTo({
  167. url: "../../my/setPhone/setPhone"
  168. })
  169. },
  170. // 手写签名
  171. go_signature() {
  172. uni.navigateTo({
  173. url: "../../my/signature/signature"
  174. })
  175. },
  176. get_info() {
  177. this.$api.user_getUinfo({
  178. staff_num: uni.getStorageSync('user').staff_num
  179. }).then((res) => {
  180. console.log(res.data.data)
  181. this.info = res.data.data
  182. })
  183. },
  184. add(){
  185. uni.chooseImage({
  186. count: 1,
  187. success: (chooseImageRes) => {
  188. const tempFilePaths = chooseImageRes.tempFilePaths;
  189. console.log(chooseImageRes.tempFiles[0]);
  190. console.log(tempFilePaths)
  191. // uni.uploadFile({
  192. // url: this.base_url + "/worksheet/design/up_images",
  193. // header: {
  194. // 'Authorization': this.token
  195. // },
  196. // filePath: tempFilePaths[0],
  197. // formData: {
  198. // image: chooseImageRes.tempFiles[0]
  199. // },
  200. // success: (uploadFileRes) => {
  201. // console.log(uploadFileRes);
  202. // console.log(uploadFileRes.data);
  203. // // console.log(JSON.parse(uploadFileRes.data));
  204. // }
  205. // })
  206. }
  207. })
  208. }
  209. }
  210. }
  211. </script>
  212. <style lang="scss">
  213. page {
  214. background-color: #F5F8F8;
  215. }
  216. .top {
  217. background-color: #FFFFFF;
  218. width: 750rpx;
  219. height: 440rpx;
  220. background-image: url(./icon/top.png);
  221. background-size: 100% 100%;
  222. background-position: 0 -110rpx;
  223. background-repeat: no-repeat;
  224. .avatar {
  225. padding-top: 34rpx;
  226. text-align: center;
  227. image {
  228. width: 200rpx;
  229. height: 200rpx;
  230. border-radius: 50%;
  231. }
  232. }
  233. .info {
  234. margin-top: 20rpx;
  235. .name {
  236. text-align: center;
  237. font-size: 40rpx;
  238. font-weight: 700;
  239. }
  240. .box {
  241. margin-top: 30rpx;
  242. display: flex;
  243. justify-content: space-around;
  244. .item {
  245. width: 250rpx;
  246. text-align: center;
  247. .label {
  248. font-size: 30rpx;
  249. color: #009FE8;
  250. margin-bottom: 10rpx;
  251. }
  252. .text {
  253. font-size: 32rpx;
  254. }
  255. }
  256. }
  257. }
  258. margin-bottom: 20rpx;
  259. }
  260. .content {
  261. background-color: #FFFFFF;
  262. .box {
  263. display: flex;
  264. justify-content: space-around;
  265. align-items: center;
  266. border-bottom: 2rpx solid #F5F8F8;
  267. .item {
  268. height: 95rpx;
  269. width: 230rpx;
  270. text-align: center;
  271. position: relative;
  272. .text {
  273. font-size: 34rpx;
  274. line-height: 95rpx;
  275. }
  276. .line {
  277. margin: -6rpx auto 0;
  278. width: 80rpx;
  279. height: 6rpx;
  280. background-color: #009FE8;
  281. }
  282. }
  283. }
  284. .list_1 {
  285. box-sizing: border-box;
  286. padding: 0 50rpx;
  287. .item {
  288. border-bottom: 2rpx solid #F5F8F8;
  289. height: 95rpx;
  290. display: flex;
  291. justify-content: space-between;
  292. align-items: center;
  293. font-size: 32rpx;
  294. .label {
  295. width: 200rpx;
  296. text-align: left;
  297. }
  298. .text {
  299. width: 350rpx;
  300. text-align: left;
  301. color: #8e8e8e;
  302. }
  303. .right {
  304. width: 100rpx;
  305. text-align: right;
  306. }
  307. }
  308. }
  309. .list_2 {
  310. box-sizing: border-box;
  311. padding: 0 50rpx;
  312. .item {
  313. border-bottom: 2rpx solid #F5F8F8;
  314. height: 95rpx;
  315. display: flex;
  316. justify-content: space-between;
  317. align-items: center;
  318. font-size: 30rpx;
  319. text-align: center;
  320. color: #8e8e8e;
  321. .text_1 {
  322. width: 190rpx;
  323. }
  324. .text_2 {
  325. width: 240rpx;
  326. }
  327. .text_3 {
  328. width: 160rpx;
  329. }
  330. }
  331. .item:first-child {
  332. font-size: 32rpx;
  333. color: #333;
  334. }
  335. }
  336. .list_3 {
  337. box-sizing: border-box;
  338. padding: 50rpx;
  339. overflow: hidden;
  340. .item {
  341. float: left;
  342. margin-right: 25rpx;
  343. margin-bottom: 30rpx;
  344. width: 200rpx;
  345. text-align: center;
  346. .img{
  347. image{
  348. width: 200rpx;
  349. height: 140rpx;
  350. }
  351. .add{
  352. font-size: 110rpx;
  353. color: #DCDCDC;
  354. text-align: center;
  355. height: 140rpx;
  356. line-height: 140rpx;
  357. background-color: #EEEEEE;
  358. }
  359. }
  360. .text{
  361. width: 180rpx;
  362. font-size: 24rpx;
  363. color: #8e8e8e;
  364. }
  365. }
  366. .item:nth-child(3n){
  367. margin-right: 0;
  368. }
  369. }
  370. }
  371. </style>