index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <view class="index-container">
  3. <TuanAppShim bg="transparent"></TuanAppShim>
  4. <view style="text-align: center;">
  5. <image
  6. src="../../static/images/new-user/default-user-avatar.png"
  7. style="width: 102rpx;height: 102rpx;border-radius: 50%;"
  8. ></image>
  9. </view>
  10. <view style="padding-top: 30rpx;">
  11. <view v-if="electronicCardInfo.buyerId">
  12. <ATFCardDisplay
  13. :card-data="electronicCardInfo" :label-list="electronicLabelInfo"
  14. is-show-label introduction-pic-margin="14rpx -30rpx 0"
  15. ></ATFCardDisplay>
  16. <view style="font-size: 28rpx;">
  17. <view
  18. style="display: flex;justify-content: space-between;align-items: center;padding-bottom: 20rpx;border-bottom: 2rpx solid #cccccc;"
  19. >
  20. <tui-button type="blue" width="280rpx" height="68rpx" margin="20rpx auto 0" open-type="share">
  21. 分享名片
  22. </tui-button>
  23. <tui-button
  24. type="blue" width="280rpx" height="68rpx" margin="20rpx auto 0"
  25. @click="go(`/another-tf/another-user/calling-card-management/calling-card-form?id=${electronicCardInfo.buyerId}`)"
  26. >
  27. 编辑名片
  28. </tui-button>
  29. </view>
  30. <tui-list-view>
  31. <tui-list-cell background-color="transparent" padding="20rpx 0">
  32. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  33. <view>
  34. <view v-if="electronicLabelInfo && electronicLabelInfo.length">标签</view>
  35. <view v-else>您还没设置名片标签</view>
  36. </view>
  37. <view style="flex: 1;text-align: right;">
  38. <view
  39. v-if="electronicLabelInfo && electronicLabelInfo.length"
  40. style="display: inline-block;width: fit-content;"
  41. >
  42. <tui-button
  43. type="blue" width="220rpx" height="68rpx" margin="20rpx 0 0"
  44. @click="go(`/another-tf/another-user/calling-card-management/label-list`)"
  45. >
  46. 管理标签
  47. </tui-button>
  48. </view>
  49. <view v-else style="display: inline-block;width: fit-content;">
  50. <tui-button
  51. type="blue" width="220rpx" height="68rpx" margin="20rpx 0 0"
  52. @click="go(`/another-tf/another-user/calling-card-management/card-label-form`)"
  53. >
  54. 新建标签
  55. </tui-button>
  56. </view>
  57. </view>
  58. </view>
  59. </tui-list-cell>
  60. <tui-list-cell background-color="transparent" padding="20rpx 0">
  61. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  62. <text>是否启用:</text>
  63. <view style="flex: 1;text-align: right;">
  64. <text v-if="electronicCardInfo.state">是</text>
  65. <text v-else>否</text>
  66. </view>
  67. </view>
  68. </tui-list-cell>
  69. <tui-list-cell background-color="transparent" padding="20rpx 0">
  70. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  71. <text>是否加入黑名单:</text>
  72. <view style="flex: 1;text-align: right;">
  73. <text v-if="electronicCardInfo.ifBlack">是</text>
  74. <text v-else>否</text>
  75. </view>
  76. </view>
  77. </tui-list-cell>
  78. <tui-list-cell background-color="transparent" padding="20rpx 0">
  79. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  80. <text>名片头像:</text>
  81. <view style="flex: 1;text-align: right;">
  82. <image
  83. :src="common.seamingImgUrl(electronicCardInfo.headImage) || headerImg"
  84. style="width: 102rpx;height: 102rpx;border-radius: 50%;"
  85. ></image>
  86. </view>
  87. </view>
  88. </tui-list-cell>
  89. <tui-list-cell background-color="transparent" padding="20rpx 0">
  90. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  91. <text>用户ID:</text>
  92. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.buyerId }}</text>
  93. </view>
  94. </tui-list-cell>
  95. <tui-list-cell background-color="transparent" padding="20rpx 0">
  96. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  97. <text>昵称:</text>
  98. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.name }}</text>
  99. </view>
  100. </tui-list-cell>
  101. <tui-list-cell background-color="transparent" padding="20rpx 0">
  102. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  103. <text>性别:</text>
  104. <view style="flex: 1;text-align: right;">
  105. <text v-if="electronicCardInfo.sex == 1">男</text>
  106. <text v-else-if="electronicCardInfo.sex == 2">女</text>
  107. <text v-else>未知</text>
  108. </view>
  109. </view>
  110. </tui-list-cell>
  111. <tui-list-cell background-color="transparent" padding="20rpx 0">
  112. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  113. <text>生日:</text>
  114. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.birthday }}</text>
  115. </view>
  116. </tui-list-cell>
  117. <tui-list-cell background-color="transparent" padding="20rpx 0">
  118. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  119. <text>手机号:</text>
  120. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.phone }}</text>
  121. </view>
  122. </tui-list-cell>
  123. <tui-list-cell background-color="transparent" padding="20rpx 0">
  124. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  125. <text>地址:</text>
  126. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.address }}</text>
  127. </view>
  128. </tui-list-cell>
  129. <tui-list-cell background-color="transparent" padding="20rpx 0">
  130. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  131. <text>邮箱:</text>
  132. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.mailbox }}</text>
  133. </view>
  134. </tui-list-cell>
  135. <tui-list-cell background-color="transparent" padding="20rpx 0">
  136. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  137. <text>微信号:</text>
  138. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.weChatSignal }}</text>
  139. </view>
  140. </tui-list-cell>
  141. <tui-list-cell background-color="transparent" padding="20rpx 0">
  142. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  143. <text>座机:</text>
  144. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.landline }}</text>
  145. </view>
  146. </tui-list-cell>
  147. <tui-list-cell background-color="transparent" padding="20rpx 0">
  148. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  149. <text>个人简介:</text>
  150. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.personalProfile }}</text>
  151. </view>
  152. </tui-list-cell>
  153. <tui-list-cell background-color="transparent" padding="20rpx 0">
  154. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  155. <text>创建时间:</text>
  156. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.createTime }}</text>
  157. </view>
  158. </tui-list-cell>
  159. <tui-list-cell background-color="transparent" padding="20rpx 0">
  160. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  161. <text>更新时间:</text>
  162. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.updateTime }}</text>
  163. </view>
  164. </tui-list-cell>
  165. <tui-list-cell background-color="transparent" padding="20rpx 0">
  166. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  167. <text>样式ID:</text>
  168. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.styleId }}</text>
  169. </view>
  170. </tui-list-cell>
  171. <tui-list-cell background-color="transparent" padding="20rpx 0">
  172. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  173. <text>用户标签ID:</text>
  174. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.label }}</text>
  175. </view>
  176. </tui-list-cell>
  177. <tui-list-cell background-color="transparent" padding="20rpx 0">
  178. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  179. <text>是否企业:</text>
  180. <view style="flex: 1;text-align: right;">
  181. <text v-if="electronicCardInfo.isEnterprise">是</text>
  182. <text v-else>否</text>
  183. </view>
  184. </view>
  185. </tui-list-cell>
  186. <view v-if="electronicCardInfo.isEnterprise">
  187. <tui-list-cell background-color="transparent" padding="20rpx 0">
  188. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  189. <text>企业头像:</text>
  190. <view style="flex: 1;text-align: right;">
  191. <image
  192. :src="common.seamingImgUrl(electronicCardInfo.enterpriseHeadImage) || headerImg"
  193. style="width: 102rpx;height: 102rpx;border-radius: 50%;"
  194. ></image>
  195. </view>
  196. </view>
  197. </tui-list-cell>
  198. <tui-list-cell background-color="transparent" padding="20rpx 0">
  199. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  200. <text>企业名称:</text>
  201. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.enterpriseName }}</text>
  202. </view>
  203. </tui-list-cell>
  204. <tui-list-cell background-color="transparent" padding="20rpx 0">
  205. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 4rpx;">
  206. <text>担任职务:</text>
  207. <text style="flex: 1;text-align: right;">{{ electronicCardInfo.enterpriseDuties }}</text>
  208. </view>
  209. </tui-list-cell>
  210. </view>
  211. </tui-list-view>
  212. </view>
  213. </view>
  214. <view v-else style="padding-bottom: 45rpx;">
  215. <tui-no-data :fixed="false">您还未设置名片~</tui-no-data>
  216. <tui-button
  217. type="blue" width="220rpx" height="68rpx" margin="20rpx auto 0"
  218. @click="go(`/another-tf/another-user/calling-card-management/calling-card-form`)"
  219. >
  220. 新建名片
  221. </tui-button>
  222. </view>
  223. </view>
  224. </view>
  225. </template>
  226. <script>
  227. import { mapGetters } from 'vuex'
  228. export default {
  229. name: 'Index',
  230. data() {
  231. return {
  232. showCount: 0,
  233. previousMargin: '0',
  234. nextMargin: '80rpx',
  235. headerImg: require('../../static/images/userimg.png')
  236. }
  237. },
  238. async onShow(options) {
  239. this.showCount = this.showCount + 1
  240. if (this.showCount > 1) {
  241. uni.showLoading()
  242. try {
  243. const data = await this.$store.dispatch('user/getElectronicCardAction')
  244. if (data.enterpriseUserId) await this.$store.dispatch('user/getElectronicLabelAction', { id: data.enterpriseUserId })
  245. uni.hideLoading()
  246. } catch (err) {
  247. console.log(err)
  248. uni.hideLoading()
  249. }
  250. }
  251. },
  252. onShareAppMessage(res) {
  253. if ((res.from === 'button') || (res.from === 'menu')) {
  254. console.log(res.target)
  255. }
  256. return {
  257. title: '您好,这是我的名片,望惠存',
  258. path: this.$store.getters.electronicCardInfo.buyerId
  259. ? `/another-tf/another-user/calling-card/card-sharing?id=${this.$store.getters.electronicCardInfo.buyerId}`
  260. : '/pages/index/index',
  261. imageUrl: (this.$store.getters.electronicCardInfo.pictureIntroduction && this.$store.getters.electronicCardInfo.pictureIntroduction.split(',')[0]) || this.$store.getters.electronicCardInfo.headImage || ''
  262. }
  263. },
  264. computed: {
  265. ...mapGetters(['electronicCardInfo', 'electronicLabelInfo'])
  266. },
  267. methods: {
  268. }
  269. }
  270. </script>
  271. <style lang="less" scoped>
  272. .index-container {
  273. min-height: 100vh;
  274. padding: 0 30rpx 120rpx;
  275. background-color: #fefefe;
  276. box-sizing: border-box;
  277. /deep/ .tui-list-cell {
  278. border-bottom: 2rpx solid #cccccc;
  279. }
  280. }
  281. </style>