Ver código fonte

潜客搜集

zhengjinyi 1 ano atrás
pai
commit
11ce5fc160

+ 14 - 4
components/cm-module/cm-ross/cm-ross-popup.vue

@@ -7,12 +7,12 @@
 			</view>
 			<view class="tui-popup-mssg">
 				<view class="tui-popup-mssg-img">
-					<image src="https://img.caimei365.com/group1/M00/00/55/rB-lF2MMhUWAC7vAAAGQFrJJQrw679.jpg">
+					<image :src="advertData.image">
 				</view>
 				<view class="tui-popup-mssg-text">
 					<view class="tui-popup-mssg-text-t">
-						<view class="text">对西班牙Ross品牌感兴趣?</view>
-						<view class="text">西班牙Ross商品</view>
+						<view class="text">{{ advertData.guidingOne }}</view>
+						<view class="text">{{ advertData.guidingTwo }}</view>
 					</view>
 					<view class="tui-popup-mssg-text-b">
 						<view class="text">
@@ -65,12 +65,18 @@
 
 <script>
 import { mapState, mapMutations } from 'vuex'
+import cmSrsMixins from '@/utils/cmSrsMixins.js'
 export default {
 	name: 'cm-ross-popup',
+	mixins: [cmSrsMixins],
 	props: {
 		popupShow: {
 			type: Boolean,
 			default: true
+		},
+		advertisement:{
+			type: Object,
+			default: {}
 		}
 	},
 	data() {
@@ -78,16 +84,18 @@ export default {
 			userId: 0, // 用户Id
 			consultParams: {
 				ip:'',
+				shopId:'',
 				createTime:'',
 				consultMobile: '',
 				consultName: '',
 				isClick:1
 			},
+			advertData:{},
 			isDisabled: true
 		}
 	},
 	created() {
-		this.initData()
+		this.initData(this.advertisement)
 	},
 	computed: {
 		...mapState(['hasLogin'])
@@ -96,6 +104,8 @@ export default {
 		async initData(data) {
 			const userInfo = await this.$api.getStorage()
 			this.userId = userInfo.userId ? userInfo.userId : 0
+			this.advertData = data
+			this.consultParams.shopId = data.shopId
 		},
 		handleInputName(e) {
 			this.consultParams.name = e.detail.value

+ 3 - 3
components/cm-module/homeIndex/banner.vue

@@ -66,10 +66,10 @@ export default {
 			const index = e.detail.current
 			this.current = index
 		},
-		NavToDetailPage(floor) {
+		NavToDetailPage(item) {
 			//跳转
-			this.cmsSysStatistics(1)
-			this.$api.FlooryNavigateTo(floor)
+			this.cmsSysStatistics(1,item.id)
+			this.$api.FlooryNavigateTo(item)
 		}
 	}
 }

+ 10 - 11
components/cm-module/homeIndex/pageSpecial.vue

@@ -3,7 +3,7 @@
 		<view class="container-pages clearfix">
 			<scroll-view scroll-x>
 				<view class="tui-goods__list">
-					<view class="tui-goods__item ross" v-if="advertisement">
+					<view class="tui-goods__item ross" v-if="shopAdvert.length>0">
 						<swiper class="tui-goods__ross" 
 								circular 
 								@change="swiperChange"
@@ -12,15 +12,15 @@
 								:interval="5000"
 								:duration="500"
 							>
-							<swiper-item v-for="(item, index) in advertisement" :key="item">
-								<view class="tui-goods__ross" @click="this.$api.navigateTo('/pages/supplier/user/my-shop?shopId=1378')">
-									<image class="ross-image" :src="item" mode=""></image>
+							<swiper-item v-for="(item, index) in shopAdvert" :key="item">
+								<view class="tui-goods__ross" @click="NavToDetailPage(item)">
+									<image class="ross-image" :src="item.appImage" mode=""></image>
 								</view>
 							</swiper-item>
 						</swiper>
 						<view class="swiper__dots-box">
 						    <view
-						        v-for="(item, idx) in advertisement"
+						        v-for="(item, idx) in shopAdvert"
 						        :key="idx"
 						        :class="[idx === current ? 'swiper__dots-long' : 'none']"
 						        :data-index="current"
@@ -142,11 +142,6 @@ export default {
 	data() {
 		return {
 			tempData: {},
-			advertisement:[
-				'https://www.caimei365.com/img/ross/ross-image@1x.jpg',
-				'https://img.caimei365.com/group1/M00/00/A4/rB-lF2TxdE-AAOcgAAGPzubpUIU968.jpg',
-				'https://img.caimei365.com/group1/M00/04/92/rB-lGGT32GiAbNIMAANwZbKVhEE875.jpg'
-			],
 			current: 0 ,// 切换轮播
 			iconLive: 'https://static.caimei365.com/app/img/icon/icon-live.gif'
 		}
@@ -174,7 +169,7 @@ export default {
 		this.initData(this.templateData)
 	},
 	computed: {
-		...mapState(['isRossShow'])
+		...mapState(['shopAdvert'])
 	},
 	methods: {
 		initData(data) {
@@ -183,6 +178,10 @@ export default {
 		swiperChange(e) {//轮播图切换
 			this.current = e.detail.current
 		},
+		NavToDetailPage(item) {
+			//跳转
+			this.$api.FlooryNavigateTo(item)
+		},
 		NavArticlePath(LINK) {
 			// 友盟埋点首页文章模块点击
 			if (process.env.NODE_ENV != 'development') {

+ 2 - 2
mixins/cmsMixins.js

@@ -6,8 +6,8 @@ const cmsMixins = {
 		
     },
     methods: {
-        cmsSysStatistics(cmsSysType,productId) {
-            this.ProductService.sYsStatisticsTypesSatisticsNumber({typeId:cmsSysType,productId:productId})
+        cmsSysStatistics(cmsSysType,bannerId) {
+            this.ProductService.sYsStatisticsTypesSatisticsNumber({typeId:cmsSysType,bannerId:bannerId})
                 .then(response => {
                     const map = {
 					    1: '首页轮播',

+ 1 - 11
pages/goods/good-floor.vue

@@ -13,16 +13,6 @@
 				<!-- 金刚区菜单 -->
 				<templateNav :list="navBarsList" v-if="isRequest" />
 			</view>
-			<!-- ross广告图区 -->
-			<view class="container-ross" v-if="isRossShow">
-				<view class="ross-image" @click="this.$api.navigateTo('/pages/supplier/user/my-shop?shopId=1378')">
-					<image
-						class="image"
-						src="https://static.caimei365.com/app/img/ross/ross-image@2x.jpg"
-						mode=""
-					></image>
-				</view>
-			</view>
 			<!-- 楼层 -->
 			<view class="container-section tui-skeleton">
 				<page-floor :list="pageList" :userIdentity="userIdentity" :pageType="2" v-if="isRequest" />
@@ -64,7 +54,7 @@ export default {
 		}
 	},
 	computed: {
-		...mapState(['hasLogin', 'userInfo', 'isRossShow', 'isWxAuthorize'])
+		...mapState(['hasLogin', 'userInfo','isWxAuthorize'])
 	},
 	onLoad(option) {
 		if (option.type == 'share') {

+ 9 - 9
pages/goods/product.vue

@@ -14,7 +14,7 @@
             :headerColor="headerColor"
             :type="isShareType"
             :page="backPage"
-        ></custom-p>
+        />
         <view
             class="product-topnav"
             id="topBar"
@@ -79,7 +79,7 @@
             borderRadius="10rpx"
             :isLoading="true"
             :loadingType="5"
-        ></tui-skeleton>
+        />
         <template v-else>
             <view class="cart-content empty" v-if="isInvalid">
                 <view class="empty-container">
@@ -577,7 +577,7 @@
             </view>
         </template>
         <!-- 商品参数 -->
-        <cm-prams-popup v-if="popupShow0" :popupShow="popupShow0" :product="product"></cm-prams-popup>
+        <cm-prams-popup v-if="popupShow0" :popupShow="popupShow0" :product="product" />
         <!-- 选择规格弹窗 -->
         <cm-unit-popup
             v-if="popupShow3"
@@ -589,7 +589,7 @@
             :goodsData="goodsData"
             @buyConfirm="handleBuyConfirm"
             @skuClick="handleSkuClick"
-        ></cm-unit-popup>
+        />
         <!-- 弹窗提示 -->
         <tui-modal
             :show="modal"
@@ -601,7 +601,7 @@
             :size="32"
             shape="circle"
             :maskClosable="false"
-        ></tui-modal>
+        />
         <!-- 商品详情可见度弹窗提醒 -->
         <cm-product-modal
             v-if="showModal"
@@ -611,14 +611,14 @@
             :userIdentity="userIdentity"
             :firstClubType="firstClubType"
         />
-        <!-- ross弹窗 -->
-        <cmRossPopup v-if="showRossHtml" :popupShow="showRossHtml"></cmRossPopup>
+        <!-- 供应商收集用户信息弹窗 -->
+        <cmRossPopup v-if="showRossHtml" :popupShow="showRossHtml" :advertisement="advertisement" />
 
         <!-- 分享弹窗 -->
-        <cm-share-popup ref="sharePopup" :data="posterData" type="product"></cm-share-popup>
+        <cm-share-popup ref="sharePopup" :data="posterData" type="product" />
 
         <!-- 协销名片 -->
-        <cm-seller-modal :suid="suid"></cm-seller-modal>
+        <cm-seller-modal :suid="suid" />
     </view>
 </template>
 

+ 2 - 2
pages/search/search-supplier.vue

@@ -68,8 +68,8 @@
 					<!--加载loadding-->
 			</view>
 		</view>
-		<!-- ross弹窗 -->
-		<cmRossPopup v-if="showRossHtml" :popupShow="showRossHtml"></cmRossPopup>
+        <!-- 供应商收集用户信息弹窗 -->
+        <cmRossPopup v-if="showRossHtml" :popupShow="showRossHtml" :advertisement="advertisement" />
 	</view>  
 </template>
 

+ 2 - 2
pages/search/search.vue

@@ -482,8 +482,8 @@
                 </view>
             </view>
         </tui-drawer>
-		<!-- ross弹窗 -->
-		<cmRossPopup v-if="showRossHtml" :popupShow="showRossHtml"></cmRossPopup>
+        <!-- 供应商收集用户信息弹窗 -->
+        <cmRossPopup v-if="showRossHtml" :popupShow="showRossHtml" :advertisement="advertisement" />
         <!-- 透明模态层 -->
         <modal-layer v-if="isModallayer"></modal-layer>
     </view>

+ 2 - 2
pages/supplier/user/my-shop.vue

@@ -405,8 +405,8 @@
 				</view>
 			</view>
 		</template>
-		<!-- ross弹窗 -->
-		<cmRossPopup v-if="showRossHtml" :popupShow="showRossHtml"></cmRossPopup>
+        <!-- 供应商收集用户信息弹窗 -->
+        <cmRossPopup v-if="showRossHtml" :popupShow="showRossHtml" :advertisement="advertisement" />
 		<!-- 侧边 -->
 		<scroll-top :isScrollTop="isScrollTop" :bottom="200"></scroll-top>
 	</view>

+ 12 - 2
services/user.service.js

@@ -909,6 +909,16 @@ export default class UserService {
 	        isLoading: false,
 	    }) 
     }
+    /**
+	 *@获取供应商广告弹窗信息
+	 */
+    getUserPopUpInfo(data = {}) {
+	    return this.AjaxService.get({
+	        url: '/user/information/getPopUpInfo',
+	        data,
+	        isLoading: false,
+	    }) 
+    }
     /**
 	 *@插入填写咨询人基本信息
 	 *@param consultName:页面类型
@@ -926,9 +936,9 @@ export default class UserService {
     /**
 	 *@查看访问者是否浏览过roos相关页面
 	 */
-    userInformationVisitRoos(data = {}) {
+    getShopAdvert(data = {}) {
 	    return this.AjaxService.get({
-	        url: '/user/information/visitRoos',
+	        url: '/user/information/getShopAdvert',
 	        data,
 	        isLoading: false,
 	    }) 

+ 31 - 33
store/index.js

@@ -25,7 +25,7 @@ const store = new Vuex.Store({
         isLoginType: 0,
         isLoginProductId: 0,
         isManage: false,// 是否是管理员或者小组长
-        isRossShow:false // 是否显示ross广告图
+        shopAdvert:[] // 供应商广告图列表
     },
     mutations: {
         login(state, provider) { //用户身份 1、协销 2、资质机构 3、供应商 4.个人机构
@@ -83,32 +83,31 @@ const store = new Vuex.Store({
             })
         },
         async updateNoticeNum(state) { // 更新通知消息数量
-            const userInfo = await caimeiApi.getStorage()
-            const commonId = userInfo.clubId ? userInfo.clubId : 0
-            getUserService.getAuthClubCount({ commonId: commonId })
-                .then(response => {
-                    state.noticeNum = response.data.count
-                    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,
-                    })
+            try{
+                const userInfo = await caimeiApi.getStorage()
+                const commonId = userInfo.clubId ? userInfo.clubId : 0
+                const res = await getUserService.getAuthClubCount({ commonId: commonId })
+                state.noticeNum = res.data.count
+                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()
@@ -143,13 +142,12 @@ const store = new Vuex.Store({
         async updateRossShow(state){
             const USER_EVEN = await caimeiApi.getStorage()
             if(USER_EVEN.userIdentity === 1) { return }
-            getUserService.userInformationVisitRoos({ userId: USER_EVEN.userId ? USER_EVEN.userId : 0 })
-			    .then(response => {
-                    state.isRossShow = response.data
-			    })
-			    .catch(error => {
-                    console.log(error)
-			    })
+            try{
+                const res = await getUserService.getShopAdvert({ userId: USER_EVEN.userId ? USER_EVEN.userId : 0 })
+                state.shopAdvert = res.data
+            }catch(error){
+				 console.log(error)
+            }
         },
         updateAllNum(state, num) {
             if (num >= 100) {

+ 72 - 54
utils/cmSrsMixins.js

@@ -1,6 +1,6 @@
 // 统计Ross 用户 
 import Vue from 'vue'
-import { includeList , roosConfig } from './router.config.js' // 配置信息
+import { includeList } from './router.config.js' // 配置信息
 // 参数
 const defaultParams = {
     accessClient: 1, // 来源 0 网站 1 小程序
@@ -16,90 +16,108 @@ const defaultParams = {
 const cmSrsMixins = {
     data() {
         return {
-            handleProsId: 0,
-            handleShopId: 0,
+            handleProsId: '',
+            handleShopId: '',
             handleProsKey: '',
             handleShopKey: '',
             showRossHtml: false,
-            isDisabled: true
+            isDisabled: true,
+            advertisement:{},// 弹窗广告信息
+            popUpParams: {
+                shopId: '',
+                productId: '',
+                infoId: '',
+                keyword: ''
+            },
         }
     },
     methods: {
         checkedIsRossSet() {
-            if (roosConfig.productIdList.includes(this.handleProsId * 1) ||
-				roosConfig.shopIds.includes(this.handleShopId * 1) ||
-				roosConfig.keyWords.includes(this.handleProsKey) ||
-				roosConfig.shopKeyWords.includes(this.handleShopKey)
-            ) {
+            if (this.handleProsId  || this.handleShopId  || this.handleProsKey || this.handleShopKey) {
+                this.popUpParams.shopId = this.handleShopId
+                this.popUpParams.productId = this.handleProsId
+                this.popUpParams.keyword = this.handleProsKey ? this.handleProsKey : '' || this.handleShopKey ? this.handleShopKey : ''
                 uni.setStorageSync('behaviorType', 2)
                 this.setingSysParams()
                 if (!this.hasLogin) {
                     this.userInformationIsClick()
                 }
-            }else{
+            } else {
                 this.setingSysParams()
             }
         },
         // 接口参数设置
-        async setingSysParams(){
-		    const sysParams = Object.assign({}, defaultParams)
-		    const userSync = uni.getStorageSync('userInfo')
+        async setingSysParams() {
+            const sysParams = Object.assign({}, defaultParams)
+            const userSync = uni.getStorageSync('userInfo')
             const route = this.getPath()
-		    const pageData = this.isIncludeType(route.path)
-		    // 协销不记录
-		    if (userSync.userIdentity === 1) return
-		    // 参数设置
-		    sysParams.userId = userSync.userId ? userSync.userId : 0
-		    sysParams.pagePath = route.fullPath
-		    sysParams.pageType = pageData ? pageData.pageType : ''
-		    sysParams.behaviorType = uni.getStorageSync('behaviorType') ? uni.getStorageSync('behaviorType') : 1
-		    // 根据path获取不同的参数
+            const pageData = this.isIncludeType(route.path)
+            // 协销不记录
+            if (userSync.userIdentity === 1) return
+            // 参数设置
+            sysParams.userId = userSync.userId ? userSync.userId : 0
+            sysParams.pagePath = route.fullPath
+            sysParams.pageType = pageData ? pageData.pageType : ''
+            sysParams.behaviorType = uni.getStorageSync('behaviorType') ? uni.getStorageSync('behaviorType') : 1
+            // 根据path获取不同的参数
             if (route.path === '/pages/supplier/user/my-shop') {
-			    sysParams.shopId = route.query.shopId ? route.query.shopId : 0
-            } 
+                sysParams.shopId = route.query.shopId ? route.query.shopId : 0
+            }
             if (route.path === '/pages/goods/product') {
-			    sysParams.productId = route.query.id ? route.query.id : 0
-			    sysParams.pageLabel = uni.getStorageSync('productLabel')
+                sysParams.productId = route.query.id ? route.query.id : 0
+                sysParams.pageLabel = uni.getStorageSync('productLabel')
             } else {
-			    sysParams.pageLabel = uni.getStorageSync('pageLabel') ? uni.getStorageSync('pageLabel') : pageData.pageLabel
+                sysParams.pageLabel = uni.getStorageSync('pageLabel') ? uni.getStorageSync('pageLabel') :
+                    pageData.pageLabel
             }
-		    console.log('记录路径:', sysParams.pagePath, '标签:', sysParams.pageLabel)
-		    // 统计接口调用
-		    this.userRecordStatistics(sysParams)
-		    console.log('---用户行为轨迹记录成功---')
+            console.log('记录路径:', sysParams.pagePath, '标签:', sysParams.pageLabel)
+            // 统计接口调用
+            this.userRecordStatistics(sysParams)
+            console.log('---用户行为轨迹记录成功---')
         },
-        userRecordStatistics(params){
+        userRecordStatistics(params) {
             // 上送
             this.UserService.userRecordStatistics(params)
-			    .then(response => {
-			        console.log('---用户行为轨迹记录成功---')
+                .then(response => {
+                    console.log('---用户行为轨迹记录成功---')
                     uni.removeStorageSync('pageLabel')
                     uni.removeStorageSync('behaviorType')
-			    })
-			    .catch(error => {
-                    console.log('---用户行为轨迹记录失败---')
-			    })
-        },
-        userInformationIsClick() {
-            // 查看用户是否有过弹框游客当天是否有过弹框
-            this.UserService.userInformationIsClick()
-                .then(response => {
-                    if (response.data) {
-                        setTimeout(() => {
-                            this.showRossHtml = true
-                        }, 5000)
-                    }
                 })
                 .catch(error => {
-                    console.log('查询失败~')
+                    console.log('---用户行为轨迹记录失败---')
                 })
         },
-        isIncludeType(url){
+        async userInformationIsClick() {
+            // 查看用户是否有过弹框游客当天是否有过弹框
+            try {
+                const res = await this.UserService.userInformationIsClick(this.popUpParams)
+                if (res.data) {
+                    this.getUserPopUpInfo()
+                    setTimeout(() => {
+                        this.showRossHtml = true
+                    }, 5000)
+                }
+            } catch (error) {
+                console.log('查询失败~')
+            }
+        },
+        async getUserPopUpInfo() {
+		    // 获取供应商广告弹窗信息
+		    try {
+		        const res = await this.UserService.getUserPopUpInfo(this.popUpParams)
+                const data = res.data
+		        this.advertisement = data
+                this.consultParams.shopId = data.shopId
+		    } catch (error) {
+		        console.log('获取失败~')
+		    }
+        },
+        isIncludeType(url) {
             // 校验返回页面类型
-		    if (!url) return false
-		    return includeList.find(item => url === item.url)
+            if (!url) return false
+            return includeList.find(item => url === item.url)
         },
-        getPath(){
+        getPath() {
             // 获取路径
             const pages = getCurrentPages()
             const len = pages.length
@@ -110,4 +128,4 @@ const cmSrsMixins = {
     }
 }
 
-export default cmSrsMixins
+export default cmSrsMixins

+ 0 - 7
utils/router.config.js

@@ -52,10 +52,3 @@ export const includeList = [
     {title:'重置密码', url:'/pages/supplier/user/setting/password',pageLabel:'重置密码', pageType:66 },
     {title:'更换手机号', url:'/pages/supplier/user/setting/phone',pageLabel:'更换手机号', pageType:67 },
 ]
-//Ross 统计配置
-export const  roosConfig = {
-    productIdList:[7247,7248,7520],//Ross 商品ID集合
-    shopIds:[1378],// Ross 供应商Id
-    keyWords:['Binary Premium','智能体疗管理系统','448k','肌肉重塑疗法','西班牙ROSS','ROSS','智能体疗','西班牙Ross','Ross','西班牙ross','ross'],//搜索关键词
-    shopKeyWords:['深圳艾斯佰丽生物科技有限公司','艾斯佰丽']// 搜索供应商关键词
-}