Przeglądaj źródła

crm系统优化

xiebaomin 1 rok temu
rodzic
commit
06e1534c18

+ 1 - 0
common/config/wxLogin.js

@@ -40,6 +40,7 @@ const wxLoginQuick = async function(){// 根据微信的code获取用户登录
             store.commit('login',response.data)
             uni.setStorageSync('token',response.data.token)
             uni.setStorageSync('unionId',response.data.unionId)
+            uni.setStorageSync('spUserId', response.data.spUserId)
             if(response.data.userIdentity ==1){
                 uni.navigateTo({url:'/pages/seller/index/index'})
             }else if(response.data.userIdentity === 3){

+ 19 - 6
components/cm-share-popup/cm-seller-modal.vue

@@ -1,6 +1,6 @@
 <template>
-    <view class="seller-card" v-if="userId !== 0">
-        <view class="seller-card-mine" v-if="!modal" @click="modal = true">
+    <view class="seller-card" v-if="userId > 0">
+        <view class="seller-card-mine" v-if="!modal" @click="changeModal">
             <image
                 :src="userInfo.image || 'https://static.caimei365.com/app/img/icon/default-head.png'"
                 style="width: 100%;height: 100%;object-fit: contain;border-radius: 50%;"
@@ -9,7 +9,7 @@
         </view>
         <tui-modal class="sellerMode" @cancel="hideModal" :show="modal" custom>
             <view class="tui-modal-custom">
-                <view class="close" @click="modal = false">
+                <view class="close" @click="changeModal">
                     <image
                         src="https://static.caimei365.com/app/img/supplier-login/close.png"
                         style="width: 100%;height: 100%;"
@@ -40,7 +40,7 @@
                                     <view class="card-name">{{ userInfo.linkMan }}</view>
                                     <view class="card-info-tab">客户经理</view>
                                 </view>
-                                <view class="card-info-iphone">{{ userInfo.contractMobile }}</view>
+                                <view class="card-info-iphone">{{ userInfo.contractMobile && userInfo.contractMobile.replace(/(?=(\d{4})+$)/g,"-") }}</view>
                             </view>
                         </view>
                         <view class="card-qrcode">
@@ -52,7 +52,11 @@
                                     mode=""
                                 ></image>
                             </view>
-                            <view class="tips">长按或扫二维码 联系我</view>
+                            <view class="tips">
+                                <view class="">
+                                    长按或扫二维码
+                                </view>
+                                <view style="white-space: nowrap;">——联系我——</view>
                         </view>
                     </view>
                 </view>
@@ -83,17 +87,26 @@ export default {
     methods: {
         hideModal() {
             this.modal = false
+            uni.setStorageSync('sellerCardChange', 2)
         },
         initData() {
             this.userId = uni.getStorageSync('sellerUserId') || this.sellerUserId
             if(this.userId > 0) {
                 this.getUserInfo()
-                this.modal = true
+                if (uni.getStorageSync('sellerCardChange') === 1) {
+                    this.modal = true
+                } else {
+                    this.modal = false
+                }
             }
         },
         async getUserInfo() {
             const { data } = await this.SellerService.GetSellerHome({ userId: this.userId })
             this.userInfo = data
+        },
+        changeModal() {
+            this.modal = !this.modal
+            uni.setStorageSync('sellerCardChange', this.modal ? 1 : 2)
         }
     }
 }

+ 20 - 58
components/cm-share-popup/cm-share-popup.vue

@@ -11,7 +11,7 @@
 
 <script>
 import DrawPoster from './draw-poster.js'
-import {mapState} from 'vuex'
+import { mapState } from 'vuex'
 import { generateWxUnlimited, enCodeQueryStr } from '@/pages/goods/mixins/share.helper.js'
 import simpleSharePopup from './simple-share-popup/simple-share-popup.vue'
 export default {
@@ -35,6 +35,7 @@ export default {
     data() {
         return {
             posterUrl: '',
+            ctx: '',
             posterData: {
                 /* 用户信息 */
                 image: '', // 用户头像
@@ -51,6 +52,7 @@ export default {
                 productPrice: '', // 产品价格
                 productOriginPrice: '', // 产品原价
                 productImage: '', // 产品图片
+                id: '', //商品id
 
                 /* 活动参数 */
                 activityName: '', // 活动名称
@@ -64,7 +66,10 @@ export default {
     methods: {
         async getUserInfo() {
             const { data } = await this.SellerService.GetSellerHome({ userId: this.userInfo.userId })
-            this.posterData.image = data.image // 用户头像
+            this.posterData.image =
+                data.image === 'undefined' || !data.image
+                    ? 'https://static.caimei365.com/app/img/icon/default-head.png'
+                    : data.image // 用户头像
             this.posterData.qrCode = data.qrCode // 用户二维码
             this.posterData.linkMan = data.linkMan // 用户名
             this.posterData.contractMobile = data.contractMobile // 用户手机号
@@ -103,24 +108,17 @@ export default {
                 if (!this.posterUrl) {
                     await this.getUserInfo()
                     this.posterData = { ...this.posterData, ...this.data }
-                    // const { data: qrCodeImage } = await generateWxUnlimited(this, {
-                    //     pagePath: this.posterData.path,
-                    //     queryStr: `type=1&sellerUserId=${this.userInfo.userId}`
-                    // })
-                    // this.posterData.qrCodeImage = qrCodeImage
-
+                    const { data: qrCodeImage } = await generateWxUnlimited(this, {
+                        pagePath: this.posterData.path,
+                        queryStr: 'sellerUserId=' + this.userInfo.userId + '&id=' + this.posterData.id
+                    })
+                    this.posterData.qrCodeImage = qrCodeImage
                     switch (this.type) {
                         case 'product':
                             await this.createProductPoster()
                             break
-                        case 'activity':
-                            await this.createActivityPoster()
-                            break
-                        default:
-                            await this.createNormalPoster()
                     }
-
-                    const {tempFilePath} = await this.canvasToTempFilePath()
+                    const { tempFilePath } = await this.canvasToTempFilePath()
                     this.posterUrl = tempFilePath
                 }
                 uni.hideLoading()
@@ -168,7 +166,6 @@ export default {
                 }
             }
             textArray.push(priceText)
-            console.log(this.posterData)
             // 处理产品名称
             if (productName) {
                 const nameStr = productName || activityName
@@ -185,56 +182,21 @@ export default {
         // 商品海报
         async createProductPoster() {
             try {
+                const [error, result] = await uni.downloadFile({ url: this.posterData.productImage })
+                const [error2, result2] = await uni.downloadFile({ url: this.posterData.qrCodeImage })
+                this.posterData.productImage = result.tempFilePath
+                this.posterData.qrCodeImage = result2.tempFilePath
                 const ctx = uni.createCanvasContext('poster', this)
                 const drawPoster = new DrawPoster(ctx, {
                     avatarUrl: this.posterData.avatar,
                     userName: this.posterData.username,
-                    subTitle: '强烈为你推荐该商品',
-                    coverUrl: this.posterData.productImage,
-                    // ewmUrl: this.posterData.qrCodeImage,
-                    textArray: this.generateTextArray(),
-                    image: this.posterData.image,
-                    qrCode: this.posterData.qrCode, // 用户二维码
-                    linkMan: this.posterData.linkMan, // 用户名
-                    contractMobile: this.posterData.contractMobile, // 用户手机号
-                })
-                return await drawPoster.draw()
-            } catch (e) {
-                throw e
-            }
-        },
-
-        // 活动页面
-        async createActivityPoster() {
-            try {
-                const ctx = uni.createCanvasContext('poster', this)
-                const drawPoster = new DrawPoster(ctx, {
-                    avatarUrl: this.posterData.avatar,
-                    userName: this.posterData.username,
-                    subTitle: '强烈为你推荐该商品',
                     coverUrl: this.posterData.productImage,
-                    // ewmUrl: this.posterData.qrCodeImage,
+                    ewmUrl: this.posterData.qrCodeImage,
                     textArray: this.generateTextArray(),
                     image: this.posterData.image,
                     qrCode: this.posterData.qrCode, // 用户二维码
                     linkMan: this.posterData.linkMan, // 用户名
-                    contractMobile: this.posterData.contractMobile, // 用户手机号
-                })
-                return await drawPoster.draw()
-            } catch (e) {
-                throw e
-            }
-        },
-
-        // 普通海报
-        async createNormalPoster() {
-            try {
-                const ctx = uni.createCanvasContext('poster', this)
-                const drawPoster = new DrawPoster(ctx, {
-                    avatarUrl: this.posterData.avatar,
-                    userName: this.posterData.username,
-                    subTitle: '强烈为你推荐该商城',
-                    textArray: ['']
+                    contractMobile: this.posterData.contractMobile.replace(/(?=(\d{4})+$)/g,"-") // 用户手机号
                 })
                 return await drawPoster.draw()
             } catch (e) {
@@ -251,6 +213,6 @@ export default {
     top: -9999px;
     left: -9999px;
     width: 375px;
-    height: 610px;
+    height: 620px;
 }
 </style>

+ 39 - 35
components/cm-share-popup/draw-poster.js

@@ -1,13 +1,13 @@
 // 默认配置参数
 const defaultOptions = () => ({
-    avatarUrl: 'https://static.caimei365.com/app/mini-hehe/icon/icon-join-us.png',
+    avatarUrl: '',
     userName: '采美',
     subTitle: '强烈为你推荐该商城',
-    coverUrl: 'https://static.caimei365.com/app/mini-hehe/icon/icon-share.png',
-    bgImageUrl: 'https://static.caimei365.com/app/mini-hehe/icon/bg-share-01.png',
+    coverUrl: '',
+    bgImageUrl: 'https://static.caimei365.com/app/img/icon/bgImage.png',
     userBg: 'https://static.caimei365.com/app/img/icon/bg-card.png',
     userTitleBg: 'https://static.caimei365.com/app/img/icon/logo-fanbai.png',
-    // ewmUrl: 'https://static.caimei365.com/app/mini-hehe/icon/icon-ewm-hehe.jpg',
+    ewmUrl: '',
     textArray: [],
     scale: 0.5,
     duty: {
@@ -21,14 +21,12 @@ export default class DrawPoster {
     constructor(ctx, options = {}) {
         this.ctx = ctx
         this.options = Object.assign(defaultOptions(), options)
-        console.log('配置信息为:', this.options)
     }
     // 开始绘制
     draw() {
         return new Promise(async (resolve, reject) => {
             try {
                 await this.drawBgImage()
-                // await this.drawHeader()
                 await this.drawUserCoverImage()
                 await this.drawCenterInfo()
             } catch (e) {
@@ -47,7 +45,7 @@ export default class DrawPoster {
             const { bgImageUrl, scale } = this.options
             const [error, result] = await uni.downloadFile({ url: bgImageUrl })
             if (error) return
-            this.ctx.setFillStyle('#999999')
+            this.ctx.drawImage(result.tempFilePath, 0, 0, 750 * scale, 1240 * scale)
             this.ctx.save()
             return Promise.resolve(true)
         } catch (e) {
@@ -55,27 +53,27 @@ export default class DrawPoster {
         }
     }
     // 绘制圆角矩形
-    async drawRoundRect(x, y, w, h, r) {
+    drawRoundRect(x, y, w, h, r, color) {
+        this.ctx.save()
         this.ctx.beginPath()
         this.ctx.moveTo(x + r , y)
         this.ctx.arcTo(x + w, y, x + w, y + h, r)
         this.ctx.arcTo(x + w, y + h, x , y + h, r)
         this.ctx.arcTo(x, y + h, x, y, r)
         this.ctx.arcTo(x, y, x + w, y , r)
-        this.ctx.setFillStyle('#FFFFFF')
+        this.ctx.setFillStyle(color)
         this.ctx.fill()
-        this.ctx.clip()
+        // this.ctx.clip()
     }
     // 绘制中心区域
     async drawCenterInfo() {
         try {
-            const { scale } = this.options
-
+            const { scale, coverUrl, ewmUrl } = this.options
             this.ctx.beginPath()
-            this.drawRoundRect(28 * scale, 28 * scale, 694 * scale, 878 * scale, 8)
-            await this.drawCoverImage()
+            await this.drawRoundRect(28 * scale, 28 * scale, 694 * scale, 878 * scale, 8, '#FFFFFF')
             await this.drawFooterText()
-            await this.drawEwmImage()
+            this.ctx.drawImage(coverUrl, 56 * scale, 56 * scale, 638 * scale, 658 * scale)
+            this.ctx.drawImage(ewmUrl, 524 * scale, 730 * scale, 160 * scale, 160 * scale)
             return Promise.resolve(true)
         } catch (e) {
             return Promise.reject(e)
@@ -84,13 +82,13 @@ export default class DrawPoster {
     // 绘制封面图片
     async drawCoverImage() {
         try {
+            this.ctx.beginPath()
             const { coverUrl, scale } = this.options
-            const [error, result] = await uni.downloadFile({ url: coverUrl })
-            if (error) return
-            this.ctx.drawImage(result.tempFilePath, 56 * scale, 56 * scale, 638 * scale, 658 * scale)
+            this.ctx.drawImage(coverUrl, 56 * scale, 56 * scale, 638 * scale, 658 * scale)
+            this.ctx.save()
             return Promise.resolve(true)
         } catch (e) {
-            return Promise.reject(e)
+            console.log(e)
         }
     }
     // 绘制名片封面
@@ -100,10 +98,10 @@ export default class DrawPoster {
             await this.drawBorderReduisImage(userBg, 28 * scale, 920 * scale, 694 * scale, 290 * scale, 8)
             await this.drawUserCardInner() // 绘制名片内容
             await this.drawCircleImg(image, 120 * scale, 1090 * scale, 30) //头像
-            this.drawFontText(30 * scale, 200 * scale, 1070 * scale, '#fff', linkMan, 'bold', true)
+            this.drawFontText(36 * scale, 200 * scale, 1070 * scale, '#fff', linkMan, 'bold', true)
             this.drawFontText(30 * scale, 200 * scale, 1130 * scale, '#fff', contractMobile, '400')
-            await this.drawBorderReduisImage(qrCode, 550 * scale, 980 * scale, 150 * scale, 150 * scale, 6)
-            this.drawFontText(20 * scale, 550 * scale, 1160 * scale, '#fff', ['长按或扫二维码', '——联系我——'], '400')
+            await this.drawBorderReduisImage(qrCode, 556 * scale, 1010 * scale, 120 * scale, 120 * scale, 6)
+            this.drawFontText(18 * scale, 550 * scale, 1160 * scale, '#fff', ['长按或扫二维码', '——联系我——'], '400')
             return Promise.resolve(true)
         } catch (e) {
             return Promise.reject(e)
@@ -122,7 +120,6 @@ export default class DrawPoster {
     }
     async drawCircleImg(img, x, y, r) {
         const [error, result] = await uni.downloadFile({ url: img })
-        console.log('result', result, x, y, r)
         if (error) return
         this.ctx.save()
         this.ctx.beginPath()
@@ -130,7 +127,6 @@ export default class DrawPoster {
         this.ctx.arc(x, y, r, 0, 2 * Math.PI)
         this.ctx.clip()
         this.ctx.drawImage(result.tempFilePath, x - r, y - r, size, size)
-        console.log('x - r, y - r, size, size', x - r, y - r, size, size)
         this.ctx.restore()
     }
     async drawBorderReduisImage(imgUrl, bg_x, bg_y, bg_w, bg_h, bg_r) {
@@ -147,28 +143,34 @@ export default class DrawPoster {
         this.ctx.restore()
     }
     // 绘制文字
-    drawFontText(fontsize, x, y, color, text, bold, isDuty = false) {
-        this.ctx.beginPath()
-        this.ctx.font = `${bold} ${fontsize}px sans-serif`
-        this.ctx.setFillStyle(color)
+    async drawFontText(fontsize, x, y, color, text, bold, isDuty = false) {
+        this.ctx.save()
         if (Array.isArray(text)) {
+            this.ctx.beginPath()
+            this.ctx.font = `${bold} ${fontsize}px sans-serif`
+            this.ctx.setFillStyle(color)
             text.forEach((e, i) => {
                 this.ctx.fillText(e, x, y + fontsize * i)
             })
         } else {
+            this.ctx.beginPath()
+            this.ctx.font = `${bold} ${fontsize}px sans-serif`
+            this.ctx.setFillStyle(color)
             this.ctx.fillText(text, x, y)
             if (isDuty) {
-                this.ctx.fillStyle = `${this.options.duty.bgColor}`
-                this.ctx.fillRect(x + (text.length * fontsize)- 30, y-fontsize, 66, fontsize + 4)
-                this.ctx.font = `${400} ${fontsize}px sans-serif`
+                await this.drawRoundRect(x + (text.length * fontsize) + 10,  y-fontsize, 66, fontsize + 4, 6, '#FFBB00')
+                // this.ctx.fillStyle = `${this.options.duty.bgColor}`
+                // this.ctx.fillRect(x + (text.length * fontsize) + 10, y-fontsize, 66, fontsize + 4)
+                this.ctx.font = `${400} ${fontsize-4}px sans-serif`
                 this.ctx.setFillStyle('#fff')
-                this.ctx.fillText(this.options.duty.text, x + (text.length * fontsize) -30, y)
+                this.ctx.fillText(this.options.duty.text, x + (text.length * fontsize) + 15, y - 2)
             }
         }
     }
     // 绘制底部
     drawFooterText(callback) {
         const { scale, textArray } = this.options
+        this.ctx.beginPath()
         if (callback) {
             callback({ scale, ctx: this.ctx, textArray })
         } else {
@@ -178,14 +180,16 @@ export default class DrawPoster {
                 this.ctx.fillText(txt, 56 * scale, (710 + 56 * index) * scale)
             })
         }
+        this.ctx.save()
     }
     // 绘制底部二维码
     async drawEwmImage() {
         try {
             const { ewmUrl, scale } = this.options
-            const [error, result] = await uni.downloadFile({ url: ewmUrl })
-            if (error) return
-            this.ctx.drawImage(result.tempFilePath, 524 * scale, 730 * scale, 160 * scale, 160 * scale)
+            // const [error, result] = await uni.downloadFile({ url: ewmUrl })
+            console.log(ewmUrl, this.options)
+            // if (error) return
+            this.ctx.drawImage(ewmUrl, 524 * scale, 730 * scale, 160 * scale, 160 * scale)
             return Promise.resolve(true)
         } catch (e) {
             return Promise.reject(e)

+ 1 - 1
main.js

@@ -9,7 +9,7 @@ import ResidenceTime from './plugins/simple-residence-time'
 import residence from './utils/residence.js'
 
 // 友盟
-import Uma from './plugins/uma'
+// import Uma from './plugins/uma'
 
 // 公共组件 全局组件
 import { msg, modal, prePage, boundingClientRect } from './utils/util'

+ 1 - 0
mixins/appMixins.js

@@ -21,6 +21,7 @@ const appMixins = {
                     this.updateRossShow()
                     uni.setStorageSync('token',response.data.token)
                     uni.setStorageSync('unionId',response.data.unionId)
+                    uni.setStorageSync('spUserId', response.data.spUserId)
                 })
                 .catch(error =>{
                     this.logout(error.data)

+ 7 - 1
pages.json

@@ -34,7 +34,13 @@
 				"enablePullDownRefresh": true,
 				"navigationStyle": "custom"
 			}
-		}
+		},
+        {
+        	"path": "pages/sharePage/index",
+        	"style": {
+        		"navigationBarTitleText": "采美商城"
+        	}
+        }
 	],
 	"subPackages": [{
 			"root": "pages/service/", //信息服务模块

+ 15 - 54
pages/goods/mixins/share.helper.js

@@ -2,70 +2,31 @@
 /* 小程序码 */
 import store from '@/store/index.js'
 import { wxUnlimited } from '@/services/sellse.service.js'
-const fs = uni.getFileSystemManager()
-const qrcodePath = `${wx.env.USER_DATA_PATH}/qrcodePath`
 
-const defalutOptions = {
-    title: '护肤上颜选,正品有好货~',
-    path: '/pages/index/index',
-    imageUrl: 'https://static.caimei365.com/app/mini-hehe/icon/icon-share.png'
-}
-
-export function shareDataResult(shareData, title, coverUrl) {
-    const state_str = encodeURIComponent(encrypt(shareData))
-    const result = {
-        title: title || defalutOptions.title,
-        path: `${defalutOptions.path}?state_str=${state_str}`,
-        imageUrl: coverUrl || defalutOptions.imageUrl
-    }
-    return result
-}
-
-const queryKeyOfMap = {
-    'type': 't',
-    'inviteUserId': 'i',
-    'activityId': 'a',
-    'dealerUserId': 'd',
-    'keyWord': 'k',
-    'productId': 'p',
-    'jumpState': 'j',
-    'collageId': 'c',
-    'sellerUserId': 'u'
-}
 
-const enQueryKeyOfMap = {
-    't': 'type',
-    'i': 'inviteUserId',
-    'a': 'activityId',
-    'd': 'dealerUserId',
-    'k': 'keyWord',
-    'p': 'productId',
-    'j': 'jumpState',
-    'c': 'collageId',
-    'u': 'sellerUserId'
-}
-
-// 创建二维码保存路径
-function createQrcodeDir(callback) {
-    try {
-        fs.accessSync(qrcodePath)
-        console.log('已存在文件夹')
-        callback(qrcodePath)
-    } catch (e) {
-        fs.mkdirSync(qrcodePath)
-        console.log('不存在文件夹')
-        callback(qrcodePath)
+/*
+ * queryStringify
+ * 将url?k=v&k1=v1的序列化转成k-v对象
+ */
+export function queryParse(query = '') {
+    if (query.startsWith('?')) {
+        query = query.slice(0)
     }
+    const obj = Object.create(null)
+    query.split('&').forEach(str => {
+        const v = str.split('=')
+        obj[v[0]] = v[1]
+    })
+    return obj
 }
 
-
 /* 生成二维码链接 */
 export const generateWxUnlimited = async (that, params) => {
     try {
         // 从服务端获取二维码arrayBuffer
         return await that.SellerService.wxUnlimited({
             page: params.pagePath,
-            scene: params.queryStr,
+            scene: params.queryStr, // codeQueryStr(params.queryStr)
             check_path: process.env.NODE_ENV === 'production', // 是否校验页面
             env_version: process.env.NODE_ENV === 'production' ? 'release' : 'trial', // 正式版 or 开发版
             width: 200, // 二维码宽度
@@ -104,4 +65,4 @@ export function enCodeQueryStr(query) {
             }
         }).join('=')
     }).join('&')
-}
+}

Plik diff jest za duży
+ 607 - 590
pages/goods/product.vue


+ 1 - 0
pages/login/bindOperator.vue

@@ -121,6 +121,7 @@
 					this.$store.commit('updateStatus',response.data)
 					uni.setStorageSync('token',response.data.token)
 					uni.setStorageSync('unionId',response.data.unionId)
+                    uni.setStorageSync('spUserId', response.data.spUserId)
 					setTimeout(()=>{
 						if(response.data.userIdentity === 1){
 							this.$api.navigateTo('/pages/seller/index/index')

+ 7 - 4
pages/notice/club/components/notice-cell.vue

@@ -39,21 +39,24 @@
 		<template v-if="cellType === 3">
 			<view class="tui-notice-cell clearfix">
 				<view class="tui-cell-top">
-                    <view class="cell-title" v-if="cell.shopTieredType > 1"> {{ cell.shopTieredType | noticeSellerFilters }} </view>
+                    <view class="cell-title" v-if="cell.shopTieredType > 1"> 客户经理分配通知 </view>
 					<view class="cell-title" v-else> {{ cell.messageType | noticeUsersFilters }} </view>
 					<view class="cell-time"> {{ cell.time }} </view>
 				</view>
                 <view class="tui-cell-seller" v-if="cell.shopTieredType > 4">
                     <view class="seller">
-                       客户经理:<text>{{cell.superUserName}}</text>
+                       客户经理:<text>{{cell.userName}}</text>
                     </view>
                     <view class="seller">
                         手机号码:<text>{{cell.mobile}}</text>
                     </view>
                 </view>
-				<view class="tui-cell-content"> 
-					{{ noticeUsersText(cell)}}
+				<view class="tui-cell-content" v-if="cell.shopTieredType > 1"> 
+					{{ noticeSellerFilters(cell)}}
 				</view> 
+                <view class="tui-cell-content" v-else>
+                	{{ noticeUsersText(cell)}}
+                </view> 
 			</view>
 		</template>
 		<!-- 机构优惠促销通知 -->

+ 8 - 8
pages/notice/club/mixins/notice.mixins.js

@@ -38,14 +38,6 @@ const noticeMixins = {
             }
             return map[value]
         },
-        noticeSellerFilters(value) {
-            // 客户经理分配通知  5,客户经理分配通知。6,客户经理重新分配通知
-            const map = {
-                5: '采美平台已为您匹配专属客户经理,为您提供专业咨询服务。',
-                6: '因公司内部人员调整需要,采美平台已为您更换了新客户经理。',
-            }
-            return map[value]
-        }
     },
     methods: {
         getUserAuthClubMessageList() {
@@ -126,6 +118,14 @@ const noticeMixins = {
                     console.log('error=>', error.msg)
                 })
         },
+        noticeSellerFilters(cell) {
+            // 客户经理分配通知  5,客户经理分配通知。6,客户经理重新分配通知
+            const map = {
+                5: '采美平台已为您匹配专属客户经理,为您提供专业咨询服务。',
+                6: '因公司内部人员调整需要,采美平台已为您更换了新客户经理。',
+            }
+            return map[cell.shopTieredType]
+        },
         noticeOrderText(cell) { // 交易物流通知文案
             const map = {
                 1: '您已成功下单!',

+ 5 - 6
pages/seller/club/list.vue

@@ -330,7 +330,7 @@ export default {
             this.isShowIndex = true
         }
         if (!this.isManage) {
-            this.listItemTab = this.listItemTab.filter((e, i) => i === 2)
+            this.listItemTab = this.listItemTab.filter((e, i) => i !== 1)
         }
     },
     computed: {
@@ -436,15 +436,15 @@ export default {
             switch (index) {
                 case 0:
                     this.tabCurrentIndex = 0
-                    this.listQuery.userIdentity = 4
                     this.listQuery.status = 90
                     this.listQuery.pageNum = 1
+                    this.listQuery.userIdentity = 4
                     this.GetSellerClubList()
                     break
                 case 1:
                     this.listQuery.pageNum = 1
-                    this.listQuery.userIdentity = 2
                     this.listQuery.status = 90
+                    this.listQuery.userIdentity = 2
                     this.GetSellerClubList()
                     break
             }
@@ -455,14 +455,14 @@ export default {
             switch (index) {
                 case 0:
                     this.tabCurrentIndex = 0
-                    this.listQuery.type = this.isManage ? 1 : 6
+                    this.listQuery.type = 1
                     this.listQuery.status = 90
                     this.listQuery.pageNum = 1
                     this.listQuery.groupServiceId = 0
                     this.GetSellerClubList()
                     break
                 case 1:
-                    this.listQuery.type = 2
+                    this.listQuery.type = this.isManage ? 2 : 6
                     this.listQuery.status = 90
                     this.listQuery.pageNum = 1
                     this.listQuery.groupServiceId = 0
@@ -585,7 +585,6 @@ export default {
         }
     },
     onShow() {
-        this.listQuery.type = this.isManage ? 1 : 6
         wxLogin.wxLoginAuthorize()
         this.initGetStotage()
     }

+ 2 - 3
pages/seller/components/message.vue

@@ -34,7 +34,7 @@
 </template>
 
 <script>
-    import { mapState, mapMutations } from 'vuex'
+    import { mapState } from 'vuex'
     export default {
         data() {
             return {
@@ -43,7 +43,6 @@
                 StaticUrl: this.$Static,
                 notificationCount: 0,
                 skeletonShow: false,
-                allCount:0,
                 tradeCount: 0,
                 accountCount: 0,
                 promotionCount: 0
@@ -78,7 +77,7 @@
             // 清理未读消息
             clearNews() {
             	// 标记消息已读
-            	if(this.allCount == 0){
+            	if(this.notificationCount == 0){
             		this.$util.msg('暂无未读消息', 2000)
             		return
             	}

+ 3 - 2
pages/seller/components/user.vue

@@ -245,12 +245,12 @@ export default {
                 {
                 	name: '机构活跃分析',
                 	path: '/pages/seller/remarks/institutional-activity-analysis',
-                	icon: 'https://static.caimei365.com/app/img/icon/icon_seller_7@2x.png'
+                	icon: 'https://static.caimei365.com/app/img/icon/visits.png'
                 },
                 {
                 	name: '我的名片',
                 	path: '/pages/seller/remarks/business-card',
-                	icon: 'https://static.caimei365.com/app/img/icon/icon_seller_7@2x.png'
+                	icon: 'https://static.caimei365.com/app/img/icon/my-card.png'
                 }
 			]
 		}
@@ -278,6 +278,7 @@ export default {
 					this.login(response.data)
 					uni.setStorageSync('token', response.data.token)
 					uni.setStorageSync('unionId', response.data.unionId)
+                    uni.setStorageSync('spUserId', response.data.spUserId)
 					this.getUserSellerHome()
 					this.getOrderCount()
 				} else {

+ 5 - 5
pages/seller/index/index.vue

@@ -100,11 +100,11 @@ export default {
     computed: {
         ...mapState(['userInfo'])
     },
-    onShow() {
-        this.updateSellerNoticeNum() // 消息通知
-    },
+    // onShow() {
+    //     this.updateSellerNoticeNum() // 消息通知
+    // },
 	methods: {
-        ...mapMutations(['updateSellerNoticeNum']),
+        // ...mapMutations(['updateSellerNoticeNum']),
 		// 切换组件
 		cut_index(type) {
 			this.show_index = type
@@ -148,7 +148,7 @@ export default {
 		}
 		return {
 			title: '生美医美正品采购服务平台',
-			path: `pages/tabBar/home/index?sellerUserId=${this.userInfo.userId || 0}`,
+			path: `pages/tabBar/home/index?type=sellerShare&sellerUserId=${this.userInfo.userId || 0}`,
 			imageUrl: 'https://static.caimei365.com/app/img/bg/min-banner.jpg'
 		}
 	}

+ 25 - 9
pages/seller/notice/components/trajectory.vue

@@ -1,16 +1,16 @@
 <template>
     <view class="trajectory">
         <view class="title">访问轨迹</view>
-        <time-axis v-for="item in trajectoryList" :key="item.id">
+        <time-axis v-for="item in trajectoryList" :key="item.userID">
             <template #title>
-                <text>{{item.time}}</text>
+                <text>{{item.accessTime}}</text>
             </template>
             <template #content>
                 <view class="time-axis-content">
-                    <image :src="item.image || '../../../../static/temp/icon-new@2x.png'" class="axis-product" mode=""></image>
+                    <image :src="item.titleImage || '../../../../static/temp/icon-new@2x.png'" class="axis-product" mode=""></image>
                     <view class="axis-product-info">
-                        <view class="product-title">【{{item.title}}】</view>
-                        <view class="product-info">{{item.content}}</view>
+                        <view class="product-title">【{{item.pageType | pageTypeChange}}】</view>
+                        <view class="product-info">{{item.title}}</view>
                     </view>
                 </view>
             </template>
@@ -24,14 +24,21 @@ export default {
     props: {
         trajectoryList: {
             type: Array,
-            default: () => ([
-                {}
-            ])
+            default: () => ([])
         }
     },
     components: {
         TimeAxis
     },
+    filters: {
+        pageTypeChange(val) {
+            const obj = {
+                '6': '商品',
+                '11': '文章'
+            }
+            return obj[val]
+        }
+    },
     data() {
         return {}
     }
@@ -61,12 +68,21 @@ export default {
 .axis-product-info {
     display: flex;
     flex-direction: column;
-    justify-content: space-between;
     height: 136rpx;
     width: 426rpx;
     color: #333333;
     font-size: 26rpx;
     margin-left: 24rpx;
+    .product-info {
+        margin-top: 16rpx;
+        overflow: hidden;
+        -webkit-line-clamp: 2;
+        text-overflow: ellipsis;
+        display: -webkit-box;
+        -webkit-box-orient: vertical;
+        height: 73rpx;
+        width: 426rpx;
+    }
 }
 .time-axis-content {
     display: flex;

+ 4 - 4
pages/seller/notice/components/visits-cell.vue

@@ -2,15 +2,15 @@
     <view class="visits-cell" @click="$emit('handlerVisits', visitsInfo)">
         <view class="visits-club">
             <image :src="visitsInfo.image || '/static/icon-user-active@3x.png'" mode="" class="visits-author"></image>
-            <view>{{visitsInfo.name || '广州市渼洋阳医疗美容诊所有限公司'}}</view>
+            <view>{{visitsInfo.name}}</view>
         </view>
         <view class="visits-content">
             <view class="container">
                 <view class="visits-name">
-                    {{ visitsInfo.linkMan || '李淑霞'}}
+                    {{ visitsInfo.linkMan }}
                 </view>
                 <view class="visits-phone">
-                    {{ visitsInfo.contractMobile || '13922400399'}}
+                    {{ visitsInfo.contractMobile }}
                 </view>
             </view>
             <view class="container">
@@ -18,7 +18,7 @@
                     关注点:
                 </view>
                 <view class="visits-concern">
-                    {{ visitsInfo.pageLabel || '黄金微针,水光针,微针,小气泡,热玛吉激光,光子嫩肤'}}
+                    {{ visitsInfo.pageLabel }}
                 </view>
             </view>
         </view>

+ 1 - 1
pages/seller/notice/mixins/notice.mixins.js

@@ -20,7 +20,7 @@ const noticeMixins = {
                 2: '系统已为你分配机构客户,请及时跟进。',
                 3: '系统已将你的机构转移给其他销售人员,你已无权管理该客户。',
                 4: '系统已为你分配机构客户,请及时跟进。',
-                7: `昨日【${cell.name}...】等${cell.couponFee}家机构客户访问了采美商城`,
+                7: `昨日【${cell.name}...】等${cell.sum}家机构客户访问了采美商城`,
                 8: '系统已将你的机构客户进行回收,你已无权管理该客户。'
             }
             return map[cell.shopTieredType]

+ 4 - 12
pages/seller/notice/service/Institutional_visits.vue

@@ -6,7 +6,7 @@
                 @handlerVisits="handlerVisits"
                 :visits-info="visitsInfo"
                 v-for="visitsInfo in visitsList"
-                :key="visitsInfo.clubId"
+                :key="visitsInfo.userID"
             />
         </template>
     </view>
@@ -20,15 +20,7 @@ export default {
     },
     data() {
         return {
-            visitsList: [{
-                image: '',
-                pageLabel: '',
-                name: '',
-                linkMan: '',
-                contractMobile: '',
-                accessTime: '2023-08-29',
-                clubId: '1111'
-            }],
+            visitsList: [],
             accDateTime: '',
             userInfo: {}
         }
@@ -56,7 +48,7 @@ export default {
                     '&clubId=' +
                     $event.clubId +
                     '&accessTime=' +
-                    $event.accessTime
+                    $event.accessTime.substr(0, 10)
             )
         },
         async getVisitesClubList() {
@@ -64,7 +56,7 @@ export default {
                 spId: this.userInfo.serviceProviderId,
                 accDateTime: this.accDateTime
             })
-            this.visitsList = data.list
+            this.visitsList = data
         }
     }
 }

+ 17 - 18
pages/seller/notice/service/service.vue

@@ -45,28 +45,26 @@ export default {
                 source: 2,
                 commonId: ''
             },
-            messageList: [
-                {
-                    id: 1,
-                    shopTieredType: 7,
-                    time: '2023年8月29日',
-                    content: '大黄蜂'
-                }
-            ], // 信息列表
+            messageList: [], // 信息列表
             userInfo: {},
             isLastPage: false, //  是否是最后一页
         }
     },
     mounted() {
-        this.getMessageList()
+        this.getMessageList({isRefresh: false})
     },
     methods: {
         // 请求信息列表
-        async getMessageList() {
+        async getMessageList(options) {
             this.userInfo = uni.getStorageSync('userInfo')
             this.params.commonId = this.userInfo.serviceProviderId
             const { data } = await this.SellerService.getSellerNotice(this.params)
-            this.messageList = [...this.messageList, ...data.list]
+            if (options.isRefresh) {
+                this.messageList = data.list
+            }
+            else {
+                this.messageList = [...this.messageList, ...data.list]
+            }
             this.isLastPage = data.isLastPage
         },
         // 删除
@@ -78,7 +76,7 @@ export default {
                         success: () => {
                             this.params.pageSize = this.params.pageNum * this.params.pageSize
                             this.params.pageNum = 1
-                            this.getMessageList()
+                            this.getMessageList({isRefresh: true})
                         }
                     })
                 })
@@ -87,30 +85,31 @@ export default {
                 })
         },
         // 详情
-        trampInfo($event) {
+        async trampInfo($event) {
             const time = $event.time.replace(/[年月日]/g, '-')
             if ($event.shopTieredType === 7) {
                 this.$api.navigateTo(
                     '/pages/seller/notice/service/Institutional_visits?spId=' +
                         this.userInfo.serviceProviderId +
                         '&accDateTime=' +
-                        time.substr(0, time.length - 1)
+                        time.substr(0, 10)
                 )
             } else {
-                this.$api.navigateTo('/pages/seller/club/club-portrait?userId=' + $event.clubId)
+                const {data} = await this.SellerService.getFindUserId({id: $event.clubId, userType: 1})
+                this.$api.navigateTo('/pages/seller/club/club-portrait?userId=' + data.data)
             }
         }
     },
     onPullDownRefresh() {
         this.params.pageSize = 10
         this.params.pageNum = 1
-        this.getMessageList()
+        this.getMessageList({isRefresh: true})
         uni.stopPullDownRefresh()
     },
     onReachBottom() {
-        if (this.isLastPage) {
+        if (!this.isLastPage) {
             this.params.pageNum += 1
-            this.getMessageList()
+            this.getMessageList({isRefresh: false})
         }
     }
 }

+ 1 - 3
pages/seller/notice/service/visits_details.vue

@@ -20,9 +20,7 @@ export default {
     },
     data() {
         return {
-            visitsInfo: {
-                id: 1
-            },
+            visitsInfo: {},
             accessTime: '', // 访问日期
             spId: '', // 协销id
             clubId: '' ,// 机构id

+ 2 - 3
pages/seller/remarks/components/mine-card.vue

@@ -18,7 +18,7 @@
                         </view>
                     </view>
                     <view class="card-info-iphone">
-                        {{ userInfo.contractMobile }}
+                        {{ userInfo.contractMobile.replace(/(?=(\d{4})+$)/g,"-") }}
                     </view>
                 </view>
             </view>
@@ -27,8 +27,7 @@
                     <image :show-menu-by-longpress="true" :src="userInfo.qrCode || ''" class="qrcode" mode=""></image>
                 </view>
                 <view class="tips">
-                    长按或扫二维码
-                    联系我
+                    长按或扫二维码—-联系我-—
                 </view>
             </view>
         </view>

+ 5 - 5
pages/seller/remarks/institutional-activity-analysis.vue

@@ -32,7 +32,7 @@
                 </view>
             </view>
             <view class="list">
-                <activity-analysis v-for="(item, index) in clubList" :key="index" :clubInfo="item"/>
+                <activity-analysis v-for="(item, index) in clubList" :key="index" :clubInfo="item" />
             </view>
         </view>
     </view>
@@ -68,7 +68,7 @@ export default {
             dataList: {},
             clubList: [], // 机构列表
             pageNum: 1,
-            isLastPage: true, // 是否是最后一页
+            isLastPage: true // 是否是最后一页
         }
     },
     mounted() {
@@ -115,7 +115,7 @@ export default {
             })
             this.clubList = [...this.clubList, ...data.clubList.list]
             this.isLastPage = data.clubList.isLastPage
-        },
+        }
     }
 }
 </script>
@@ -131,7 +131,7 @@ export default {
     background: #ffffff;
     display: flex;
     flex-direction: column;
-    position: sticky;
+    position: fixed;
     top: 0;
     left: 0;
     z-index: 99;
@@ -166,7 +166,7 @@ export default {
     padding: 38rpx 24rpx;
     box-sizing: border-box;
     .list {
-        margin-top: 40rpx;
+        margin-top: 740rpx;
     }
     .analysis-tabs {
         color: #666666;

+ 20 - 0
pages/sharePage/index.vue

@@ -0,0 +1,20 @@
+<template>
+    <view>
+        采美商城
+    </view>
+</template>
+
+<script>
+    export default {
+        data() {
+            return {}
+        },
+        onLoad(options) {
+            console.log('options', options)
+        },
+        methods: {},
+    }
+</script>
+
+<style>
+</style>

+ 18 - 4
pages/tabBar/home/index.vue

@@ -130,10 +130,24 @@ export default {
             sellerUserId: 0, // 协销id
 		}
 	},
-	onLoad(options) {
-        if (options.sellerUserId) {
-            this.sellerUserId = options.sellerUserId
-            uni.setStorageSync('sellerUserId', options.sellerUserId)
+	onLoad(option) {
+        console.log('options', option)
+        if(!uni.getStorageSync('sellerUserId')) {
+            uni.setStorageSync('sellerUserId', option.sellerUserId || 0)
+        }
+    },
+    onShow() {
+        if (!uni.getStorageSync('spUserId')) {
+            this.sellerUserId = uni.getStorageSync('sellerUserId')
+        } else {
+            if (uni.getStorageSync('spUserId') === uni.getStorageSync('sellerUserId')) {
+                this.sellerUserId = uni.getStorageSync('sellerUserId')
+            } else {
+                this.sellerUserId = 0
+            }
+        }
+        if (this.userInfo.userIdentity === 1) {
+            this.sellerUserId = 0
         }
     },
     computed: {

+ 1 - 1
services/ajax.service.js

@@ -15,7 +15,7 @@ class AjaxService {
         const REV_TOKEN_ENV = uni.getStorageSync('token') ? uni.getStorageSync('token') : 'X-token'
         const REV_COOKIE_ENV = uni.getStorageSync('sessionid') ? uni.getStorageSync('sessionid') : 'sessionid'
         header['Accept'] = 'application/json'
-        header['Content-Type'] = 'application/x-www-form-urlencoded'
+        header['Content-Type'] = header['content-type'] || 'application/x-www-form-urlencoded'
         header['X-Token'] = REV_TOKEN_ENV
         header['cookie'] = REV_COOKIE_ENV
         return header

+ 15 - 1
services/sellse.service.js

@@ -384,9 +384,13 @@ export default class SellerService {
      */
     wxUnlimited (data = {}) {
 	    return this.AjaxService.post({ 
-	        url:'/user/wxacode', 
+	        url:'/tools/wxacode', 
 	        data, 
 	        isLoading: true,
+            header: {
+                'content-type': 'application/json',
+                'Accept': '*/*'
+            }
 	    })
     }
     /**
@@ -469,4 +473,14 @@ export default class SellerService {
             isLoading: true 
         })
     }
+    /**
+     * 获取机构userId
+     */
+    getFindUserId(data = {}) {
+        return this.AjaxService.get({
+            url:'/user/getFindUserId', 
+            data, 
+            isLoading: true 
+        })
+    }
 }

+ 30 - 29
store/index.js

@@ -110,35 +110,36 @@ const store = new Vuex.Store({
                     })
                 })
         },
-        async updateSellerNoticeNum(state) { // 更新协销通知消息数量
-            const userInfo = await caimeiApi.getStorage()
-            const commonId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
-            console.log(userInfo, commonId)
-            getSellerService.getSellerNoticeSpCount({ commonId: commonId, messageType: 3 })
-                .then(response => {
-                    state.noticeNum = response.data.notificationCount
-                    if (state.noticeNum >= 100) {
-                        uni.setTabBarBadge({
-                            index: 2,
-                            text: '99+'
-                        })
-                    } else if (state.noticeNum > 0) {
-                        uni.setTabBarBadge({
-                            index: 2,
-                            text: String(state.noticeNum)
-                        })
-                    } else {
-                        uni.removeTabBarBadge({
-                            index: 2,
-                        })
-                    }
-                })
-                .catch(error => {
-                    uni.removeTabBarBadge({
-                        index: 2,
-                    })
-                })
-        },
+        // async updateSellerNoticeNum(state) { // 更新协销通知消息数量
+        //     const userInfo = await caimeiApi.getStorage()
+        //     const commonId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
+        //     console.log(userInfo, commonId)
+        //     getSellerService.getSellerNoticeSpCount({ commonId: commonId, messageType: 3 })
+        //         .then(response => {
+        //             state.noticeNum = response.data.notificationCount
+        //             console.log(response)
+        //             if (state.noticeNum >= 100) {
+        //                 uni.setTabBarBadge({
+        //                     index: 2,
+        //                     text: '99+'
+        //                 })
+        //             } else if (state.noticeNum > 0) {
+        //                 uni.setTabBarBadge({
+        //                     index: 2,
+        //                     text: String(state.noticeNum)
+        //                 })
+        //             } else {
+        //                 uni.removeTabBarBadge({
+        //                     index: 2,
+        //                 })
+        //             }
+        //         })
+        //         .catch(error => {
+        //             uni.removeTabBarBadge({
+        //                 index: 2,
+        //             })
+        //         })
+        // },
         async updateRossShow(state){
             const USER_EVEN = await caimeiApi.getStorage()
             if(USER_EVEN.userIdentity === 1) { return }

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików