Quellcode durchsuchen

commit -m 咨询记录

zhengjinyi vor 1 Jahr
Ursprung
Commit
dfdf4369e9

+ 6 - 6
pages.json

@@ -751,6 +751,12 @@
 						"navigationBarTitleText": "访问详情"
 					}
 				},
+				{
+					"path": "club/club-visit-details",
+					"style": { 
+						"navigationBarTitleText": "重点访问详情"
+					}
+				},
 				{
 					"path": "club/allClub-list",
 					"style": {
@@ -763,12 +769,6 @@
 						"navigationBarTitleText": "邀请运营人员"
 					}
 				},
-				{
-					"path": "club/club-info",
-					"style": {
-						"navigationBarTitleText": "商城访问记录"
-					}
-				},
 				{
 					"path": "club/club-detail",
 					"style": {

+ 51 - 62
pages/seller/club/club-visit-detail.vue

@@ -22,8 +22,8 @@
 					<view class="info-p">访问时长:<text>{{ visit.accessDuration }}</text></view>
 				</view>
 				<!--加载loadding-->
-				<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
-				<tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
+				<tui-loadmore :visible="loadding" :index="3" type="black" />
+				<tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText" />
 				<!--加载loadding-->
 			</view>
 			<view class="vsit-content-none" v-else>
@@ -46,9 +46,6 @@
 
 <script>
 import { mapState, mapMutations } from 'vuex'
-import authorize from '@/common/config/authorize.js'
-import wxLogin from '@/common/config/wxLogin.js'
-
 export default {
 	data() {
 		return {
@@ -64,8 +61,7 @@ export default {
 				accessDate:'',
 				ip:'',
 				pageNum:1,
-				pageSize:10,
-				type:0
+				pageSize:10
 			},
 			list:[] ,
 		}
@@ -97,13 +93,8 @@ export default {
 	},
 	computed: {},
 	onLoad(option) {
-		if(option.type === '2'){
-			this.listQuery.accessDate = option.accessDate
-			this.listQuery.ip = option.ip
-			this.listQuery.type = 0
-		}else{
-			this.listQuery.type = 1
-		}
+		this.listQuery.accessDate = option.accessDate
+		this.listQuery.ip = option.ip
 		this.listQuery.clubId = option.clubId
 		this.getClubRecordDetail()
 		setTimeout(() => {
@@ -111,58 +102,56 @@ export default {
 		}, 1000)
 	},
 	methods: {
-		getClubRecordDetail() {
+		async getClubRecordDetail() {
 			//获取记录详情
-			this.listQuery.pageNum = 1
-			this.UserService.userClubRecordDetail(this.listQuery)
-				.then(response => {
-					let data = response.data
-					if (data.list && data.list.length > 0) {
-						this.hasNextPage = response.data.hasNextPage
-						this.list = data.list
-						this.pullFlag = false
-						setTimeout(() => {
-							this.pullFlag = true
-						}, 500)
-						if (this.hasNextPage) {
-							this.pullUpOn = false
-							this.nomoreText = '上拉显示更多'
-						} else {
-							this.pullUpOn = true
-							this.loadding = false
-							this.nomoreText = '已至底部'
-						}
+			try{
+				this.listQuery.pageNum = 1
+				const res = await this.UserService.userClubRecordDetail(this.listQuery)
+				const data = res.data
+				if (data.list && data.list.length > 0) {
+					this.hasNextPage = data.hasNextPage
+					this.list = data.list
+					this.pullFlag = false
+					setTimeout(() => {
+						this.pullFlag = true
+					}, 500)
+					if (this.hasNextPage) {
+						this.pullUpOn = false
+						this.nomoreText = '上拉显示更多'
+					} else {
+						this.pullUpOn = true
+						this.loadding = false
+						this.nomoreText = '已至底部'
 					}
-				})
-				.catch(error => {
-					this.$util.msg(error.msg, 2000)
-				})
+				}
+			}catch(error){
+				console.log('加载异常~',error.msg)
+			}
 		},
-		getOnReachBottomData() {
-			this.listQuery.pageNum += 1
-			this.UserService.userClubRecordDetail(this.listQuery)
-				.then(response => {
-					let data = response.data
-					if (data.list && data.list.length > 0) {
-						this.hasNextPage = response.data.hasNextPage
-						this.list = this.list.concat(data.list)
-						this.pullFlag = false // 防上拉暴滑
-						setTimeout(() => {
-							this.pullFlag = true
-						}, 500)
-						if (this.hasNextPage) {
-							this.pullUpOn = false
-							this.nomoreText = '上拉显示更多'
-						} else {
-							this.pullUpOn = false
-							this.loadding = false
-							this.nomoreText = '已至底部'
-						}
+		async getOnReachBottomData() {
+			try{
+				this.listQuery.pageNum += 1
+				const res = await this.UserService.userClubRecordDetail(this.listQuery)
+				const data = res.data
+				if (data.list && data.list.length > 0) {
+					this.hasNextPage = data.hasNextPage
+					this.list = this.list.concat(data.list)
+					this.pullFlag = false // 防上拉暴滑
+					setTimeout(() => {
+						this.pullFlag = true
+					}, 500)
+					if (this.hasNextPage) {
+						this.pullUpOn = false
+						this.nomoreText = '上拉显示更多'
+					} else {
+						this.pullUpOn = false
+						this.loadding = false
+						this.nomoreText = '已至底部'
 					}
-				})
-				.catch(error => {
-					this.$util.msg(error.msg, 2000)
-				})
+				}
+			}catch(e){
+				console.log('上滑加载异常~',error.msg)
+			}
 		},
 		onPageScrollTop(){
 			uni.pageScrollTo({

+ 346 - 0
pages/seller/club/club-visit-details.vue

@@ -0,0 +1,346 @@
+<template>
+	<view class="container club-visit">
+		<tui-skeleton
+			v-if="skeletonShow"
+			backgroundColor="#fafafa"
+			borderRadius="10rpx"
+			:isLoading="true"
+			:loadingType="5"
+		/>
+		<template v-else>
+			<view class="visit-content clearfix" v-if="list.length > 0">
+				<view
+					class="info-main-list"
+					v-for="(visit, index) in list"
+					:key="index"
+					:class="index === list.length - 1 ? 'none' : ''"
+				>
+					<view class="info-title" v-if="visit.accessDate">{{ visit.accessDate }}</view>
+					<view
+						class="info-main"
+						v-for="(record, recordIndex) in visit.record"
+						:key="recordIndex"
+						:class="recordIndex === visit.record.length - 1 ? 'none' : ''"
+					>
+						<view class="info-p"
+							>访问时间:<text>{{ record.accessNewTime }}</text></view
+						>
+						<view class="info-p"
+							>页面类型:<text>{{ record.pageType ? record.pageType : '--' }}</text></view
+						>
+						<view class="info-p"
+							>页面标签:<text>{{ record.pageLabel ? record.pageLabel : '--' }}</text></view
+						>
+						<view class="info-p"
+							>商品名称:<text>{{ record.productName ? record.productName : '--' }}</text></view
+						>
+						<view class="info-p">商品图片: <text v-if="!record.productImage">--</text></view>
+						<view class="info-img" v-if="record.productImage"
+							><image :src="record.productImage" alt=""
+						/></view>
+						<view class="info-p"
+							>访问来源:<text>{{ record.accessSource | accessSourceFilters }}</text></view
+						>
+						<view class="info-p"
+							>访问客户端:<text>{{ record.accessClient | accessClientFilters }}</text></view
+						>
+						<view class="info-p"
+							>访问时长:<text>{{ record.accessDuration }}</text></view
+						>
+					</view>
+				</view>
+				<!--加载loadding-->
+				<tui-loadmore :visible="loadding" :index="3" type="black" />
+				<tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText" />
+				<!--加载loadding-->
+			</view>
+			<view class="vsit-content-none" v-else>
+				<image
+					class="none-image"
+					src="https://static.caimei365.com/app/img/bg/bg_visit_none@2x.png"
+					mode=""
+				></image>
+				<view class="none-text">暂无数据</view>
+			</view>
+		</template>
+		<!-- 侧边 -->
+		<view class="scrollTop" :style="{ bottom: '150rpx' }">
+			<view class="icon top" @click="onPageScrollTop" :class="isScrollTop ? 'show' : 'none'">
+				<text class="iconfont icon-zhiding"></text>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+import { mapState, mapMutations } from 'vuex'
+export default {
+	data() {
+		return {
+			skeletonShow: true,
+			isScrollTop: false,
+			nomoreText: '上拉显示更多',
+			hasNextPage: false,
+			loadding: false,
+			pullUpOn: true,
+			pullFlag: true,
+			listQuery: {
+				clubId: 0,
+				pageNum: 1,
+				pageSize: 10
+			},
+			list: []
+		}
+	},
+	filters: {
+		accessClientFilters(value) {
+			// 访问客户端
+			const map = {
+				'0': '网站',
+				'1': '小程序'
+			}
+			return map[value]
+		},
+		accessSourceFilters(value) {
+			// 访问来源
+			if (!value) return '--'
+		 const map = {
+				'0': '直接访问',
+				'1': '百度搜索',
+				'2': '360搜索',
+				'3': '谷歌搜索',
+				'4': '神马搜索',
+				'5': '头条搜索',
+				'6': '搜狗搜索',
+				'7': '直接访问'
+		 }
+			return map[value]
+		}
+	},
+	computed: {},
+	onLoad(option) {
+		this.listQuery.clubId = option.clubId
+		this.getClubRecordDetail()
+		setTimeout(() => {
+			this.skeletonShow = false
+		}, 1000)
+	},
+	methods: {
+		async getClubRecordDetail() {
+			//获取记录详情
+			try {
+				this.listQuery.pageNum = 1
+				const res = await this.UserService.getClubKeynoteRecord(this.listQuery)
+				const data = res.data
+				if (data.list && data.list.length > 0) {
+					this.hasNextPage = data.hasNextPage
+					this.list = data.list
+					this.pullFlag = false
+					setTimeout(() => {
+						this.pullFlag = true
+					}, 500)
+					if (this.hasNextPage) {
+						this.pullUpOn = false
+						this.nomoreText = '上拉显示更多'
+					} else {
+						this.pullUpOn = true
+						this.loadding = false
+						this.nomoreText = '已至底部'
+					}
+				}
+			} catch (error) {
+				console.log('加载异常~', error.msg)
+			}
+		},
+		async getOnReachBottomData() {
+			try {
+				this.listQuery.pageNum += 1
+				const res = await this.UserService.getClubKeynoteRecord(this.listQuery)
+				const data = res.data
+				if (data.list && data.list.length > 0) {
+					this.hasNextPage = data.hasNextPage
+					this.list = this.list.concat(data.list)
+					this.pullFlag = false // 防上拉暴滑
+					setTimeout(() => {
+						this.pullFlag = true
+					}, 500)
+					if (this.hasNextPage) {
+						this.pullUpOn = false
+						this.nomoreText = '上拉显示更多'
+					} else {
+						this.pullUpOn = false
+						this.loadding = false
+						this.nomoreText = '已至底部'
+					}
+				}
+			} catch (e) {
+				console.log('上滑加载异常~', error.msg)
+			}
+		},
+		onPageScrollTop() {
+			uni.pageScrollTo({
+				scrollTop: 0,
+				duration: 600
+			})
+		}
+	},
+	onPullDownRefresh() {
+		setTimeout(() => {
+			this.getClubRecordDetail()
+			uni.stopPullDownRefresh()
+		}, 200)
+	},
+	onReachBottom() {
+		if (this.hasNextPage) {
+			this.loadding = true
+			this.pullUpOn = true
+			this.getOnReachBottomData()
+		}
+	},
+	onPageScroll(e) {
+		//实时获取到滚动的值
+		if (e.scrollTop > 800) {
+			this.isScrollTop = true
+		} else {
+			this.isScrollTop = false
+		}
+	},
+	onShow() {}
+}
+</script>
+
+<style lang="scss">
+page {
+	height: auto;
+}
+.club-visit {
+	width: 100%;
+	.visit-content {
+		width: 100%;
+		height: auto;
+		float: left;
+		box-sizing: border-box;
+		.info-main-list {
+			width: 100%;
+			height: auto;
+			padding: 20rpx 0;
+			margin-bottom: 24rpx;
+			border-bottom: 20rpx solid #f5f5f5;
+			box-sizing: border-box;
+			&.none {
+				border-bottom: none;
+			}
+		}
+		.info-title {
+			width: 100%;
+			box-sizing: border-box;
+			padding: 24rpx 24rpx 0 24rpx;
+			position: relative;
+			line-height: 48rpx;
+			font-size: 40rpx;
+			color: #333;
+			font-weight: bold;
+		}
+		.info-main {
+			width: 100%;
+			height: auto;
+			padding: 20rpx 0;
+			border-bottom: 2rpx solid #f5f5f5;
+			box-sizing: border-box;
+			.info-p {
+				width: 100%;
+				box-sizing: border-box;
+				padding: 0 24rpx;
+				position: relative;
+				line-height: 66rpx;
+				font-size: 30rpx;
+				color: #999999;
+				text-overflow: ellipsis;
+				overflow: hidden;
+				display: -webkit-box;
+				-webkit-line-clamp: 1;
+				line-clamp: 1;
+				-webkit-box-orient: vertical;
+				text {
+					color: #333333;
+				}
+			}
+			.info-img {
+				width: 200rpx;
+				height: 200rpx;
+				image {
+					width: 200rpx;
+					height: 200rpx;
+					display: block;
+					margin-left: 24rpx;
+					border: 1px dashed #e2e2e2;
+				}
+			}
+			&.none {
+				border-bottom: none;
+			}
+		}
+	}
+	.vsit-content-none {
+		width: 100%;
+		min-height: 800rpx;
+		background: #ffffff;
+		border-radius: 24rpx;
+		padding: 52rpx 24rpx;
+		box-sizing: border-box;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		flex-direction: column;
+		.none-image {
+			width: 260rpx;
+			height: 260rpx;
+			margin-bottom: 20rpx;
+		}
+		.none-text {
+			font-size: $font-size-28;
+			color: #999999;
+			line-height: 44rpx;
+		}
+	}
+}
+.scrollTop {
+	width: 80rpx;
+	height: 100rpx;
+	position: fixed;
+	right: 20rpx;
+	z-index: 99;
+	.icon {
+		width: 80rpx;
+		height: 80rpx;
+		border-radius: 50%;
+		float: left;
+		margin: 10rpx 0;
+		line-height: 80rpx;
+		text-align: center;
+		.contact-btn {
+			width: 80rpx;
+			height: 80rpx;
+			background-color: rgba(0, 0, 0, 0);
+			line-height: 80rpx;
+			.iconfont {
+				font-size: $font-size-44;
+				color: #ffffff;
+			}
+		}
+		&.top {
+			background-color: rgba(0, 0, 0, 0.4);
+			&.show {
+				opacity: 1;
+			}
+			&.none {
+				opacity: 0;
+			}
+		}
+		.iconfont {
+			font-size: $font-size-44;
+			color: #ffffff;
+		}
+	}
+}
+</style>

+ 2 - 2
pages/seller/club/club-visit.vue

@@ -81,12 +81,12 @@ export default {
 		handleVisitDeatil(type, visit) {
 			if (type === 2) {
 				this.$api.navigateTo(
-					`/pages/seller/club/club-visit-detail?type=${type}&clubId=${this.clubId}&accessDate=${
+					`/pages/seller/club/club-visit-detail?clubId=${this.clubId}&accessDate=${
 						visit.accessDate
 					}&ip=${visit.ip}`
 				)
 			} else {
-				this.$api.navigateTo(`/pages/seller/club/club-visit-detail?type=${type}&clubId=${this.clubId}`)
+				this.$api.navigateTo(`/pages/seller/club/club-visit-details?clubId=${this.clubId}`)
 			}
 		},
 		hanldNavigateBack() {

+ 1 - 1
pages/seller/notice/components/trajectory.vue

@@ -3,7 +3,7 @@
         <view class="title">访问轨迹</view>
         <time-axis v-for="item in trajectoryList" :key="item.userID">
             <template #title>
-                <text>{{item.accessTime}}</text>
+                <text>{{item.accessTime}})(停留时长{{ item.accessDuration }})</text>
             </template>
             <template #content>
                 <view class="time-axis-content">

+ 38 - 4
pages/seller/remarks/add-record.vue

@@ -364,6 +364,17 @@
 			:reportInfo="reportInfo"
 			@handleChoiceaReport="handleChoiceaReportData"
 		/>
+		<!-- 提示弹窗 -->
+		<tui-modal
+			:show="modal"
+			@click="handleClick"
+			:content="contentModalText"
+			:button="modalButton"
+			color="#333"
+			:size="32"
+			shape="circle"
+			:maskClosable="false"
+		/>
 	</view>
 </template>
 
@@ -428,7 +439,19 @@ export default {
 			reportInfo:{
 				questionMan:'',
 				questionManId:0
-			}
+			},
+			modal: false,
+			contentModalText: '', //操作文字提示语句
+			modalButton: [
+				{
+					text: '知道了',
+					customStyle: {
+						color: '#fff',
+						bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)'
+					},
+					plain: false
+				}
+			],
 		}
 	},
 	onLoad(option) {
@@ -613,6 +636,12 @@ export default {
 				}
 			})
 			console.log('trendsLabelsList', trendsLabelsList)
+			// 标签必须有一项
+			if (!this.firstLabelList.length && !trendsLabelsList.length && !staticLabelsList.length) {
+				  this.modal = true
+				  this.contentModalText = '标签必须选择或者填写一项' 
+				  return
+			}
 			if(this.firstLabelList.length > 0){
 				this.remarksParams.remarks = JSON.stringify(this.firstLabelList)
 			}
@@ -744,6 +773,9 @@ export default {
 				this.$util.msg('您输入的字数已达上限', 2000)
 			}
 		},
+		handleClick() {
+			this.modal = false
+		},
 		followupFilters(value) {
 			// 订单来源
 			const map = {
@@ -776,14 +808,16 @@ export default {
 		sourceActionsFilters(value) {
 			// 客户来源
 			const map = {
-				0: '网站',
+				0: '搜素引擎',
 				1: '小程序',
 				2: '公众号',
 				3: '小红书',
 				4: '微博',
 				5: '搜狐',
-				6: '其他'
-				
+				7: '抖音',
+				8: '视频号',
+				9: '朋友推荐',
+				6: '其他',
 			}
 			return map[value]
 		},

+ 38 - 4
pages/seller/remarks/add.vue

@@ -387,6 +387,17 @@
 			:reportInfo="reportInfo"
 			@handleChoiceaReport="handleChoiceaReportData"
 		/>
+		<!-- 提示弹窗 -->
+		<tui-modal
+			:show="modal"
+			@click="handleClick"
+			:content="contentModalText"
+			:button="modalButton"
+			color="#333"
+			:size="32"
+			shape="circle"
+			:maskClosable="false"
+		/>
 	</view>
 </template>
 
@@ -457,7 +468,19 @@ export default {
 				clubId: 0,
 				name: '',
 				linkMan: ''
-			}
+			},
+			modal: false,
+			contentModalText: '', //操作文字提示语句
+			modalButton: [
+				{
+					text: '知道了',
+					customStyle: {
+						color: '#fff',
+						bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)'
+					},
+					plain: false
+				}
+			],
 		}
 	},
 	onLoad(option) {
@@ -680,6 +703,12 @@ export default {
 				}
 			})
 			console.log('trendsLabelsList', trendsLabelsList)
+			// 标签必须有一项
+			if (!this.firstLabelList.length && !trendsLabelsList.length && !staticLabelsList.length) {
+				  this.modal = true
+				  this.contentModalText = '标签必须选择或者填写一项' 
+				  return
+			}
 			if(this.firstLabelList.length > 0){
 				this.remarksParams.remarks = JSON.stringify(this.firstLabelList)
 			}
@@ -820,6 +849,9 @@ export default {
 				this.$api.navigateTo(`/pages/seller/login/information?userID=${this.userInfo.userId}`)
 			}
 		},
+		handleClick() {
+			this.modal = false
+		},
 		followupFilters(value) {
 			// 订单来源
 			const map = {
@@ -852,14 +884,16 @@ export default {
 		sourceActionsFilters(value) {
 			// 客户来源
 			const map = {
-				0: '网站',
+				0: '搜素引擎',
 				1: '小程序',
 				2: '公众号',
 				3: '小红书',
 				4: '微博',
 				5: '搜狐',
-				6: '其他'
-				
+				7: '抖音',
+				8: '视频号',
+				9: '朋友推荐',
+				6: '其他',
 			}
 			return map[value]
 		},

+ 5 - 3
pages/seller/remarks/details.vue

@@ -230,14 +230,16 @@ export default {
 		sourceActionsFilters(value) {
 			// 客户来源
 			const map = {
-				0: '网站',
+				0: '搜素引擎',
 				1: '小程序',
 				2: '公众号',
 				3: '小红书',
 				4: '微博',
 				5: '搜狐',
-				6: '其他'
-				
+				7: '抖音',
+				8: '视频号',
+				9: '朋友推荐',
+				6: '其他',
 			}
 			return map[value]
 		},

+ 5 - 3
pages/seller/remarks/record-details.vue

@@ -201,14 +201,16 @@ export default {
 		sourceActionsFilters(value) {
 			// 客户来源
 			const map = {
-				0: '网站',
+				0: '搜素引擎',
 				1: '小程序',
 				2: '公众号',
 				3: '小红书',
 				4: '微博',
 				5: '搜狐',
-				6: '其他'
-				
+				7: '抖音',
+				8: '视频号',
+				9: '朋友推荐',
+				6: '其他',
 			}
 			return map[value]
 		},

+ 5 - 2
services/public.js

@@ -51,11 +51,14 @@ export function uploadFileImage() {
                         wx.hideLoading()
                         resolve(res)
                     },
-                    error: function(e) {
+                    error: function(error) {
                         wx.hideLoading()
-                        reject(res)
+                        reject(error)
                     }
                 })
+            },
+            fail: (error) =>{
+                console.log('error',error)
             }
         })
     })

+ 10 - 0
services/user.service.js

@@ -963,6 +963,16 @@ export default class UserService {
 	        isLoading: false,
 	    }) 
     }
+    /**
+	 *@机构重点访问记录详情
+	 */
+    getClubKeynoteRecord(data = {}) {
+	    return this.AjaxService.get({
+	        url: '/user/seller/getClubKeynoteRecord',
+	        data,
+	        isLoading: false,
+	    }) 
+    }
     /**
 	 *@机构画像
 	 */