Commit 254749da by 张立顺

联调完成

1 parent e3f24408
/**
* 申请门店开通
*/
import api from '~/utils/request/request'
const common = 'scrm.api.carlife.common.'
// export
\ No newline at end of file \ No newline at end of file
...@@ -4,26 +4,16 @@ const CODE = { ...@@ -4,26 +4,16 @@ const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT', platformEntrance: 'BUSINESS_ASSISTANT',
productCode: 'PC00c3' productCode: 'PC00c3'
} }
class outPut { class applyApi {
/**获取园区店开通场景数据 */ /**申请门店 */
getSignMerchant(data) { merchantApply(data) {
return api.post( return api.post(
{ {
method: 'scrm.api.boutiquecoupon.getSceneTotal.byYqMerchantId', method: 'scrm.api.busassistant.merchant.apply',
...data
}
// true
)
}
/**获取服务商(生意助手看产值)我的门店页数据 */
partnerMerchantTotal(data) {
return api.post(
{
method: 'scrm.api.boutiquecoupon.partnermerchant.yqList',
...data ...data
} }
// true // true
) )
} }
} }
export default outPut export default applyApi
import applyApi from './applyApi.js'
export default new applyApi()
...@@ -36,5 +36,15 @@ class mineApi { ...@@ -36,5 +36,15 @@ class mineApi {
// true // true
) )
} }
/** 是否有未读消息 */
messageBoxPageIsRead(data) {
return api.post(
{
method: 'scrm.api.busassistant.messageBox.isread',
...data
}
// true
)
}
} }
export default mineApi export default mineApi
import outPut from './outPut.js'
export default new outPut()
...@@ -7,29 +7,44 @@ const CODE = { ...@@ -7,29 +7,44 @@ const CODE = {
class outputApi { class outputApi {
/** 获取服务商(生意助手看产值)我的客户页总收益 */ /** 获取服务商(生意助手看产值)我的客户页总收益 */
getMerchantTotal(data) { getMerchantTotal(data) {
return api.post( return api.post({
{ method: 'scrm.api.boutiquecoupon.partnermerchant.getMerchantTotal',
method: 'scrm.api.boutiquecoupon.partnermerchant.getMerchantTotal', ...data
...data })
}
)
} }
/** 分页获取服务商(生意助手看产值)我的客户页数据 */ /** 分页获取服务商(生意助手看产值)我的客户页数据 */
getCustomerPageList(data) { getCustomerPageList(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchant.customerPageList',
...data
})
}
/** 服务商(生意助手看产值)我的客户详情数据 */
getCustomerDetail(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchant.getCustomerDetail',
...data
})
}
/**获取园区店开通场景数据 */
getSignMerchant(data) {
return api.post( return api.post(
{ {
method: 'scrm.api.boutiquecoupon.partnermerchant.customerPageList', method: 'scrm.api.boutiquecoupon.getSceneTotal.byYqMerchantId',
...data ...data
} }
// true
) )
} }
/** 服务商(生意助手看产值)我的客户详情数据 */ /**获取服务商(生意助手看产值)我的门店页数据 */
getCustomerDetail(data) { partnerMerchantTotal(data) {
return api.post( return api.post(
{ {
method: 'scrm.api.boutiquecoupon.partnermerchant.getCustomerDetail', method: 'scrm.api.boutiquecoupon.partnermerchant.yqList',
...data ...data
} }
// true
) )
} }
} }
......
// pages/apply/apply.js // pages/apply/apply.js
const navStyle = "background-color: transparent;"; const navStyle = 'background-color: transparent;'
import { IMG_URL } from "~/utils/constantData.js"; import { IMG_URL } from '~/utils/constantData.js'
import applyApi from '~/api/applyApi/index'
// `${IMG_URL}index/car2.png`, // `${IMG_URL}index/car2.png`,
//本地图片路径 //本地图片路径
let IMG_URLLocal = "../../images/"; let IMG_URLLocal = '../../images/'
Page({ Page({
/** /**
...@@ -13,40 +14,66 @@ Page({ ...@@ -13,40 +14,66 @@ Page({
navStyle, navStyle,
IMG_URL, IMG_URL,
carObj: { carObj: {
name: "kafdkf", name: 'kafdkf',
model: "dfdsf3443", model: 'dfdsf3443',
selNum: 132, selNum: 132,
contact: "", contact: '',
phone: "", phone: ''
}, }
}, },
// navbar高度设置 // navbar高度设置
navbarReady(e) { navbarReady(e) {
let { height, statusBarHeight } = e.detail; let { height, statusBarHeight } = e.detail
this.setData({ this.setData({
tabBarStyle: height / 2 + statusBarHeight, tabBarStyle: height / 2 + statusBarHeight
// headerHeight: height / 2 + statusBarHeight + 88*2 // headerHeight: height / 2 + statusBarHeight + 88*2
}); })
}, },
// 提交信息 // 提交信息
applyFn() { applyFn() {
let { name } = this.data.carObj; let { name } = this.data.carObj
console.log("name: ", name); console.log('name: ', name)
if (!name) { if (!name) {
wx.pro.showToast({ wx.pro.showToast({
title: "请输入店名", title: '请输入店名',
icon: "error", icon: 'error'
}); })
return; return
}
this.submitForm()
console.log(123)
},
submitForm() {
let { carObj } = this.data
let { userInfo } = wx.$storage.get()
let MerchantInfo = userInfo.subLoginUser
let params = {
serviceMerchantId: MerchantInfo.merchantId,
serviceMerchantName: MerchantInfo.merchantName,
serviceMerchantPhone: MerchantInfo.phone,
merchantContact: carObj.contact,
phone: carObj.phone,
applyMerchantName: carObj.name,
carType: carObj.model,
baseCustomer: carObj.selNum
} }
console.log(123); applyApi
.merchantApply(params)
.then(result => {
console.log(result)
if (result) {
wx.$api.showToast('申请成功')
wx.$router.back()
}
})
.catch(err => {})
}, },
bindinputFn(e) { bindinputFn(e) {
// console.log("e: ", e); // console.log("e: ", e);
let name = e.currentTarget.dataset.name; let name = e.currentTarget.dataset.name
let content = e.detail.value; let content = e.detail.value
this.setData({ this.setData({
[`carObj.${name}`]:content [`carObj.${name}`]: content
}) })
}, },
/** /**
...@@ -54,7 +81,7 @@ Page({ ...@@ -54,7 +81,7 @@ Page({
*/ */
onLoad(options) {}, onLoad(options) {},
onRoute(params) { onRoute(params) {
console.log("params: ", params); console.log('params: ', params)
}, },
/** /**
...@@ -90,5 +117,5 @@ Page({ ...@@ -90,5 +117,5 @@ Page({
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {}, onShareAppMessage() {}
}); })
...@@ -4,20 +4,24 @@ Component({ ...@@ -4,20 +4,24 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
time: {
type: String
},
merchantName: {
type: String
},
messageType: {
type: String
}
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {},
},
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {}
}
}) })
/* pages/mineDetail/messageBox/components/messageBox.wxss */
\ No newline at end of file \ No newline at end of file
/* pages/mineDetail/messageBox/components/messageBox.wxss */
.msgBox {
display: flex;
flex-direction: column;
box-sizing: border-box;
background-color: #fff;
// width: 100%;
border-radius: 8rpx;
padding: 20rpx;
margin-bottom: 20rpx;
// height: 200rpx;
.title {
display: flex;
flex-wrap: wrap;
color: rgba(50, 52, 54, 1);
font-size: 28rpx;
.name {
color: rgba(50, 52, 54, 1);
font-size: 28rpx;
// font-face: PingFangSC;
font-weight: 500;
}
}
.time {
font-size: 24rpx;
color: #8A8C90;
text-align: right;
}
}
\ No newline at end of file \ No newline at end of file
<!-- pages/mineDetail/messageBox/components/messageBox.wxml --> <!-- pages/mineDetail/messageBox/components/messageBox.wxml -->
<!-- <text>pages/mineDetail/messageBox/components/messageBox.wxml</text> --> <!-- <text>pages/mineDetail/messageBox/components/messageBox.wxml</text> -->
<view class="msgBox"> <view class="msgBox">
<view class="title">您的客户XXXX汽车服务有限公司门店活动正在进行中</view> <view class="title" wx:if="{{messageType == 0}}"><view>您好,您的客户</view><text class="name">{{merchantName}}</text><view>门店账号已开通成功。</view></view>
<view class="title" wx:if="{{messageType == 1}}"><view>您好,您的客户</view><text class="name">{{merchantName}}</text><view>门店活动已开通,活动信息如下:</view></view>
<view class="title" wx:if="{{messageType == 2}}"><view>您的客户</view><text class="name">{{merchantName}}</text><view>门店活动正在进行中</view></view>
<view class="title" wx:if="{{messageType == 3}}"><view>您的客户</view><text class="name">{{merchantName}}</text><view>门店活动已结束:</view></view>
<view class="title" wx:if="{{messageType == 4}}"><view>您好,您的客户</view><text class="name">{{merchantName}}</text><view>门店场景已开通,待开展业务,信息如下:</view></view>
<slot/> <slot/>
<view class="time">10-03 09:26:26</view> <view class="time">{{time}}</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -19,28 +19,43 @@ Component({ ...@@ -19,28 +19,43 @@ Component({
warReport: { warReport: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
type: 0 type: 0,
list: 'warReportList'
}, },
message: { message: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
type: 1 type: 1,
list: 'messageList'
} }
}, },
warReportList: [],
messageList: [],
serviceMerchantId: '' serviceMerchantId: ''
}, },
attached() { attached() {
// this.initTime() // this.initTime()
let { userInfo } = wx.$storage.get() let { userInfo } = wx.$storage.get()
let merchantId = userInfo.subLoginUser.merchantId
this.setData({ this.setData({
serviceMerchantId: userInfo.subLoginUser.merchantId serviceMerchantId: userInfo.subLoginUser.merchantId
// serviceMerchantId: 12580
}) })
this.getMessageList('warReport') this.getMessageList('warReport')
this.getMessageList('message')
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
copyLink(e) {
console.log(e)
let { url } = e.currentTarget.dataset
// console.log(e.current.)
wx.$api.setCopyData(url, () => {
// wx.$spi.showToast('复制成功')
})
},
navbarReady(e) { navbarReady(e) {
let { height, statusBarHeight } = e.detail let { height, statusBarHeight } = e.detail
console.log(e) console.log(e)
...@@ -49,10 +64,24 @@ Component({ ...@@ -49,10 +64,24 @@ Component({
}) })
}, },
refreshList(e) { refreshList(e) {
console.log(e) // console.log(e)
let { type } = this.data
let { typename } = e.currentTarget.dataset
type[typename].pageNum = 1
this.getMessageList(typename)
}, },
scrollonReachBottom(e) { scrollonReachBottom(e) {
console.log(e) console.log(e)
let { typename } = e.currentTarget.dataset
let { type } = this.data
// 判断当前页是否是末页
console.log(type[typename].pages == type[typename].currentPage)
if (type[typename].pages == type[typename].pageNum) return wx.$api.showToast('列表已到底')
type[typename].pageNum = type[typename].pageNum + 1
this.setData({
type
})
this.getMessageList(typename)
}, },
changeTabIndx(e) { changeTabIndx(e) {
// console.log(e) // console.log(e)
...@@ -63,17 +92,35 @@ Component({ ...@@ -63,17 +92,35 @@ Component({
tabIndx: detail tabIndx: detail
}) })
}, },
MatchCeil(num) {
return Match.ceil(num)
},
getMessageList(typeName) { getMessageList(typeName) {
let { serviceMerchantId, type } = this.data let that = this
let { serviceMerchantId, type, warReportList, messageList } = this.data
let list = type[typeName]['list']
console.log('list', this.data[list])
// return
let params = { let params = {
serviceMerchantId, serviceMerchantId,
...type[typeName] ...type[typeName]
} }
// console.log(Math.ceil(2.8))
wx.$api.showLoading('加载中...') wx.$api.showLoading('加载中...')
mineApi mineApi
.messageBoxPage(params) .messageBoxPage(params)
.then(result => { .then(result => {
console.log(result) console.log(result)
let { count, data, pageSize, pageNum, pages } = result
const listName = `${type[typeName]['list']}`
type[typeName]['pages'] = pages
type[typeName]['pageNum'] = pageNum
console.log(listName)
this.setData({
[listName]: type[typeName].pageNum == 1 ? data : [...this.data[list], ...data],
type
})
}) })
.catch(err => {}) .catch(err => {})
.finally(() => { .finally(() => {
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
padding-top: 400rpx; padding-top: 400rpx;
font-size: 24rpx; font-size: 24rpx;
color: #8A8C90; color: #8A8C90;
// height: 80vh;
display: flex;
flex-direction: column;
overflow: hidden;
&::after { &::after {
content: ''; content: '';
...@@ -23,4 +27,34 @@ ...@@ -23,4 +27,34 @@
} }
.list {
box-sizing: border-box;
padding: 20rpx 32rpx;
}
.scrollCon {
// flex: 1;
height: calc(100% - 100rpx);
}
.cell {
display: flex;
align-items: center;
font-size: 24rpx;
color: #8A8C90;
line-height: 48rpx;
}
.value {
margin-left: 10rpx;
font-size: 24rpx;
color: #323436;
}
.link {
margin-left: 10rpx;
font-weight: 400;
font-size: 24rpx;
color: #3666FE;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
<view class="layout"> <view class="layout">
</view> --> </view> -->
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady"> <navigation-bar showBack="{{true}}" navStyle="{{navStyle}}" bindnavbarReady="navbarReady">
<view>消息盒子</view> <view>消息盒子</view>
</navigation-bar> </navigation-bar>
<view class="layout test" style="padding-top:{{tabBarStyle}}px;"> <view class="layout " style="padding-top:{{tabBarStyle}}px; height:calc(100vh - {{tabBarStyle}}px)">
<tab <tab
tab="{{tabList}}" tab="{{tabList}}"
itemWidth="{{'50%'}}" itemWidth="{{'50%'}}"
index="{{tabIndx}}" index="{{tabIndx}}"
bindclick="changeTabIndx" bindclick="changeTabIndx"
class="tabContainer" /> class="tabContainer" />
<view hidden="{{tabIndx==0}}"> <view hidden="{{tabIndx==1}}" class="scrollCon">
<scroll-view <scroll-view
scroll-y scroll-y
enable-back-to-top enable-back-to-top
...@@ -25,9 +25,10 @@ ...@@ -25,9 +25,10 @@
style="height:100%;" style="height:100%;"
scroll-top="{{scrollTop}}" scroll-top="{{scrollTop}}"
class=" list" class=" list"
data-type="warReport" data-typeName="warReport"
refresher-triggered="{{triggered}}"> refresher-triggered="{{triggered}}">
<msg-box> <!-- -->
<msg-box wx:for="{{warReportList}}" wx:key='index' messageT>
<view class="warReportBox"> <view class="warReportBox">
<view class="item"> <view class="item">
<view class="label">当前产值</view> <view class="label">当前产值</view>
...@@ -45,7 +46,7 @@ ...@@ -45,7 +46,7 @@
</msg-box> </msg-box>
</scroll-view> </scroll-view>
</view> </view>
<view hidden="{{tabIndx==1}}"> <view hidden="{{tabIndx==0}}" class="scrollCon">
<scroll-view <scroll-view
scroll-y scroll-y
enable-back-to-top enable-back-to-top
...@@ -56,12 +57,34 @@ ...@@ -56,12 +57,34 @@
style="height:100%;" style="height:100%;"
scroll-top="{{scrollTop}}" scroll-top="{{scrollTop}}"
class=" list" class=" list"
data-type="message" data-typeName="message"
refresher-triggered="{{triggered}}"> refresher-triggered="{{triggered}}">
<msg-box wx:for="messageList" wx:key='index'> <!-- -->
<view class="cell"> <msg-box
wx:for="{{messageList}}"
wx:key='index'
merchantName="{{item.merchantName}}"
messageType="{{item.messageType}}"
time="{{item.updatedTime}}">
<view class="cell" wx:if="{{item.messageType == 1}}">
<view class="label">活动名称:</view> <view class="label">活动名称:</view>
<view class="">xxxx</view> <view class="value">{{item.activityName}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 1}}">
<view class="label">开始时间:</view>
<view class="value">{{item.activityStartTime}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 1}}">
<view class="label">结算时间:</view>
<view class="value">{{item.activityEndTime}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 1}}">
<view class="label">活动链接:</view>
<view class="link" bind:tap="copyLink" data-url="{{item.activityUrl}}">点击复制活动链接</view>
</view>
<view class="cell" wx:if="{{item.messageType == 4}}">
<view class="label">产品名称:</view>
<view class="value">{{item.activityName}}</view>
</view> </view>
</msg-box> </msg-box>
</scroll-view> </scroll-view>
......
// pages/tab/mine/mine.js // pages/tab/mine/mine.js
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
import USERAPI from '~/api/usersApi/index' import USERAPI from '~/api/usersApi/index'
import mineApi from '~/api/mineApi/index'
const IMAGES = Object.freeze({ const IMAGES = Object.freeze({
icon0: `${IMG_URL}/personal/icon1.png`, icon0: `${IMG_URL}/personal/icon1.png`,
icon1: `${IMG_URL}/personal/icon2.png` icon1: `${IMG_URL}/personal/icon2.png`,
userAvatarUrl: `${IMG_URL}/personal/userAvatarUrl.png`
}) })
Page({ Page({
/** /**
...@@ -11,7 +13,12 @@ Page({ ...@@ -11,7 +13,12 @@ Page({
*/ */
data: { data: {
navStyle: 'background-color: rgba(0,0,0,0);', navStyle: 'background-color: rgba(0,0,0,0);',
IMAGES IMAGES,
isRead: false
},
navGO(e) {
let { path } = e.currentTarget.dataset
wx.$router.go(path)
}, },
logout() { logout() {
let _this = this let _this = this
...@@ -39,10 +46,33 @@ Page({ ...@@ -39,10 +46,33 @@ Page({
}) })
console.log(e) console.log(e)
}, },
messageBoxPageIsRead() {
console.log(111)
let { serviceMerchantId } = this.data
mineApi
.messageBoxPageIsRead({ serviceMerchantId })
.then(result => {
console.log(result)
this.setData({
isRead: result
})
})
.catch(err => {
console.log(err)
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) {}, onLoad: function (options) {
let { userInfo } = wx.$storage.get()
let serviceMerchantId = userInfo.subLoginUser.merchantId
this.setData({
serviceMerchantId,
userInfo: userInfo.subLoginUser
})
console.log(serviceMerchantId)
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
...@@ -51,7 +81,9 @@ Page({ ...@@ -51,7 +81,9 @@ Page({
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () {}, onShow: function () {
this.messageBoxPageIsRead()
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
......
...@@ -23,25 +23,27 @@ ...@@ -23,25 +23,27 @@
</navigation-bar> </navigation-bar>
<view class="layout" style="padding-top:{{tabBarStyle}}px;"> <view class="layout" style="padding-top:{{tabBarStyle}}px;">
<view class="userInfoCon"> <view class="userInfoCon">
<image class="headPortrait" src="" webp>头像</image> <image class="headPortrait" src="{{userInfo.userAvatarUrl||IMAGES.userAvatarUrl }}" webp>
<view class="name">代理商账号名</view> 头像
<view class="id">账号:商户ID</view> </image>
<view class="createTime">创建时间:2022-10-03</view> <view class="name">{{userInfo.merchantId}}</view>
<view class="id">账号:{{userInfo.merchantId}}</view>
<view class="createTime">创建时间:{{userInfo.createdDate}}</view>
</view> </view>
<view class="utilBoxTitle">常用工具</view> <view class="utilBoxTitle">常用工具</view>
<view class="boxItemCon"> <view class="boxItemCon">
<view class="item"> <view class="item" data-path="pages.customerManagement" bind:tap="navGO">
<view class="imgcon"> <view class="imgcon">
<image class="img" src="{{IMAGES.icon0}}" /> <image class="img" src="{{IMAGES.icon0}}" />
</view> </view>
<view class="name">客户管理</view> <view class="name">客户管理</view>
</view> </view>
<view class="item"> <view class="item" data-path="pages.messageBox" bind:tap="navGO">
<view class="imgcon"> <view class="imgcon">
<view class="redPot" /> <view class="redPot" hidden="{{!isRead}}" />
<image class="img" src="{{IMAGES.icon1}}" /> <image class="img" src="{{IMAGES.icon1}}" />
</view> </view>
<view class="name">客户管理</view> <view class="name">消息盒子</view>
</view> </view>
</view> </view>
<button <button
......
// pages/tab/output/components/sceneBox/sceneBox.js
Component({
/**
* 组件的属性列表
*/
properties: {
sceneActive: {
type: Number,
value: -1
},
hasOpenIcon: {
type: Boolean,
value: true
},
formData: {
type: Object,
value: () => { }
},
scenePriceList: {
type: Array,
value: () => []
}
},
/**
* 组件的初始数据
*/
data: {
IMGURL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
custSceneList: [{
title: '新车洽谈场景',
subTitle: '1.0新车权益销售'
}, {
title: '新车交付场景',
subTitle: '1.1新车精品升级'
}, {
title: '0-12个月',
subTitle: '1.2新车线上转化'
}, {
title: '12个月以上',
subTitle: '1.3存量用户众筹'
}]
},
/**
* 组件的方法列表
*/
methods: {
handleClick(e) {
let { idx } = e.currentTarget.dataset
this.triggerEvent('handleSceneChange', { sceneIdx: idx })
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!-- pages/tab/output/components/sceneBox/sceneBox.wxml -->
<view class="flex scene">
<view
class="scene-item {{ formData['scene' + (index + 1)] ? 'open' : ''}} {{ (sceneActive != -1 && sceneActive == index + 1) ? 'active' : ''}}"
wx:for="{{custSceneList}}"
wx:key="index"
bindtap="handleClick"
data-idx="{{index + 1}}">
<view wx:if="{{formData['showList'][index]}}" class="open-icon">已开通</view>
<image wx:if="{{formData['showList'][index]}}" class="scene-img" src="{{IMGURL}}output/caract0{{index + 1}}.png?v={{img_version}}" />
<image wx:else class="scene-img" src="{{IMGURL}}output/car0{{index + 1}}.png?v={{img_version}}" />
<view class="scene-title">{{item.title}}</view>
<view>{{item.subTitle}}</view>
<!-- wx:if="{{scenePriceList.length}}" -->
<view class="total-price">¥ {{formData['showList'][index].totalMoney||0}}</view>
</view>
</view>
/* pages/tab/output/components/sceneBox/sceneBox.wxss */
.flex {
display: flex;
}
.scene {
text-align: center;
width: 100%;
}
.scene-item {
box-sizing: border-box;
position: relative;
width: 25%;
/* flex: 1; */
background: #F7F8FC;
margin-right: 4rpx;
font-size: 18rpx;
color: #8A8C90;
padding: 32rpx 0 28rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.scene-item:last-child {
margin-right: 0;
}
.scene-title {
font-size: 24rpx;
height: 44rpx;
line-height: 44rpx;
margin: 10rpx 0 4rpx;
}
/* 已开通 - start */
.open.scene-item {
background: #F0F7FF;
}
.open-icon {
box-sizing: border-box;
position: absolute;
left: 0.5rpx;
top: 0.5rpx;
width: 56rpx;
height: 32rpx;
line-height: 24rpx;
background: #FEEBD6;
border-radius: 6rpx 0 8rpx 0;
font-size: 16rpx;
color: #EF971E;
padding: 4rpx;
}
/* 已开通 - end */
/* 选中 - start */
.active.scene-item {
background-image: linear-gradient(145deg, #F0F7FF 0%, #FFFFFF 73%);
border: 2rpx solid #3666FE;
box-shadow: 0 4rpx 8rpx 0 rgba(180, 186, 204, 0.32), 0 8rpx 20rpx 0 rgba(180, 186, 204, 0.40);
/* background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/output/carselect.png') no-repeat;
background-size: 100% 100%; */
}
/* 选中 - end */
.scene-title {
color: #323436;
font-weight: 600;
}
.scene-img {
width: 56rpx;
height: 56rpx;
}
.total-price {
height: 40rpx;
line-height: 40rpx;
margin-top: 22rpx;
font-size: 24rpx;
color: #3666FE;
font-weight: 600;
}
\ No newline at end of file \ No newline at end of file
// pages/tab/output/components/merchant/mrechant.js // pages/tab/output/components/merchant/mrechant.js
import outPut from '~/api/outPut/index' import outputApi from '~/api/outputApi/index'
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
import { getNowMonth } from '~/utils/format' import { getNowMonth } from '~/utils/format'
const IMAGES = { const IMAGES = {
...@@ -28,6 +28,9 @@ Component({ ...@@ -28,6 +28,9 @@ Component({
interval: 2000, interval: 2000,
duration: 500, duration: 500,
// tabIndx: 4, // tabIndx: 4,
current: 0,
totalMoney: 0,
totalOrder: 0,
list: [], list: [],
nowList: [], nowList: [],
todayList: [], todayList: [],
...@@ -36,66 +39,7 @@ Component({ ...@@ -36,66 +39,7 @@ Component({
todayTime: '', todayTime: '',
monthTime: '' monthTime: ''
}, },
list: [ list: [],
{
id: 1,
merchantName: '广西弘泽汽车销售服务有限公司',
totalMoney: '14580.00',
sence1: false,
sence2: true,
sence3: false,
sence4: true,
newList: [
{
time: '09-28 11:19',
content: '今日升级2单,产值¥4480'
},
{
time: '09-28 11:19',
content: '今日升级2单,产值¥4480'
}
]
},
{
id: 2,
merchantName: '广西弘泽汽车销售服务有限公司7483493849389348938',
totalMoney: '14580.00',
sence1: false,
sence2: false,
sence3: false,
sence4: false,
newList: []
},
{
id: 3,
merchantName: '广西弘泽汽车销售服务有限公司',
totalMoney: '14580.00',
sence1: false,
sence2: true,
sence3: false,
sence4: true,
newList: [
{
time: '09-28 11:19',
content: '今日升级2单,产值¥4480'
},
{
time: '09-28 11:19',
content: '今日升级2单,产值¥4480'
}
]
},
{
id: 4,
merchantName: '广西弘泽汽车销售服务有限公司7483493849389348938',
totalMoney: '14580.00',
sence1: false,
sence2: false,
sence3: false,
sence4: false,
newList: []
}
],
funnelList: { funnelList: {
start: [ start: [
{ label: '到店量', key: 'toShopCount' }, { label: '到店量', key: 'toShopCount' },
...@@ -113,6 +57,10 @@ Component({ ...@@ -113,6 +57,10 @@ Component({
// showNothingSceneCon: false // showNothingSceneCon: false
}, },
attached() { attached() {
let { userInfo } = wx.$storage.get()
this.setData({
userInfo: userInfo.subLoginUser
})
this.initTime() this.initTime()
this.getTotalMerchantCount() this.getTotalMerchantCount()
}, },
...@@ -120,17 +68,51 @@ Component({ ...@@ -120,17 +68,51 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
pickSheet(e) {
let that = this
let { index } = e.currentTarget.dataset
let { dataObj, userInfo, list } = this.data
wx.showActionSheet({
// '全部'
itemList: ['本月', '本日'],
// 先处理成全部默认去请求
success(res) {
// if (res.tapIndex!=2) {
// let parmas =
let key = res.tapIndex == 0 ? 'monthTime' : 'todayTime'
let merchantId = list[index]['merchantId']
let params = {
partnerMerchantId: '44209468', // userInfo.merchantId
merchantIdList: [merchantId],
...dataObj[key]
}
that
.getMerchantById(params)
.then(result => {
console.log(result)
that.setMerchantObj(index, result)
})
.catch(err => {})
console.log(res.tapIndex)
},
fail(res) {
console.log(res.errMsg)
}
})
},
initTime() { initTime() {
let date = new Date() let date = new Date()
let today = date.getDate() let today = date.getDate()
let month = getNowMonth() let month = getNowMonth()
const todayTime = { const todayTime = {
startTime: `${month}-${today}`, startTime: `${month}-${today} 00:00:00`,
endTime: `${month}-${today}` endTime: `${month}-${today} 23:59:59`
} }
const monthTime = { const monthTime = {
startTime: `${month}-01`, startTime: `${month}-01 00:00:00`,
endTime: `${month}-${today}` endTime: `${month}-${today} 23:59:59`
} }
this.setData({ this.setData({
dataObj: { dataObj: {
...@@ -139,39 +121,46 @@ Component({ ...@@ -139,39 +121,46 @@ Component({
} }
}) })
}, },
swiperChange(e) { getTotalMerchantCount(type) {
console.log(e)
},
getTotalMerchantCount() {
let { userInfo } = wx.$storage.get() let { userInfo } = wx.$storage.get()
let { merchantId } = userInfo.subLoginUser let { current } = this.data
console.log('merchantId', merchantId) // let { merchantId } = userInfo.subLoginUser
// console.log('merchantId', merchantId)
// 默认返回2前两条的具体数据 剩下需要自己手动查询 // 默认返回2前两条的具体数据 剩下需要自己手动查询
outPut // console.log(outputApi.partnerMerchantTotal)
.partnerMerchantTotal({ merchantId }) outputApi
.partnerMerchantTotal({ merchantId: '44209468' })
.then(result => { .then(result => {
console.log(result) // console.log(result)
let { dataList, yqMerchantIds } = result let { dataList, yqMerchantIds } = result
const list = yqMerchantIds.reduce((list, item, index) => { const list = yqMerchantIds.reduce((list, item, index) => {
let obj = {} let obj = {}
obj.totalMoney = dataList[index]?.totalMoney || 0 obj.totalMoney = dataList[index]?.totalMoney || 0
obj.totalOrder = dataList[index]?.totalOrder || 0 obj.totalOrder = dataList[index]?.totalOrder || 0
obj.merchantName = dataList[index].merchantName
obj.merchantId = item obj.merchantId = item
obj.startInd = 1 obj.startInd =
// dataList[index]?.sceneList.findIndex(item => { dataList[index]?.sceneList.findIndex(item => {
// return item != null return item != null
// }) || 1 }) || -1
obj.showNothingSceneCon = item.startInd == -1 obj.showNothingSceneCon = item.startInd == -1
obj.showList = dataList[index]?.sceneList || [] obj.showList = dataList[index]?.sceneList || []
// obj.norList = type?obj.
obj.norList = item.sceneList
list.push(obj) list.push(obj)
return list return list
}, []) }, [])
console.log('list', list) // console.log('list', list)
// this.
// this
// totalMoney = list[current].totalMoney
this.setData({ this.setData({
list, list,
yqMerchantIds yqMerchantIds,
totalMoney: list[current].totalMoney,
totalOrder: list[current].totalOrder
}) })
}) })
.catch(err => {}) .catch(err => {})
...@@ -181,19 +170,84 @@ Component({ ...@@ -181,19 +170,84 @@ Component({
let { list } = this.data let { list } = this.data
let { index } = e.currentTarget.dataset let { index } = e.currentTarget.dataset
let { sceneIdx } = e.detail let { sceneIdx } = e.detail
console.log(sceneIdx)
// let value = list[index][sceneIdx]
// console.log(list[index]['showList'][sceneIdx - 1])
// 没开通场景不给切换过去
if (!list[index]['showList'][sceneIdx - 1]) return
list[index].startInd = sceneIdx - 1 list[index].startInd = sceneIdx - 1
this.setData({ this.setData({
list list
}) })
}, },
getMerchantById(params) {
// console.log(outPut)
return new Promise((resolve, reject) => {
// console.log(outPut)
outputApi
.getSignMerchant(params)
.then(result => {
resolve(result)
})
.catch(err => {
reject(err)
})
})
},
setMerchantObj(index, item) {
console.log(item)
item = item[0]
let obj = {}
obj.totalMoney = item?.totalMoney || 0
obj.totalOrder = item?.totalOrder || 0
// obj.merchantName = item.merchantName
// obj.merchantId = item
obj.startInd =
item?.sceneList.findIndex(item => {
return item != null
}) || -1
obj.showNothingSceneCon = obj.startInd == -1
obj.showList = item?.sceneList || []
// obj.norList = type?obj.
// obj.norList = item.sceneList
let { list } = this.data
// item.list[index] = list[index]
console.log('listObj', listObj)
let listObj = `list[${index}]`
this.setData({
[listObj]: Object.assign(list[index], obj)
})
},
swiperChange(e) { swiperChange(e) {
console.log(e) console.log(e)
let { yqMerchantIds } = this.data let { list } = this.data
let { current } = e.detail let { current } = e.detail
if (condition) { this.setData({
totalMoney: list[current].totalMoney,
totalOrder: list[current].totalOrder
})
// list
if (current >= 1 && list[current + 1] && list[current + 1].startInd == -1) {
// 请求
// partnerMerchantId
let merchantId = list[current + 1]['merchantId']
console.log(merchantId)
let params = {
partnerMerchantId: '44209468',
merchantIdList: [merchantId]
}
// console.log()
console.log('params', params)
this.getMerchantById(params)
.then(result => {
console.log(result)
this.setMerchantObj(current + 1, result)
})
.catch(err => {
console.log(err)
})
} }
this.triggerEvent('swiperChange', current)
} }
} }
}) })
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"scene-box": "../../../../../components/SceneBox/SceneBox", "scene-box": "../SceneBox/SceneBox",
"nothingTipsCon": "../nothingTipsCon/nothingTipsCon" "nothingTipsCon": "../nothingTipsCon/nothingTipsCon"
} }
} }
...@@ -121,12 +121,28 @@ ...@@ -121,12 +121,28 @@
.funneItem { .funneItem {
position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
z-index: 999; z-index: 999;
width: 100%; width: 100%;
height: 400rpx; height: 400rpx;
font-size: 24rpx;
color: #323436;
.num {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: Helvetica-Bold;
font-weight: Bold;
font-size: 28rpx;
color: #3666FE;
// width: 100%;
// margin: 0 auto;
}
} }
.diagnosisCon { .diagnosisCon {
...@@ -215,7 +231,7 @@ ...@@ -215,7 +231,7 @@
} }
.full { .full {
height: 1350rpx !important; height: 1450rpx !important;
} }
.short { .short {
......
<!-- pages/tab/output/components/merchant/mrechant.wxml --> <!-- pages/tab/output/components/merchant/mrechant.wxml -->
<!-- <text>pages/tab/output/components/merchant/mrechant.wxml</text> -->
<!-- hidden="{{true}}" --> <!-- hidden="{{true}}" -->
<view class="con"> <view class="con">
<view class="statistics"> <view class="statistics">
<view class="totalOutputValue box"> <view class="totalOutputValue box">
<view class="num">¥300000.00</view> <view class="num">¥{{totalMoney}}</view>
<view class="label">总产值</view> <view class="label">总产值</view>
</view> </view>
<view class="totalOrder box"> <view class="totalOrder box">
<view class="num">500</view> <view class="num">{{totalOrder}}</view>
<view class="label">订单数/笔</view> <view class="label">订单数/笔</view>
</view> </view>
</view> </view>
...@@ -27,8 +26,8 @@ ...@@ -27,8 +26,8 @@
<swiper-item> <swiper-item>
<view class="merchantDataStatistics-con"> <view class="merchantDataStatistics-con">
<view class="contitle"> <view class="contitle">
<view class="name">广西宏泽汽车有限公司</view> <view class="name">{{item.merchantName}}</view>
<view class="select"> <view class="select" data-index="{{index}}" bind:tap="pickSheet">
<view>全部</view> <view>全部</view>
<image <image
class="arrow {{isAct?'isAct':''}}" class="arrow {{isAct?'isAct':''}}"
...@@ -48,7 +47,7 @@ ...@@ -48,7 +47,7 @@
</view> </view>
<view class="outputValueCon" wx:if="{{!showNothingSceneCon}}"> <view class="outputValueCon" wx:if="{{!showNothingSceneCon}}">
<view class="title">产值图</view> <view class="title">产值图</view>
<view class="swiperCon"> <view class="swiperCon" wx:if="{{item['showList']}}">
<view class="swiper-item "> <view class="swiper-item ">
<view class="fluuelCon"> <view class="fluuelCon">
<image class="bg-image" src="{{IMAGES.funnel}}" /> <image class="bg-image" src="{{IMAGES.funnel}}" />
...@@ -59,7 +58,7 @@ ...@@ -59,7 +58,7 @@
wx:for-item="funneItem"> wx:for-item="funneItem">
<view class="funneItem"> <view class="funneItem">
<view class="label">{{funneItem['label']}}</view> <view class="label">{{funneItem['label']}}</view>
<view class="num">{{item['showList' ][funneItem['key']] }}</view> <view class="num">{{item.showList[item.startInd][funneItem['key']]||0}}</view>
</view> </view>
</block> </block>
</view> </view>
...@@ -69,12 +68,12 @@ ...@@ -69,12 +68,12 @@
<view class="merchantCount"> <view class="merchantCount">
<view class="turnover"> <view class="turnover">
<image class="img " webp src="{{IMAGES.money}}" /> <image class="img " webp src="{{IMAGES.money}}" />
<view class="num">200</view> <view class="num">{{item.showList[item.startInd]['totalMoney']||0}}</view>
<view class="label">营业额/¥</view> <view class="label">营业额/¥</view>
</view> </view>
<view class="customerUnitPrice"> <view class="customerUnitPrice">
<image class="img " webp src="{{IMAGES.paper}}" /> <image class="img " webp src="{{IMAGES.paper}}" />
<view class="num">2000</view> <view class="num">{{item.showList[item.startInd]['custUnitPrice']||0}}</view>
<view class="label">客单价/¥</view> <view class="label">客单价/¥</view>
</view> </view>
</view> </view>
...@@ -82,12 +81,14 @@ ...@@ -82,12 +81,14 @@
<view class="diagnosisCon"> <view class="diagnosisCon">
<view class="tipsIcon">指标诊断</view> <view class="tipsIcon">指标诊断</view>
<view class="tips"> <view class="tips">
日均升级客单价低于1000/低于上2个月平均日升级客单价的10%,建议梳理驻店销售的技能,以及加强与流量方的互动。 {{item.showList[item.startInd]['diagnoseList'][0]}}
<!-- 日均升级客单价低于1000/低于上2个月平均日升级客单价的10%,建议梳理驻店销售的技能,以及加强与流量方的互动。 -->
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- <view wx:else>test</view> -->
</view> </view>
<view wx:if="{{showNothingSceneCon}}" /> <view wx:if="{{showNothingSceneCon}}" />
</view> </view>
......
// pages/tab/output/components/staff/staff.js // pages/tab/output/components/staff/staff.js
import { IMG_URL } from '~/utils/constantData'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {},
},
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
expectImg: `${IMG_URL}/output/expect.png`
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {}
}
}) })
/* pages/tab/output/components/staff/staff.wxss */
\ No newline at end of file \ No newline at end of file
/* pages/tab/output/components/staff/staff.wxss */
.staffCon {
box-sizing: border-box;
display: flex;
flex-direction: column;
// justify-content: center;
align-items: center;
padding-top: 88rpx;
background-color: #fff;
height: 100vh;
.img {
width: 512rpx;
height: 512rpx;
}
.label {
margin-top: -50rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!-- pages/tab/output/components/staff/staff.wxml --> <!-- pages/tab/output/components/staff/staff.wxml -->
<view class="staffCon"> <view class="staffCon">
<!-- <img src="" alt=""> --> <image class="img" src="{{expectImg}}" />
<view>程序员在通宵建设中…</view> <view class="label">程序员在通宵建设中…</view>
</view> </view>
...@@ -53,7 +53,8 @@ const pathEnum = { ...@@ -53,7 +53,8 @@ const pathEnum = {
material: '/rop-scrm-marketing/', //素材 material: '/rop-scrm-marketing/', //素材
sop: '/rop-scrm-sop/', sop: '/rop-scrm-sop/',
customercollect: '/rop-scrm-bigdatautil/', customercollect: '/rop-scrm-bigdatautil/',
drac: '/rop-scrm-entmicro/' drac: '/rop-scrm-entmicro/',
busassistant: '/rop-scrm-busassistant/'
} }
const defaultMerchantId = { const defaultMerchantId = {
ip: '44184606', ip: '44184606',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!