Commit ba4d5930 by 李伟康

commit 场景集市

1 parent 4db397b0
Showing 40 changed files with 1768 additions and 17 deletions
...@@ -165,7 +165,11 @@ ...@@ -165,7 +165,11 @@
"pages/aiCheck/redundance/redundance", "pages/aiCheck/redundance/redundance",
"pages/aiCheck/detail/detail", "pages/aiCheck/detail/detail",
"pages/receptionDetail/receptionDetail", "pages/receptionDetail/receptionDetail",
"pages/aiCheck/defense/defense" "pages/aiCheck/defense/defense",
"pages/sceneMarket/index/index",
"pages/sceneMarket/clue/clue",
"pages/sceneMarket/clueForm/clueForm",
"pages/sceneMarket/clueDetail/clueDetail"
] ]
}, },
{ {
......
...@@ -36,7 +36,16 @@ Component({ ...@@ -36,7 +36,16 @@ Component({
isInt: { isInt: {
type: Boolean, type: Boolean,
value: false value: false
} },
color: {
type: String,
value: '#282829'
},
placeholderColor: {
type: String,
value: '#B1B1B3'
},
textStyle: String
}, },
/** /**
...@@ -63,7 +72,12 @@ Component({ ...@@ -63,7 +72,12 @@ Component({
}) })
}, },
setValue(value) { setValue(value) {
let { customMaxLength, maxlength, isLimitNum, isInt } = this.data let {
customMaxLength,
maxlength,
isLimitNum,
isInt
} = this.data
if (this.properties.filterEmoji) { if (this.properties.filterEmoji) {
if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value) if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value)
} }
...@@ -89,12 +103,16 @@ Component({ ...@@ -89,12 +103,16 @@ Component({
} }
} }
console.log(value) console.log(value)
this.setData({ value }) this.setData({
value
})
return value return value
}, },
textareaInput(e) { textareaInput(e) {
let { value } = e.detail let {
value
} = e.detail
value = this.setValue(value) value = this.setValue(value)
this.triggerEvent('input', { this.triggerEvent('input', {
...@@ -103,7 +121,9 @@ Component({ ...@@ -103,7 +121,9 @@ Component({
}, },
textareaBlur(e) { textareaBlur(e) {
let { value } = e.detail let {
value
} = e.detail
this.setData({ this.setData({
edit: true edit: true
}) })
......
<view class='textarea-box {{maxlength>0&&showWordLimit?"showWordLimit":""}}'> <view class='textarea-box {{maxlength>0&&showWordLimit?"showWordLimit":""}}'>
<block wx:if='{{edit}}'> <block wx:if='{{edit}}'>
<text class='textarea' bindtap="openTextarea" <text class='textarea' bindtap="openTextarea"
style="color:{{value?'#282829':'#B1B1B3'}}; {{textStyle}}">{{value||placeholder||'请输入'}}</text> style="color:{{value?color:placeholderColor}}; {{textStyle}}">{{value||placeholder||'请输入'}}</text>
</block> </block>
<block wx:else> <block wx:else>
<textarea class='_textarea_' maxlength="{{customMaxLength?-1:maxlength}}" value='{{value}}' <textarea class='_textarea_' maxlength="{{customMaxLength?-1:maxlength}}" value='{{value}}'
bindinput='textareaInput' focus='{{textareaFocus}}' bindblur='textareaBlur' bindconfirm='textareaBlur'></textarea> bindinput='textareaInput' focus='{{textareaFocus}}' bindblur='textareaBlur' bindconfirm='textareaBlur' style="{{textStyle}}"></textarea>
</block> </block>
<block wx:if='{{maxlength>0&&showWordLimit}}'> <block wx:if='{{maxlength>0&&showWordLimit}}'>
<view class='wordLimit'> <view class='wordLimit'>
......
...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd"; ...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 2; let index = 1;
const accountInfo = wx.getAccountInfoSync(); const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync(); const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion; const envName = accountInfo.miniProgram.envVersion;
......
...@@ -10,6 +10,7 @@ Page({ ...@@ -10,6 +10,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
if (options.level == 2) this.level = 2
carLifeApi.getCarBrandList().then(res => { carLifeApi.getCarBrandList().then(res => {
// this.setLocalStorage('wx_scrm_car_brand_list', carInfo) // this.setLocalStorage('wx_scrm_car_brand_list', carInfo)
const carInfo = res.data const carInfo = res.data
...@@ -50,7 +51,10 @@ Page({ ...@@ -50,7 +51,10 @@ Page({
}, },
getLetter() { getLetter() {
wx.hideLoading() wx.hideLoading()
let { brandList, letter } = this.data let {
brandList,
letter
} = this.data
let arr = [] let arr = []
if (brandList.length > 0) { if (brandList.length > 0) {
brandList.forEach(e => { brandList.forEach(e => {
...@@ -79,15 +83,27 @@ Page({ ...@@ -79,15 +83,27 @@ Page({
}) })
}, },
start(e) { start(e) {
let { letter } = e.target.dataset let {
letter
} = e.target.dataset
this.setData({ this.setData({
showTip: true, showTip: true,
letter letter
}) })
}, },
move(e) { move(e) {
let { letterHeight, showTip, height, toTop, arr } = this.data let {
let { y, num, isNum } = this letterHeight,
showTip,
height,
toTop,
arr
} = this.data
let {
y,
num,
isNum
} = this
if (showTip) { if (showTip) {
y = e.touches[0].clientY y = e.touches[0].clientY
num = Math.ceil((y - toTop) / letterHeight) num = Math.ceil((y - toTop) / letterHeight)
...@@ -110,17 +126,39 @@ Page({ ...@@ -110,17 +126,39 @@ Page({
}) })
}, },
showCarSeries(e) { showCarSeries(e) {
let { item } = e.currentTarget.dataset, const {
level
} = this
let {
item
} = e.currentTarget.dataset,
brandInfo = { brandInfo = {
vehicleBrandId: item.id, vehicleBrandId: item.id,
vehicleBrandName: item.name vehicleBrandName: item.name
} }
if (item.childs && item.childs.length) if (item.childs && item.childs.length) {
if (level) {
this.setData({
carSeriesList: item.childs
})
return
}
wx.$router.go('carSeries', { wx.$router.go('carSeries', {
brandInfo, brandInfo,
list: item.childs list: item.childs,
})
} else this.showToast('暂无该品牌车系')
},
cancel() {
this.setData({
carSeriesList: []
})
},
choose(e) {
const {item} = e.currentTarget.dataset
wx.$router.back(page => {
page.changeCarBrand && page.changeCarBrand(item)
}) })
else this.showToast('暂无该品牌车系')
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
......
...@@ -35,4 +35,16 @@ ...@@ -35,4 +35,16 @@
<!-- 提示 --> <!-- 提示 -->
<view class='tips' hidden='{{!showTip}}'>{{letter}}</view> <view class='tips' hidden='{{!showTip}}'>{{letter}}</view>
</view> </view>
<block wx:if="{{carSeriesList.length}}">
<view class="car-type-box">
<view class="bg" bindtap="cancel" ></view>
<view class="brands-box">
<block wx:for="{{carSeriesList}}" wx:key="index">
<view class="title" bindtap="choose" data-item="{{item}}">{{item.name}}
</view>
</block>
</view>
</view>
</block>
</view> </view>
...@@ -118,3 +118,65 @@ ...@@ -118,3 +118,65 @@
font-size: var(--fontSize18); font-size: var(--fontSize18);
} }
} }
.car-type-box {
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
font-size: 28rpx;
color: #333;
z-index: 9999;
}
.car-type-box .bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
}
.car-type-box .brands-box {
position: absolute;
top: 0;
right: 0;
width: 60.5%;
height: 100%;
overflow-y: scroll;
background: #fff;
-webkit-overflow-scrolling: touch;
animation: move 0.4s;
box-sizing: border-box;
padding-bottom: 40rpx;
}
.car-type-box .title {
width: 100%;
height: 108rpx;
line-height: 108rpx;
box-sizing: border-box;
padding-left: 32rpx;
color: #969799;
background: #F7F8FA;
}
.car-type-box .brands-box .brands-list {
width: 100%;
box-sizing: border-box;
padding-left: 32rpx;
border-bottom: 1rpx solid #e9e9e9;
animation: show-car-type .25s forwards;
}
@keyframes show-car-type{
0%{
min-height: 0;
opacity: 0;
}
100%{
min-height: 100rpx;
opacity: 1;
}
}
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/sceneMarket/clue/clue.js
import methods from './methods'
Page({
...methods,
/**
* 页面的初始数据
*/
data: {
tabHeight: 36,
tab: [''],
tabIndex: 0,
pageSize: 10,
currentPage: 1,
total: 0,
storeName: '',
list: [],
flag: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getTabHeight()
this.getSceneMarketMaterialMenu()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "场景线索"
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/sceneMarket/clue/clue.wxss */
\ No newline at end of file \ No newline at end of file
<tab-bar tabList="{{ tab }}" bindclick="tabBarClick" id="scene-clue-tab" tabIndex="{{tabIndex}}" />
<scroll-view scroll-y style="height:calc(100vh - {{tabHeight}}px)">
</scroll-view>
\ No newline at end of file \ No newline at end of file
import {
getSceneClueList,
getSceneMarketMaterialMenu
} from '../request'
import dayjs from 'dayjs'
export default {
refresh(){
this.setData({
pageSize: 10,
currentPage: 1,
total: 0,
list:[]
})
this.getSceneClueList()
},
tabBarClick(e) {
const tabIndex = e.detail
this.setData({
tabIndex
})
this.getSceneClueList()
},
jumpClueIndex() {
wx.navigateTo({
url: '/packageEquity/pages/sceneMarket/clue/clue',
})
},
/**获取tab高度 */
getTabHeight() {
wx.$util.getViewInfo('#scene-clue-tab', res => {
if (res?.height) this.setData({
tabHeight: res.height
})
})
},
async getSceneMarketMaterialMenu() {
try {
const {
code,
message,
data
} = await getSceneMarketMaterialMenu()
if (code == 0) {
data?.map(e => {
e.text = e.directoryName
})
this.setData({
tab: data
})
} else throw message
} catch (error) {
wx.$util.showToast(error)
}
},
async getSceneClueList() {
try {
const {
tab,
storeName,
tabIndex,
pageSize,
currentPage
} = this.data, {
code,
message,
data
} = await getSceneClueList({
pageSize,
currentPage,
businessCode:tab[tabIndex].code,
storeName
})
if (code == 0) {
} else throw message
} catch (error) {
console.log(error)
wx.$util.showToast(error)
}
},
a() {
let {
currentPage,
total,
pageSize
} = this.data
if (!pageSize) pageSize = 10
if (Math.ceil(total / pageSize) > currentPage) {
this.setData({
currentPage: currentPage + 1
})
this.getSceneClueList()
} else {
this.setData({
nothing: true
})
}
}
}
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/sceneMarket/clueDetail/clueDetail.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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
/* packageEquity/pages/sceneMarket/clueDetail/clueDetail.wxss */
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/sceneMarket/clueDetail/clueDetail.wxml-->
<text>packageEquity/pages/sceneMarket/clueDetail/clueDetail.wxml</text>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/sceneMarket/clueForm/clueForm.js
import methods from './methods'
import formStatic from './formStatic'
Page({
...methods,
/**
* 页面的初始数据
*/
data: {
...formStatic,
formData: {},
dynamicFormData:{},
nextBtn: true,
dynamicForm: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getSceneMarketMaterialMenu()
},
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index",
"form-item":"../components/formItem/formItem"
},
"navigationBarTitleText": "线索登记"
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/sceneMarket/clueForm/clueForm.wxss */
page {
background: #f7f8fa;
}
.layout {
padding: 24rpx 24rpx 232rpx;
.box {
padding: 0 20rpx;
border-radius: 16rpx;
background: #fff;
margin-bottom: 24rpx;
.form-item {
border-bottom: 2rpx solid #eff0f2;
&:last-of-type {
border-bottom: none;
}
}
}
.title {
color: #333333;
font-size: 28rpx;
font-weight: 500;
padding: 24rpx 0;
line-height: 32rpx;
border-bottom: 2rpx solid #eff0f2;
}
}
.btn-box {
position: fixed;
left: 0;
width: 100%;
bottom: 0;
padding: 64rpx 0;
background: #f7f8fa;
z-index: 2;
.btn {
width: 622rpx;
height: 88rpx;
margin: 0 auto;
border-radius: 12rpx;
background: #347bff;
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
font-size: 32rpx;
}
.disabled-btn {
background: rgba(52, 123, 255, .5);
}
}
\ No newline at end of file \ No newline at end of file
<view class="layout">
<view class="box">
<block wx:for="{{fixedForm}}" wx:key="index">
<view class="form-item">
<form-item item="{{item}}" formData="{{formData}}" bindKeyInput="bindKeyInput" bindMultiPickerChange="bindMultiPickerChange" bindMultiPickerColumnChange="bindMultiPickerColumnChange"></form-item>
</view>
</block>
</view>
<block wx:if="{{dynamicForm.length}}">
<block wx:for="{{dynamicForm}}" wx:key="index">
<view class="box">
<block wx:if="{{item.title}}">
<view class="title">{{item.title}}</view>
</block>
<block wx:for="{{item.form}}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
<view class="form-item">
<form-item item="{{i}}" formData="{{dynamicFormData}}" bindKeyInput="bindKeyInput" formName="dynamicFormData" bindPickerChange="bindPickerChange"></form-item>
</view>
</block>
</view>
</block>
</block>
</view>
<view class="btn-box">
<block wx:if="{{nextBtn}}">
<view class="btn {{formData.storeName && formData.storeBrandId && formData.businessCode ? '' :'disabled-btn'}}" bindtap="next">下一步</view>
</block>
<block wx:else>
<view class="btn" bindtap="submit">提交</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
export default {
fixedForm: [{
label: '门店名称',
required: true,
type: 'input',
maxlength: 50,
placeholder: '请输入门店名称',
key: 'storeName'
},
{
label: '门店品牌',
required: true,
type: 'carBrand',
key:'storeBrandId',
labelName:'storeBrand'
},
{
label: '业务类型',
required: true,
type: 'multiSelector',
optionList: [],
optionLabel: 'directoryName',
labelName: 'businessName',
key: 'businessCode',
placeholder: '请选择业务类型'
},
],
sceneForm: {
/**数字化延保 */
'SC_B002': [{
form: [{
label: '存量续保客户数',
type: 'input',
maxlength: 50,
placeholder: '请输入客户数量',
key: 'existingRenewalCustomers'
},
{
label: '合作的保险公司',
type: 'input',
maxlength: 50,
placeholder: '请输入保险公司名称',
key: 'cooperatingInsuranceCompanies'
},
{
label: '赠送的门店服务或权益',
type: 'input',
maxlength: 50,
placeholder: '请输入具体服务或权益',
key: 'giftedStoreServicesOrBenefits'
},
{
label: '新能源续保返现情况',
type: 'input',
maxlength: 50,
placeholder: '请输入续保返现情况',
key: 'newEnergyRenewalCashbackDetails'
},
{
label: '是否使用第三方商场提现',
type: 'input',
maxlength: 50,
placeholder: '请描述是否使用第三方商场提现',
key: 'useThirdPartyMallForWithdrawal'
},
{
label: '新第三方商场名称',
type: 'input',
maxlength: 50,
placeholder: '请输入新第三方商场名称',
key: 'newThirdPartyMallName'
},
{
label: '保险公司佣金政策及送修承诺',
type: 'input',
maxlength: 50,
placeholder: '请输入保险公司佣金政策及送修承诺',
key: 'insuranceCompanyCommissionPoliciesAndRepairPromises'
},
{
label: '续保优惠方式',
type: 'input',
maxlength: 50,
placeholder: '请输入续保优惠方式',
key: 'renewalDiscountMethods'
},
{
label: '续保人员情况',
type: 'input',
maxlength: 50,
placeholder: '请输入续保人员情况',
key: 'renewalStaffDetails'
},
{
label: '续保业务投入计划',
type: 'input',
maxlength: 50,
placeholder: '请输入续保业务投入计划',
key: 'renewalBusinessInvestmentPlans'
},
]
}],
/**售后众筹 */
'SC_B006': [{
title: '人员信息',
form: [{
label: '经销商姓名/联系方式',
type: 'input',
maxlength: 50,
placeholder: '请输入经销商姓名/联系方式',
key: 'dealerName'
},
{
label: '店总经理',
type: 'input',
maxlength: 50,
placeholder: '请输入店总经理',
key: 'generalManager'
},
{
label: '售后总监',
type: 'input',
maxlength: 50,
placeholder: '请输入售后总监',
key: 'afterSalesDirector'
},
{
label: '销售后总监',
type: 'input',
maxlength: 50,
placeholder: '请输入销售后总监',
key: 'postSalesDirector'
},
{
label: '市场经理',
type: 'input',
maxlength: 50,
placeholder: '请输入市场经理',
key: 'marketingManager'
},
]
},
{
title: '门店属性',
form: [{
label: '展厅地址',
type: 'input',
required: true,
maxlength: 50,
placeholder: '请输入展厅地址',
key: 'showroomAddress'
},
{
label: '地理位置',
type: 'select',
required: true,
optionList: ['市中心单店', '城郊单店', '市中心汽车城', '城郊汽车城'],
labelName: 'location',
placeholder: '请选择位置',
key: 'location'
},
{
label: '店面性质',
type: 'select',
required: true,
optionList: ['集团店', '独立店', '二级网点'],
labelName: 'storeNature',
placeholder: '请选择店面性质',
key: 'storeNature'
},
]
},
{
title: '设施与人员',
form: [{
label: '售后工位数',
type: 'input',
maxlength: 50,
placeholder: '请输入售后工位数',
key: 'afterSalesStations'
},
{
label: '精品施工工位数',
type: 'input',
maxlength: 50,
placeholder: '请输入精品施工工位数',
key: 'premiumConstructionStations'
},
{
label: 'SA总人数(服务顾问)',
type: 'input',
maxlength: 50,
placeholder: '请输入SA总人数(服务顾问)',
key: 'serviceAdvisorsTotal'
},
{
label: '客服人数',
type: 'input',
maxlength: 50,
placeholder: '请输入客服人数',
key: 'customerServiceStaff'
},
]
},
{
title: '运营数据',
form: [{
label: '目前基盘数(现有客户)',
type: 'input',
maxlength: 50,
placeholder: '请输入目前基盘数',
key: 'currentCustomerBase'
},
{
label: '3年内基盘数(目标客户)',
type: 'input',
maxlength: 50,
placeholder: '请输入3年内基盘数',
key: 'targetCustomerBaseWithin3Years'
},
{
label: '进店量(月度)',
type: 'input',
maxlength: 50,
placeholder: '请输入进店量',
key: 'monthlyVisits'
},
{
label: '精品成交金额(月度)',
type: 'input',
maxlength: 50,
placeholder: '请输入精品成交金额',
key: 'monthlyPremiumSalesAmount'
},
]
},
{
title: '产品信息',
form: [{
label: '主要进店车型',
type: 'input',
maxlength: 50,
placeholder: '请输入主要进店车型',
key: 'mainModels'
},
{
label: '主营原厂精品(列举5个)',
type: 'input',
maxlength: 50,
placeholder: '请输入主营原厂精品',
key: 'mainOriginalPremiums'
},
{
label: '购车赠送精品',
type: 'input',
maxlength: 50,
placeholder: '请输入购车赠送精品',
key: 'purchaseGiftPremiums'
},
]
},
{
title: '其他',
form: [{
label: '备注',
type: 'textarea',
maxlength: 200,
placeholder: '请输入备注',
key: 'remarks'
} ]
}
]
},
}
\ No newline at end of file \ No newline at end of file
import {
getSceneMarketMaterialMenu,
saveSceneMarketLead
} from '../request'
export default {
changeCarBrand(e) {
const {
id,
name
} = e
this.setData({
['formData.storeBrandId']: id,
['formData.storeBrand']: name
})
},
async getSceneMarketMaterialMenu() {
try {
const {
code,
message,
data
} = await getSceneMarketMaterialMenu()
if (code == 0) {
let optionList = [
[],
[]
],
secondOption = []
for (let key in data) {
optionList[0].push(data[key])
secondOption.push(data[key].sceneMarketLevelTwoList)
}
optionList[1] = secondOption[0]
this.setData({
[`fixedForm[2].optionList`]: optionList,
secondOption
})
} else throw message
} catch (error) {
wx.$util.showToast(error)
}
},
bindMultiPickerColumnChange({
detail: e
}) {
let {
column,
value
} = e.detail, {
secondOption
} = this.data
if (column == 0) {
this.setData({
[`fixedForm[2].optionList[1]`]: secondOption[value]
})
}
},
bindMultiPickerChange({
detail: e
}) {
const {
value
} = e.detail, {
fixedForm
} = this.data,
[first, second] = value
let businessName = `${fixedForm[2].optionList[0][first].directoryName}-${fixedForm[2].optionList[1][second].directoryName}`,
businessCode = fixedForm[2].optionList[1][second].code
this.setData({
['formData.businessName']: businessName,
['formData.businessCode']: businessCode,
nextBtn: true,
dynamicFormData: {},
dynamicForm: []
})
},
bindKeyInput({
detail: e
}) {
const {
key,
formName
} = e.currentTarget.dataset
this.setData({
[`${formName}.${key}`]: e.detail.value
})
},
bindPickerChange({
detail: e
}) {
const {
key,
option,
formName
} = e.currentTarget.dataset
this.setData({
[`${formName}.${key}`]: option[e.detail.value]
})
},
next() {
const {
formData,
sceneForm
} = this.data
if (formData.storeName && formData.storeBrandId && formData.businessCode) {
if (sceneForm[formData.businessCode]) this.setData({
dynamicForm: sceneForm[formData.businessCode],
nextBtn: false
})
else wx.$util.showToast('当前场景尚未配置对应表单')
}
},
submit() {
try {
const {
formData,
dynamicForm,
dynamicFormData,
fixedForm
} = this.data
let requiredList = []
fixedForm.map(e => {
if (!formData[e.key]) throw e.placeholder
})
dynamicForm.map(e => {
e.form.map(i => {
if (i.required) requiredList.push({
placeholder: i.placeholder,
key: i.key
})
})
})
requiredList.map(e => {
if (!dynamicFormData[e.key]) throw e.placeholder
})
this.saveSceneMarketLead()
} catch (error) {
wx.$util.showToast(error)
}
},
async saveSceneMarketLead() {
try {
let {
formData,
dynamicForm,
dynamicFormData
} = this.data,
extendedAttributes = {}
dynamicForm.map(e => {
e.form.map(i => {
if (dynamicFormData[i.key]) extendedAttributes[i.key] = dynamicFormData[i.key]
})
})
const params = {
storeName: formData.storeName,
storeBrandId: formData.storeBrandId,
storeBrand: formData.storeBrand,
businessCode: formData.businessCode,
extendedAttributes: JSON.stringify(extendedAttributes)
}
const {
code,
message,
data
} = await saveSceneMarketLead(params)
if (code == 0) {
if (data) {
wx.$util.showToast('数据保存成功')
setTimeout(() => {
wx.$router.back(page => {
page.refresh()
})
}, 1e3)
} else throw message
} else throw message
} catch (error) {
console.log(error)
wx.$util.showToast(error)
}
}
}
\ No newline at end of file \ No newline at end of file
// components/tabView/tabView.js
Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
/**
* 组件的属性列表
*/
properties: {
tabList: {
type: Array,
value: []
},
height: null,
tagIndex: {
type: Number,
value: 0
},
refresherEnabled: Boolean,
triggered: Boolean
},
/**
* 组件的初始数据
*/
data: {
scrollTop: 0,
},
/**
* 组件的方法列表
*/
methods: {
click(e) {
let {
index,
item
} = e.currentTarget.dataset
item.index = index
this.setData({
scrollTop: 0,
tagIndex: index
})
this.triggerEvent('click', item)
},
tabScrollTolower(e) {
this.triggerEvent('tabScrollTolower')
},
viewScrollTolower(e) {
this.triggerEvent('viewScrollTolower')
},
bindrefresherrefresh(e) {
this.triggerEvent('refresherrefresh')
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="tab-box" id="tabView" style="height:calc(100vh - {{height}}px)">
<scroll-view style="height:100%;" scroll-y class="tab" bindscrolltolower="tabScrollTolower">
<view>
<block wx:for="{{tabList}}" wx:key="index">
<view class="tab-item {{tagIndex==index?'active':''}}" bindtap="click" data-item="{{item}}" data-index="{{index}}">
<view class="text">{{item.directoryName}}</view>
</view>
</block>
</view>
</scroll-view>
<view class="view">
<view style="height:100%;">
<scroll-view style="height:100%" scroll-y scroll-top="{{scrollTop}}" bindscrolltolower="viewScrollTolower" refresher-enabled="{{refresherEnabled}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="bindrefresherrefresh">
<view class="content">
<slot name="content"></slot>
</view>
</scroll-view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/tabView/tabView.wxss */
.tab-box {
display: flex;
}
.tab {
width: 24%;
box-sizing: border-box;
text-align: center;
background: #f7f8fa;
}
.view {
width: 76%;
height: 100%;
position: relative;
background: #fff;
}
.tab-item {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 116rpx;
font-size: 24rpx;
color: #707071;
box-sizing: border-box;
padding: 0 14rpx;
transition: all .5s;
background-color: #EFF0F2;
position: relative;
}
.tab-item .text {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
}
.active {
font-weight: 500;
background: #fff;
position: sticky;
top: 0;
color: #2D2D2E;
}
.active::after {
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
width: 6rpx;
height: 40rpx;
border-radius: 0 596rpx 596rpx 0;
background: #347bff;
content: '';
}
@keyframes show-border {
0% {
height: 0;
}
100% {
height: 60rpx;
}
}
.refresherEnabled {
position: relative;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
opacity: 0;
}
.content {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/sceneMarket/components/formItem/formItem.js
Component({
/**
* 组件的属性列表
*/
properties: {
item: Object,
formData: Object,
formName:{
type:String,
value:'formData'
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
showCarBrandBox(){
wx.navigateTo({
url: '/packageEquity/pages/carEquity/carBrands/carBrands?level=2',
})
},
bindMultiPickerChange(e){
this.triggerEvent('MultiPickerChange', e)
},
bindMultiPickerColumnChange(e){
this.triggerEvent('MultiPickerColumnChange', e)
},
bindKeyInput(e){
this.triggerEvent('KeyInput', e)
},
bindPickerChange(e){
this.triggerEvent('PickerChange', e)
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/sceneMarket/components/formItem/formItem.wxss */
.item {
padding: 24rpx 0 8rpx;
color: #333333;
font-size: 28rpx;
.required{
color: #F24724;
}
.value {
display: flex;
align-items: center;
padding: 16rpx 0;
height: 32rpx;
font-size: 28rpx;
color: #333333;
.input {
width:100%;
height: 100%;
}
.picker-box {
width: 100%;
}
.picker {
display: flex;
align-items: center;
width: 100%;
height: 100%;
}
.placeholder {
color: #3333334d;
font-size: 28rpx;
}
.arrow {
width: 32rpx;
height: 32rpx;
margin-left: auto;
}
}
.textarea{
height: 192rpx;
padding: 16rpx 0;
}
}
\ No newline at end of file \ No newline at end of file
<view class="item">
<view class="label">
{{item.label}}
<block wx:if="{{item.required}}">
<text class="required">*</text>
</block>
</view>
<block wx:if="{{item.type == 'textarea'}}">
<view class="textarea">
<gl-textarea bindinput="bindKeyInput" data-key="{{item.key}}" data-form-name="{{formName}}" maxlength="{{item.maxlength}}" placeholderColor="#3333334d" placeholder="{{item.placeholder}}" color="#333333" textStyle="font-size:28rpx;line-height:32rpx;" />
</view>
</block>
<block wx:else>
<view class="value">
<block wx:if="{{item.type == 'input'}}">
<input placeholder="{{item.placeholder}}" class="input" type="{{item.inputType || 'text'}}" maxlength="{{item.maxlength}}" bindinput="bindKeyInput" data-key="{{item.key}}" data-form-name="{{formName}}" placeholder-class="placeholder" />
</block>
<block wx:elif="{{item.type == 'carBrand'}}">
<view class="picker" bindtap="showCarBrandBox">
<view class="text-hide" wx:if="{{formData[item.labelName]}}">
{{formData[item.labelName]}}
</view>
<text class="placeholder" wx:else>{{item.placeholder}}</text>
<image class="arrow" src="/components/images/arrow-x.png" />
</view>
</block>
<block wx:elif="{{item.type == 'multiSelector'}}">
<picker class="picker-box" mode="multiSelector" range="{{item.optionList}}" range-key="{{item.optionLabel}}" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" data-key="{{item.key}}" data-form-name="{{formName}}">
<view class="picker">
<view class="text-hide" wx:if="{{formData[item.labelName]}}">
{{formData[item.labelName]}}
</view>
<text class="placeholder" wx:else>{{item.placeholder}}</text>
<image class="arrow" src="/components/images/arrow-x.png" />
</view>
</picker>
</block>
<block wx:elif="{{item.type == 'select'}}">
<picker class="picker-box" mode="selector" range="{{item.optionList}}" range-key="{{item.optionLabel || ''}}" bindchange="bindPickerChange" data-key="{{item.key}}" data-option="{{item.optionList}}" data-form-name="{{formName}}">
<view class="picker">
<view class="text-hide" wx:if="{{formData[item.labelName]}}">
{{formData[item.labelName]}}
</view>
<text class="placeholder" wx:else>{{item.placeholder}}</text>
<image class="arrow" src="/components/images/arrow-x.png" />
</view>
</picker>
</block>
</view>
</block>
</view>
// packageEquity/pages/sceneMarket/components/material/material.js
import {
getMaterialById
} from '../../request'
Component({
/**
* 组件的属性列表
*/
properties: {
item: Object
},
/**
* 组件的初始数据
*/
data: {
materialTypeEnum: {
0: '图片',
1: '视频',
2: 'PDF',
3: '富文本',
4: 'Excel',
5: 'Word'
},
readStatusEnum: {
0: '已查看',
1: '未查看'
}
},
/**
* 组件的方法列表
*/
methods: {
async jump() {
try {
const {
item
} = this.data
if (item.type == 3) {
//富文本
} else {
const {
code,
data,
message
} = await getMaterialById({
id: item.id
})
if (code == 0) {
console.log(data)
if (item.type == 0 || item.type == 1) {
//视频、图片
} else {
//文档
const url = data.detailInfos[0].image
wx.downloadFile({
url,
success: function (res) {
const manage = wx.getFileSystemManager()
let file = url.split('/')
let fileName = file[file.length - 1]
manage.saveFile({
tempFilePath: res.tempFilePath,
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
success: function (res) {
wx.$util.showToast('请点击右上角『…』选择“保存到手机”')
setTimeout(() => {
wx.openDocument({
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
showMenu: true,
})
}, 1e3)
}
})
}
})
}
} else throw message
}
} catch (error) {
wx.$util.showToast(error)
}
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/sceneMarket/components/material/material.wxss */
.material-item {
display: flex;
position: relative;
margin: 0 24rpx 24rpx;
.status {
position: absolute;
right: 0;
top: 0;
height: 40rpx;
width: fit-content;
padding: 0 12rpx;
font-size: 22rpx;
color: #999999;
background: #9999991a;
}
.status-green {
color: #35c376;
background: #35c3761a;
}
.icon {
width: 128rpx;
height: 128rpx;
margin-right: 16rpx;
flex-shrink: 0;
position: relative;
.image {
width: 100%;
height: 100%;
}
.label {
display: flex;
align-items: center;
padding: 0 6rpx;
position: absolute;
width: fit-content;
color: #ffffff;
left: 8rpx;
top: 8rpx;
height: 28rpx;
background: #00000066;
font-size: 20rpx;
}
}
.text {
width: calc(100% - 144rpx);
.title {
width: calc(100% - 98rpx);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #333333;
font-size: 30rpx;
font-weight: 700;
}
.tags {
display: flex;
align-items: center;
gap: 0 8rpx;
margin: 8rpx 0;
.tag {
display: flex;
align-items: center;
height: 40rpx;
background: #ff9d0a1a;
padding: 0 12rpx;
width: fit-content;
color: #ff9d0a;
font-size: 22rpx;
border-radius: 4rpx;
}
}
.date {
color: #999999;
font-size: 24rpx;
}
}
}
\ No newline at end of file \ No newline at end of file
<view class="material-item" bindtap="jump">
<view class="status {{item.readStatus == 0?'status-green':''}}">{{readStatusEnum[item.readStatus]}}</view>
<view class="icon">
<block wx:if="{{item.cover}}">
<image class="image" src="{{item.cover}}" />
</block>
<block wx:else>
<image class="image" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/material-{{item.type}}.png" />
</block>
<view class="label">{{materialTypeEnum[item.type]}}</view>
</view>
<view class="text">
<view class="title">{{item.title}}</view>
<view class="tags">
<block wx:for="{{item.sceneMarketTagsList}}" wx:for-item="i" wx:key="index">
<view class="tag">{{i.tagName}}</view>
</block>
</view>
<view class="date">{{item.date||''}}</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/sceneMarket/index/index.js
import methods from './methods'
Page({
...methods,
/**
* 页面的初始数据
*/
data: {
tabHeight: 36,
tab: [''],
tabIndex: 0,
tagIndex: 0,
requestParams: {},
materialList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getTabHeight()
this.getSceneMarketMaterialMenu()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"tab-view":"../components/TabView/TabView",
"material":"../components/material/material"
},
"navigationBarTitleText": "场景集市"
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/sceneMarket/index/index.wxss */
.search-box {
position: sticky;
top: 0;
display: flex;
align-items: center;
padding-left: 24rpx;
background-color: #fff;
height: 88rpx;
}
.clue-btn {
position: fixed;
bottom: 206rpx;
right: 36rpx;
width: 128rpx;
height: 128rpx;
border-radius: 15.06rpx;
background: #ffffffcc;
box-shadow: 0 3.76rpx 18.82rpx 0 #0000001a;
display: flex;
align-items: center;
justify-content: center;
.clue-icon {
width: 96rpx;
height: 96rpx;
}
}
\ No newline at end of file \ No newline at end of file
<tab-bar tabList="{{ tab }}" bindclick="tabBarClick" id="scene-market-tab" />
<tab-view tabList="{{tab[tabIndex].sceneMarketLevelTwoList}}" tagIndex="{{tagIndex}}" height="{{tabHeight}}" bindclick="tabClick">
<view class="tab-view-box" slot="content">
<view class="search-box">
</view>
<block wx:if="{{requestComplete}}">
<view class="box">
<view class="material-box">
<block wx:if="{{materialList.length}}">
<block wx:for="{{materialList}}" wx:key="index">
<view class="item">
<material item="{{item}}"></material>
</view>
</block>
</block>
<block wx:else>
<view class="list-nothing flex">
<view class="icon">
<image webp src=""></image>
</view>
没有找到筛选结果
</view>
</block>
</view>
</view>
</block>
</view>
</tab-view>
<view class="clue-btn" bindtap="jumpClueIndex">
<image class="clue-icon" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/scene.png" />
</view>
\ No newline at end of file \ No newline at end of file
import {
getSceneMarketMaterialMenu,
getSceneMarketMaterialList
} from '../request'
import dayjs from 'dayjs'
export default {
jumpClueIndex() {
wx.navigateTo({
url: '/packageEquity/pages/sceneMarket/clue/clue',
})
},
/**获取tab高度 */
getTabHeight() {
wx.$util.getViewInfo('#scene-market-tab', res => {
if (res?.height) this.setData({
tabHeight: res.height
})
})
},
async getSceneMarketMaterialMenu() {
try {
const {
code,
message,
data
} = await getSceneMarketMaterialMenu()
if (code == 0) {
data?.map(e => {
e.text = e.directoryName
})
this.setData({
tab: data
})
} else throw message
} catch (error) {
wx.$util.showToast(error)
}
},
tabBarClick(e) {
const tabIndex = e.detail,
{
tab
} = this.data
this.setData({
tabIndex,
tagIndex: 0
})
let detail = tab[tabIndex].code
if (tab[tabIndex]?.sceneMarketLevelTwoList.length) detail = tab[tabIndex].sceneMarketLevelTwoList[0]
this.tabClick({
detail
})
},
tabClick({
detail: {
code: businessCode
}
}) {
this.setData({
requestParams: {
businessCode
},
requestComplete: false
})
this.getSceneMarketMaterialList()
},
async getSceneMarketMaterialList() {
try {
const {
requestParams
} = this.data, {
code,
message,
data
} = await getSceneMarketMaterialList(requestParams)
if (code == 0) {
data?.map(e => {
e.date = dayjs(e.createdDate).format('YYYY-MM-DD')
})
this.setData({
materialList: data,
requestComplete: true
})
} else throw message
} catch (error) {
wx.$util.showToast(error)
}
}
}
\ No newline at end of file \ No newline at end of file
import api from '~/utils/request/request.js'
module.exports = {
/**查询所有业务场景 */
getSceneMarketMaterialMenu(data = {}) {
return api.post('dj.api.carboutique.material.scenemarket.findAllLevel', data)
},
/**根据场景查询素材列表 */
getSceneMarketMaterialList(data = {}) {
return api.post('dj.api.carboutique.material.scenemarket.findByOneCode', data)
},
/**查询素材详情 */
getMaterialById(data = {}) {
return api.post('dj.api.smartcarlife.customervisits.getMaterialById', data)
},
/**
* 查询所属的线索列表
*/
getSceneClueList(data = {}) {
return api.post('dj.api.carboutique.material.scenemarket.findOwerLeads', data)
},
/**保存线索 */
saveSceneMarketLead(data = {}) {
return api.post('dj.api.carboutique.material.scenemarket.saveSceneMarketLead', data)
},
}
\ 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!