| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <template>
- <view v-if="!loading">
- <view v-if="recommendCard&&userInfo.id!=recommendCard.userId">
- <view style="height: 136rpx;"></view>
- <view class="sc-box ddflex">
- <image class="sc-header" :src="recommendCard.avatar?recommendCard.avatar:'../../static/images/userimg.png'">
- </image>
- <view class="sc-name">
- <view>{{recommendCard.realName}}</view>
- <view class="sc-tag">{{recommendCard.jobName}}</view>
- </view>
- <view class="sc-line"></view>
- <view class="sc-contact" @click="jumpSingleChatRoom()">
- <image src="/static/images/wxChat.png"></image>
- <view>聊一聊</view>
- </view>
- <view class="sc-btn flex" @click="toIndex">进入我的微页</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- const app = getApp();
- const req = require("../../utils/request.js");
- export default {
- data() {
- return {
- userInfo:{},
- recommendCard: {},
- loading:true
- };
- },
- components: {},
- props: {
- userId:String
- },
- watch: {},
- mounted() {
- this.userInfo = req.getStorage('userInfo')
- this.getRecommendCard()
- },
- methods: {
- // 获取推荐销售
- getRecommendCard() {
- if(this.userId){
- req.getRequest('/api/user/userInfoById', {userId:this.userId}, res => {
- if(res.visitingCardDTO){
- this.recommendCard = res.visitingCardDTO
- this.loading = false
- }else{
- req.getRequest('/api/visiting/card/recommendCardInfo', {shareSaleNo:req.getStorage("shareId")?req.getStorage("shareId"):null}, res => {
- this.recommendCard = res
- this.loading = false
- })
- }
- })
- }else{
- req.getRequest('/api/visiting/card/recommendCardInfo', {shareSaleNo:req.getStorage("shareId")?req.getStorage("shareId"):null}, res => {
- this.recommendCard = res
- this.loading = false
- })
- }
- },
- jumpSingleChatRoom() {
- if (this.recommendCard) {
- req.jumpSingleChatRoom(this.recommendCard.userId, this.recommendCard.avatar, this.recommendCard
- .realName);
- }
- },
- // jumpConversation() {
- // req.jumpConversation();
- // },
- toIndex() {
- uni.switchTab({
- url: '/pages/index/index'
- })
- }
- }
- };
- </script>
- <style>
- @import "./index.css";
- </style>
|