index.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view v-if="recommendCard">
  3. <view style="height: 136rpx;"></view>
  4. <view class="sc-box ddflex">
  5. <image class="sc-header" :src="recommendCard.avatar?recommendCard.avatar:'../../static/images/userimg.png'">
  6. </image>
  7. <view class="sc-name">
  8. <view>{{recommendCard.realName}}</view>
  9. <view class="sc-tag">{{recommendCard.jobName}}</view>
  10. </view>
  11. <view class="sc-line"></view>
  12. <view class="sc-contact" @click="jumpSingleChatRoom()">
  13. <image src="/static/images/wxChat.png"></image>
  14. <view>聊一聊</view>
  15. </view>
  16. <view class="sc-btn flex" @click="toIndex">进入我的微页</view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. const app = getApp();
  22. const req = require("../../utils/request.js");
  23. export default {
  24. data() {
  25. return {
  26. recommendCard: {}
  27. };
  28. },
  29. components: {},
  30. props: {},
  31. watch: {},
  32. mounted() {
  33. this.getRecommendCard()
  34. },
  35. methods: {
  36. // 获取推荐销售
  37. getRecommendCard() {
  38. req.getRequest('/api/visiting/card/recommendCardInfo', {}, res => {
  39. this.recommendCard = res
  40. })
  41. },
  42. jumpSingleChatRoom() {
  43. if (this.recommendCard) {
  44. req.jumpSingleChatRoom(this.recommendCard.userId, this.recommendCard.avatar, this.recommendCard
  45. .realName);
  46. }
  47. },
  48. // jumpConversation() {
  49. // req.jumpConversation();
  50. // },
  51. toIndex() {
  52. uni.switchTab({
  53. url: '/pages/index/index'
  54. })
  55. }
  56. }
  57. };
  58. </script>
  59. <style>
  60. @import "./index.css";
  61. </style>