social.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <div class="info">
  3. <header>
  4. <h5>专业社区影响力</h5>
  5. </header>
  6. <div class="edit">
  7. <el-form ref="form" :rules="rules" :model="social" label-width="130px">
  8. <div class="line">
  9. <img
  10. class="prefix-icon"
  11. src="~@/assets/img/sign/github.png"
  12. srcset="~@/assets/img/sign/github@2x.png"
  13. alt="github"
  14. />
  15. <el-form-item label="Github" prop="github">
  16. <el-input placeholder="请输入需绑定账号用户名" v-model="social.github"></el-input>
  17. </el-form-item>
  18. <span class="opts">
  19. <el-button type="info" @click="handleCancel('github')">取消</el-button>
  20. <el-button type="primary" @click="onSubmit('github')">确认</el-button>
  21. </span>
  22. </div>
  23. <div class="line">
  24. <img
  25. class="prefix-icon"
  26. src="~@/assets/img/sign/zhihu.png"
  27. srcset="~@/assets/img/sign/zhihu@2x.png"
  28. alt="zhihu"
  29. />
  30. <el-form-item label="知乎" prop="zhihu">
  31. <el-input placeholder="请输入需绑定账号用户名" v-model="social.zhihu"></el-input>
  32. </el-form-item>
  33. <span class="opts">
  34. <el-button type="info" @click="handleCancel('zhihu')">取消</el-button>
  35. <el-button type="primary" @click="onSubmit('zhihu')">确认</el-button>
  36. </span>
  37. </div>
  38. <div class="line">
  39. <img
  40. class="prefix-icon"
  41. src="~@/assets/img/sign/stackoverflow.png"
  42. srcset="~@/assets/img/sign/stackoverflow@2x.png"
  43. alt="stackoverflow"
  44. />
  45. <el-form-item label="StackOverflow" prop="stackoverflow">
  46. <el-input placeholder="请输入需绑定账号用户名" v-model="social.stackoverflow"></el-input>
  47. </el-form-item>
  48. <span class="opts">
  49. <el-button type="info" @click="handleCancel('stackoverflow')">取消</el-button>
  50. <el-button type="primary" @click="onSubmit('stackoverflow')">确认</el-button>
  51. </span>
  52. </div>
  53. <div class="line">
  54. <img
  55. class="prefix-icon"
  56. src="~@/assets/img/sign/dribbble.png"
  57. srcset="~@/assets/img/sign/dribbble@2x.png"
  58. alt="dribbble"
  59. />
  60. <el-form-item label="Dribbble" prop="dribbble">
  61. <el-input placeholder="请输入需绑定账号用户名" v-model="social.dribbble"></el-input>
  62. </el-form-item>
  63. <span class="opts">
  64. <el-button type="info" @click="handleCancel('dribbble')">取消</el-button>
  65. <el-button type="primary" @click="onSubmit('dribbble')">确认</el-button>
  66. </span>
  67. </div>
  68. </el-form>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. import uploader from "@/components/uploader";
  74. export default {
  75. data() {
  76. return {
  77. // editing: true,
  78. editingItem: [],
  79. rules: {
  80. name: ""
  81. },
  82. social: {
  83. imageUrl: "",
  84. start: "",
  85. end: "",
  86. company: "",
  87. position: "",
  88. des: ""
  89. },
  90. experience: [
  91. {
  92. imageUrl: "",
  93. start: "2019-01-02",
  94. end: "2019-01-02",
  95. company: "程序员客栈",
  96. position: "高级产品经理",
  97. des:
  98. "主要负责程序员客栈“雇佣直通车、1980服务、云端项目、雇佣项目“项目前后端开发,参与整个项目的设计、需求讨论、代码开发、联调测试及系统维护迭代。 【主要工作成就】:解决“雇佣直通车”项目,系统智能自动匹配算法问题。"
  99. }
  100. ],
  101. current: null
  102. };
  103. },
  104. components: {
  105. uploader
  106. },
  107. methods: {
  108. onSubmit(idx) {
  109. console.log("submit!", this.form);
  110. this.experience.push(this.form);
  111. },
  112. handleAdd() {
  113. this.experience.push(this.init);
  114. this.editingItem.push(this.experience.length - 1);
  115. },
  116. handleImageUrl(url) {
  117. this.form.imageUrl = url;
  118. },
  119. handleDelete(idx) {
  120. this.experience.splice(this.experience.indexOf(this.current), 1);
  121. },
  122. handleCancel(idx) {
  123. this.editingItem.splice(this.editingItem.indexOf(idx), 1);
  124. },
  125. editItem(idx) {
  126. this.editingItem.push(idx);
  127. }
  128. }
  129. };
  130. </script>
  131. <style lang="scss">
  132. .info {
  133. header .el-icon-plus {
  134. font-size: 18px;
  135. }
  136. .edit {
  137. padding: 20px;
  138. > form {
  139. .opts {
  140. float: right;
  141. }
  142. .to {
  143. margin-right: 10px;
  144. }
  145. .line {
  146. position: relative;
  147. display: flex;
  148. justify-content: space-between;
  149. align-items: center;
  150. height: 80px;
  151. border-bottom: 1px solid #ebeef5;
  152. .el-form-item {
  153. margin-bottom: 0;
  154. }
  155. .el-input {
  156. width: 586px;
  157. }
  158. .prefix-icon {
  159. position: absolute;
  160. left: 0;
  161. top: 50%;
  162. transform: translateY(-50%);
  163. width: 26px;
  164. height: 26px;
  165. z-index: 10;
  166. }
  167. }
  168. .el-form-item__label {
  169. text-align: left;
  170. padding-left: 30px;
  171. }
  172. }
  173. }
  174. }
  175. </style>