addConnect.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div class="userAddConnect">
  3. <div class="contentArea">
  4. <div class="cellBox" v-for="item in userData">
  5. <div class="stitle">{{item.title}}</div>
  6. <input
  7. type="text"
  8. v-model="item.value"
  9. :placeholder="item.placeholder"
  10. v-if="item.type === 'text'" />
  11. <el-select v-model="item.value" :placeholder="item.placeholder" v-else-if="item.type==='select'">
  12. <el-option
  13. v-for="option in item.options"
  14. :key="option.value"
  15. :label="option.label"
  16. :value="option.value">
  17. </el-option>
  18. </el-select>
  19. </div>
  20. <div class="submitBtn" @click="submitHandler">
  21. <p>保存</p>
  22. </div>
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. /**
  28. * 名片夹
  29. */
  30. import Vue from 'vue'
  31. import { InfiniteScroll, Loadmore, CellSwipe, MessageBox } from 'mint-ui';
  32. import MintUI from 'mint-ui';
  33. import "mint-ui/lib/style.css";
  34. const mix = {
  35. data() {
  36. return {
  37. // 详情id
  38. detailID: this.$route.params.detail,
  39. }
  40. },
  41. methods: {
  42. }
  43. }
  44. export default {
  45. name: 'UserAddConnect',
  46. mixins: [mix],
  47. data() {
  48. return {
  49. userData: [
  50. { title: '联系电话', type:"text", name: 'phone', value: '', placeholder: "请输入您的联系电话(选填)" },
  51. { title: '微信号', type:"text",name: 'weixin', value: '', placeholder: "请输入您的微信号(选填)" },
  52. { title: '企业官网', type:"text", name: 'website', value: '', placeholder: "请输入您的企业官网链接,需以http://开头(选填)"},
  53. {
  54. title: '展示信息设置', type:"select", name: 'qq', value: '', placeholder: "选择您需要展示的联系方式",
  55. options: [{label: "不展示", value: 1},{label: "联系电话", value: 2},{label: "微信号", value: 3},{label: "企业官网", value: 4},]
  56. },
  57. ],
  58. loading: true,
  59. }
  60. },
  61. async created() {
  62. },
  63. async mounted() {
  64. await this.needLogin()
  65. this.getConnectInfo()
  66. },
  67. methods: {
  68. /** 获取 */
  69. getConnectInfo() {
  70. this.loading = true
  71. this.$axios.post('/api/nameCard/list', {}).then(res => {
  72. if (res.data.status === 1) {
  73. } else {
  74. this.$message.error('查询失败:' + res.info)
  75. }
  76. }).finally(() => {
  77. this.loading = false
  78. })
  79. },
  80. jumpUserPage() {
  81. const { id } = this.selectedItem
  82. let url = `/wo/${id}`
  83. if (this.$deviceType.app) {
  84. location.href = `proginn://jump?path=${url}`
  85. } else {
  86. location.href = url
  87. }
  88. },
  89. calcUserVip(item) {
  90. const { isVip, vipTypeID } = item
  91. return { [ 'vip' + vipTypeID ]: isVip }
  92. },
  93. submitHandler() {
  94. if (!this.checkSubmit()) {
  95. return
  96. }
  97. //todo 存入
  98. },
  99. checkSubmit() {
  100. return true
  101. }
  102. },
  103. }
  104. </script>
  105. <style lang="scss">
  106. @import "../../../assets/css/scssCommon";
  107. .el-select {
  108. width: 100%;
  109. .el-input__inner {
  110. margin-top: pxtovw(2);
  111. width: pxtovw(355);
  112. height: pxtovw(44);
  113. background: rgba(255, 255, 255, 1);
  114. border-radius: pxtovw(3);
  115. border:pxtovw(1) solid rgba(146,154,164,0.2);
  116. padding: pxtovw(15) pxtovw(10);
  117. }
  118. }
  119. input::placeholder {
  120. color: #AFB9C4;
  121. height:pxtovw(14);
  122. font-size:pxtovw(14);
  123. font-weight:400;
  124. line-height:pxtovw(14);
  125. }
  126. </style>
  127. <style lang="scss" scoped>
  128. @import '../../../assets/css/otherpage/user/addConnect.scss';
  129. </style>