xiebaomin 1 jaar geleden
bovenliggende
commit
7bc040d9dd

+ 48 - 28
pages/seller/remarks/business-card.vue

@@ -1,30 +1,31 @@
 <template>
     <view class="business-card">
         <view class="select-item" @click.native="showActionSheet = true">
-            <view class="select-title">
-                头像
-            </view>
+            <view class="select-title">头像</view>
             <view class="select-content">
-                <image class="aov" src="../../../static/icon-user@3x.png" mode=""></image>
+                <image
+                    class="aov"
+                    :src="info.image || 'https://static.caimei365.com/app/img/icon/default-head.png'"
+                    mode=""
+                ></image>
                 <text class="cell-more iconfont icon-xiayibu"></text>
             </view>
         </view>
         <view class="select-item" @click.native="$api.navigateTo('/pages/seller/remarks/mine-qrcode')">
-            <view class="select-title">
-                二维码
-            </view>
+            <view class="select-title">二维码</view>
             <view class="select-content">
-                <image class="aov" src="../../../static/icon-user@3x.png" mode=""></image>
+                <image class="aov" :src="info.qrcode" mode="" v-if="info.qrcode"></image>
+                <text v-else>无</text>
                 <text class="cell-more iconfont icon-xiayibu"></text>
             </view>
         </view>
-        <tui-actionsheet  
-         :show="showActionSheet" 
-         :item-list="itemList" 
-         @click="itemClick" 
-         :isCancel="fasle"
-         @cancel="closeActionSheet">
-        </tui-actionsheet>
+        <tui-actionsheet
+            :show="showActionSheet"
+            :item-list="itemList"
+            @click="itemClick"
+            :isCancel="fasle"
+            @cancel="closeActionSheet"
+        ></tui-actionsheet>
     </view>
 </template>
 
@@ -33,32 +34,51 @@ import { uploadFileImage } from '@/services/public.js'
 export default {
     data() {
         return {
-            userInfo: {
-                photo: ''
-            },
+            userInfo: {},
             showActionSheet: false,
-            itemList: [{
-               text: '手机相册',
-            },
-            {
-               text: '取消',
-            }],
+            itemList: [
+                {
+                    text: '手机相册'
+                },
+                {
+                    text: '取消'
+                }
+            ],
+            info: {}
         }
     },
+    mounted() {
+        this.userInfo = uni.getStorageSync('userInfo')
+        this.getUserInfo()
+    },
     methods: {
         itemClick(e) {
             if (e.index === 1) {
                 return (this.showActionSheet = false)
             } else {
                 uploadFileImage().then(res => {
-                    this.userInfo.photo = JSON.parse(res.data).data
-                    this.showActionSheet = false
+                    this.$util.msg('请稍后')
+                    const img = JSON.parse(res.data).data
+                    if (!img) return this.$util.msg('图片上传失败')
+                    this.SellerService.updateSellerInfo({
+                        userId: this.userInfo.userId,
+                        image: img,
+                        qrcode: this.userInfo.qrcode || ''
+                    }).then(res => {
+                        this.getUserInfo()
+                        this.showActionSheet = false
+                        this.$util.msg('上传成功')
+                    })
                 })
             }
         },
         closeActionSheet() {
             this.showActionSheet = false
         },
+        async getUserInfo() {
+            const { data } = await this.SellerService.GetSellerHome({ userId: this.userInfo.userId })
+            this.info = data
+        }
     }
 }
 </script>
