Commit c45f00d8 by 前端

名片线索开发

1 parent 62848a07
......@@ -19,4 +19,22 @@ module.exports = {
true
)
},
/** 活动申请记录访问记录 */
getApplyRecord(data) {
return api.post({
method: 'entmicro.api.business.card.activity.pagerecord',
...data
},
true
)
},
// 切换跟进状态
activityFollow(data) {
return api.post({
method: 'entmicro.api.business.card.activity.follow',
...data
},
true
)
},
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ const target = ["ip", "dev", "uat", "beta", "prod"];
3预发布
4生产
*/
const index = 2;
const index = 1;
const secretKey = {
ip: {},
dev: {
......
......@@ -34,7 +34,7 @@
<image class="icon-dial" webp src="{{IMGURL}}home/icon-dial.png?v={{img_version}}"></image>
<view class="phone-text">拨打电话</view>
</view>
<view class="line"></view>
<view wx:if="{{isStaff}}" class="line"></view>
<view wx:if="{{isStaff}}" bindtap="goRecord" class="record-dial">
<image class="icon-dial" webp src="{{IMGURL}}index/record.png?v={{img_version}}"></image>
<view class="phone-text">名片线索</view></view>
......
// components/popup/popup.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type:Boolean,
default: false,
observer(n) {
this.setData({
popShow: n
})
}
},
list: {
type:Array,
default: [],
observer(n) {
console.log(n);
this.setData({
dataList: n
})
}
}
},
/**
* 组件的初始数据
*/
data: {
dataList: []
},
/**
* 组件的方法列表
*/
methods: {
// 关闭弹框
overlayUp() {
this.triggerEvent('closePop')
}
}
})
{
"component": true,
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-icon": "@vant/weapp/icon/index"
}
}
\ No newline at end of file
/* components/popup/popup.wxss */
.popup-header {
height: 56px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0px 16px;
.popup-title {
font-weight: 600;
font-size: 16px;
color: #222222;
}
}
.popup-content {
max-height: calc(80vh - 50px);
overflow: auto;
&-header {
display: flex;
height: 40px;
line-height: 48px;
background: #f2f2f2;
text-align: center;
.popup-item {
font-weight: 600;
font-size: 14px;
color: #333333;
}
}
&-body {
display: flex;
height: 48px;
line-height: 48px;
background: #ffffff;
border: 1px solid #e5e5e5;
text-align: center;
}
.popup-item {
font-size: 14px;
color: #666666;
&:first-child {
width: 60px;
}
&:nth-child(2),
&:nth-child(3) {
flex: 1;
}
}
}
\ No newline at end of file
<!--components/popup/popup.wxml-->
<van-popup
show="{{ popShow }}"
round
position="bottom"
custom-style="height: 40%;"
safe-area-inset-bottom
close-on-click-overlay
bind:click-overlay="overlayUp"
>
<view class="popup-header">
<view class="popup-title">访问记录</view>
<view class="popup-icon"><van-icon name="cross" bindtap="overlayUp" /></view>
</view>
<view class="popup-content">
<view class="popup-content-header">
<view class="popup-item">序号</view>
<view class="popup-item">访问页面</view>
<view class="popup-item">访问时间</view>
</view>
<view class="popup-content-body" wx:for="{{dataList}}" wx:key="{{item.id}}">
<view class="popup-item">{{ index + 1 }}</view>
<view class="popup-item">{{ item.pageName }}</view>
<view class="popup-item">{{ item.createdTime }}</view>
</view>
</view>
</van-popup>
......@@ -78,6 +78,9 @@ page {
}
.prod-detail {
.img-items {
width: 100%;
}
.occupancy {
height: 120rpx;
......
......@@ -27,7 +27,7 @@
</view>
<view class="prod-detail">
<block wx:for="{{productImgs}}" wx:key="index">
<image webp wx:if="{{ index < 3}}" webp class="img-item {{item.className?item.className:''}} img-item{{index}} img-item{{actNum}}{{index}}" src="{{item.url?item.url:item}}?v={{img_version}}">
<image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" webp src="{{item.url?item.url:item}}?v={{img_version}}">
<block wx:if="{{ index == 0}}">
<!-- && phone -->
<view class="phone" bindtap="phoneCall" data-phone="{{phone}}">
......
// components/recordApply/recordApply.js
import {
businessApi
} from "../../api/api";
import {
componentsMixin
} from "../../mixins/index";
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
applyData: {
type: Array,
default: [],
observer(n) {
this.setData({
dataList: n
})
}
}
},
/**
* 组件的初始数据
*/
data: {
applyData: [
{
merchantName: '深圳卡罗拉门店 (新能源·代理商)',
carModel: '宝马',
businessScenario: '6个月以上',
productItems: '360全景导航、氛围灯',
createdTime: '2022-11-15 08:30:05',
contactName: '张无忌',
contactPhone: '13532222298'
}
]
dataList: [],
recordList: [],
popShow: false,
isClick: false
},
/**
* 组件的方法列表
*/
methods: {
getRecord(e) {
this.setData({
popShow: true
})
console.log(e);
const {activityId} = e.currentTarget.dataset.info
const params = {
activityId
}
businessApi.getApplyRecord(params).then(res => {
console.log(res, '000');
if(res&&res.code == 0) {
this.setData({
recordList: res.data
})
} else {
wx.showToast({
title: res.message || '系统异常',
icon: 'none'
})
}
})
},
// 关闭pop
closePop() {
this.setData({
popShow: false
})
},
// 切换跟进状态
changeFollow(e) {
this.setData({
isClick: true
})
const {activityId, followType} = e.currentTarget.dataset.follow
let data = {
activityId: activityId,
followType: followType == 0 ? 1 : 0
}
businessApi.activityFollow(data).then(res => {
if (res.code == 0) {
this.triggerEvent('changeApplyData', activityId)
wx.showToast({
title: '跟进状态修改成功',
icon: 'none'
})
} else {
wx.showToast({
title: res.message || '系统异常',
icon: 'none'
})
}
})
},
// 打电话
callApply(e) {
const phoneNumber = e.currentTarget.dataset.contactPhone
wx.makePhoneCall({
phoneNumber: phoneNumber,
});
}
}
})
{
"component": true,
"usingComponents": {
"Popup": "../../components/popup/popup"
}
}
\ No newline at end of file
/* components/recordApply/recordApply.wxss */
.apply-wrap {
padding: 24rpx;
.content {
height: calc(100% - 160rpx);
overflow: scroll;
}
.apply-item {
box-sizing: border-box;
background: #fff;
box-shadow: 0 8rpx 16rpx 0 rgba(224, 224, 224, 0.5);
margin-bottom: 24rpx;
&-head {
padding: 20rpx 32rpx 24rpx;
border-bottom: 2rpx solid rgba(195, 195, 195, 0.3);
.title {
font-weight: 600;
font-size: 32rpx;
color: #333333;
line-height: 48rpx;
}
.maxWidth {
max-width: 700rpx;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.type {
font-weight: 400;
font-size: 24rpx;
......@@ -32,11 +38,14 @@
line-height: 32rpx;
}
}
&-content {
padding: 24rpx 32rpx 20rpx;
border-bottom: 2rpx solid rgba(195, 195, 195, 0.3);
.content-wrap {
margin-bottom: 16rpx;
.title {
font-weight: 400;
font-size: 28rpx;
......@@ -52,6 +61,7 @@
color: #333333;
margin-left: 32rpx;
}
.linkman {
height: 64rpx;
background: #f5f7fa;
......@@ -59,6 +69,7 @@
line-height: 64rpx;
padding: 0 16rpx;
box-sizing: border-box;
.phone-num {
color: #6e6e7a;
margin: 0 12rpx 0 8rpx;
......@@ -66,29 +77,82 @@
}
}
}
&-footer {
height: 96rpx;
padding: 0 32rpx 0 24rpx;
box-sizing: border-box;
justify-content: space-between;
font-size: 28rpx;
line-height: 96rpx;
&-left {
position: relative;
.popover-main {
position: absolute;
top: -50rpx;
left: 0;
background: #4C4C4C;
height: 50rpx;
width: 200rpx;
.popover-item {
height: 50rpx;
line-height: 50rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 24rpx;
color: rgba(255, 255, 255, 0.90);
padding: 0 12rpx;
}
&::before {
position: absolute;
top: 51rpx;
left: 23rpx;
content: '';
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-top: 10rpx solid #4C4C4C;
}
}
}
.follew-result {
color: #f0aa06;
}
.fail {
color: #999999 !important;
}
.record {
color: #5850FF;
text-align: right;
}
}
.icon-remove,
.icon-collect {
margin-right:16rpx;
margin-right: 16rpx;
}
}
}
.flex {
display: flex;
}
.follow-icon {
width: 64rpx;
height: 56rpx;
vertical-align: middle;
}
.phone-icon {
width: 40rpx;
height: 40rpx;
vertical-align: middle;
}
\ No newline at end of file
<!--components/recordApply/recordApply.wxml-->
<view class="apply-wrap">
<block wx:for="{{applyData}}">
<block wx:for="{{dataList}}" wx:key="index">
<view class="apply-item">
<view class="apply-item-head">
<view class="title flex">
......@@ -23,28 +23,29 @@
</view>
<view class="content-wrap flex">
<view class="title">申请人</view>
<view class="info linkman flex">
<view class="info linkman flex" bindtap="callApply" data-phone="{{item.contactPhone}}">
<view style="max-width: 120rpx; overflow: hidden; white-space: nowrap">{{ item.contactName }}</view>
<span class="phone-num">{{ item.contactPhone }}</span>
<view class="sprite-icon icon-phone"></view>
<view>
<image mode="widthFix" class="phone-icon" webp src="{{IMGURL}}home/call.png?v={{img_version}}"></image>
</view>
</view>
</view>
</view>
<view class="apply-item-footer flex">
<view class="flex">
<!-- <block wx:if="{{index == 0}}">
<van-popover theme="dark" placement="top-start">
<view class="tip">点击可切换状态</view>
<block #reference>
<view :class="['sprite-icon', item.followType == 0 ? ' icon-remove' : ' icon-collect']"></view>
</block>
</van-popover>
</block> -->
<!-- <view v-else :class="['sprite-icon', item.followType == 0 ? ' icon-remove' : ' icon-collect']" @click.stop="checkCollect(item)"></view>
<view :class="['follew-result', item.followType == 0 ? 'fail' : 'success']">{{ item.followType == 0 ? '未跟进' : '已跟进' }}</view> -->未跟进
<view class="apply-item-footer-left {{item.followType == 0 ? ' icon-remove' : ' icon-collect'}}" bindtap="changeFollow" data-follow="{{item}}">
<image wx:if="{{item.followType != 0}}" mode="widthFix" class="follow-icon" webp src="{{IMGURL}}home/follow1.png?v={{img_version}}"></image>
<image wx:else mode="widthFix" class="follow-icon" webp src="{{IMGURL}}home/follow2.png?v={{img_version}}"></image>
<view class="popover-main" wx:if="{{index==0 && !isClick}}">
<view class="popover-item">点击可切换状态</view>
</view>
</view>
<view class="{{item.followType == 0 ? 'fail' : 'success'}} 'follew-result'">{{ item.followType == 0 ? '未跟进' : '已跟进' }}</view>
</view>
<view class="record">访问记录</view>
<view class="record" bindtap="getRecord" data-info="{{item}}">访问记录</view>
</view>
</view>
</block>
</view>
\ No newline at end of file
</view>
<Popup show="{{popShow}}" list="{{recordList}}" bindclosePop="closePop"></Popup>
\ No newline at end of file
......@@ -6,8 +6,8 @@ Component({
properties: {
recordData: {
type: Array,
default: [],
observer(n) {
console.log(n);
this.setData({
tableData: n
})
......@@ -19,14 +19,30 @@ Component({
* 组件的初始数据
*/
data: {
fruitList: ['访客','联系电话','最后访问时间'],
tableData: []
tabList: ['访客','联系电话','最后访问时间'],
tableData: [],
popShow: false,
recordList: []
},
/**
* 组件的方法列表
*/
methods: {
selectRecord(e) {
console.log(e);
let dataIndex = e.currentTarget.dataset.id
let dataList = this.data.tableData[dataIndex].recordRelationList
console.log(dataList);
this.setData({
popShow: true,
recordList: dataList
})
},
closePop() {
this.setData({
popShow: false
})
}
}
})
{
"component": true,
"usingComponents": {}
"usingComponents": {
"Popup": "../../components/popup/popup"
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
<view class='table'>
<!-- 左侧表格滚动 -->
<view class="table_right_scroll_box">
<view class="flex_direction_column_item" wx:for="{{fruitList}}" wx:for-index="index" wx:key="index">
<view class="flex_direction_column_item" wx:for="{{tabList}}" wx:for-index="index" wx:key="index">
<view class='item_name'>{{item}}</view>
<view wx:for="{{tableData}}" wx:for-item="litem" wx:for-index="lindex" wx:key="lindex" class='item_name item_price'>
<block wx:if="{{item == '访客'}}">{{litem.nickName}}</block>
......@@ -14,6 +14,7 @@
<!-- 右侧固定 -->
<view class='table_left_column'>
<view class='item_name'>操作</view>
<view class='left_col_item' wx:for="{{tableData.length}}" wx:for-index="index" wx:key="index">访问记录</view>
<view class='left_col_item' wx:for="{{tableData.length}}" wx:for-index="index" wx:key="index" data-id="{{index}}" bindtap="selectRecord">访问记录</view>
</view>
</view>
<Popup show="{{popShow}}" list="{{recordList}}" bindclosePop="closePop"></Popup>
......@@ -22,30 +22,31 @@ Component({
* 组件的初始数据
*/
data: {
productTabList: [{
id: "0",
name: "scene1",
title: "车损升级",
url: "car4",
},
productTabList: [
{
id: "1",
name: "scene2",
title: "精品升级",
title: "膜升级驻店",
url: "car1",
},
{
id: "2",
name: "scene3",
title: "客户线上化",
title: "次新车二次转化",
url: "car2",
},
{
id: "3",
name: "scene4",
title: "众筹活动",
title: "售后众筹",
url: "car3",
},
{
id: "0",
name: "scene1",
title: "车损险升级",
url: "car4",
},
],
productSubscribTabList: [{
id: "0",
......@@ -59,6 +60,12 @@ Component({
title: "客户活跃",
url: "car6",
},
{
id: "2",
name: "scene3",
title: "膨胀金活动",
url: "car2",
},
],
productList: {
scene1: [{
......@@ -191,6 +198,17 @@ Component({
// isSelect: false,
// },
],
scene3: [{
nameZh: "膨胀金",
isSelect: false,
actNum: 2,
activeNavIdx: 0,
},
// {
// nameZh: "其他",
// isSelect: false,
// },
],
},
sceneNum: "",
sceneName: "",
......
......@@ -10,7 +10,16 @@ Page({
data: {
tabData: ['访问记录', '活动申请'],
tabIndex: 0,
applyData: [],
recordData: [],
recordPageData: {
pageNum: 1,
pageSize: 20,
},
applyPageData: {
pageNum: 1,
pageSize: 20,
}
},
// tab切换
selectTab(e) {
......@@ -24,19 +33,25 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getCarRecord()
this.getApplyList()
},
// 获取访问记录
getCarRecord() {
let merchant = wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId
let cardId = wx.$storage.get("scene").cardId
let params = {
pageNum: 1,
pageSize: 20,
pageNum: this.data.recordPageData.pageNum,
pageSize: this.data.recordPageData.pageSize,
merchant: merchant,
cardId: cardId
}
businessApi.cardRecordPage(params).then(res => {
console.log(res, '000');
if(res&&res.code == 0) {
let data = this.data.recordData.concat(res.data.data)
this.setData({
recordData: res.data.data.data
recordData: data
})
} else {
wx.showToast({
......@@ -45,23 +60,44 @@ Page({
})
}
})
let params1 = {
pageNum: 1,
pageSize: 20,
},
// 获取访问申请
getApplyList() {
let merchant = wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId
let cardId = wx.$storage.get("scene").cardId
let params = {
pageNum: this.data.applyPageData.pageNum,
pageSize: this.data.applyPageData.pageSize,
merchant: merchant,
cardId: cardId
}
// businessApi.activityApplyList(params1).then(res => {
// console.log(res, '000');
// if(res&&res.code == 0) {
// this.setData({
// applyData: res.data.data.data
// })
// } else {
// wx.showToast({
// title: res.message || '系统异常',
// icon: 'none'
// })
// }
// })
businessApi.activityApplyList(params).then(res => {
console.log(res, '000');
if(res&&res.code == 0) {
let data = this.data.applyData.concat(res.data.data)
this.setData({
applyData: data
})
} else {
wx.showToast({
title: res.message || '系统异常',
icon: 'none'
})
}
})
},
// 修改申请记录跟进状态值
changeApplyData(e) {
console.log(e.detail);
const activityId = e.detail
this.data.applyData.map(item => {
if (item.activityId == activityId) {
item.followType = !item.followType
}
})
this.setData({
applyData: this.data.applyData
})
},
/**
......@@ -103,7 +139,21 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
if (this.data.tabIndex == 0) {
const size = this.data.recordPageData.pageNum *this.data.recordPageData.pageSize
if (this.data.recordData.length<=size) return
this.setData({
['recordPageData.pageNum']: this.data.recordPageData.pageNum+1
})
this.getCarRecord()
} else {
const size = this.data.applyPageData.pageNum *this.data.applyPageData.pageSize
if (this.data.applyData.length<=size) return
this.setData({
['applyPageData.pageNum']: this.data.applyPageData.pageNum+1
})
this.getApplyList()
}
},
/**
......
......@@ -6,8 +6,9 @@
</view>
</view>
<block wx:if="{{tabIndex == 0}}">
<RecordTable recordData="{{recordData}}"></RecordTable>
<RecordTable recordData="{{recordData}}"></RecordTable>
</block>
<block wx:else>
<RecordApply applyData="{{applyData}}" bindchangeApplyData="changeApplyData"></RecordApply>
</block>
<block wx:else="">
<RecordApply applyData="{{applyData}}"></RecordApply></block>
</view>
\ No newline at end of file
var measureList = Object.freeze([
{
name: '新车洽谈场景',
tips: '车损升级',
iconName: 'icon1',
product: [
{
name: '车损升级',
parentName: '新车洽谈场景',
tips: '车损升级',
value: '0-0',
typeIndex: '1.0',
isCheck: false,
rate: '0.5',
averagePrice: 1200,
flowCost: '0.4',
flowCostText: '40%',
serviceDividendRatio: '0.23'
}
]
},
{
name: '新车交付场景',
tips: '精品升级',
tips: '膜升级驻店',
iconName: 'icon2',
product: [
{
......@@ -42,7 +22,7 @@ var measureList = Object.freeze([
{
name: '0-6月',
iconName: 'icon3',
tips: '膨胀金活动',
tips: '次新车二次转化',
product: [
{
name: '膨胀金活动-车衣',
......@@ -75,7 +55,7 @@ var measureList = Object.freeze([
{
name: '6个月以上',
iconName: 'icon4',
tips: '众筹活动',
tips: '售后众筹',
product: [
{
name: '360全景导航',
......@@ -143,6 +123,26 @@ var measureList = Object.freeze([
serviceDividendRatio: '0.24'
}
]
},
{
name: '新车洽谈场景',
tips: '车损险升级',
iconName: 'icon1',
product: [
{
name: '车损升级',
parentName: '新车洽谈场景',
tips: '车损升级',
value: '0-0',
typeIndex: '1.0',
isCheck: false,
rate: '0.5',
averagePrice: 1200,
flowCost: '0.4',
flowCostText: '40%',
serviceDividendRatio: '0.23'
}
]
}
])
......
......@@ -20,7 +20,7 @@ Page({
* 页面的初始数据
*/
data: {
isStaff: true,
isStaff: false,
tabList: [
{
name: '增值转化',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!