Commit 323ac314 by 前端

init

1 parent d8d3b63b
Showing 82 changed files with 4793 additions and 2 deletions
{ {
"pages": ["login/loading/loading", "pages/tab/index/index", "pages/tab/output/output", "pages/tab/mine/mine", "pages/webView/webView", "login/index/index", "login/accountItems/accountItems", "pages/viewVideo/index", "pages/viewProd/index", "pages/viewProdBanner/index", "pages/measure/measure/measure", "pages/measure/measureResult/measureResult"], "pages": ["login/loading/loading", "pages/tab/index/index", "pages/tab/output/output", "pages/tab/mine/mine", "pages/webView/webView", "login/index/index", "login/accountItems/accountItems", "pages/viewVideo/index", "pages/viewProd/index", "pages/viewProdBanner/index", "pages/measure/measure/measure", "pages/measure/measureResult/measureResult", "packagesList/activityDetail/activityDetail"],
"requiredPrivateInfos": ["getLocation"], "requiredPrivateInfos": ["getLocation"],
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",
"window": { "window": {
...@@ -33,6 +33,33 @@ ...@@ -33,6 +33,33 @@
} }
] ]
}, },
"subpackages": [
{
"root": "packagesList/pages",
"name": "packagesList",
"pages": ["videoDetal/videoDetal", "productDetail/productDetail", "scenarioDetail/scenarioDetail"]
},
{
"root": "packagesList/packageOutput",
"name": "packageOutput",
"pages": ["pages/openBusiness", "pages/summary"]
},
{
"root": "packagesList/mineDetail",
"name": "mineDetail",
"pages": ["pages/messageBox", "pages/customerManagement", "pages/clue"]
},
{
"root": "packagesList/apply",
"name": "apply",
"pages": ["pages/apply"]
},
{
"root": "packagesList/applyProd",
"name": "applyProd",
"pages": ["pages/apply"]
}
],
"preloadRule": { "preloadRule": {
"pages/tab/mine/mine": { "pages/tab/mine/mine": {
"network": "all", "network": "all",
...@@ -60,4 +87,4 @@ ...@@ -60,4 +87,4 @@
"desc": "你的位置信息将用于小程序位置接口的效果展示" "desc": "你的位置信息将用于小程序位置接口的效果展示"
} }
} }
} }
\ No newline at end of file \ No newline at end of file
// packagesList/pages/activityDetail/activityDetail.js
import { getActivityDetailApi } from '~/api/index.js'
import { IMG_URL } from '~/utils/constantData'
Page({
/**
* 页面的初始数据
*/
data: {
IMGURL: IMG_URL,
activityInfo: {},
autoplay: true
},
toActivity() {
const activityInfo = this.data.activityInfo
wx.navigateToMiniProgram({
appId: 'wxe10067a63c1856ac',
path: 'pages/crowdfunding/index/index?id=' + activityInfo.crowdFundActivityId + '&merchantId=' + activityInfo.merchantNo,
envVersion: 'trial',
success(res) {
// 打开成功
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options)
wx.$router.getData(res => {
console.log(res)
this.getActivityDetail(res.id)
// this.setData({
// hasPhoneNumber: res.hasPhoneNumber
// })
})
},
getActivityDetail(id) {
getActivityDetailApi({ id }).then(res => {
res.beginTime = new Date(res.beginTime).format('yyyy年MM月dd日')
res.endTime = new Date(res.endTime).format('yyyy年MM月dd日')
this.setData({
activityInfo: res
})
})
},
handlePlay() {
this.setData({
autoplay: !this.data.autoplay
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packagesList/pages/activityDetail/activityDetail.wxss */
.activity-detail {
background-color: #F5F5F7;
.swiper {
height: 422rpx;
}
.swiper-img {
width: 100%;
height: 422rpx;
}
}
.activity-name {
font-size: 32rpx;
font-weight: 600;
background-color: #fff;
padding: 16rpx 32rpx 32rpx;
}
.activity-introduction {
margin-top: 20rpx;
background-color: #fff;
padding: 24rpx 32rpx;
.activity-title {
font-weight: 500;
font-size: 36rpx;
color: #2D2D33;
}
.activity-content {
margin: 16rpx 0 48rpx;
font-weight: 400;
font-size: 28rpx;
color: #444444;
line-height: 52rpx;
}
.activity-info {
margin-top: 16rpx;
.activity-item {
display: flex;
align-items: center;
margin-bottom: 8rpx;
.activity-icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
.text {
font-weight: 400;
font-size: 28rpx;
color: #444444;
}
}
}
.activity-btn {
margin-top: 48rpx;
margin-bottom: 136rpx;
font-weight: 500;
font-size: 32rpx;
color: #5850FF;
text-align: center;
line-height: 48rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/pages/activityDetail/activityDetail.wxml-->
<view class="activity-detail">
<swiper class="swiper" autoplay="{{autoplay}}" circular="true" current="{{current}}" interval="5000">
<swiper-item class="swiper-item" wx:if="{{activityInfo.videoUrl}}">
<video class="swiper-img" src="{{activityInfo.videoUrl}}" bindplay="handlePlay" bindpause="handlePlay"></video>
</swiper-item>
<swiper-item class="swiper-item" wx:for="{{activityInfo.imageUrlArr}}" wx:key="index">
<image class="swiper-img" webp src="{{item}}"></image>
</swiper-item>
</swiper>
<view class="activity-name">{{activityInfo.activityName}}</view>
<view class="activity-introduction">
<view class="activity-title">活动介绍</view>
<view class="activity-content">
{{activityInfo.activityEvent}}
</view>
<view class="activity-title">活动举办方</view>
<view class="activity-info">
<view class="activity-item" wx:if="{{activityInfo.sponsorName}}">
<image class="activity-icon" webp src="{{IMGURL}}image/activity/icon-company.png"></image>
<view class="text">{{activityInfo.sponsorName}}</view>
</view>
<view class="activity-item" wx:if="{{activityInfo.address}}">
<image class="activity-icon" webp src="{{IMGURL}}image/activity/icon-address.png"></image>
<view class="text">{{activityInfo.address}}</view>
</view>
<view class="activity-item">
<image class="activity-icon" webp src="{{IMGURL}}image/activity/icon-time.png"></image>
<view class="text">{{activityInfo.beginTime + ' - ' + activityInfo.endTime}}</view>
</view>
</view>
<view class="activity-btn" bindtap="toActivity">查看活动详情页面</view>
</view>
</view>
<!-- <phone-number type="{{'scenario'}}" bindtoApplication="toApplication" bindupdatePhoneNumber="updatePhoneNumber" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number> -->
\ No newline at end of file \ No newline at end of file
// packagesList/apply/components/ApplyBusiness/ApplyBusiness.js
import { scenceList } from '~/pages/tab/index/constant/data'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
scenceList,
carObj: {
name: '',
model: '',
selNum: '',
contact: '',
phone: ''
},
actNum:0, //选中的场景
selectProdArr:[] //选中的产品数组
},
/**
* 组件的方法列表
*/
methods: {
selectCar(e) {
// console.log('e: ', e);
let {num} = e.currentTarget.dataset
this.setData({
actNum:num
})
},
selectProd(e){
console.log('e: ', e);
let item = e.currentTarget.dataset.item
let productName = item.productName
let {selectProdArr} = this.data;
let searchIndex = selectProdArr.findIndex((item)=>item.productName == productName)
if(searchIndex != -1){
// 找到item、删除
selectProdArr.splice(searchIndex, 1)
}else{
selectProdArr.push(item)
}
this.setData({
selectProdArr
})
console.log(this.data.selectProdArr, 'selectProdArr--')
},
bindinputFn(e) {
// console.log("e: ", e);
let name = e.currentTarget.dataset.name
let content = e.detail.value
this.setData({
[`carObj.${name}`]: content
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packagesList/apply/components/ApplyBusiness/ApplyBusiness.wxss */
.inp-wrap {
margin-left: 32rpx;
display: flex;
align-items: center;
height: 112rpx;
border-bottom: 1px solid #f3f3f3;
.title {
margin-right: 64rpx;
// margin-top: 8px;
// margin-bottom: 8px;
font-weight: 600;
font-size: 14px;
color: #323436;
.point {
color: #f35251;
}
}
.inp {
flex: 1;
height: 112rpx;
// padding: 7px 12px;
// border: 1px solid #E3E4E8;
// border-radius: 2px;
}
.inp-placeholder {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #8a8c90;
}
}
.scene-title {
display: flex;
align-items: center;
margin-left: 32rpx;
margin-top: 48rpx;
margin-bottom: 36rpx;
font-weight: 500;
font-size: 28rpx;
color: #323436;
.tip {
font-size: 22rpx;
color: #6E6E7A;
}
}
.content-product {
.scene {
// margin-top: 32rpx;
// margin-left: 20rpx;
// margin-right: 20rpx;
// margin-bottom: 10rpx;
margin: 32rpx 16rpx 0;
.scene-wrap {
display: flex;
}
.item-wrap {
margin-right: 8rpx;
margin-bottom: 40rpx;
position: relative;
width: 160rpx;
height: 180rpx;
border-radius: 8rpx;
border: 1px solid #f7f8fc;
box-sizing: border-box;
}
.item {
position: relative;
// padding-top: 10px;
width: 160rpx;
height: 180rpx;
background: #f7f8fc;
border-radius: 8rpx;
box-sizing: border-box;
// border: 1px solid #f7f8fc;
}
.open-img {
position: absolute;
top: 0;
right: 0;
width: 78rpx;
height: 78rpx;
box-sizing: border-box;
}
.act {
// background-image: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/act.png");
// background-size: 100% 100%;
border: 1px solid var(--btnColor);
// box-shadow: 0 2rpx 4rpx 0 rgba(180, 186, 204, 0.4);
background-image: linear-gradient(145deg, #f0f7ff 0%, #ffffff 73%);
box-shadow: 0 4rpx 8rpx 0 rgba(180, 186, 204, 0.32),
0 8rpx 20rpx 0 rgba(180, 186, 204, 0.4);
&::after {
position: absolute;
left: 50%;
bottom: -7px;
display: block;
content: "";
width: 6px;
height: 6px;
border-bottom: 1px solid var(--btnColor);
border-right: 1px solid var(--btnColor);
transform: rotate(45deg) translateX(-50%);
background-color: #fff;
}
// .open-img{
// display: none;
// }
.item {
background: transparent;
}
}
.img {
padding-top: 10px;
display: block;
margin: 0 auto 2px;
width: 28px;
height: 28px;
}
.name-box {
height: 68rpx;
display: flex;
justify-content: center;
align-items: center;
margin-top: 8rpx;
}
.name {
width: 100rpx;
font-weight: 500;
font-size: 12px;
color: #323436;
text-align: center;
}
.item-wrap:nth-child(2) .name {
width: 120rpx;
}
.msg {
font-weight: 500;
font-size: 18rpx;
// color: #323436;
color: #8A8C90;
text-align: center;
}
}
}
.scene-select {
display: flex;
flex-wrap: wrap;
padding: 0 16rpx 32rpx;
.scene-item {
&:nth-child(3n+3) {
margin-right: 0;
}
position: relative;
margin-right: 10rpx;
margin-bottom: 20rpx;
width: 216rpx;
height: 64rpx;
background: #F5F5FA;
border-radius: 8rpx;
font-size: 28rpx;
color: #323436;
text-align: center;
line-height: 64rpx;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
white-space:nowrap;
}
.act {
background: #F0F7FF;
border: 2rpx solid #3E71FE;
border-radius: 8rpx;
font-weight: 500;
color: #3666FE;
.act-img {
display: block;
}
}
.act-img {
display: none;
position: absolute;
top: 0;
right: 0;
width: 30rpx;
height: 22rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/apply/components/ApplyBusiness/ApplyBusiness.wxml-->
<wxs module="filter" src="./ApplyBusiness.wxs"></wxs>
<view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
开店名称
<text class="point">*</text>
</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.name}}" bindinput="bindinputFn" data-name="name" maxlength="{{30}}" placeholder="营业执照上的公司名称" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">店面车型</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.model}}" bindinput="bindinputFn" data-name="model" maxlength="{{30}}" placeholder="主营品牌/车型" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">新车销量/基盘客户</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.selNum}}" bindinput="bindinputFn" data-name="selNum" maxlength="{{30}}" placeholder="请输入数字" type="number"/>
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">联系人</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.contact}}" bindinput="bindinputFn" data-name="contact" maxlength="{{50}}" placeholder="请输入联系人" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">手机号</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.phone}}" bindinput="bindinputFn" data-name="phone" maxlength="{{11}}" placeholder="请输入手机号" type="number"/>
</view>
<view class="scene-title" hover-class="none" hover-stop-propagation="false">业务场景</view>
<view class="content-product">
<view class="scene">
<scroll-view scroll-x="{{true}}">
<view class="scene-wrap">
<view class="item-wrap {{actNum== index ? 'act':''}}" data-num="{{index}}" data-scenestatus="{{item.sceneStatus}}" bindtap="selectCar" wx:for="{{scenceList}}" wx:key="name">
<view class="item">
<image webp class="img" src="{{item.src}}" />
<view class="name-box">
<view class="name">{{item.name}}</view>
</view>
<!-- <view class="msg">{{item.msg}}</view> -->
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="scene-title" hover-class="none" hover-stop-propagation="false">
业务场景
<view class="tip" hover-class="none" hover-stop-propagation="false">(可多选)</view>
</view>
<view class="scene-select">
<view class="scene-item {{filter.hasProdAct(item,selectProdArr)?'act':''}}" wx:for="{{scenceList[actNum]['productList']}}" wx:key="index" data-item="{{item}}" data-index="{{index}}" bindtap="selectProd">
<glsx-image webp class="act-img" src="index/act-img.png"></glsx-image>
{{item.productName}}
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
//查询是否选中
function hasProdAct(prod,selectProdArr) {
// console.log('prod: ', JSON.stringify(prod));
// console.log('selectProdArr: ', JSON.stringify(selectProdArr));
if(!selectProdArr || selectProdArr.length === 0) return
console.log('selectProdArr: ', selectProdArr);
var resIndex = -1
for(var i = 0;i<selectProdArr.length;i++){
if(selectProdArr[i].productName == prod.productName){
resIndex = i
}
}
if(resIndex == -1){
return false
}
return true;
}
// 导出对外暴露的属性
module.exports = {
hasProdAct: hasProdAct
}
\ No newline at end of file \ No newline at end of file
// packagesList/apply/components/ApplyProduct/ApplyProduct.js
import { getMerchantListApi } from '~/api/applyProd.js'
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
behaviors: [computedBehavior],
data: {
prodName: '',
storeShow: false,
selectStoreItem: {},
scene: 3 //场景值
},
computed: {
selectStoreValue(data) {
return data.selectStoreItem.name || '请选择合作门店'
}
},
lifetimes: {
attached() {
this.getMerchantListFn()
}
},
/**
* 组件的方法列表
*/
methods: {
//获取门店
async getMerchantListFn() {
let { scene } = this.data
let userInfo = wx.$storage.get('userInfo')
let params = {
// scene,
serviceMerchantId: userInfo.merchantId
}
let { code, data } = await getMerchantListApi(params)
if (code == 0 && data.length != 0) {
data = data.map(item => {
item.name = item.merchantName
return item
})
// console.log('data: ', data);
this.setData({
actions: data
})
}
},
// 选择门店
selectStore() {
this.setData({ storeShow: true });
},
onStoreClose() {
this.setData({ storeShow: false });
},
onStoreSelect(event) {
console.log(event.detail);
let selectStoreItem = event.detail
this.setData({ selectStoreItem })
this.onStoreClose()
},
}
})
{
"component": true,
"usingComponents": {
"van-action-sheet": "@vant/weapp/action-sheet/index",
"van-cell": "@vant/weapp/cell/index"
},
"styleIsolation": "shared"
}
\ No newline at end of file \ No newline at end of file
/* packagesList/apply/components/ApplyProduct/ApplyProduct.wxss */
.apply-product {
.inp-wrap {
margin-left: 32rpx;
display: flex;
align-items: center;
height: 112rpx;
border-bottom: 1px solid #f3f3f3;
.title {
margin-right: 64rpx;
// margin-top: 8px;
// margin-bottom: 8px;
font-weight: 600;
font-size: 14px;
color: #323436;
.point {
color: #f35251;
}
}
.inp {
flex: 1;
height: 112rpx;
// padding: 7px 12px;
// border: 1px solid #E3E4E8;
// border-radius: 2px;
}
.inp-placeholder {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #8a8c90;
}
.out-van-cell {
flex: 1;
.inp-van-cell {
&.van-cell {
height: 112rpx;
line-height: 112rpx;
padding: 0;
flex: 1;
.point {
color: #f35251;
}
// line-height: 1;
}
&:after {
display: none;
}
.van-cell__title {
flex: none;
width: 184rpx;
}
.van-cell-text {
font-weight: 600;
}
.van-cell__value {
text-align: left;
font-family: UICTFontTextStyleBody;
min-height: 1.4rem;
overflow: hidden;
text-overflow: clip;
white-space: nowrap;
}
.van-cell__right-icon-wrap {
margin-right: 32rpx;
height: 112rpx;
line-height: 112rpx;
}
}
}
}
}
.list-sheet-wrap {
max-height: 60vh;
overflow-y: auto;
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/apply/components/ApplyProduct/ApplyProduct.wxml-->
<view class="apply-product">
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
您的产品名称
<text class="point">*</text>
</view>
<input class="inp" placeholder-class="inp-placeholder" model:value="{{prodName}}" maxlength="{{10}}" placeholder="请输入产品名称" />
</view>
<view class="inp-wrap">
<view class="out-van-cell">
<van-cell custom-class="inp-van-cell" value="{{selectStoreValue}}" is-link bind:click="selectStore">
<view slot="title">
<view class="van-cell-text">
合作门店
<text class="point">*</text>
</view>
</view>
</van-cell>
</view>
</view>
</view>
<view>
<van-action-sheet show="{{ storeShow }}" cancel-text="取消" actions="{{ actions }}" list-class="list-sheet-wrap" bind:cancel="onStoreClose" bind:close="onStoreClose" bind:select="onStoreSelect" />
</view>
\ No newline at end of file \ No newline at end of file
// pages/apply/apply.js
const navStyle = 'background-color: transparent;'
import { IMG_URL } from '~/utils/constantData.js'
import applyApi from '~/api/applyApi/index'
import { addCoProductApi } from '~/api/applyProd.js'
// `${IMG_URL}index/car2.png`,
//本地图片路径
let IMG_URLLocal = '../../images/'
import utils from '~/utils/util.js'
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
Page({
/**
* 页面的初始数据
*/
behaviors: [computedBehavior],
data: {
// navStyle,
IMG_URL,
tabActive: 1,
tabList: [{
title: '申请业务',
name: 1
}, {
title: '申请产品',
name: 2
}],
isLoading: false
},
// computed: {
// hasProdAct(data) {
// return data.selectProdArr.
// }
// },
// navbar高度设置
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
// headerHeight: height / 2 + statusBarHeight + 88*2
})
},
onTabChange(e) {
const { name } = e.detail
this.setData({
tabActive: name
})
},
// 申请业务
applyBusiness() {
if (this.data.isLoading) {
return
}
const subCompData = this.selectComponent('#apply-business').data
let { name } = subCompData.carObj
// console.log('name: ', name)
if (!name) {
wx.pro.showToast({
title: '请输入开店名称',
icon: 'error'
})
return
}
this.submitBusinessForm(subCompData)
},
submitBusinessForm(subCompData) {
let { carObj, selectProdArr } = subCompData
let { clueId } = this.data
let selectProdArrStr = ''
selectProdArr.forEach((item, index) => { selectProdArrStr += `${item.productName}${selectProdArr.length - 1 == index ? '' : ';'}` })
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,
clueId,
intentProducts: selectProdArrStr
}
this.setData({
isLoading: true
})
// return wx.$api.showToast('申请成功')
applyApi
.merchantApply(params)
.then(result => {
// console.log(result)
if (result) {
wx.$api.showToast('申请成功')
setTimeout(() => {
wx.$router.back(page => {
page && page.getClueInit && page.getClueInit()
})
}, 1000)
}
})
.catch(err => {
this.setData({
isLoading: false
})
})
},
// 申请产品
applyProduct() {
if (this.data.isLoading) {
return
}
const subCompData = this.selectComponent('#apply-product').data
let { prodName, selectStoreItem } = subCompData
if (!prodName) {
wx.pro.showToast({
title: '请输入产品名称',
icon: 'error'
})
return
}
if (utils.isEmptyObj(selectStoreItem)) {
wx.pro.showToast({
title: '请选择合作门店',
icon: 'error'
})
return
}
this.submitProductForm(subCompData)
},
async submitProductForm(subCompData) {
let { prodName, selectStoreItem } = subCompData
let userInfo = wx.$storage.get('userInfo')
let params = {
...selectStoreItem,
serviceMerchantId: userInfo.merchantId,
serviceMerchantName: userInfo.merchantName,
coProduct: prodName
}
this.setData({
isLoading: true
})
let { code } = await addCoProductApi(params)
if (code == 0) {
wx.$api.showToast('申请成功')
setTimeout(() => {
wx.$router.back()
}, 1000)
} else {
this.setData({
isLoading: false
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) { },
onRoute(params) {
// 线索id
this.setData({
clueId: params
})
// console.log('params: ', params)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() { },
/**
* 生命周期函数--监听页面显示
*/
onShow() { },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload() { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() { },
/**
* 用户点击右上角分享
*/
onShareAppMessage() { }
})
{
"usingComponents": {
"apply-business": "../components/ApplyBusiness/ApplyBusiness",
"apply-product": "../components/ApplyProduct/ApplyProduct",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index"
},
"navigationStyle": "custom",
"onReachBottomDistance": 10,
"enablePullDownRefresh": true
}
\ No newline at end of file \ No newline at end of file
/* pages/apply/apply.wxss */
page {
background: white;
// height: 100%;
position: relative;
}
.apply {
padding-bottom: 64rpx;
.head {
position: sticky;
top: 0;
width: 100%;
}
.introduce {
height: 320rpx;
}
.content-wrap{
background-image:linear-gradient(to bottom,#D0E5FE,#fff);
}
.content {
margin-left: 24rpx;
margin-right: 24rpx;
padding-top: 16px;
// padding: 16px 17px 0;
background: #ffffff;
box-shadow: 0 6rpx 24rpx 0 rgba(175, 181, 219, 0.4);
border-radius: 16rpx;
.item {
}
.top {
margin-bottom: 32rpx;
align-items: center;
.line {
width: 6rpx;
height: 36rpx;
background: #3666fe;
border-radius: 0 8rpx 8rpx 0;
}
.title {
margin-left: 26rpx;
font-weight: 500;
font-size: 32rpx;
color: #323436;
// line-height: 48rpx;
}
}
}
.btn-box {
position: fixed;
bottom: 64rpx;
left: 0;
width: 100%;
background-color: #FFFFFF;
}
.btn {
margin: 64rpx auto 0;
width: 648rpx;
font-weight: 500;
font-size: 17px;
color: #ffffff;
background: var(--btnColor);
// position: absolute;
// bottom: 40rpx;
// left: 50%;
// transform: translateX(-50%);
}
}
<!-- pages/apply/apply.wxml -->
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
申请业务
</navigation-bar>
<view class="apply">
<image class="head" src="{{IMG_URL}}index/apply-title.png" style="height:{{tabBarStyle}}px;" />
<image class="introduce" src="{{IMG_URL}}index/new-apply-bg.png" />
<view class="content-wrap">
<view class="content" hover-class="none" hover-stop-propagation>
<view class="top">
<!-- <view class="line" hover-class="none" hover-stop-propagation="false" />
<view class="title" hover-class="none" hover-stop-propagation="false">开通门店账号</view> -->
<van-tabs active="{{ tabActive }}" bind:change="onTabChange">
<van-tab wx:for="{{tabList}}" wx:key="index" title="{{item.title}}" name="{{item.name}}">
</van-tab>
</van-tabs>
</view>
<apply-business id="apply-business" wx:if="{{tabActive == 1}}"></apply-business>
<apply-product id="apply-product" wx:if="{{tabActive == 2}}"></apply-product>
</view>
</view>
<button wx:if="{{tabActive == 1}}" class="btn" bindtap="applyBusiness">提交开店信息</button>
<view wx:if="{{tabActive == 2}}" class="isFullSucreen btn-box" bindtap="applyProduct">
<button class="btn">申请合作</button>
</view>
<!-- <button class="btn" bindtap="applyFn">申请合作产品</button> -->
</view>
\ No newline at end of file \ No newline at end of file
// pages/apply/apply.js
const navStyle = 'background-color: transparent;'
import { IMG_URL } from '~/utils/constantData.js'
import {getMerchantListApi,addCoProductApi} from '~/api/applyProd.js'
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
import utils from '~/utils/util.js'
Page({
/**
* 页面的初始数据
*/
behaviors: [computedBehavior],
data: {
IMG_URL,
// navStyle,
prodName:'',
cooperativeStore:'',
storeShow: false,
actions: [
// {
// "merchantId": 0,
// "merchantName": "选项1"
// },
// {
// "merchantId": 1,
// "merchantName": "选项2"
// },
],
selectStoreItem:{},
scene:'' //场景值
},
computed: {
selectStoreValue(data) {
return data.selectStoreItem.name || '请输入合作门店'
}
},
// navbar高度设置
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
// headerHeight: height / 2 + statusBarHeight + 88*2
})
},
// 选择门店
selectStore(){
this.setData({ storeShow: true });
},
onStoreClose() {
this.setData({ storeShow: false });
},
onStoreSelect(event) {
console.log(event.detail);
let selectStoreItem = event.detail
this.setData({ selectStoreItem})
this.onStoreClose()
},
// 提交信息
applyFn() {
let {prodName,selectStoreItem} = this.data
if (!prodName) {
wx.pro.showToast({
title: '请输入产品名称',
icon: 'error'
})
return
}
if(utils.isEmptyObj(selectStoreItem)){
wx.pro.showToast({
title: '请选择合作门店',
icon: 'error'
})
return
}
this.submitForm()
// console.log(123)
},
async submitForm() {
let {prodName,selectStoreItem} = this.data
let userInfo = wx.$storage.get('userInfo')
let params = {
...selectStoreItem,
serviceMerchantId:userInfo.merchantId,
serviceMerchantName:userInfo.merchantName,
coProduct:prodName
}
let {code} = await addCoProductApi(params)
// console.log('res: ', res);
if(code == 0){
wx.$api.showToast('申请成功')
setTimeout(() => {
wx.$router.back(page => {
let node = page.selectComponent('#indexclue')
node && node.getClueInit()
})
}, 1000)
}
// // return wx.$api.showToast('申请成功')
// applyApi
// .merchantApply(params)
// .then(result => {
// console.log(result)
// if (result) {
// wx.$api.showToast('申请成功')
// setTimeout(() => {
// wx.$router.back(page => {
// let node = page.selectComponent('#indexclue')
// node && node.getClueInit()
// })
// }, 1000)
// }
// })
// .catch(err => {})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onRoute(params) {
// console.log('params: ', params.scene)
this.setData({
scene:params.scene
})
this.getMerchantListFn()
},
//获取门店
async getMerchantListFn(){
let {scene} = this.data
let userInfo = wx.$storage.get('userInfo')
let params = {
// scene,
serviceMerchantId:userInfo.merchantId
}
let {code,data} = await getMerchantListApi(params)
if(code== 0 && data.length != 0){
data = data.map(item=>{
item.name = item.merchantName
return item
} )
// console.log('data: ', data);
this.setData({
actions:data
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"van-action-sheet": "@vant/weapp/action-sheet/index",
"van-cell": "@vant/weapp/cell/index"
},
"navigationStyle": "custom",
"onReachBottomDistance": 10,
"enablePullDownRefresh": true
}
\ No newline at end of file \ No newline at end of file
/* pages/apply/apply.wxss */
page {
background: white;
// height: 100%;
position: relative;
}
.apply {
padding-bottom: 64rpx;
.head {
position: sticky;
top: 0;
width: 100%;
}
.introduce {
height: 320rpx;
}
.content-wrap{
background-image:linear-gradient(to bottom,#D0E5FE,#fff);
}
.content {
margin-left: 24rpx;
margin-right: 24rpx;
padding-top: 16px;
// padding: 16px 17px 0;
background: #ffffff;
box-shadow: 0 6rpx 24rpx 0 rgba(175, 181, 219, 0.4);
border-radius: 16rpx;
.item {
}
.top {
margin-bottom: 32rpx;
display: flex;
align-items: center;
.line {
// width: 3px;
// height: 14px;
// background:var(--btnColor);
width: 6rpx;
height: 36rpx;
background: #3666fe;
border-radius: 0 8rpx 8rpx 0;
}
.title {
margin-left: 26rpx;
font-weight: 500;
font-size: 32rpx;
color: #323436;
// line-height: 48rpx;
}
}
.inp-wrap {
margin-left: 32rpx;
display: flex;
align-items: center;
height: 112rpx;
border-bottom: 1px solid #f3f3f3;
.title {
margin-right: 64rpx;
// margin-top: 8px;
// margin-bottom: 8px;
font-weight: 500;
font-size: 14px;
color: #323436;
.point {
color: #f35251;
}
}
.inp {
flex: 1;
height: 112rpx;
// padding: 7px 12px;
// border: 1px solid #E3E4E8;
// border-radius: 2px;
}
.inp-placeholder {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #8a8c90;
}
.out-van-cell{
flex: 1;
.inp-van-cell{
&.van-cell{
height: 112rpx;
line-height: 112rpx;
padding:0;
flex: 1;
.point {
color: #f35251;
}
// line-height: 1;
}
&:after{
display:none;
}
.van-cell__title{
flex: none;
width:184rpx;
}
.van-cell__value{
text-align:left;
}
.van-cell__right-icon-wrap{
margin-right: 32rpx;
height: 112rpx;
line-height: 112rpx;
}
}
}
}
.scene-title {
display: flex;
align-items: center;
margin-left: 32rpx;
margin-top: 48rpx;
margin-bottom: 36rpx;
font-weight: 500;
font-size: 28rpx;
color: #323436;
.tip{
font-size: 22rpx;
color: #6E6E7A;
}
}
.content-product {
.scene {
// margin-top: 32rpx;
// margin-left: 20rpx;
// margin-right: 20rpx;
// margin-bottom: 10rpx;
margin: 32rpx 16rpx 0;
.scene-wrap {
display: flex;
}
.item-wrap {
margin-right: 8rpx;
margin-bottom: 40rpx;
position: relative;
width: 160rpx;
height: 180rpx;
border-radius: 8rpx;
border: 1px solid #f7f8fc;
box-sizing: border-box;
}
.item {
position: relative;
// padding-top: 10px;
width: 160rpx;
height: 180rpx;
background: #f7f8fc;
border-radius: 8rpx;
box-sizing: border-box;
// border: 1px solid #f7f8fc;
}
.open-img {
position: absolute;
top: 0;
right: 0;
width: 78rpx;
height: 78rpx;
box-sizing: border-box;
}
.act {
// background-image: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/act.png");
// background-size: 100% 100%;
border: 1px solid var(--btnColor);
// box-shadow: 0 2rpx 4rpx 0 rgba(180, 186, 204, 0.4);
background-image: linear-gradient(145deg, #f0f7ff 0%, #ffffff 73%);
box-shadow: 0 4rpx 8rpx 0 rgba(180, 186, 204, 0.32),
0 8rpx 20rpx 0 rgba(180, 186, 204, 0.4);
&::after {
position: absolute;
left: 50%;
bottom: -7px;
display: block;
content: "";
width: 6px;
height: 6px;
border-bottom: 1px solid var(--btnColor);
border-right: 1px solid var(--btnColor);
transform: rotate(45deg) translateX(-50%);
background-color: #fff;
}
// .open-img{
// display: none;
// }
.item {
background: transparent;
}
}
.img {
padding-top: 10px;
display: block;
margin: 0 auto 2px;
width: 28px;
height: 28px;
}
.name {
margin-bottom: 2px;
font-weight: 500;
font-size: 12px;
color: #323436;
text-align: center;
}
.msg {
font-weight: 500;
font-size: 18rpx;
// color: #323436;
color: #8A8C90;
text-align: center;
}
}
}
.scene-select{
display: flex;
flex-wrap: wrap;
padding: 0 16rpx 32rpx;
.scene-item{
&:nth-child(3n+3) {
margin-right: 0;
}
position: relative;
margin-right: 10rpx;
margin-bottom: 20rpx;
width: 216rpx;
height: 64rpx;
background: #F5F5FA;
border-radius: 8rpx;
font-size: 28rpx;
color: #323436;
text-align: center;
line-height: 64rpx;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
white-space:nowrap;
}
.act{
background: #F0F7FF;
border: 2rpx solid #3E71FE;
border-radius: 8rpx;
font-weight: 500;
color: #3666FE;
.act-img{
display: block;
}
}
.act-img{
display: none;
position:absolute;
top: 0;
right: 0;
width: 30rpx;
height: 22rpx;
}
}
}
.btn {
position: fixed;
bottom: 60rpx;
left: 50%;
transform: translateX(-50%);
// margin: 64rpx auto 0;
width: 648rpx;
font-weight: 500;
font-size: 17px;
color: #ffffff;
background: var(--btnColor);
}
}
.list-sheet-wrap{
max-height: 60vh;
overflow-y: auto;
}
<!-- pages/apply/apply.wxml -->
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
申请合作产品
</navigation-bar>
<view class="apply">
<image class="head" src="{{IMG_URL}}index/apply-title.png" style="height:{{tabBarStyle}}px;" />
<image class="introduce" src="{{IMG_URL}}index/apply-prod.png" />
<view class="content-wrap">
<view class="content" hover-class="none" hover-stop-propagation>
<view class="top">
<view class="line" hover-class="none" hover-stop-propagation="false" />
<view class="title" hover-class="none" hover-stop-propagation="false">申请合作</view>
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
您的产品名称
<text class="point">*</text>
</view>
<input class="inp" placeholder-class="inp-placeholder" model:value="{{prodName}}" maxlength="{{10}}" placeholder="请输入产品名称" />
</view>
<view class="inp-wrap">
<!-- <view class="title" hover-class="none" hover-stop-propagation="false">
合作门店
<text class="point">*</text>
</view> -->
<!-- <input class="inp" placeholder-class="inp-placeholder" model:value="{{cooperativeStore}}" maxlength="{{30}}" placeholder="营业执照上的公司名称" /> -->
<view class="out-van-cell">
<van-cell custom-class="inp-van-cell" value="{{selectStoreValue}}" is-link bind:click="selectStore">
<view slot="title">
<view class="van-cell-text">
合作门店
<text class="point">*</text>
</view>
</view>
</van-cell>
</view>
</view>
</view>
</view>
<button class="btn" bindtap="applyFn">申请合作产品</button>
</view>
<view>
<van-action-sheet show="{{ storeShow }}" cancel-text="取消" actions="{{ actions }}" list-class="list-sheet-wrap" bind:cancel="onStoreClose" bind:close="onStoreClose" bind:select="onStoreSelect" />
</view>
\ No newline at end of file \ No newline at end of file
//查询是否选中
function hasProdAct(prod,selectProdArr) {
// console.log('prod: ', JSON.stringify(prod));
// console.log('selectProdArr: ', JSON.stringify(selectProdArr));
if(!selectProdArr || selectProdArr.length === 0) return
console.log('selectProdArr: ', selectProdArr);
var resIndex = -1
for(var i = 0;i<selectProdArr.length;i++){
if(selectProdArr[i].productName == prod.productName){
resIndex = i
}
}
if(resIndex == -1){
return false
}
return true;
}
// 导出对外暴露的属性
module.exports = {
hasProdAct: hasProdAct
}
\ No newline at end of file \ No newline at end of file
// components/Tab/Tab.js
// behaviors: [LocationBehavior],
import { imgUrlMixin } from '~/mixins/index'
Component({
behaviors: [imgUrlMixin],
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
outClassName:String,
tab: Array,
openScroll: Boolean,
index: {
type: Number,
observer: function (n) {
this.setData({
count: n,
to: `to-${n}`
})
}
},
itemWidth: String,
align: {
type: String,
default: ''
}
},
/**
* 组件的初始数据
*/
data: {
count: 0,
to: ''
},
/**
* 组件的方法列表
*/
methods: {
click(e) {
let { count } = e.currentTarget.dataset
this.setData({
count,
to: `to-${count}`
})
this.triggerEvent('click', count)
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<block wx:if="{{openScroll}}">
<scroll-view
class="tab-box {{align}} {{outClassName}}"
scroll-x
enable-flex
scroll-with-animation
scroll-into-view="{{to}}">
<block wx:for="{{tab}}" wx:key="index">
<view
class="tab {{index==count?'active':''}}"
bindtap="click"
data-count="{{index}}"
id="to-{{index}}">
<view class="text">{{item}}</view>
<!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> -->
<view class="line" />
</view>
</block>
</scroll-view>
</block>
<block wx:else>
<view class="tab-box flex">
<block wx:for="{{tab}}" wx:key="index">
<view
class="tab {{index==count?'active':''}}"
style="width:{{itemWidth}}"
bindtap="click"
data-count="{{index}}">
<view class="text text-center">{{item}}</view>
<view class="line" style="lineStyle" />
</view>
</block>
</view>
</block>
/* components/Tab/Tab.wxss */
.tab-box {
display: flex;
/* display: grid; */
width: 100%;
height: 92rpx;
box-sizing: border-box;
}
.tab-box.left {
padding-left: 32rpx;
}
.left .tab {
padding-right: 40rpx;
}
/* .flex .tab {
flex: 1;
} */
.tab {
position: relative;
flex-shrink: 0;
}
.tab .text {
height: 84rpx;
display: flex;
align-items: center;
box-sizing: border-box;
/* color: #A9A9A9; */
font-size: 32rpx;
color: #8A8C90;
justify-content: center;
}
.left .text {
justify-content: flex-start;
}
.flex .tab .text {
padding: 0;
}
.tab.active .text {
/* font-weight: 500; */
/* font-weight: 600; */
font-size: 44rpx;
transition: all .25s;
font-weight: 500;
font-size: 32rpx;
color: #3666FE;
font-family: PingFangSC-S0pxibold;
}
.tab .line {
width: 120rpx;
height: var(--borderRadius);
background: var(--btnColor);
border-radius: 2rpx;
margin: 0 auto;
transform: scale(0);
transition: all .25s;
}
.tab.active .line {
transform: scale(1);
}
.tab-box::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
/* 外部出进来的自定义样式 */
.project-tab {
padding-left: 20px;
padding-right: 20px;
}
.project-tab .tab {
margin-right: 28px;
}
.project-tab .tab.active .text {
font-size: 28rpx;
color: var(--btnColor);
}
.project-tab .tab .line {
width: auto;
}
\ No newline at end of file \ No newline at end of file
// pages/mineDetail/messageBox/components/messageBox.js
Component({
/**
* 组件的属性列表
*/
properties: {
time: {
type: String
},
merchantName: {
type: String
},
messageType: {
type: String
}
},
/**
* 组件的初始数据
*/
data: {
titleObj: {
0: {
label: '您好,您的客户',
sceneLabel: '门店账号已开通成功。'
},
1: {
label: '您好,您的客户',
sceneLabel: '门店活动已开通,活动信息如下:'
},
2: {
label: '您的客户',
sceneLabel: '门店活动正在进行中'
},
3: {
label: '您的客户',
sceneLabel: '门店活动已结束:'
},
4: {
label: '您好,您的客户',
sceneLabel: '门店场景已开通,待开展业务,信息如下:'
},
5: {
label: '您好,您的客户',
sceneLabel: '门店业务场景已开通:'
},
6: {
label: '您好,您的客户',
sceneLabel: '门店业务场景已开通:'
}
}
},
/**
* 组件的方法列表
*/
methods: {}
})
{
"component": true,
"usingComponents": {}
}
\ 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;
margin-bottom: 8rpx;
view {
// word-break: break-all;
display: inline-block;
white-space: pre-wrap
}
.name {
color: rgba(50, 52, 54, 1);
font-size: 28rpx;
// font-face: PingFangSC;
font-weight: 600;
}
}
.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 -->
<!-- <view>pages/mineDetail/messageBox/components/messageBox.wxml</view> -->
<view class="msgBox">
<view class="title">
<text>{{titleObj[messageType]['label']}}</text>
<text class="name">{{merchantName}}</text>
<text>{{titleObj[messageType]['sceneLabel']}}</text>
</view>
<!-- <view class="title" wx:if="{{messageType == 1}}">
<text>您好,您的客户</text>
<text class="name">{{merchantName}}</text>
<text>门店活动已开通,活动信息如下:</text>
</view>
<view class="title" wx:if="{{messageType == 2}}">
<view>您的客户</view>
<view class="name">{{merchantName}}</view>
<view>门店活动正在进行中</view>
</view>
<view class="title" wx:if="{{messageType == 3}}">
<view>您的客户</view>
<view class="name">{{merchantName}}</view>
<view>门店活动已结束:</view>
</view>
<view class="title" wx:if="{{messageType == 4}}">
<text>您好,您的客户</text>
<text class="name">{{merchantName}}</text>
<text>门店场景已开通,待开展业务,信息如下:</text>
</view> -->
<slot />
<view class="time">{{filter.timeformat(time)}}</view>
</view>
<wxs module="filter">
module.exports = {
timeformat: function (time) {
time = time.slice(0,-3)
return time
}
}
</wxs>
\ No newline at end of file \ No newline at end of file
// packagesList/mineDetail/pages/clue.js
import { IMG_URL } from '~/utils/constantData.js'
import { unreadApi, pageApi, tagApi } from '~/api/index.js'
const IMAGES = Object.freeze({
arrow: `${IMG_URL}/index/point.png`,
actArrow: `${IMG_URL}/index/actArrow.png`
})
Page({
/**
* 页面的初始数据
*/
data: {
IMAGES,
IMG_URL,
disLikeRecordFlag: true,
typeList: [
{
0: '无电话',
1: '有电话',
2: '联系电话',
selectIndex: 2,
key: 'hasPhone'
},
{
0: '非意向客户',
1: '是意向客户',
2: '意向客户',
selectIndex: 2,
key: 'starTag'
},
{
0: '来自访客',
1: '来自门店',
2: '线索来源',
selectIndex: 2,
key: 'clueSource'
},
{
2: '重置',
selectIndex: 2
}
],
levelTagObj: {
1: {
label: '初步了解'
},
2: {
label: '深入了解',
class: 'tag-red'
},
3: {
label: '签约成交',
class: 'tag-blue'
}
},
clueList: [],
// 看线索部分
unreadClueCount: 0,
cluePageSize: 1000,
clueCurrentPage: 1,
disLikeFlag: true,
clueParams: {} //看线索参数
},
//点击收藏
showToast: function (e) {
wx.$storage.set('disLikeRecordFlag', false)
let disLikeRecordFlag = wx.$storage.get('disLikeRecordFlag')
this.setData({
disLikeFlag: false,
disLikeRecordFlag
})
let { type, item } = e.currentTarget.dataset
// console.log('type,item: ', type, item)
let tipObj = {}
if (item.starTag == 1) {
tipObj = {
type: 'fail',
title: '取消标记为意向客户'
}
} else {
tipObj = {
type: 'success',
title: '成功标记为意向客户'
}
}
this.data.prompt.showToast({
type: tipObj.type,
title: tipObj.title,
duration: 1000,
compelete: function () {
// console.log("toast框隐藏之后,会调用该函数");
//例如:跳转页面wx.navigateTo({ url: 'xxx' });
}
})
//切换收藏标记
let index = e.currentTarget.dataset.outidx
let completeStatus = `clueList[${index}].like`
this.setData({
[completeStatus]: !this.data.clueList[index].like
})
//发请求
let { sessionId } = wx.$storage.get()
let params = {
clueId: item.clueId,
sessionId
}
this.getTagApi(params)
},
//看线索重置
resetCluelist() {
let { typeList } = this.data
typeList.forEach(item => {
item.selectIndex = 2
})
this.setData({
typeList,
clueParams: {}
})
//重置数据
this.clearclueData()
this.getPageApi()
},
filterTypeFn(e) {
let { typeList } = this.data
let index = e.currentTarget.dataset.index
// 重置筛选
if (index == 3) {
return this.resetCluelist()
}
let itemList = Object.values(typeList[index]).slice(0, 2)
itemList.push('全部')
let _this = this
wx.pro.showActionSheet({
itemList,
success(res) {
//重置数据
_this.clearclueData()
// 选中全部
let selectIndex = res.tapIndex
// console.log('selectIndex: ', selectIndex);
typeList[index].selectIndex = selectIndex
let params = typeList.reduce((obj, item, index) => {
// console.log(' item: ', item)
if (item['key']) {
let itemIndx = item.selectIndex
// key: 'clueSource'
if (item['key'] == 'clueSource') {
// itemIndx += 1
obj[item['key']] = itemIndx == 2 ? '' : itemIndx + 1
} else {
obj[item['key']] = itemIndx == 2 ? '' : itemIndx
}
}
return obj
}, {})
// console.log(params)
// 清空数据
_this.setData({ typeList, clueParams: params })
_this.getPageApi(params)
},
fail(res) {
// console.log(res.errMsg)
}
})
},
//重置数据
clearclueData() {
this.setData({
clueList: [],
clueCurrentPage: 1
// hasPhone: '',
// starTag: '',
// clueSource: '',
})
},
// 打电话
phoneCallFn(e) {
let { phone } = e.currentTarget.dataset
wx.$api.phoneCall(phone)
},
// 复制号码
setCopyDataFn(e) {
let { phone } = e.currentTarget.dataset
wx.$api.setCopyData(phone)
},
getClueInit(param) {
this.getUnreadApi(param)
this.getPageApi(param)
},
//未读消息
async getUnreadApi(param) {
let { code, data } = await unreadApi(param)
if (code == 0) {
this.setData({
unreadClueCount: data.unreadClueCount
})
}
},
//获取浏览线索数据列表
async getPageApi(param) {
let { cluePageSize, clueCurrentPage, clueList } = this.data
let params = {
pageSize: cluePageSize,
currentPage: clueCurrentPage,
...param
}
let { code, data } = await pageApi(params)
if (code == 0) {
let arr = data.list.map(item => {
if (item.visitList && item.visitList.length > 5) {
item.getMoreFlag = true
}
return item
})
//添加分页数据
// let concatArr = []
// if(arr.length > 0) {
// concatArr = clueList.concat(arr)
// }
this.setData({
clueList: arr
})
let arrinx = arr.findIndex(e => e.clueType == 1 && e.starTag == 0)
this.setData({
disLikeFlagIdx: arrinx,
triggered: false
})
}
},
//喜欢收藏功能
async getTagApi(param) {
let { clueParams } = this.data
let res = await tagApi(param)
if (res.code == 0) {
let clueListPamas = {
...param,
...clueParams
}
this.getPageApi(clueListPamas)
}
},
// 上拉刷新
scrolltolowerFn() {
let { clueCurrentPage, clueParams } = this.data
let params = {
...clueParams,
clueCurrentPage: clueCurrentPage++
}
this.setData({
clueCurrentPage
})
this.getPageApi(params)
},
// 下拉刷新
refreshList() {
// console.log('onPullDownRefresh: ');
let { clueParams } = this.data
this.getClueInit(clueParams)
// this.resetCluelist()
// this.onLoad()
wx.pro.showToast({
title: '刷新成功',
icon: 'success',
duration: 1500
})
},
gotoApply(e) {
let { type, item } = e.currentTarget.dataset
// let { } = e.currentTarget.dataset
// console.log(item)
// return
if (type == 'active') {
let { userInfo } = wx.$storage.get()
let pMerchantName = userInfo.subLoginUser.merchantName
let pMerchantId = userInfo.subLoginUser.merchantId
// let sceneActive
// switch (this.data.actNum) {
// case 0:
// sceneActive = 1
// break
// case 1:
// sceneActive = 2
// break
// case 2:
// sceneActive = 3
// break
// case 3:
// sceneActive = 4
// break
// }
// let pMerchantId = userInfo.subLoginUser.merchantId
// console.log("type,item: ", type, item);
const params = {
merchantInfo: {
pMerchantId,
pMerchantName,
merchantId: item.visitList[0].merchantId,
merchantName: item.visitList[0].merchantName
},
// sceneActive,
clueId: item.clueId
// sceneCodeList: ['SC001', 'SC002','SC003','SC004']
}
//申请活动
// wx.$router.go("packageOutput.openBusiness", params);
wx.$router.go('packagesList.openBusiness', params)
} else {
//申请门店
// let { type, item } = e.currentTarget.dataset
wx.$router.go('packagesList.apply', item?.clueId || '')
}
// wx.$router.go('apply',1235)
},
getMore(e) {
// console.log("显示更多数据");
let index = e.currentTarget.dataset.outidx
// console.log("index: ", index);
let completeStatus = `clueList[${index}].getMoreFlag`
this.setData({
[completeStatus]: !this.data.clueList[index].getMoreFlag
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 看线索
this.getClueInit()
this.data.prompt = this.selectComponent('#toast')
let disLikeRecordFlag = wx.$storage.get('disLikeRecordFlag')
this.setData({
disLikeRecordFlag
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"vas-toast": "/pages/tab/index/components/likeToast/likeToast"
}
}
\ No newline at end of file \ No newline at end of file
/* packagesList/mineDetail/pages/clue.wxss */
.clue-wrap {
padding: 0px 10px 0;
background-color: #f2f3f7;
height: 100vh;
// margin-top: -16rpx;
// overflow: scroll;
.types {
// margin-bottom: 8px;
box-sizing: border-box;
padding: 16rpx 0;
display: flex;
align-items: center;
// position: sticky;
// top: 280rpx;
z-index: 2;
background-color: #f2f3f7;
// margin-top: -32rpx;
.type {
margin-left: 8px;
display: flex;
justify-content: center;
align-items: center;
padding: 0 16rpx;
height: 24px;
line-height: 24px;
background: #ffffff;
border-radius: 14px;
font-size: 12px;
color: #8a8c90;
.point {
margin-left: 2px;
width: 12px;
height: 12px;
}
}
.active {
color: #3964fe;
}
}
.list-wrap {
height: calc(100% - 80rpx);
}
.list {
// overflow: scroll;
box-sizing: border-box;
// padding-bottom: 8rpx;
.msg {
padding: 10px 16px 16px;
margin-bottom: 8px;
position: relative;
background-color: #fff;
border-radius: 4px;
}
.like {
position: absolute;
right: 12px;
top: 0;
width: 23px;
height: 23px;
}
.disLike-tit {
width: 172rpx;
background: rgba(0, 0, 0, 0.60);
padding: 8rpx 0rpx;
font-family: PingFangSC-Regular;
font-size: 20rpx;
color: #FFFFFF;
line-height: 36rpx;
text-align: center;
border-radius: 8rpx;
position: absolute;
right: 0rpx;
top: 61rpx;
}
.disLike-titsan {
width: 0;
height: 0;
border: 18rpx solid;
border-color: transparent transparent #686868;
position: absolute;
right: 27rpx;
top: 30rpx;
}
.name {
display: flex;
align-items: center;
// font-weight: 400;
font-size: 28rpx;
color: #323436;
.avatar {
margin-left: 2px;
width: 20px;
height: 20px;
}
.level-tag {
width: 96rpx;
height: 32rpx;
line-height: 32rpx;
font-size: 20rpx;
color: #FFFFFF;
background: #48D241;
border-radius: 6rpx;
margin-left: 24rpx;
text-align: center;
}
.tag-red {
background: #FD6C59;
}
.tag-blue {
background: #557CF7;
}
}
.line {
margin-top: 10px;
margin-bottom: 10px;
height: 0;
border-bottom: #eeeeee 1px dashed;
}
.want-more {
box-sizing: border-box;
// overflow: hidden;
transition: all 3s ease;
}
// .height {
// height: 200rpx;
// }
// .auto {
// height: auto;
// }
.hiddenMore {
display: none !important;
}
.showMore {
display: flex !important;
}
.want-btn {
margin-top: 10px;
font-size: 12px;
color: var(--btnColor);
}
.record {
// margin-top: 4px;
// margin-bottom: 4px;
box-sizing: border-box;
// height: 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
.action-wrap {
display: flex;
align-items: center;
font-size: 24rpx;
color: #393b3e;
}
// .action{
// }
// .detail{
// }
.time {
font-size: 12px;
color: #8a8c90;
}
}
.info {
margin-top: 10px;
display: flex;
justify-content: space-between;
.phone-wrap {
display: flex;
align-items: center;
}
.phone {
font-size: 24rpx;
color: #3666fe;
}
.phone-img {
margin-left: 12px;
margin-right: 8px;
width: 20px;
height: 20px;
border-radius: 50%;
}
.copy {
width: 20px;
height: 20px;
border-radius: 50%;
}
.btn {
width: 85px;
height: 24px;
background: var(--btnColor);
border-radius: 12px;
font-size: 12px;
color: #ffffff;
text-align: center;
line-height: 24px;
}
}
.noDataImg {
width: 512rpx;
height: 512rpx;
margin-left: 100rpx;
position: relative;
.noDataTxt {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #CCCED1;
position: absolute;
bottom: 32rpx;
left: 50%;
transform: translateX(-50%);
}
}
.shop {
.name-wrap {
display: flex;
justify-content: space-between;
align-items: center;
}
.source {
font-size: 10px;
color: #8a8c90;
}
.btn {
border: 1px solid var(--btnColor);
border-radius: 12px;
background-color: #fff;
font-size: 12px;
color: var(--btnColor);
}
.shop-action-wrap {
display: flex;
justify-content: space-between;
align-items: center;
}
.shop-record {
width: 100%;
}
.shop-source {
margin-top: 4px;
width: 100%;
font-size: 24rpx;
color: #393b3e;
}
}
.bottomTips {
text-align: center;
color: #393b3e;
font-size: 26rpx;
height: 60rpx;
line-height: 40rpx;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/mineDetail/pages/clue.wxml-->
<view class="clue-wrap" hover-class="none" hover-stop-propagation="false">
<view class="types">
<view class="type {{item['selectIndex']!=2&&index != 3?'active':'' }}" wx:for="{{typeList}}" wx:key="index" data-index="{{index}}" style="{{index == 0 ? 'margin-left: 0px;' : ''}}" bindtap="filterTypeFn">
{{item[item['selectIndex']] }}
<image webp class="point" wx:if="{{index != 3}}" src="{{item['selectIndex']!=2&&index != 3? IMAGES.actArrow : IMAGES.arrow}}" />
</view>
</view>
<!-- bindscrolltolower="scrolltolowerFn" -->
<scroll-view scroll-y="true" class="list-wrap" enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="refreshList" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="list" hover-class="none" hover-stop-propagation="false">
<view class="msg" wx:for="{{clueList}}" wx:key="index">
<!-- 门店助手 -->
<view class="shop" wx:if="{{item.clueType == 2}}">
<view class="name-wrap">
<view class="name" hover-class="none" hover-stop-propagation="false">
{{item.nickName}}
<image webp class="avatar" src="{{IMG_URL}}index/man.png" wx:if="{{item.clueType != 3}}" />
</view>
<view class="source" hover-class="none" hover-stop-propagation="false">通过门店助手申请</view>
</view>
<view class="line" hover-class="none" hover-stop-propagation="false" />
<view class="record" wx:for="{{item.visitList}}" wx:key="id" wx:for-index="idx" wx:for-item="itemName">
<view class="shop-record">
<view class="shop-action-wrap">
<view class="action-wrap">
<view class="action" selectable="false" space="false" decode="false">
访问页面:
</view>
<view class="detail" selectable="false" space="false" decode="false">
{{itemName.productDesc}}
</view>
</view>
<view class="time" selectable="false" space="false" decode="false">
{{itemName.clueDate}}
</view>
</view>
<view class="shop-source" hover-class="none" hover-stop-propagation="false">
所属门店:{{itemName.merchantName}}
</view>
</view>
</view>
<view class="info" hover-class="none" hover-stop-propagation="false">
<view>
<view class="phone-wrap" wx:if="{{item.phone}}">
<view class="phone">{{item.phone}}</view>
<image webp class="phone-img" data-phone="{{item.phone}}" bindtap="phoneCallFn" src="{{IMG_URL}}index/phone.png" />
<image webp class="copy" data-phone="{{item.phone}}" bindtap="setCopyDataFn" src="{{IMG_URL}}index/copy.png" />
</view>
</view>
<view class="btn" hover-class="none" hover-stop-propagation="false" data-type="active" data-item="{{item}}" wx:if="{{item.applyStatus == 0}}" bindtap="gotoApply">
开通活动
</view>
</view>
</view>
<!-- 生意助手 -->
<view wx:else>
<image webp class="like" wx:if="{{item.clueType == 1 && item.starTag == 1}}" src="{{IMG_URL}}index/like.png" data-type="like" data-outidx="{{index}}" data-item="{{item}}" bindtap="showToast" />
<image webp class="like" wx:if="{{item.clueType == 1 && item.starTag == 0}}" src="{{IMG_URL}}index/dislike.png" data-type="dislike" data-outidx="{{index}}" data-item="{{item}}" bindtap="showToast" />
<view class="disLike-tit" wx:if="{{item.clueType == 1 && item.starTag == 0 && disLikeFlag && disLikeRecordFlag}}" hidden="{{index != disLikeFlagIdx}}">
标记为意向客户
</view>
<view class="disLike-titsan" wx:if="{{item.clueType == 1 && item.starTag == 0 && disLikeFlag && disLikeRecordFlag}}" hidden="{{index != disLikeFlagIdx}}" />
<view class="name" hover-class="none" hover-stop-propagation="false">
{{item.nickName}}
<image webp class="avatar" src="{{IMG_URL}}index/avatar.png" wx:if="{{item.clueType != 3}}" />
<view wx:if="{{item.levelTag}}" class="level-tag {{levelTagObj[item.levelTag] ? levelTagObj[item.levelTag].class : ''}}">{{levelTagObj[item.levelTag] ? levelTagObj[item.levelTag].label : ''}}</view>
</view>
<view class="line" hover-class="none" hover-stop-propagation="false" />
<!-- {{item.getMoreFlag?'height':'auto'}} -->
<view class="want-more ">
<view class="record {{idx>4&&item.getMoreFlag?'hiddenMore':''}} {{idx>4&&!item.getMoreFlag?'showMore':''}}" wx:for="{{item.visitList}}" wx:key="id" wx:for-index="idx" wx:for-item="itemName">
<view class="action-wrap">
<view class="action" selectable="false" space="false" decode="false">访问页面:
</view>
<view class="detail" selectable="false" space="false" decode="false">
{{itemName.productDesc}}
</view>
</view>
<view class="time" selectable="false" space="false" decode="false">
{{itemName.clueDate}}
</view>
</view>
</view>
<view class="want-btn" wx:if="{{item.visitList.length > 5}}" hover-class="none" hover-stop-propagation="false" data-outidx="{{index}}" bindtap="getMore">
{{ item.getMoreFlag ?'更多数据':'收起数据'}}
</view>
<view class="info" hover-class="none" hover-stop-propagation="false" wx:if="{{item.phone}}">
<view class="phone-wrap">
<view class="phone">{{item.phone}}</view>
<image webp class="phone-img" data-phone="{{item.phone}}" bindtap="phoneCallFn" src="{{IMG_URL}}index/phone.png" />
<image webp class="copy" data-phone="{{item.phone}}" bindtap="setCopyDataFn" src="{{IMG_URL}}index/copy.png" />
</view>
<view class="btn" hover-class="none" hover-stop-propagation="false" data-type="shop" bindtap="gotoApply" data-item="{{item}}" wx:if="{{item.applyStatus == 0}}">
+开店面
</view>
</view>
</view>
</view>
<view class="bottomTips" wx:if="{{clueList.length>10}}">到底啦!</view>
<view class="noDataImg" wx:if="{{!clueList.length}}">
<image webp src="{{IMG_URL}}index/trEmpty.png " />
<text class="noDataTxt">没有符合条件的线索~</text>
</view>
</view>
</scroll-view>
</view>
<!-- 收藏、取消提示框 -->
<vas-toast id='toast' />
\ No newline at end of file \ No newline at end of file
// pages/mineDetail/customerManagement/customerManagement.js
import mineApi from '~/api/mineApi/index'
// import USERAPI from '~/api/usersApi/index'
import { IMG_URL } from '~/utils/constantData'
const listObj = Object.freeze([
{
key: 'merchantId',
label: '商户号:',
editLabel: '商户号'
},
{
key: 'actualAccountName',
label: '商户账号:',
editLabel: '商户账号'
},
{
key: 'merchantName',
label: '门店名称:',
placeholder: '请输入您的客户门店简称',
editLabel: '门店名称',
maxLength: 20
},
{
key: 'contactName',
label: '联系人:',
placeholder: '请输入客户门店联系人',
editLabel: '联系人',
maxLength: 10
},
{
key: 'phone',
label: '手机号:',
placeholder: '请输入客户门店联系人手机号',
editLabel: '手机号',
maxLength: 11,
reg: '/[^d]/g,',
type: 'number'
},
{
key: 'mainBrand',
label: '主营品牌:',
// 请输入客户门店主营品牌,
placeholder: '多个品牌以分号区隔',
editLabel: '主营品牌',
maxLength: 20
},
{
key: 'newCarSales',
label: '新车销量:',
placeholder: '请输入客户门店新车月平均销售数',
editLabel: '新车销量',
maxLength: 5,
reg: '/[^d]/g',
type: 'number'
},
{
key: 'existUserNumber',
label: '存量用户数:',
placeholder: '请输入客户门店存量用户数',
editLabel: '存量用户数',
maxLength: 8,
reg: '/[^d]/g',
type: 'number'
}
])
Component({
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {},
/**
* 组件的初始数据
*/
data: {
pageNum: 1,
pageSize: 10,
pages: 1,
customerList: [{}],
listObj,
isSuper: false,
testData: [
{
a: 1
}
],
bgUrl: `${IMG_URL}/output/empty.png`
},
attached() {
// this.initTime()
let { userInfo } = wx.$storage.get()
this.setData({
isSuper: userInfo.isSuper
})
this.getMerchantCustomInfoList()
},
/**
* 组件的方法列表
*/
methods: {
restPageNum() {
// console.log('restPageNum')
this.setData({
pageNum: 1
})
this.getMerchantCustomInfoList('reset')
},
scrollonReachBottom() {
// console.log('scrollonReachBottom')
let { pages, pageNum } = this.data
// 判断当前页是否是末页
if (pages == pageNum) return wx.$api.showToast('列表已到底')
this.setData({
pageNum: pageNum + 1
})
this.getMerchantCustomInfoList()
},
// 分页查询客户列表
getMerchantCustomInfoList(type) {
wx.$api.showLoading('加载中...')
let { pageNum, pageSize, customerList } = this.data
let params = {
pageNum,
pageSize
}
mineApi
.merchantCustomInfo(params)
.then(result => {
console.log(result)
let { pages, list, total } = result
console.log(list)
list = list.map(item => {
item.merchantName = item.merchantName || item.actualMerchantName
item.phone = item.phone || item.actualPhone
// || item.actualContactName
item.contactName = item.contactName || item.actualContactName
return item
})
console.log(list)
this.setData({
customerList: pageNum == 1 ? list : [...customerList, ...list],
triggered: false,
pages
})
})
.catch(err => {})
.finally(() => {
if (type == 'reset') {
wx.$api.showToast({
title: '刷新成功',
icon: 'success'
})
} else {
wx.$api.hideLoading()
}
})
},
submit(data) {
let obj = ['merchantId', 'merchantName', 'contactName', 'phone', 'mainBrand', 'newCarSales', 'existUserNumber']
let objList = {}
obj.forEach(item => {
if (data[item]) {
objList[item] = data[item]
}
})
mineApi
.saveMerchantCustomInfo(objList)
.then(result => {
wx.$api.showToast('更新成功')
// console.log(result)
// this.setData({
// pageNum: 1
// })
// this.getMerchantCustomInfoList()
})
.catch(err => {})
},
changeStatus(e) {
console.log(e)
let { customerList, isSuper } = this.data
let { index, item } = e.currentTarget.dataset
// let
let status = customerList[index].isEdit
// console.log(isEdit)
// customerList[index]['isEdit'] = !customerList[index]['isEdit']
if (item.isEdit) {
// 提交客户信息更新
!isSuper && this.submit(customerList[index])
}
console.log(index)
// let indexEdit = console.log(!status)
this.setData({
[`customerList[${index}].isEdit`]: !status
})
},
input(e) {
let { index, name } = e.currentTarget.dataset
// console.log(index)
// console.log(name)
let { customerList, listObj } = this.data
let { value } = e.detail
// listObj
customerList[index][name] = value
this.setData({
customerList
})
// let { name } = e.currentTarget.dataset
// this.setData({
// [`orderObj.${name}`]: value
// })
}
}
})
{
"navigationBarTitleText": "客户管理",
"component": true,
"usingComponents": {
"gl-cell": "../../../components/GlCell/GlCell"
}
}
/* pages/mineDetail/customerManagement/customerManagement.wxss */
page {
background-color: #F2F3F7;
}
.customerManagementCon {
width: 100%;
height: 100%;
// width: 100vw;
// height: 100vh;
}
.input {
text-align: left;
font-size: 28rpx;
caret-color: #3666FE;
width: 430rpx;
}
.disabled {
// color: #333;
color: #a6a9ad;
}
.customerBox {
box-sizing: border-box;
margin: 20rpx 20rpx 0;
padding: 32rpx;
background: #FFFFFF;
border-radius: 8rpx;
.titleCon {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 2rpx dashed #CCCED1;
padding-bottom: 20rpx;
.name {
font-size: 28rpx;
color: #323436;
max-width: 90%;
}
.statusBtn {
font-size: 24rpx;
color: #3666FE;
}
}
}
.list {
overflow: scroll;
}
.cellSty {
display: block;
height: 80rpx;
line-height: 80rpx;
}
.placeholder-class {
color: #C3C3C3;
// font-size: 20rpx;
}
\ No newline at end of file \ No newline at end of file
<!-- pages/mineDetail/customerManagement/customerManagement.wxml -->
<view class="customerManagementCon">
<!-- required hidden="{{hidden}}" -->
<scroll-view
style="{{ margin-right: 5px;}}"
wx:if="{{customerList.length}}"
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="restPageNum"
bindscrolltolower="scrollonReachBottom"
refresher-threshold="104"
style="height:100vh;"
class=" list"
refresher-triggered="{{triggered}}">
<view class="customerBox" wx:for="{{customerList}}" wx:key="index">
<view class="titleCon">
<view class="name text-hide">{{item.actualMerchantName}}</view>
<view
class="statusBtn"
data-index="{{index}}"
data-item="{{item}}"
bind:tap="changeStatus">
{{item.isEdit?'完成':'编辑'}}
</view>
</view>
<view/>
<gl-cell
wx:for="{{listObj}}"
wx:key="ind"
wx:for-index="ind"
wx:for-item="childItem"
valueAlign="right"
class="cellSty"
label="{{item.isEdit?childItem.editLabel :childItem.label }}"
requiredAfter
cellHeight="{{false}}"
labelWidth="200rpx">
<!-- type="number" -->
<input
placeholder="{{item.isEdit? childItem['placeholder']:''}}"
class="input {{item.isEdit&&(ind == 0|| ind == 1) ? 'disabled':''}}"
placeholder-class="placeholder-class"
maxlength="{{childItem.maxLength}}"
value="{{item[childItem['key']] }}"
bindinput="input"
type="{{childItem['type']||''}}"
data-index="{{index}}"
data-name="{{childItem['key']}}"
data-reg="{{childItem['reg']}}"
disabled="{{!item.isEdit || ind == 0|| ind == 1 }}"
always-embed></input>
</gl-cell>
<!-- <gl-cell
valueAlign="right"
label="车主姓名"
requiredAfter
class="cellSty"
cellHeight="{{false}}"
labelWidth="140rpx">
<input
placeholder="点击输入"
class="input"
placeholder-class="placeholder-class"
maxlength="16"
value="{{orderObj.customer.customerName}}"
bindinput="input"
data-name="customer.customerName"
disabled="{{orderObj.orderSource == 5}}"
always-embed></input>
</gl-cell> -->
</view>
</scroll-view>
<view wx:else>
<nothing-tips tips="暂无相关客户~" bg="{{bgUrl}}" />
</view>
</view>
// pages/mineDetail/messageBox/messageBox.js
import mineApi from '~/api/mineApi/index'
// import { handleCopy } from '~/utils/utils_wx'
import outputApi from '~/api/outputApi/index'
import { deleteSecond } from '~/utils/format'
// import drawQrcode from '~/utils/lib/weapp-qrcode.js'
Component({
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {},
/**
* 组件的初始数据
*/
data: {
navStyle: 'background-color: rgba(0,0,0,0);',
loginType: 0,
agree: true,
tabIndx: 0,
text: '',
tabList: ['战报', '通知'],
type: {
warReport: {
pageNum: 1,
pageSize: 10,
type: 0,
list: 'warReportList'
},
message: {
pageNum: 1,
pageSize: 10,
type: 1,
list: 'messageList'
}
},
// findKey: '',
warReportList: [],
messageList: [],
serviceMerchantId: ''
},
attached() {
// this.ewmChange()
// this.initTime()
let { userInfo } = wx.$storage.get()
let merchantId = userInfo.subLoginUser.merchantId
this.setData({
serviceMerchantId: userInfo.subLoginUser.merchantId
// serviceMerchantId: 12580
})
this.getMessageList('warReport')
this.getMessageList('message')
},
/**
* 组件的方法列表
*/
methods: {
// 实例化二维码canvas
// ewmChange(url) {
// let size = {}
// size.w = (wx.getSystemInfoSync().windowWidth / 750) * 600
// size.h = size.w
// var that = this
// drawQrcode({
// width: size.w,
// height: size.h,
// canvasId: 'myQrcode',
// text: url || that.data.text
// // v1.0.0+版本支持在二维码上绘制图片
// })
// },
preView(e) {
let { valueurl } = e.currentTarget.dataset
// console.log(e)
// console.log(valueUrl)
// let urls = []
// urls.push(valueUrl)
// // wx.$router.jumpH5(valueUrl)
// console.log(urls)
// console.log([valueUrl])
wx.$api.previewImage({
urls: [valueurl],
current: valueurl
})
},
showPoster(e) {
const { item } = e.currentTarget.dataset
let updatedTime = deleteSecond(item.createdTime)
this.setData({
// findKey: 'crowdFundActivityId',
posterItem: {
activityName: item.activityName,
posterUrl: item.valueUrl,
updatedTime,
// crowdFundActivityId: item.valueUrl,
type: 'warReport'
}
})
},
async copyLink(e) {
const { item } = e.currentTarget.dataset
// posterObj = this.selectComponent('#poster')
// this.setData({
// findKey: 'activityId'
// })
// try {
// let flag = await posterObj.check(item)
// posterObj.setData({
// poster: flag,
// show: true
// })
// } catch (error) {
wx.$api.showLoading('加载中...')
outputApi
.getPosterUrl({
id: item.crowdFundActivityId
})
.then(res => {
item.posterUrl = res
item.type = 'motherChainPoster'
console.log(item)
this.setData({
posterItem: item,
isShowTip: false
})
})
.catch(() => {
wx.$api.showToast('下载海报失败')
})
// }
},
share(e) {
// console.log(e)
let that = this
const dpr = wx.getSystemInfoSync().pixelRatio
wx.canvasToTempFilePath({
canvasId: 'myQrcode',
x: 0,
y: 0,
width: 600,
height: 600,
destWidth: 600 * dpr, // width*屏幕像素密度
destHeight: 600 * dpr, // height*屏幕像素密度
fileType: 'jpg',
quality: 1, //图片的质量,目前仅对 jpg 有效。取值范围为 (0, 1],不在范围内时当作 1.0 处理。
success: function (res) {
var tempFilePath = res.tempFilePath
wx.getImageInfo({
src: tempFilePath,
success(obj) {
wx.showShareImageMenu({
path: obj.path
})
},
fail() {}
})
},
fail: function (res) {
console.log(res)
}
})
},
navbarReady(e) {
let { height, statusBarHeight } = e.detail
console.log(e)
this.setData({
tabBarStyle: height / 2 + statusBarHeight
})
},
async refreshList(e) {
console.log(e)
let { type } = this.data
let { typename } = e.currentTarget.dataset
type[typename].pageNum = 1
let res = await this.getMessageList(typename)
let toastObj = {
success: {
title: '刷新成功',
icon: 'success'
},
fail: {
title: '刷新失败',
icon: 'error'
}
}
wx.$api.showToast({
...toastObj[res],
duration: 1000
})
},
scrollonReachBottom(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) {
let { detail } = e
this.setData({
tabIndx: detail
})
},
MatchCeil(num) {
return Match.ceil(num)
},
getMessageList(typeName) {
let that = this
return new Promise((resolve, reject) => {
let { serviceMerchantId, type, warReportList, messageList } = this.data
let list = type[typeName]['list']
// console.log('list', this.data[list])
// return
let params = {
serviceMerchantId: serviceMerchantId,
...type[typeName]
}
// console.log(Math.ceil(2.8))
wx.$api.showLoading('加载中...')
mineApi
.messageBoxPage(params)
.then(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,
triggered: false
})
resolve('success')
})
.catch(err => {
reject('fail')
})
.finally(() => {
wx.$api.hideLoading()
})
})
}
}
})
{
"component": true,
"usingComponents": {
"msg-box": "../components/msgBox/msgBox",
"tab": "../components/Tab/Tab"
},
"navigationStyle": "custom"
}
/* pages/mineDetail/messageBox/messageBox.wxss */
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.layout {
position: relative;
// padding: 400rpx 16rpx 0;
padding-top: 400rpx;
font-size: 24rpx;
color: #8A8C90;
// height: 80vh;
display: flex;
flex-direction: column;
overflow: hidden;
&::after {
content: '';
width: 100%;
height: 265rpx;
// background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg.webp') no-repeat;
background-color: #fff;
// background-size: 100% 486rpx;
position: absolute;
left: 0;
top: 0;
z-index: -1;
}
.tabContainer {
height: 100rpx;
background-color: #fff;
}
.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;
}
.warReportBox {
box-sizing: border-box;
display: flex;
padding: 32rpx 0;
.item {
width: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin: auto;
.num {
margin-top: 8rpx;
font-weight: 500;
font-size: 32rpx;
color: #323436;
}
}
}
.warReportLink {
display: flex;
.label {
font-size: 24rpx;
color: #8A8C90;
margin-right: 5rpx;
}
}
.link {
margin-left: 10rpx;
font-weight: 400;
font-size: 24rpx;
color: #3666FE;
}
}
.erweimaCanvas {
position: fixed;
top: -9999rpx;
left: -9999rpx;
}
\ No newline at end of file \ No newline at end of file
<!-- pages/mineDetail/messageBox/messageBox.wxml -->
<!-- pages/tab/output/output.wxml -->
<!-- <navigation-bar navStyle="{{navStyle}}">服务商账号名称</navigation-bar>
<view class="layout">
</view> -->
<navigation-bar showBack="{{true}}" navStyle="{{navStyle}}" bindnavbarReady="navbarReady">
<view>消息盒子</view>
</navigation-bar>
<view class="layout " style="padding-top:{{tabBarStyle}}px; height:calc(100vh - {{tabBarStyle}}px)">
<tab
tab="{{tabList}}"
itemWidth="{{'50%'}}"
index="{{tabIndx}}"
bindclick="changeTabIndx"
class="tabContainer" />
<!-- -->
<view class="scrollCon" hidden="{{tabIndx==1}}">
<scroll-view
wx:if="{{tabBarStyle}}"
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
bindscrolltolower="scrollonReachBottom"
refresher-threshold="104"
style="height:100%;"
scroll-top="{{scrollTop}}"
class="list"
data-typeName="warReport"
refresher-triggered="{{triggered}}">
<msg-box
wx:for="{{warReportList}}"
wx:key='index'
merchantName="{{item.merchantName}}"
messageType="{{item.messageType}}"
time="{{item.createdTime}}">
<view class="warReportBox" wx:if="{{item.messageType == 2}}">
<view class="item">
<view class="label">当前产值</view>
<view class="num font-number">{{item.currentValue||'0.0'}}元</view>
</view>
</view>
<view class="warReportBox" wx:if="{{item.messageType == 3}}">
<view class="item">
<view class="label">总产值</view>
<view class="num font-number">{{item.totalValue}}元</view>
</view>
<view class="item">
<view class="label">完成目标</view>
<view class="num font-number">{{item.completeRate}}</view>
</view>
</view>
<view class="warReportLink">
<view class="label">点击了解详情:</view>
<view
class="link"
wx:if="{{item.valueUrl}}"
data-valueurl="{{item.valueUrl}}"
data-item="{{item}}"
bind:tap="showPoster">
战报详情
</view>
</view>
</msg-box>
</scroll-view>
</view>
<view hidden="{{tabIndx==0}}" class="scrollCon">
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
bindscrolltolower="scrollonReachBottom"
refresher-threshold="104"
style="height:100%;"
scroll-top="{{scrollTop}}"
class="list"
data-typeName="message"
refresher-triggered="{{triggered}}">
<msg-box
wx:for="{{messageList}}"
wx:key='index'
merchantName="{{item.merchantName}}"
messageType="{{item.messageType}}"
time="{{item.createdTime}}">
<view wx:if="{{item.messageType == 1}}">
<view class="cell">
<view class="label">活动名称:</view>
<view class="value">{{item.activityName||item.productName}}</view>
</view>
<view class="cell">
<view class="label">开始时间:</view>
<view class="value">{{item.activityStartTime||'-'}}</view>
</view>
<view class="cell">
<view class="label">结算时间:</view>
<view class="value">{{item.activityEndTime||'-'}}</view>
</view>
<view class="cell" wx:if="{{item.crowdFundActivityId}}">
<view class="label">母链海报:</view>
<view class="link" bind:tap="copyLink" data-item="{{item}}">下载母链海报分享给门店开展活动</view>
</view>
</view>
<view class="cell" wx:if="{{item.messageType == 4}}">
<view class="label">产品名称:</view>
<view class="value">{{item.activityName||item.productName}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 5}}">
<view class="label">新车交付场景:</view>
<view class="value">{{item.activityName||item.productName}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 6}}">
<view class="label">0~12个月场景:</view>
<view class="value">{{item.activityName||item.productName}}</view>
</view>
</msg-box>
</scroll-view>
</view>
</view>
<!-- findKey="{{findKey}}" -->
<crowdfund-poster id="poster" item="{{posterItem}}" />
<canvas class="erweimaCanvas" style="width: 600rpx; height: 600rpx;" canvas-id="myQrcode" />
// packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
import wxqrcode from '~/utils/lib/wxqrcode'
import { IMG_URL } from '~/utils/constantData'
import { deleteSecond } from '~/utils/format'
import outputApi from '~/api/outputApi/index'
const IMAGES = Object.freeze({
download: `${IMG_URL}/output/download.webp`
})
Component({
/**
* 组件的属性列表
*/
properties: {
orderObj: {
type: Object,
value: () => { },
observer(n) {
n && this.dealStaffList()
}
},
hasReport: {
type: Boolean,
value: true
}
},
options: {
styleIsolation: 'shared'
},
/**
* 组件的初始数据
*/
data: {
IMGURL: IMG_URL,
IMAGES,
isShowTip: true,
isShowPoster: false,
orderFormList: [
{
label: '总场次',
name: 'totalNum'
},
{
label: '总订单',
name: 'totalOrderCount'
},
{
label: '成交金额',
name: 'totalAmount',
prefix: '¥'
}
],
merchantFormList: [
{
label: '预计活动时间',
name: 'time'
},
{
label: '实际活动时间',
name: 'realTime'
},
{
label: '订单数',
name: 'orderCount',
className: 'font-number'
},
{
label: '产值',
name: 'realAmount',
className: 'red font-number',
prefix: '¥',
isNumber: true
},
{
label: '预估产值',
name: 'predictAmount',
className: 'font-number',
prefix: '¥',
isNumber: true
}
],
tableHeadList: [
{
label: 'rankIdx',
width: '40rpx'
},
{
label: '业务员',
name: 'shareName'
},
{
label: '转发',
name: 'shareCount'
},
{
label: '浏览',
name: 'browseCount'
},
{
label: '成交',
name: 'dealCount',
width: '92rpx'
},
{
label: '产值',
name: 'totalAmount',
prefix: '¥'
}
]
},
/**
* 组件的方法列表
*/
methods: {
dealStaffList() {
var list = this.data.orderObj
list &&
list.activityList?.forEach(item => {
// 1-未开始;2-活动中;3-已结束
let sliceNum = item.activityStatus == 3 ? 3 : 10
item.showStaffList = item.staffList.length > sliceNum ? item.staffList.slice(0, sliceNum) : item.staffList
item.staffList = item.staffList.length > sliceNum ? item.staffList.slice(sliceNum) : []
})
this.setData({
orderObj: list
})
},
handleMore(e) {
var { idx } = e.currentTarget.dataset
var list = this.data.orderObj
var item = list.activityList[idx]
list.activityList[idx].showStaffList = list.activityList[idx].showStaffList.concat(item.staffList.length > 10 ? item.staffList.slice(0, 10) : item.staffList)
list.activityList[idx].staffList = item.staffList.length > 10 ? item.staffList.slice(10) : []
this.setData({
orderObj: list
})
},
handleCopy(e) {
var { idx } = e.currentTarget.dataset
var currentItem = this.data.orderObj.activityList[idx]
var qr = wxqrcode.createQrCodeImg(currentItem.activityUrl)
const base64src = function (base64data) {
return new Promise((resolve, reject) => {
const [a, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64data) || []
if (!format) reject(new Error('ERROR_BASE64SRC_PARSE'))
const filePath = `${wx.env.USER_DATA_PATH}/tmp_base64src.${format}`
const buffer = wx.base64ToArrayBuffer(bodyData)
wx.getFileSystemManager().writeFile({
filePath,
data: buffer,
encoding: 'binary',
success() {
resolve(filePath)
},
fail() {
reject(new Error('ERROR_BASE64SRC_WRITE'))
}
})
})
}
base64src(qr).then(res => {
wx.getImageInfo({
src: res,
success(obj) {
wx.showShareImageMenu({
path: obj.path
})
},
fail() { }
})
})
},
handleJumpH5(e) {
// const { item } = e.currentTarget.dataset
// wx.$router.jumpH5(item.activityUrl)
},
async download(e) {
const { item } = e.currentTarget.dataset
if (item.mockPoster) {
item.posterUrl = item.mockPoster
this.setData({
crowdPosterItem: item,
isShowTip: false
})
return
}
// posterObj = this.selectComponent('#crowdPoster'),
// { options } = wx.$router.getPageInstance()
// const { options } = wx.$router.getPageInstance()
// console.log(options)
// try {
// let flag = await posterObj.check(item)
// posterObj.setData({
// poster: flag,
// show: true
// })
// } catch (error) {
wx.$api.showLoading('加载中...')
outputApi
.getPosterUrl({
id: item.activityId
})
.then(res => {
item.posterUrl = res
this.setData({
crowdPosterItem: item,
isShowTip: false
})
})
.catch(() => {
wx.$api.showToast('下载海报失败')
})
// }
},
/**长按海报 */
async longtouch(e) {
console.log('长按海报', e)
let { activityId } = e.detail
const res = await outputApi.reportPosterTrack({
activityId
})
this.triggerEvent('posterTrack')
},
/**长按战报/喜报 */
async handlePosterTouch(e) { },
/**战报 */
handleReport(e) {
const { item, idx } = e.currentTarget.dataset
wx.$api.showLoading('战报生成中')
outputApi
.getNewReportUrl({ activityId: item.activityId })
.then(res => {
// console.log(res)
if (!res.url) {
wx.$api.showToast('战报生成失败')
return true
}
var posterItem = {
...item,
posterUrl: res.url,
updatedTime: deleteSecond(res.updatedDate),
type: 'warReport'
}
this.setData({
crowdPosterItem: posterItem,
isShowTip: false
})
wx.$api.hideLoading()
this.triggerEvent('handleZhanReport', { item: item, idx: idx, posterItem: posterItem })
})
.catch(() => {
wx.$api.showToast('下载战报失败')
})
.finally(() => {
wx.$api.hideLoading()
})
},
/**喜报 */
handleXiReport(e) {
const { item } = e.currentTarget.dataset
wx.$api.showLoading('喜报生成中')
outputApi
.getNewGoodUrl({ activityId: item.activityId })
.then(res => {
if (!res.goodUrl) {
wx.$api.showToast('暂无喜报')
return true
}
var posterItem = {
...item,
posterUrl: res.goodUrl,
updatedTime: res.goodReportDate ? deleteSecond(res.goodReportDate) : '',
type: 'warReport'
}
this.setData({
crowdPosterItem: posterItem
})
wx.$api.hideLoading()
})
.catch(() => {
wx.$api.showToast('下载喜报失败')
})
.finally(() => {
// wx.$api.hideLoading()
})
// var posterItem = {
// ...item,
// posterUrl: item.goodUrl,
// // date: item.goodReportDate,
// updatedTime: deleteSecond(item.goodReportDate),
// type: 'warReport'
// }
// this.setData({
// // posterItem: posterItem,
// // isShowPoster: true,
// crowdPosterItem: posterItem,
// isShowTip: false
// })
}
}
})
/* packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxss */
.crowdfund-layout {
margin: 20rpx 20rpx;
padding-bottom: 136rpx;
.box {
background-color: #FFFFFF;
border-radius: 8rpx;
margin-bottom: 20rpx;
}
.flex {
display: flex;
}
.order {
display: flex;
justify-content: space-between;
align-items: center;
&-block {
width: 33.3%;
text-align: center;
font-weight: 500;
font-size: 26rpx;
color: #393B3E;
padding: 20rpx 0;
}
&-txt {
height: 40rpx;
line-height: 40rpx;
margin-bottom: 14rpx;
// font-weight: 600;
// font-family: 'number';
}
&-label {
font-size: 20rpx;
color: #8A8C90;
}
}
.merchant {
padding: 0 32rpx 32rpx;
.head {
box-sizing: border-box;
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
// height: 70rpx;
// line-height: 70rpx;
padding: 16rpx 0;
line-height: 40rpx;
font-size: 28rpx;
font-weight: 600;
border-bottom: 1rpx dashed #CCCED1;
margin-bottom: 16rpx;
&-title {
width: 70%;
}
&-link {
font-size: 24rpx;
color: #3666FE;
// line-height: 32rpx;
line-height: 37rpx;
}
.icon-download {
width: 36rpx;
height: 36rpx;
vertical-align: middle;
}
.down-tips {
position: absolute;
right: -40rpx;
top: -50rpx;
height: 52rpx;
line-height: 52rpx;
font-size: 20rpx;
color: #FFFFFF;
background: rgba(0, 0, 0, 0.60);
padding: 0 16rpx;
border-radius: 12rpx;
font-weight: 500;
&::after {
display: inline-block;
content: '';
position: absolute;
bottom: -28rpx;
right: 40rpx;
width: 0;
height: 0;
border: 18rpx solid;
border-color: #686868 transparent transparent;
}
}
}
.content {
// 表单
&-row {
display: flex;
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
color: #8A8C90;
margin-bottom: 16rpx;
}
&-label {
width: 156rpx;
flex-shrink: 0;
margin-right: 16rpx;
}
&-txt {
color: #323436;
}
&-txt.red {
color: #F35251;
}
// 排名
&-rank {
background: #F7F8FC;
border-radius: 20rpx;
margin-top: 16rpx;
padding: 0 12rpx;
.rank-title {
position: relative;
height: 72rpx;
line-height: 72rpx;
text-align: center;
font-size: 26rpx;
color: #5A6066;
font-weight: 600;
border-bottom: 1rpx solid rgba(204, 206, 209, 0.50);
// .activity-status {
// position: absolute;
// top: 0;
// right: 22rpx;
// font-size: 24rpx;
// }
}
.rank-table {
color: #5A6066;
font-size: 20rpx;
.rank {
display: flex;
justify-content: space-between;
height: 64rpx;
padding: 20rpx 16rpx;
border-bottom: 1rpx dotted rgba(204, 206, 209, 0.50);
.rank-left {
display: flex;
}
&-num {
width: 40rpx;
line-height: 64rpx;
text-align: center;
}
.rank-head {
position: relative;
width: 64rpx;
height: 64rpx;
margin-right: 12rpx;
.icon-wechat {
position: absolute;
bottom: -4rpx;
right: -4rpx;
width: 40rpx;
height: 40rpx;
}
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.rank-content {
font-size: 20rpx;
.rank-row {
position: relative;
display: flex;
height: 32rpx;
line-height: 32rpx;
margin-bottom: 8rpx;
.down-tips {
position: absolute;
left: -116rpx;
top: -60rpx;
height: 52rpx;
line-height: 52rpx;
font-size: 20rpx;
color: #FFFFFF;
background: rgba(0, 0, 0, 0.60);
padding: 0 16rpx;
border-radius: 12rpx;
font-weight: 500;
&::after {
display: inline-block;
content: '';
position: absolute;
bottom: -27rpx;
right: 67rpx;
width: 0;
height: 0;
border: 18rpx solid;
border-color: #686868 transparent transparent;
}
}
.rank-row-name {
max-width: 200rpx;
font-size: 24rpx;
color: #3666FE;
margin-right: 12rpx;
}
.name-disabled {
max-width: 200rpx;
font-size: 24rpx;
color: #5A6066;
margin-right: 12rpx;
}
&-dept {
color: #8A8C90;
}
&-txt {
color: rgba(90, 96, 102, 1);
padding: 0 10rpx 0 0;
}
&-txt::after {
display: inline-block;
content: '';
background-color: #CCCED1;
width: 1.2rpx;
height: 54%;
margin-left: 10rpx;
}
&-txt:last-child::after {
background-color: transparent;
}
}
.rank-row:last-child {
margin-bottom: 0;
}
}
.rank-price {
text-align: right;
font-size: 26rpx;
color: #8A8C90;
height: 64rpx;
line-height: 64rpx;
}
.txt-red {
color: #F35251;
}
// .th,
// .td {
// width: calc((100% - 116rpx) / 4);
// .icon-rank {
// width: 24rpx;
// height: 24rpx;
// vertical-align: middle;
// padding-right: 4rpx;
// }
// }
}
.rank:last-child {
border: none;
}
.tr-no-data {
text-align: center;
height: 32rpx;
line-height: 32rpx;
padding-bottom: 16rpx;
}
.btn-more {
height: 56rpx;
line-height: 56rpx;
// color: #5A6066;
// border: 2rpx solid #EEEEEE;
// border-radius: 28rpx;
text-align: center;
margin: 0 20rpx;
.icon-more {
width: 92rpx;
height: 36rpx;
}
}
}
}
// 建议
&-suggest {
margin-top: 32rpx;
.suggest-title {
width: 116rpx;
height: 36rpx;
line-height: 36rpx;
font-weight: 600;
font-size: 20rpx;
color: #3E71FE;
background: rgba(62, 113, 254, 0.12);
border-radius: 4rpx;
}
.suggest-txt {
font-size: 24rpx;
color: #323436;
line-height: 40rpx;
margin: 12rpx 0 16rpx;
}
.suggest-block {
line-height: 40rpx;
background: #FFF9F2;
border-radius: 20rpx;
padding: 16rpx;
.suggest-step {
display: flex;
.step-label {
width: 54rpx;
font-size: 20rpx;
color: #323436;
margin-right: 18rpx;
}
.step-txt {
width: calc(100% - 72rpx);
font-size: 22rpx;
color: #8A8C90;
}
}
}
}
// 战报
.new-report {
display: flex;
margin-top: 20rpx;
height: 52rpx;
line-height: 52rpx;
font-size: 20rpx;
color: #5A6066;
.report-left {
box-sizing: border-box;
display: flex;
font-size: 20rpx;
color: #3666FE;
padding: 0 20rpx;
height: 100%;
background: rgba(54, 102, 254, 0.06);
border: 2rpx solid rgba(62,113,254,0.70);
border-radius: 30rpx;
margin-right: 4rpx;
.icon-report {
width: 32rpx;
height: 32rpx;
vertical-align: middle;
margin-top: -2rpx;
}
}
}
}
}
}
.downloadIcon {
width: 40rpx;
height: 40rpx;
}
// .totalAmount{
// font-family: 'number';
// }
\ No newline at end of file \ No newline at end of file
<!-- packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml -->
<wxs src="../../index.wxs" module="filter" />
<view class="crowdfund-layout">
<view class="box order">
<view class="order-block" wx:for="{{orderFormList}}" wx:key="index">
<view class="order-txt font-number">
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
<text wx:if="{{item.name == 'totalAmount'}}">{{filter.money_three_for_two_thousands(orderObj[item.name] || 0.00)}}</text>
<text wx:else>{{orderObj[item.name]}}</text>
</view>
<view class="order-label">{{item.label}}</view>
</view>
</view>
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<!-- text-hide -->
<view class=" head-title" bindtap="handleJumpH5" data-item="{{item}}">
{{item.activityName}}
</view>
<view class="head-link" bindtap="download" data-item="{{item}}">
<image src="{{IMAGES.download}}" class="downloadIcon" webp></image>
母链海报
</view>
<view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view>
</view>
<view class="content">
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="content-label">{{subItem.label}}</view>
<view class="content-txt {{subItem.className}}">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{subItem.isNumber ? filter.money_three_for_two_thousands(item[subItem.name]) : item[subItem.name]}}
</view>
</view>
<!-- 排名 -->
<view class="content-rank" wx:if="{{item.showStaffList.length}}">
<view class="rank-title">员工任务排名</view>
<view class="rank-table">
<view wx:for="{{item.showStaffList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="rank">
<view class="rank-left">
<view class="rank-num">{{idx + 1}}</view>
<view class="rank-head">
<glsx-image wx:if="{{subItem.shareType == 1}}" class="icon-wechat" src="output/icon-wechat.webp" />
<image wx:if="{{subItem.imageUrl}}" src="{{subItem.imageUrl}}" />
<glsx-image wx:else src="output/icon-head.webp" />
</view>
<view class="rank-content">
<view class="rank-row">
<!-- <text wx:if="{{subItem.goodUrl}}" class="rank-row-name text-hide" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}</text> -->
<text wx:if="{{subItem.goodUrl}}" class="rank-row-name text-hide">{{subItem.shareName}}</text>
<text wx:else class="name-disabled text-hide">{{subItem.shareName}}</text>
<text class="rank-row-dept">{{subItem.departmentName || ''}}</text>
</view>
<view class="rank-row">
<text class="rank-row-txt">访客<text class="font-number">{{subItem.browseCount || 0}}</text>人</text>
<text class="rank-row-txt">成交<text class="font-number">{{subItem.dealCount || 0}}</text>单</text>
</view>
</view>
</view>
<view wx:if="{{subItem.totalAmount}}" class="rank-price txt-red font-number">
¥ {{filter.money_three_for_two_thousands(subItem.totalAmount || 0.00)}}
</view>
<view wx:else class="rank-price">暂无业绩</view>
</view>
</view>
<view wx:if="{{item.staffList.length}}" class="btn-more" bindtap="handleMore" data-idx="{{index}}">
<glsx-image class="icon-more" src="output/icon-more.webp" />
</view>
</view>
</view>
<!-- 诊断 -->
<view class="content-suggest" wx:if="{{item.activityStatus == 2 && item.suggestTxtList.length}}">
<view class="suggest-title"># 活动诊断</view>
<view class="suggest-txt">{{item.suggestTxt}}推荐以下建议:</view>
<view class="suggest-block">
<view class="suggest-step" wx:for="{{item.suggestList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="step-label">建议{{idx + 1}}</view>
<view class="step-txt">{{subItem}}</view>
</view>
</view>
</view>
<!-- 战报 -->
<view class="new-report" wx:if="{{item.activityStatus != 1 && hasReport}}">
<view class="report-left" bindtap="handleReport" data-item="{{item}}" data-idx="{{index}}">生成最新战报</view>
<view class="report-left" bindtap="handleXiReport" data-item="{{item}}" data-idx="{{index}}">生成最新喜报</view>
</view>
</view>
</view>
</view>
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{false}}" bindlongtouch="longtouch" />
<!-- <poster
posterItem="{{posterItem}}"
id="poster"
show="{{isShowPoster}}"
bindlongtouch="handlePosterTouch" /> -->
\ No newline at end of file \ No newline at end of file
const formList = [{
label: '到店贴膜量',
name: 'toShopCount'
}, {
label: '体验量',
name: 'experienceCount'
}, {
label: '成交订单',
name: 'upgradeCount'
}, {
label: '营业额',
name: 'totalSubOrderOrderMoney',
prefix: '¥'
}, {
label: '客单价',
name: 'calCustomerUnitPrice',
prefix: '¥'
}, {
label: '引流体验率',
name: 'calExperience',
suffix: '%'
}, {
label: '体验转化率',
name: 'calTransform',
suffix: '%'
}
]
const formObj = {
SC001: [{
label: '总单量',
name: 'totalCount'
}, {
label: '总产值',
name: 'totalAmount',
prefix: '¥'
}, {
label: '当月单量',
name: 'monthCount'
}, {
label: '当月产值',
name: 'monthAmount',
prefix: '¥'
}, {
label: '转化率',
name: 'conversionRate'
}, {
label: '单价',
name: 'price',
prefix: '¥'
}],
SC002: formList,
SC003: formList
}
module.exports = {
formObj
}
\ No newline at end of file \ No newline at end of file
// packageOutput/pages/summary/components/outputTransform/outputTransform.js
import { IMG_URL } from '~/utils/constantData'
import { formObj } from './constant/data'
const defaultSceneCode = 'SC002'
Component({
/**
* 组件的属性列表
*/
properties: {
formData: {
type: Object,
value: () => { }
},
sceneCode: {
type: String,
value: 'SC002',
observer(n) {
this.setData({
formDataList: formObj[n || 'defaultSceneCode']
})
}
},
hasNavigate: {
type: Boolean,
value: true
}
},
/**
* 组件的初始数据
*/
data: {
IMGURL: IMG_URL,
formDataList: formObj[defaultSceneCode]
},
/**
* 组件的方法列表
*/
methods: {
// handleDetail() {
// wx.navigateToMiniProgram({
// appId: 'wx0ff4e01294eca299', //appid
// path: '/pages/web_view/web_view',//path
// extraData: { //参数
// foo: 'bar'
// },
// envVersion: 'develop', //开发版develop 开发版 trial 体验版 release 正式版
// success(res) {
// console.log('成功')
// // 打开成功
// }
// })
// }
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageOutput/pages/summary/components/outputTransform/outputTransform.wxss */
.layout {
margin: 20rpx;
.box {
position: relative;
width: 100%;
height: 100%;
background: #FFFFFF url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/output/summary-bg.png") bottom left no-repeat;
background-size: 100% 176rpx;
border-radius: 4px;
}
.content {
display: flex;
flex-wrap: wrap;
}
.block {
position: relative;
box-sizing: border-box;
width: calc(100% / 3);
text-align: center;
padding: 32rpx 0;
font-size: 32rpx;
color: #323436;
font-weight: 600;
.label {
font-size: 26rpx;
color: #5A6066;
font-weight: 400;
margin-top: 8rpx;
}
z-index: 2;
}
.block::after {
position: absolute;
right: 0;
top: 46rpx;
display: inline-block;
content: '';
width: 1rpx;
height: 64rpx;
background: #CCCED1;
}
.block:nth-child(3n)::after {
display: none;
}
.block:nth-child(7)::after {
display: none;
}
}
.link {
box-sizing: border-box;
display: inline-block;
height: 68rpx;
line-height: 68rpx;
width: calc(100% - 64rpx);
font-size: 24rpx;
color: #5C7097;
text-align: right;
margin: 0 32rpx;
border-top: 1rpx dotted #CCCED1;
.link-btn {
box-sizing: border-box;
width: 100%;
}
.icon-link {
width: 20rpx;
height: 20rpx;
vertical-align: middle;
}
}
\ No newline at end of file \ No newline at end of file
<!-- packageOutput/pages/summary/components/outputTransform/outputTransform.wxml -->
<view class="layout">
<view class="box">
<view class="content">
<view class="block" wx:for="{{formDataList}}" wx:key="index">
<view>
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{formData[item.name] || 0}}
<text wx:if="{{item.suffix}}">{{item.suffix}}</text>
</view>
<view class="label">{{item.label}}</view>
</view>
</view>
<navigator wx:if="{{hasNavigate}}" version="trial" class="link" target="miniProgram" open-type="navigate" app-id="wx570d9331f9ace0bd" version="release">
<view class="link-btn">
<image class="icon-link" src="{{IMGURL}}output/icon-link.png?v={{img_version}}" />
查看订单详情
</view>
</navigator>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// packagesList/packageOutput/components/poster/poster.js
Component({
/**
* 组件的属性列表
*/
properties: {
posterItem: {
type: Object,
value: {}
},
show: {
type: Boolean,
value: false
},
scrollImg: {
type: Boolean,
value: true
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
hide() {
this.setData({
show: false,
poster: ''
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packagesList/packageOutput/components/poster/poster.wxss */
.layout {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 998;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(0,0,0,.8);
}
.bg-white {
padding: 32rpx 32rpx 0 32rpx;
background-color: #FFFFFF;
}
.poster {
width: 500rpx;
height: 68%;
// height: 1108rpx;
overflow: scroll;
border-radius: 8rpx 8rpx 0 0;
}
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 500rpx;
height: 90rpx;
background: #F7F8FA;
border-radius: 0 0 12rpx 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #3666FE;
margin-top: -2rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 12rpx;
}
}
.tips {
margin: 40rpx 80rpx 0;
font-size: 24rpx;
color: #FFFFFF;
line-height: 36rpx;
.underline{
font-weight: 600;
text-decoration: underline;
}
}
}
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!