@@ -72,7 +92,7 @@ export default {
         display: flex;
         justify-content: space-between;
         height: 100rpx;
-        border-bottom: 1rpx solid #E1E1E1;
+        border-bottom: 1rpx solid #e1e1e1;
         margin-top: 30rpx;
         position: relative;
         .select-title {
@@ -105,4 +125,4 @@ export default {
         padding-right: 10rpx;
     }
 }
-</style>
+</style>

+ 11 - 6
pages/seller/remarks/components/activity-analysis.vue

@@ -3,22 +3,22 @@
         <image src="../../../../static/icon-user-active@3x.png" class="analysis-img" mode=""></image>
         <view class="analysis-content">
             <view class="analysis-club">
-                韩国恩盛仪器美容院
+                {{clubInfo.name}}
             </view>
             <view class="analysis-tab">
                 <view class="tab-item">
-                    忠诚用户
+                    {{clubInfo.activeState}}
                 </view>
                 <view class="tab-item">
-                    忠诚用户
+                    {{clubInfo.customerValue}}
                 </view>
             </view>
             <view class="analysis-info">
                 <view>
-                    张顺星
+                    {{ club.linkMan }}
                 </view>
                 <view>
-                    15889586666
+                    {{ club.contractMobile }}
                 </view>
             </view>
         </view>
@@ -27,7 +27,12 @@
 
 <script>
 export default {
-    props: {},
+    props: {
+        clubInfo: {
+            type: Object,
+            default: () => ({})
+        }
+    },
     data() {
         return {}
     },

+ 10 - 5
pages/seller/remarks/components/analysis-card.vue

@@ -1,6 +1,6 @@
 <template>
     <view class="analysis-card">
-        <analysis-card-item :isSubtitle="true">
+        <analysis-card-item :isSubtitle="true" :num="analysisInfo.livelyClub">
             <template #title>
                 <view>活跃机构</view>
             </template>
@@ -8,7 +8,7 @@
                 <view>(6个月内有登录商城等行为)</view>
             </template>
         </analysis-card-item>
-        <analysis-card-item :isSubtitle="true">
+        <analysis-card-item :isSubtitle="true" :num="analysisInfo.livelyClubProportion"> 
             <template #title>
                 <view>不活跃机构</view>
             </template>
@@ -16,12 +16,12 @@
                 <view>(6个月内未登录商城等行为)</view>
             </template>
         </analysis-card-item>
-        <analysis-card-item :isPercentage="true">
+        <analysis-card-item :isPercentage="true" :num="analysisInfo.noLivelyClub">
             <template #title>
                 <view>活跃机构占比</view>
             </template>
         </analysis-card-item>
-        <analysis-card-item :isPercentage="true">
+        <analysis-card-item :isPercentage="true" :num="analysisInfo.noLivelyClubProportion">
             <template #title>
                 <view>不活跃机构占比</view>
             </template>
@@ -38,7 +38,12 @@ export default {
     props: {
         analysisInfo: {
             type: Object,
-            default: () => ({})
+            default: () => ({
+                livelyClub: 0,
+                livelyClubProportion: 0,
+                noLivelyClub: 0,
+                noLivelyClubProportion: 0
+            })
         }
     },
     data() {

+ 53 - 11
pages/seller/remarks/institutional-activity-analysis.vue

@@ -4,12 +4,12 @@
             class="club-search clearfix"
             :style="{ paddingTop: StatusBar + 'px', backgroundImage: `url(${imgUrl})`, backgroundSize: '100% 100%' }"
         >
-    		      <view class="search-top" :style="{ height: CustomBar - StatusBar + 'px' }">
+            <view class="search-top" :style="{ height: CustomBar - StatusBar + 'px' }">
                 <view
                     class="search-icon"
                     :style="{
                         width: CustomBar - StatusBar + 'px',
-                   		   height: CustomBar - StatusBar + 'px',
+                        height: CustomBar - StatusBar + 'px',
                         lineHeight: CustomBar - StatusBar + 'px;'
                     }"
                 >
@@ -17,22 +17,22 @@
                 </view>
                 <view class="title">机构活跃分析</view>
             </view>
-            <analysis-card />
+            <analysis-card :analysis-info="dataList" />
         </view>
         <view class="analysis-list">
             <view class="analysis-tabs">
                 <view
                     class="analysis-tab"
-                    :class="currentTab === index && 'active'"
+                    :class="currentTab === item.id && 'active'"
                     v-for="(item, index) in tabs"
-                    :key="index"
-                    @click="handleChangeActive(index)"
+                    :key="item.id"
+                    @click="handleChangeActive(item.id)"
                 >
                     {{ item.name }}
                 </view>
             </view>
             <view class="list">
-                <activity-analysis />
+                <activity-analysis v-for="(item, index) in clubList" :key="index" :clubInfo="item"/>
             </view>
         </view>
     </view>
@@ -53,25 +53,62 @@ export default {
             StatusBar: this.StatusBar,
             capsule: this.capsule,
             imgUrl: 'https://static.caimei365.com/app/img/icon/analysis-bg.png',
-            currentTab: 0,
+            userInfo: {},
+            currentTab: 4,
             tabs: [
                 {
+                    id: 4,
                     name: '活跃机构'
                 },
                 {
+                    id: 5,
                     name: '不活跃机构'
                 }
-            ]
+            ],
+            dataList: {},
+            clubList: [], // 机构列表
+            pageNum: 1
+        }
+    },
+    mounted() {
+        this.userInfo = uni.getStorageSync('userInfo')
+        this.getLivelyClub()
+        this.getClubList()
+    },
+    watch: {
+        currentTab(val) {
+            if (val) {
+                this.pageNum = 1
+                this.clubList = []
+                this.getClubList()
+            }
         }
     },
-    mounted() {},
     methods: {
         handleChangeActive(e) {
             this.currentTab = e
         },
         handleNavigateBack() {
             this.$api.navigateBack(1)
-        }
+        },
+        // 获取机构活跃分析占比
+        async getLivelyClub() {
+            const { data: data } = await this.SellerService.getLivelyClub({ spId: this.userInfo.serviceProviderId })
+            this.dataList = data
+        },
+        // 获取机构列表
+        async getClubList() {
+            const { data } = await this.SellerService.getClubList({
+                spId: this.userInfo.serviceProviderId,
+                userIdentity: 4,
+                status: 90,
+                type: this.currentTab,
+                pageNum: this.pageNum,
+                pageSize: 10
+            })
+            this.clubList = [...this.clubList, ...data.clubList.list]
+            this.isLastPage = data.clubList.isLastPage
+        },
     }
 }
 </script>
@@ -126,6 +163,11 @@ export default {
         display: flex;
         align-items: center;
         margin-bottom: 12rpx;
+        position: fixed;
+        background: #fff;
+        width: 100%;
+        height: 100rpx;
+        top: 700rpx;
         .analysis-tab {
             font-size: 32rpx;
             height: 54rpx;

+ 1 - 1
pages/seller/remarks/mine-qrcode.vue

@@ -15,7 +15,7 @@
 export default {
     data() {
         return {
-            active: true,
+            active: false,
             userInfo: {
                 qrcode: ''
             }

+ 28 - 2
services/sellse.service.js

@@ -391,7 +391,33 @@ export default class SellerService {
 	    })
     }
     /**
-     * 机构活跃分析
+     * 机构活跃分析占比
      */
-    
+    getLivelyClub(data = {}) {
+        return this.AjaxService.get({
+            url:'/user/seller/club/livelyClub', 
+            data, 
+            isLoading: true 
+        })
+    }
+    /**
+     * 获取机构列表
+     */
+    getClubList(data = {}) {
+        return this.AjaxService.get({
+            url:'/user/seller/club/livelyClubList', 
+            data, 
+            isLoading: true 
+        })
+    }
+    /**
+     * 更新协销信息
+     */
+    updateSellerInfo(data = {}) {
+        return this.AjaxService.get({
+            url:'/user/seller/setHome', 
+            data, 
+            isLoading: true 
+        })
+    }
 }