Commit bcde77d3 by 前端

Merge branch 'SAAS+V4.51.1-0415' into 'SAAS+V4.52.0-0429'

开发提测合并

See merge request !377
2 parents cf52f6b9 c8e8f007
Showing 133 changed files with 4153 additions and 144 deletions
......@@ -343,5 +343,10 @@ module.exports = {
// 上传pdf
uploadPdfAPI(data) {
return api.post('dj.api.smartcarlife.common.uploadPdf', data, ['file'])
},
// 查询员工是否是导师
getStaffMentorFlag(data) {
return api.post('dj.api.smartcarlife.employee.isMentor', data)
}
}
......@@ -167,7 +167,13 @@
"pages/aiCheck/detail/detail",
"pages/receptionDetail/receptionDetail",
"pages/aiCheck/defense/defense",
"pages/extract/extract/extract"
"pages/extract/extract/extract",
"pages/extract/confirm/confirm",
"pages/extract/success/success",
"pages/sceneMarket/index/index",
"pages/sceneMarket/clue/clue",
"pages/sceneMarket/clueForm/clueForm",
"pages/sceneMarket/materialPage/materialPage"
]
},
{
......@@ -238,15 +244,11 @@
"preloadRule": {
"pages/tabWorkOrder/pages/index/index": {
"network": "all",
"packages": [
"tabWorkOrder"
]
"packages": ["tabWorkOrder"]
},
"tabIndex/pages/index/index": {
"network": "all",
"packages": [
"tabWorkOrder"
]
"packages": ["tabWorkOrder"]
}
},
"resolveAlias": {
......@@ -260,4 +262,4 @@
},
"lazyCodeLoading": "requiredComponents",
"resizable": true
}
\ No newline at end of file
}
......@@ -26,6 +26,18 @@
flex-grow: 1;
}
.meeting-box {
.van-cell {
line-height: auto !important;
border: 2rpx solid #ececec;
border-radius: 16rpx;
margin-top: 16rpx;
padding: 16rpx 24rpx !important;
}
.van-field__control--textarea {
min-height: var(--field-text-area-min-height,144rpx) !important;
}
}
.input-suffix {
/* height: var(--fontSize88);
line-height: var(--fontSize88); */
......
......@@ -26,7 +26,7 @@
show-word-limit
noPadding="{{item.noPadding}}">
<!-- slot -->
<slot wx:if="{{item.type == 'slot'}}" name="{{item.name}}" />
<slot wx:if="{{item.type == 'slot'}}" name="{{item.slotName || item.name}}" />
<!-- radio -->
<view wx:if="{{item.type == 'radio'}}">
<van-radio-group value="{{formData[item.name]}}" disabled="{{item.disabled||disable}}" class="radio-box" data-attr="{{item.name}}" bindchange="handleRadio">
......@@ -34,7 +34,7 @@
wx:for-index="kIdx" wx:key="kIdx" name="{{k[item.optionLabel]}}">{{k[item.optionLabel]}}</van-radio>
</van-radio-group>
</view>
<!-- input / textarea -->
<!-- input -->
<view wx:if="{{item.type == 'input'}}" class="input-box" style="{{item.customStyle}}">
<!-- rows="1" -->
<van-field
......@@ -56,6 +56,12 @@
bindinput="handleInput" />
<text wx:if="{{item.suffix}}" class="input-suffix">{{item.suffix}}</text>
</view>
<!-- textarea -->
<view wx:if="{{item.type == 'textarea'}}" class="meeting-box">
<view class="meeting-textarea">
<van-field value="{{formData[item.name]}}" hold-keyboard type="textarea" rows="{{item.rows || '4'}}" autosize="{ minHeight: 50 }" show-word-limit placeholder="{{item.placeholder || '请输入'}}" maxlength="{{item.maxlength || 140}}" disabled="{{item.disabled||disable}}" data-attr="{{item.name}}" data-item="{{item}}" bindinput="handleInput" />
</view>
</view>
<!-- picker -->
<picker
wx:if="{{item.type == 'select'}}"
......
......@@ -36,7 +36,16 @@ Component({
isInt: {
type: Boolean,
value: false
}
},
color: {
type: String,
value: '#282829'
},
placeholderColor: {
type: String,
value: '#B1B1B3'
},
textStyle: String
},
/**
......@@ -63,7 +72,12 @@ Component({
})
},
setValue(value) {
let { customMaxLength, maxlength, isLimitNum, isInt } = this.data
let {
customMaxLength,
maxlength,
isLimitNum,
isInt
} = this.data
if (this.properties.filterEmoji) {
if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value)
}
......@@ -89,12 +103,16 @@ Component({
}
}
console.log(value)
this.setData({ value })
this.setData({
value
})
return value
},
textareaInput(e) {
let { value } = e.detail
let {
value
} = e.detail
value = this.setValue(value)
this.triggerEvent('input', {
......@@ -103,7 +121,9 @@ Component({
},
textareaBlur(e) {
let { value } = e.detail
let {
value
} = e.detail
this.setData({
edit: true
})
......@@ -113,4 +133,4 @@ Component({
})
}
}
})
})
\ No newline at end of file
<view class='textarea-box {{maxlength>0&&showWordLimit?"showWordLimit":""}}'>
<block wx:if='{{edit}}'>
<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 wx:else>
<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 wx:if='{{maxlength>0&&showWordLimit}}'>
<view class='wordLimit'>
......
......@@ -186,7 +186,7 @@ Component({
pageNum: pageNum,
pageSize: 10,
keyword: searchValue,
sellerMerchantId: userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 ? '' : (userInfo?.merchantId || '')
sellerMerchantId: userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6 ? '' : (userInfo?.merchantId || '')
}
if (nothing) return
api.searchOrderCustomer(params).then(res => {
......
......@@ -198,7 +198,7 @@ Component({
pageNum: pageNum,
pageSize: 10,
keyword: searchValue,
sellerMerchantId: userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 ? '' : (userInfo?.merchantId || '')
sellerMerchantId: userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6 ? '' : (userInfo?.merchantId || '')
}
if (nothing) return
api.searchOrderCustomer(params).then(res => {
......
......@@ -35,7 +35,7 @@ Component({
ready() {
let userInfo = wx.$util.getUserInfo()
this.setData({
isForbidden: !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5),
isForbidden: !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6),
isYqdSuper: app.globalData.isYqdSuper,
selectedSceneName: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneName,
selectedSceneDesc: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneDesc,
......
......@@ -87,6 +87,7 @@ Component({
3: '区域运营',
4: '驻店负责人',
5: '广联销售',
6: '飞行督导'
},
loginRole: '',
userInfo: {},
......@@ -95,11 +96,18 @@ Component({
lifetimes: {
attached() {
let userInfo = wx.$util.getUserInfo()
let userInfo = wx.$util.getUserInfo(),
{menuList} = this.data
const loginRole = userInfo.subLoginUser?.loginRole
if ((userInfo.loginRole == 3 || userInfo.loginRole == 6) && menuList.every((item) => item.menuText != "场景集市")) menuList.push({
menuText: "场景集市",
icon: "sceneMarket",
navigateToUrl: "/packageEquity/pages/sceneMarket/index/index",
})
this.setData({
loginRole,
userInfo
userInfo,
menuList
})
this.getData()
}
......@@ -134,6 +142,12 @@ Component({
console.log(e)
const thisPage = wx.$router.getPageInstance()
let { item } = e.currentTarget.dataset
if(item.navigateToUrl){
wx.navigateTo({
url: item.navigateToUrl
})
return
}
if (item.isTab) return thisPage.changeTabBar && thisPage.changeTabBar({ detail: item?.tabIndex })
if (!item.path) wx.$util.showToast('模块暂未开通\r\n敬请期待')
},
......
......@@ -190,8 +190,7 @@ export default {
data,[],"/rop-dj-pairexc/router"
);
},
/**
/**
* 获取token
*/
getToken() {
......@@ -199,4 +198,68 @@ export default {
"dj.api.smartcarlife.recepiton.customer.oss.getToken",
);
},
/**
* 获取话术确认状态统计
*/
getExtractCount(data) {
return api.post(
"dj.api.car.boutique.script.extract.check.status.count",
data
);
},
/**
* 多条件获取话术分页列表
*/
extractPage(data) {
return api.post(
"dj.api.car.boutique.script.extract.record.page",
data
);
},
/**
* 话术确认更新
*/
extractUpdate(data) {
return api.post(
"dj.api.car.boutique.script.extract.record.check.update",
data
);
},
/**
* 话术二次确认更新
*/
extractSecondUpdate(data) {
return api.post(
"dj.api.car.boutique.script.extract.record.second.check.update",
data
);
},
/**
* 话术分类查询标签
*/
extractLabel(data) {
return api.post(
"dj.api.car.boutique.script.extract.class.label.list",
data
);
},
/**
* 话术分类查询标签
*/
extractClass(data) {
return api.post(
"dj.api.car.boutique.script.extract.class.list",
data
);
},
/**
* 二次核验权限校验
*/
extractCheck(data) {
return api.post(
"dj.api.car.boutique.script.extract.second.check.permission",
data
);
},
}
\ No newline at end of file
......@@ -198,7 +198,7 @@ Page({
// isStaff &&
// tabIndex == 0 &&
// eventRequest.push(this.staffDailyReport(wx.$util.getUserInfo()));
if (tabIndex == 0 && !userInfo?.isSuper && userInfo?.loginRole != 3)
if (tabIndex == 0 && !userInfo?.isSuper && userInfo?.loginRole != 3 && userInfo?.loginRole != 6)
eventRequest.push(this.checkAgreeClient(wx.$util.getUserInfo()));
return new Promise((resolve) => {
Promise.all(eventRequest).then(() => {
......@@ -224,7 +224,7 @@ Page({
let { code, data } = res;
if (code == 0) {
if (!data) {
if (wx.__HAS_NOTLOGIN_MODAL || userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5) return false;
if (wx.__HAS_NOTLOGIN_MODAL || userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6) return false;
this.addModalToQueue(
"交车目标",
"您有未填写的交车目标,请点击前往",
......@@ -269,7 +269,7 @@ Page({
this.setData({
mode: -1,
});
if (userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5) return false
if (userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6) return false
this.addModalToQueue(
"温馨提示",
"未配置权益规则,请联系客服处理。",
......@@ -291,7 +291,7 @@ Page({
this.setData({
userInfo,
});
if (!userInfo.isSuper && userInfo.loginRole != 3) {
if (!userInfo.isSuper && userInfo.loginRole != 3 && userInfo?.loginRole != 6) {
this.get4SStoreList();
} else {
this.setData({ showPage: true })
......@@ -327,11 +327,11 @@ Page({
get4SStoreList() {
let userInfo = wx.$util.getUserInfo();
let params = {
merchantId: userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 ? "" : userInfo?.merchantId,
staffUUID: userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 ? "" : userInfo?.uuid,
merchantId: userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6 ? "" : userInfo?.merchantId,
staffUUID: userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6 ? "" : userInfo?.uuid,
scene: 0,
};
get4SStoreList(params, userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5).then((result) => {
get4SStoreList(params, userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo.loginRole == 6).then((result) => {
let userInfo = wx.$util.getUserInfo();
if (!result?.length) {
userInfo.shopMerchantId = null;
......@@ -341,7 +341,7 @@ Page({
wx.$util.setUserInfo(userInfo);
return wx.$router.reLaunch("pages.accountItems");
}
if (result?.length && (userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5)) {
if (result?.length && (userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6)) {
if (result[0]?.merchantName !== '全部' && result[0]?.merchantId) {
result.unshift({ merchantName: '全部' })
}
......@@ -415,7 +415,7 @@ Page({
.then((res) => {
const { list = [] } = res.data;
if (list.length) {
if (wx.__HAS_NOTLOGIN_MODAL || userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5) return false;
if (wx.__HAS_NOTLOGIN_MODAL || userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6) return false;
this.addModalToQueue(
"对练任务提醒",
"您有未完成的对练任务,点击前往完成",
......@@ -478,7 +478,7 @@ Page({
})
.then((result) => {
if (result.data) {
if (wx.__HAS_NOTLOGIN_MODAL || userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5) return false;
if (wx.__HAS_NOTLOGIN_MODAL || userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6) return false;
this.addModalToQueue(
"开单预警",
"您已超过三天未开单",
......
......@@ -11,7 +11,7 @@
<block wx:elif="{{tabIndex == 1}}">
<view class="navigation-title">
<view class="navigation-title-text text-hide">
<block wx:if="{{userInfo && (userInfo.isSuper||userInfo.loginRole== 3 || userInfo.loginRole== 5)}}">
<block wx:if="{{userInfo && (userInfo.isSuper||userInfo.loginRole== 3 || userInfo.loginRole== 5 || userInfo.loginRole == 6)}}">
数字报价
</block>
<block wx:else>
......@@ -41,7 +41,7 @@
</view>
<custom-tabBar list="{{ tabBarList }}" color="#6C6C70" selectedColor="#347BFF" tabIndex="{{ tabIndex }}" bindchange="changeTabBar" />
<!-- <store-picker items="{{ storeListRange }}" show="{{ showPicker }}" bindsearch="getStoreList" bindconfirm="changePicker" /> -->
<block wx:if="{{userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5}}">
<block wx:if="{{userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5 || userInfo.loginRole == 6}}">
<side-select-by-page-popup show="{{ shopSideSelectPopup }}" bindconfirm="changePicker" />
</block>
<block wx:else>
......
......@@ -4,12 +4,22 @@ Page({
/**
* 页面的初始数据
*/
data: {},
data: {
inputHeight: 0,
searchValue: '',
scrollTop: 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.$util.getViewInfo('#search-input', res => {
this.setData({
inputHeight: res.height
})
})
if (options.level == 2) this.level = 2
carLifeApi.getCarBrandList().then(res => {
// this.setLocalStorage('wx_scrm_car_brand_list', carInfo)
const carInfo = res.data
......@@ -50,7 +60,10 @@ Page({
},
getLetter() {
wx.hideLoading()
let { brandList, letter } = this.data
let {
brandList,
letter
} = this.data
let arr = []
if (brandList.length > 0) {
brandList.forEach(e => {
......@@ -79,15 +92,27 @@ Page({
})
},
start(e) {
let { letter } = e.target.dataset
let {
letter
} = e.target.dataset
this.setData({
showTip: true,
letter
})
},
move(e) {
let { letterHeight, showTip, height, toTop, arr } = this.data
let { y, num, isNum } = this
let {
letterHeight,
showTip,
height,
toTop,
arr
} = this.data
let {
y,
num,
isNum
} = this
if (showTip) {
y = e.touches[0].clientY
num = Math.ceil((y - toTop) / letterHeight)
......@@ -110,17 +135,72 @@ Page({
})
},
showCarSeries(e) {
let { item } = e.currentTarget.dataset,
const {
level
} = this
let {
item
} = e.currentTarget.dataset,
brandInfo = {
vehicleBrandId: item.id,
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', {
brandInfo,
list: item.childs
list: item.childs,
})
else this.showToast('暂无该品牌车系')
} else this.showToast('暂无该品牌车系')
},
cancel() {
this.setData({
carSeriesList: []
})
},
choose(e) {
const {
item
} = e.currentTarget.dataset
wx.$router.back(page => {
page.changeCarBrand && page.changeCarBrand(item)
})
},
scroll(e) {
this.setData({
scrollTop: e.detail.scrollTop
})
},
search(e) {
try {
let {
value
} = e.detail, {
brandList
} = this.data
brandList.map(i => {
i.list.map(k => {
if (k.name.includes(value)) throw k.id
})
})
} catch (id) {
this.setData({
letter: `brand-${id}`,
})
setTimeout(() => {
let {
scrollTop
} = this.data
this.setData({
scrollTopNum: scrollTop - 32
})
}, 200)
}
},
/**
* 生命周期函数--监听页面初次渲染完成
......@@ -156,4 +236,4 @@ Page({
* 用户点击右上角分享
*/
// onShareAppMessage() {}
})
})
\ No newline at end of file
<!--packageEquity/pages/carEquity/carBrands/carBrands.wxml-->
<view class="car-brands-box">
<view class="car-brands">
<scroll-view style="height:100%;" scroll-y scroll-into-view="{{letter}}">
<search-input bindsearch="search" value="{{searchValue}}" id="search-input" />
<scroll-view style="height:calc(100vh - {{inputHeight}}px);" scroll-y scroll-into-view="{{letter}}" scroll-top="{{scrollTopNum}}" bindscroll="scroll">
<block wx:if="{{flag}}">
<block wx:if="{{brandList.length}}">
<block wx:for="{{brandList}}" wx:key="index">
......@@ -9,7 +10,7 @@
<view class="title car-y-center">{{item.letter}}</view>
<view class="box">
<block wx:for="{{item.list}}" wx:for-item="i" wx:key="ind" wx:for-index="ind">
<view class="brands" catchtap="showCarSeries" data-item="{{i}}">
<view class="brands" catchtap="showCarSeries" data-item="{{i}}" id="brand-{{i.id}}">
<view class="list car-y-center">
<image src="{{i.logoUrl}}" class="icon" />
{{i.name}}
......@@ -35,4 +36,16 @@
<!-- 提示 -->
<view class='tips' hidden='{{!showTip}}'>{{letter}}</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>
......@@ -117,4 +117,66 @@
.side-bar{
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
......@@ -110,7 +110,7 @@ Component({
nothing: false,
pageNum: 1,
storeInfo: wx.$util.getUserInfo()?.default4SStoreInfo || {},
isOrder: !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5)
isOrder: !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6)
})
this.getTotal()
if (!noGetList) this.getList(true)
......
......@@ -59,7 +59,7 @@ Page({
},
// 合同协议上传确定
zyPayConfirm(e) {
wx.showLoading()
wx.showLoading({title: '加载中'})
let { zyPayOrderInfo, zyConfirmFlag } = this.data
if (zyConfirmFlag) return false
this.setData({
......
......@@ -18,7 +18,7 @@ Component({
userInfo
} = this.data
// 非超管 获取转化人员 销售顾问
if (!(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5)) {
if (!(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6)) {
if (wx.$orderListDateListScreenRefresh) { // 切换门店将数据清空
this.setData({
'form.referrerIds': [],
......@@ -457,8 +457,8 @@ Component({
})
transferIds?.map((val, index) => {
val.active = false
if (!(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5) && userInfo.uuid == val.uuid) val.active = true
if ((userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5) && index == 0) val.active = true
if (!(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6) && userInfo.uuid == val.uuid) val.active = true
if ((userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6) && index == 0) val.active = true
})
orderStatus?.map((val, index) => {
val.active = false
......@@ -527,7 +527,7 @@ Component({
}
})
})
if ((userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5)) ['selectedYqMerchantList', 'selectedMerchantList'].map(e => {
if ((userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6)) ['selectedYqMerchantList', 'selectedMerchantList'].map(e => {
delete obj[e]
})
if (isReset) obj = {}
......
......@@ -2,11 +2,11 @@
<scroll-view scroll-y class="confirm-box" style="height:calc(100vh - {{navBarHeight }}px + 1px);margin-top:calc({{navBarHeight }}px - 1px);" hidden="{{!show}}">
<view class="main" style="padding-bottom:{{btnHeight}}px">
<!-- 非超管转化人员 -->
<view class="box" wx:if="{{!(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5)}}">
<view class="box" wx:if="{{!(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5 || userInfo.loginRole == 6)}}">
<view class="title">
<view class="title-left">
转化人员
<view class="title-tips" wx:if="{{!(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5)}}">{{userInfo.merchantName}}</view>
<view class="title-tips" wx:if="{{!(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5 || userInfo.loginRole == 6)}}">{{userInfo.merchantName}}</view>
</view>
<view wx:if="{{form.transferIds.length > 12}}" bindtap="showMore" data-type="1" class="collapse-btn {{!employShowMore ? 'rotate-180' : ''}}">
<image src="{{IMG_URL}}collapse_icon.png" mode="" />
......@@ -21,7 +21,7 @@
</view>
</view>
<!-- 超管转化人员 选择园区店 -->
<view class="box" wx:if="{{(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5)}}">
<view class="box" wx:if="{{(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5 || userInfo.loginRole == 6)}}">
<view class="title">
<view class="title-left">
转化人员
......@@ -42,11 +42,11 @@
</view>
</view>
<!-- 非超管销售顾问 -->
<view class="box" wx:if="{{!(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5)}}">
<view class="box" wx:if="{{!(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5 || userInfo.loginRole == 6)}}">
<view class="title">
<view class="title-left">
销售顾问
<view class="title-tips" wx:if="{{!(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5)}}">{{userInfo.shopMerchantName}}</view>
<view class="title-tips" wx:if="{{!(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5 || userInfo.loginRole == 6)}}">{{userInfo.shopMerchantName}}</view>
</view>
<view wx:if="{{form.referrerIds.length > 12}}" bindtap="showMore" data-type="2" class="collapse-btn {{!salesmanShowMore ? 'rotate-180' : ''}}">
<image src="{{IMG_URL}}collapse_icon.png" mode="" />
......@@ -61,11 +61,11 @@
</view>
</view>
<!-- 超管销售顾问 选择4s店 -->
<view class="box" wx:if="{{(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5)}}">
<view class="box" wx:if="{{(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5 || userInfo.loginRole == 6)}}">
<view class="title">
<view class="title-left">
销售顾问
<view class="title-tips" wx:if="{{!(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5)}}">{{userInfo.shopMerchantName}}</view>
<view class="title-tips" wx:if="{{!(userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5 || userInfo.loginRole == 6)}}">{{userInfo.shopMerchantName}}</view>
</view>
<view wx:if="{{form.selectedMerchantList.length > 3}}" bindtap="showMore" data-type="2" class="collapse-btn {{!salesmanShowMore ? 'rotate-180' : ''}}">
<image src="{{IMG_URL}}collapse_icon.png" mode="" />
......
......@@ -265,7 +265,7 @@ Page({
// 补录订单上传合同协议点击确定
zyPayConfirm(e) {
let { supplementaryOrderId, zyConfirmFlag } = this.data // 补录订单id
wx.showLoading()
wx.showLoading({title: '加载中'})
if (zyConfirmFlag) return false
this.setData({
zyConfirmFlag: true
......
......@@ -214,13 +214,13 @@ Component({
nothing: false,
currentPage: 1,
storeInfo: wx.$util.getUserInfo()?.default4SStoreInfo || {},
isOrder: !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5),
isOrder: !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6),
list: []
});
// this.getTotal()
if (!noGetList) this.getList(true);
this.getOrderStatistics();
if (!userInfo?.isSuper && userInfo?.loginRole != 3) this.getMerchantCarBrandList();
if (!userInfo?.isSuper && userInfo?.loginRole != 3 && userInfo?.loginRole != 6) this.getMerchantCarBrandList();
},
async handleClickOrderBtn(e) {
// 校验是否填写昨日日报
......@@ -323,7 +323,7 @@ Component({
zyPayStatus
};
if (!userInfo.isSuper && userInfo.loginRole != 3) {
if (!userInfo.isSuper && userInfo.loginRole != 3 && userInfo?.loginRole != 6) {
// debugger
params.transferIds = [userInfo.uuid];
}
......@@ -334,7 +334,10 @@ Component({
}
wx.$util.showLoading();
quotationPage({ ...params, ...screenForm })
let eventParams = wx.$util.deepClone({...params, ...screenForm})
// 当合同协议状态为待上传时,传订单状态为待上传7
if (eventParams?.zyPayStatus == '1') eventParams.orderStatus = 7
quotationPage(eventParams)
.then((res) => {
wx.hideLoading();
if (res.code == "0") {
......@@ -587,7 +590,7 @@ Component({
// 合同协议上传确定
zyPayConfirm(e) {
let { showZyTarget, zyConfirmFlag } = this.data
wx.showLoading()
wx.showLoading({title: '加载中'})
if (zyConfirmFlag) return false
this.setData({
zyConfirmFlag: true
......@@ -662,7 +665,7 @@ Component({
{ screenForm } = this,
obj = {}
let searchTemp = wx.$util.deepClone(screenForm || {});
if (!userInfo.isSuper && userInfo.loginRole != 3) {
if (!userInfo.isSuper && userInfo.loginRole != 3 && userInfo?.loginRole != 6) {
obj.transferIds = [userInfo.uuid];
}
if (staffUuid) {
......@@ -674,11 +677,10 @@ Component({
// ...obj,
// ...searchTemp
// }, '2222');
orderStatistics({
...obj,
...searchTemp,
customerName
})
let eventParams = wx.$util.deepClone({...obj, ...searchTemp, customerName})
// 当合同协议状态为待上传时,传订单状态为待上传7
if (eventParams?.zyPayStatus == '1') eventParams.orderStatus = 7
orderStatistics(eventParams)
.then((result) => {
let { data, code } = result;
// debugger
......
import aiApi from "../../../aiApi";
Page({
data: {
showPicker: false,
showPopup: false,
defaultIndex:0,
list: [{
label: '标签名',
value: 'sceneLabelName'
}, {
label: '话术来源',
value: 'staffName'
}, {
label: '萃取时间',
value: 'scriptTime'
},
{
label: "提交人",
value: "updatedBy",
type: 'UpdatedBy',
hidden: true
},
{
label: "提交时间",
value: "updatedTime",
type: 'UpdatedTime',
hidden: true
}, {
label: '原文',
value: 'sourceContent'
}, {
label: '润色文本',
value: 'polishContent'
}
],
array: ['美国', '中国', '巴西', '日本'],
navBarHeight: 0,
navStyle: "background-color: transparent;box-shadow:none",
polishedText: '您对这辆车未来的使用规划是怎样的呀?是打算长期频繁使用,长时间陪伴您的出行呢,还是想着开个三四年,体验一番后就考虑更换新车?看样子您是准备多开几年,对吧?',
isExcellent: true,
categories: ['需求探寻', '产品介绍', '价格谈判', '异议处理'],
currentCategory: '需求探寻',
tags: [{
id: 1,
name: '互动深入',
selected: true
},
{
id: 2,
name: '逻辑清晰',
selected: true
},
{
id: 3,
name: '风险灌输有力',
selected: false
},
{
id: 4,
name: '异议处理新颖多样',
selected: false
}
]
},
// 头部返回上一级
back() {
wx.$router.back()
},
onLoad() {
wx.$router.getData(({
item
}) => {
let {
list
} = this.data
if (item.checkStatus == 0) {
list = list.filter(i => !i.hidden)
}
this.extractLabel(list, item)
this.extractClass(item)
})
},
setTags(classCode) {
const {detail} = this.data
aiApi.extractLabel({
classCode
}).then(res => {
const {
labelCode: code
} = res.data[0] || {}
detail.labelCode = code
this.setData({
detail,
tags: res.data
})
})
},
extractLabel(list, item) {
const {classCode} = item
aiApi.extractLabel({
classCode
}).then(res => {
if (item.excellentFlag === null) {
item.excellentFlag = 1
}
if (!item.labelCode) {
const {
labelCode: code
} = res.data[0] || {}
item.labelCode = code
}
this.setData({
detail: item,
list,
tags: res.data
})
})
},
extractClass(detail) {
aiApi.extractClass().then(res => {
const extractClassList = res.data || []
const classArray = extractClassList.map(i => i.className)
const defaultIndex = extractClassList.findIndex(i=>i.classCode == detail.classCode)
this.setData({
extractClassList,
defaultIndex,
classArray
})
})
},
pickerCancel() {
this.setData({
showPicker: false
})
},
pickerConfirm(event) {
const {
index
} = event.detail;
let {
extractClassList,
detail
} = this.data
detail.className = extractClassList[index].className
detail.classCode = extractClassList[index].classCode
this.setData({
showPicker: false,
classIndex: index,
detail
})
this.setTags(detail.classCode)
},
toggleClass() {
this.setData({
showPicker: true
})
},
// 编辑润色文本
handleEdit() {
this.setData({
showPopup: true
})
},
handleCancel() {
this.setData({
showPopup: false
})
},
editConfirm() {
this.handleCancel()
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
onChange(event) {
this.setDetail('excellentFlag', event.detail)
},
setDetail(name, value) {
const {
detail
} = this.data
detail[name] = value
this.setData({
detail
});
},
textareaInput(e) {
this.setDetail('polishContent', e.detail.value)
},
// 标签选择
toggleTag(e) {
const {
code
} = e.currentTarget.dataset
const {
detail
} = this.data
detail.labelCode = code
this.setData({
detail
})
},
// 确认提交
handleConfirm() {
const _this = this;
wx.showModal({
title: '温馨提示',
content: '话术确认完成?',
showCancel: true,
confirmText: '确定',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) {
_this.extractUpdate()
}
}
})
},
extractUpdate() {
const {
detail: {
id,
classCode,
excellentFlag,
labelCode,
polishContent,
type
}
} = this.data
const params = {
id,
classCode,
excellentFlag,
labelCode,
polishContent,
}
let updateApi = 'extractUpdate'
if (type == 2) {
updateApi = 'extractSecondUpdate'
}
aiApi[updateApi](params).then(res => {
if (res.data) {
wx.navigateTo({
url: `/packageEquity/pages/extract/success/success`,
});
}
})
}
})
\ No newline at end of file
{
"usingComponents": {
"van-picker": "@vant/weapp/picker/index",
"van-popup": "@vant/weapp/popup/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index"
},
"navigationStyle": "custom"
}
\ No newline at end of file
/* 基础样式 */
.bg-box {
position: fixed;
inset: 0;
z-index: -1;
width: 750rpx;
height: 640rpx;
background: linear-gradient(to bottom, #DEF6FC 0%, #E3EAFF 27%, #D6E6FF 71%, #F7F8FA 96%);
}
.container {
overflow: auto;
}
.van-radio-group {
display: flex;
gap: 20rpx;
}
.header {
font-size: 36rpx;
font-weight: bold;
padding: 30rpx 0;
text-align: center;
}
/* 信息卡片 */
.info-card {
border-radius: 16rpx;
opacity: 1;
background: #ffffff;
box-shadow: 0 4rpx 20rpx 0 #cdcdd159;
margin: 0 20rpx 20rpx;
padding: 32rpx;
.card-title {
color: #222222;
font-size: 32rpx;
font-weight: 600;
margin-bottom: 20rpx;
position: relative;
&::before {
content: '';
position: absolute;
top: 0;
left: -32rpx;
width: 8rpx;
height: 40rpx;
border-radius: 0 4rpx 4rpx 0;
background: #347bff;
}
}
}
.info-row {
display: flex;
margin-bottom: 15rpx;
font-size: 28rpx;
line-height: 45rpx;
picker {
color: #347BFF; /* 文字颜色 */
}
.picker {
width: 494rpx;
height: 68rpx;
line-height: 64rpx;
padding: 0 16rpx;
border-radius: 8rpx;
opacity: 1;
background: #f7f8fa;
box-sizing: border-box;
display:flex;
justify-content: space-between;
}
.arrow::after {
content: "";
display: inline-block;
width: 6px;
height: 6px;
border-right: 2px solid #181A1F;
border-top: 2px solid #181A1F;
transform: rotate(45deg);
margin-left: 5px;
vertical-align: middle;
}
}
.label {
width: 150rpx;
color: #999ea8;
}
.value {
flex: 1;
color: #292d33;
text {
color:#347BFF;
}
}
/* 内容区块 */
.section {
background: white;
border-radius: 12rpx;
padding: 25rpx;
margin-bottom: 30rpx;
}
.section-title {
font-weight: bold;
display: block;
margin-bottom: 30rpx;
color: #333;
}
.content-box {
background: #f9f9f9;
padding: 20rpx;
border-radius: 8rpx;
line-height: 1.6;
position: relative;
}
.editable {
padding-right: 120rpx;
}
.edit-btn {
position: absolute;
right: 20rpx;
top: 20rpx;
color: #1890ff;
}
/* 评分区域 */
.rating-section,
.category-section {
background: white;
border-radius: 12rpx;
padding: 25rpx;
margin-bottom: 30rpx;
}
.radio-item {
margin-right: 40rpx;
display: inline-block;
}
/* 标签区域 */
.tag-section {
background: white;
border-radius: 12rpx;
padding: 25rpx;
margin-bottom: 30rpx;
}
.tag-container {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
}
.tag {
width: 236rpx;
padding: 16rpx 34rpx;
border-radius: 8rpx;
opacity: 1;
box-sizing: border-box;
border: 2rpx solid #e8ecf0;
background: #f7f8fa;
color: #292d33;
font-size: 28rpx;
line-height: 28rpx;
text-align: center;
}
.tag.selected {
background: #347bff1a;
color: #347bff;
border: 2rpx solid #347bff;
}
/* 确认按钮 */
.confirm-btn {
position:fixed;
bottom: env(safe-area-inset-bottom);
width: calc(100vw - 64rpx);
background: #347BFF;
color: #fff;
margin: 20rpx 32rpx;
border-radius: 12rpx;
height: 80rpx;
line-height: 80rpx;
}
.popup-warp {
position: fixed;
inset:0;
width:100vw;
height:100vh;
background: rgba(40, 40, 41, .5);
.popup-box {
margin: 400rpx auto;
width: 622rpx;
height: 620rpx;
border-radius: 20rpx;
opacity: 1;
border: 2rpx solid #979797;
background: #ffffff;
.popup-title {
text-align: center;
color: #292d33;
font-size: 32rpx;
margin: 50rpx auto;
}
.popup-textarea {
width: 526rpx;
height: 420rpx;
padding: 20rpx;
box-sizing: border-box;
border-radius: 12rpx;
opacity: 1;
border: 2rpx solid #eff0f2;
background: #f4f5f7;
margin: 0 auto;
}
.popup-footer {
margin-top: 40rpx;
height: 100rpx;
width: 100%;
border-radius: 0 0 20rpx 20rpx;
opacity: 1;
border-top: 2rpx solid #f2f2f2;
background: #ffffff;
display:flex;
.btn {
flex: 1;
line-height: 100rpx;
font-size: 30rpx;
text-align:center;
&.btn-left {
color: #292d33;
}
&.btn-right {
color: #347BFF;
}
}
}
}
}
\ No newline at end of file
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="{{ true }}" bindback="back"
navStyle="{{navStyle}}">
<view class="navigation-title">
<view class="navigation-title-text text-hide">话术确认</view>
</view>
</navigation-bar>
<view class="bg-box"></view>
<view class="container" style="margin-top: {{navBarHeight}}px; height: calc( 100vh - {{navBarHeight}}px - 86px )">
<!-- 基本信息区域 -->
<view class="info-card">
<view class="card-title">话术信息</view>
<view class="info-row" wx:for="{{list}}" :wx:key="index">
<text class="label">{{item.label}}</text>
<view class="value">{{detail[item.value]}}
<text wx:if="{{item.value == 'polishContent'}}" bindtap="handleEdit">编辑</text>
</view>
</view>
</view>
<view class="info-card">
<view class="card-title">是否优秀话术</view>
<view class="info-row">
<text class="label">是否优秀</text>
<view class="value">
<van-radio-group custom-class="radio-box" value="{{ detail.excellentFlag }}" bind:change="onChange">
<van-radio name="{{1}}">优秀话术</van-radio>
<van-radio name="{{0}}">非优秀话术</van-radio>
</van-radio-group>
</view>
</view>
<block wx:if="{{detail.excellentFlag}}">
<view class="info-row">
<text class="label">分类</text>
<view class="value" bindtap="toggleClass">
<view class="picker">
<view>{{detail.className}}</view>
<view class="arrow"></view>
</view>
</view>
</view>
<view class="info-row">
<text class="label">优秀标签</text>
<view class="value">
<view class="tag-container">
<block wx:for="{{tags}}" wx:key="id">
<view class="tag {{detail.labelCode ==item.labelCode ? 'selected' : ''}}" bindtap="toggleTag" data-code="{{item.labelCode}}">
{{item.labelName}}
</view>
</block>
</view>
</view>
</view>
</block>
</view>
</view>
<!-- 确认按钮 -->
<button class="confirm-btn" bindtap="handleConfirm">确认</button>
<van-popup show="{{ showPicker }}"
position="bottom"
custom-style="height: 40%;"
bind:close="onClose">
<van-picker bind:cancel="pickerCancel" bind:confirm="pickerConfirm" show-toolbar="{{true}}" bindchange="bindPickerChange" default-index="{{ defaultIndex }}" value="{{index}}" columns="{{classArray}}"/>
</van-popup>
<view class="popup-warp" wx:if="{{showPopup}}">
<view class="popup-box">
<view class="popup-title">润色文本</view>
<textarea class="popup-textarea" bindinput="textareaInput" value="{{detail.polishContent}}"></textarea>
<view class="popup-footer">
<view class="btn-left btn" bindtap="handleCancel">取消</view>
<view class="btn-right btn" bindtap="editConfirm">确定</view>
</view>
</view>
</view>
\ No newline at end of file
// packageEquity/pages/extract/extract/extract.js
Page({
/**
* 页面的初始数据
*/
import aiApi from "../../../aiApi";
Page({
data: {
navBarHeight: 100,
navStyle: 'background-color: transparent;box-shadow:none',
barList: [
{
label: '全部',
checkStatus: -1
},
{
label: '待确认',
checkStatus: 0,
type: 2,
show: true,
style:
'border:2rpx solod #3582ee80;background-color:#fff5e6;color: #FF9D0A'
},
{
label: '待核验',
checkStatus: 1,
show: true,
style:
'border:2rpx solod #3582ee80;background-color:#fff5e6;color: #FF9D0A'
},
{
label: '已入库',
checkStatus: 2,
show: true,
style:
'border:2rpx solod #3582ee80;background-color:#EAF9F1;color: #35C376'
},
{
label: '已驳回',
checkStatus: 3,
allStatus: [3,4],
status: 4,
show: true,
style:
'border:2rpx solod #3582ee80;background-color:#fdece9;color: #F24724'
}
],
businessTypeList: [
{ label: '延保', type: 0 },
{ label: '精品', type: 1 }
],
activeTab: -1,
businessType: 0,
metaList: [
{
label: "话术来源",
value: "staffName"
},
{
label: '萃取时间',
value: 'scriptTime'
},
{
label: '分类',
value: 'className',
type: 'ClassName'
},
{
label: '优秀标签',
value: 'labelName',
type: 'LabelName'
},
{
label: '提交人',
value: 'updatedBy',
type: 'UpdatedBy'
},
{
label: '提交时间',
value: 'updatedTime',
type: 'UpdatedTime'
}
],
pageNum:1,
pageSize:10,
// 实际开发中这里应该是从接口获取的数据
verificationData: {
status: 'pending' // pending/approved/rejected
// 其他字段...
}
},
matchStatus(checkStatus) {
const barItem = this.data.barList.find(
item => item.checkStatus === checkStatus || item.allStatus?.includes(checkStatus)
)
return barItem || {}
},
back() {
wx.$router.back()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if(options.type) {
this.showCount(options)
return
}
wx.$router.getData((route)=>{
this.showCount(route)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
showCount(route) {
const {type} = route.params || route;
const isLink = route.params?false:true
const barList = this.data.barList.filter(i=>i.type != type)
barList.forEach(bar=>{
if(bar.status) {
bar.checkStatus = bar.status
}
})
this.setData({barList,type,isLink},()=>{
this.initMethod()
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
initMethod() {
this.getExtractCount();
this.search();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
search() {
this.setData({pageNum:1},()=>{
this.loadData()
})
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
loadData() {
const {businessType,type,activeTab,pageNum,pageSize,barList} = this.data
const checkStatusList = barList.filter(i=>{
return i.checkStatus>=0
}).reduce((prev,cur)=>{
let res = prev.concat(cur.allStatus||cur.checkStatus)
return res
},[])
const params = {
businessType,
type,
pageNum,
pageSize,
checkStatusList:activeTab == -1?checkStatusList:[activeTab]
}
if(activeTab == 3) {
params.checkStatusList = [3,4]
}
aiApi.extractPage(params).then(res=>{
const resList = res.data.list ||[]
this.updateListWithStatus(resList,res.data.total)
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
onBottomRefresh() {
let {
total,
pageNum
} = this.data
this.setData({ pageNum: ++pageNum })
if (this.data.list.length == total) return
this.loadData()
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
mergeStatus(list) {
const filterList = list.filter(item => item.checkStatus === 3 || item.checkStatus === 4);
const totalCount = filterList.reduce((sum, item) => sum + item.count, 0);
list.forEach(i=>{
if(i.checkStatus == 3 || i.checkStatus == 4) {
i.count = totalCount
}
})
return list
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
getExtractCount() {
aiApi.getExtractCount({type:this.data.type}).then(res=>{
let resList = res.data ||[]
const mergeList = this.mergeStatus(resList)
const { barList } = this.data;
const list = barList.map((i) => {
i.count = 0
const v = mergeList.find((k) =>{
return k.checkStatus == i.checkStatus || i.allStatus?.includes(k.checkStatus)
});
return { ...i, ...v };
});
this.setData({ barList: list });
})
},
updateListWithStatus(list,total) {
const updatedList = list.map((item) => {
const barItem = this.matchStatus(item.checkStatus);
return {
triggered:false,
...item,
...barItem
}
})
this.setData({
total,
list: this.data.pageNum == 1?updatedList:[...this.data.list,...updatedList],
});
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
handleSure(e) {
const { item } = e.currentTarget.dataset;
const { type} = this.data
item.type = type
wx.$router.go("/packageEquity/pages/extract/confirm/confirm", {
item,
});
},
showModal(cb) {
wx.showModal({
title: '温馨提示',
content: '话术确认完成?',
showCancel: true,
confirmText: '确定',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) {
cb()
}
}
})
},
handleVerificatio() {
this.showModal(() => {
const {list } = this.data
const ids = list.map(i=>i.id)
aiApi.extractSecondUpdate({ids}).then(res=>{
if(res.data) {
this.initMethod()
}
})
});
},
switchType(e) {
this.setData({
businessType: e.currentTarget.dataset.index,
});
this.search()
},
switchTab(e) {
this.setData({
activeTab: e.currentTarget.dataset.index,
});
this.search();
},
});
{
"usingComponents": {}
}
\ No newline at end of file
"usingComponents": {},
"navigationStyle": "custom"
}
Page {
overflow:hidden;
}
.bg-box {
position: fixed;
inset: 0;
z-index: -1;
width: 750rpx;
height: 400rpx;
background: linear-gradient(0deg, #e8f0fb00 0%, #dde8fb 100%);
}
.container {
padding: 20rpx;
background: #f7f8fa;
}
.stats-bar {
display: flex;
padding: 48rpx 20rpx;
margin-bottom: 20rpx;
border-radius: 24rpx;
opacity: 1;
background: #ffffff;
}
.stat-item {
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
}
.lable {
color: #292d33;
font-size: 26rpx;
margin-bottom: 10rpx;
}
.percent {
color: #2c66f7;
font-size: 48rpx;
font-weight: bold;
font-family: "D DIN PRO";
.unit {
font-weight: 500;
font-size: 24rpx;
}
}
.filter-box {
display: flex;
align-items: center;
justify-content: center;
width: 440rpx;
margin: 0 auto;
padding: 4rpx;
box-sizing:border-box;
height: 64rpx;
line-height: 64rpx;
border-radius: 8rpx;
opacity: 1;
background: #f2f3f5;
.active {
color: #181a1f;
font-weight: 600;
width: 200rpx;
height: 56rpx;
line-height: 56rpx;
box-sizing: border-box;
border-radius: 6rpx;
opacity: 1;
background: #ffffff;
}
.filter-item {
flex: 1;
color: #5a5e66;
text-align: center;
font-size: 28rpx;
}
}
.filter-tabs {
display: flex;
margin-bottom: 20rpx;
}
.filter-tabs text {
flex: 1;
text-align: center;
padding-bottom: 30rpx;
height: 80rpx;
color: #5a5e66;
font-size: 28rpx;
}
.filter-tabs .active {
color: #347BFF;
border-bottom: 4rpx solid #347BFF;
}
.card {
border-radius: 16rpx;
background: #ffffff;
box-shadow: 0 4rpx 16rpx 0 #cdcdd180;
padding: 32rpx;
margin-bottom: 20rpx;
}
.card-header {
display: flex;
align-items: center;
margin-bottom: 20rpx;
.tag-icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
}
}
.title {
font-size: 32rpx;
font-weight: bold;
}
.status {
margin-left: auto;
font-size: 28rpx;
padding: 6rpx 12rpx;
border-radius: 6rpx;
}
.meta-info {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
color: #999;
font-size: 26rpx;
text {
width: 40%;
margin-bottom: 16rpx;
&:nth-child(2n) {
text-align: right;
width: 60%;
}
}
}
.content-section {
margin: 30rpx 0;
display: flex;
}
.section-title {
width: 128rpx;
margin-bottom: 15rpx;
color: #999ea8;
font-size: 24rpx;
.short-tag {
margin-top:6rpx;
width: 108rpx;
height: 36rpx;
line-height: 36rpx;
text-align:center;
border-radius: 4rpx;
opacity: 1;
border: 2rpx solid #e8ecf0;
background: #f3f4f5;
color: #999ea8;
font-size: 20rpx;
}
.excellent-tag {
margin-top:6rpx;
width: 96rpx;
height: 36rpx;
line-height: 36rpx;
text-align:center;
border-radius: 4rpx;
opacity: 1;
border: 2rpx solid #347bff80;
background: #347bff1a;
color: #347bff;
font-size: 22rpx;
}
}
.original-text{
color: #292d33;
font-size: 28rpx;
flex:1;
text {
color: #347BFF;
}
}
.action-buttons {
display: flex;
margin-top: 40rpx;
}
.btn {
flex: 1;
margin: 0 15rpx;
font-size: 32rpx;
}
.reject {
background-color: #FFF1F0;
color: #FF4D4F;
}
.approve {
background-color: #F6FFED;
color: #52C41A;
}
.btn-warp {
text-align: right;
border-top: 2rpx solid #f2f2f2;
padding-top: 20rpx;
.btn-box {
display: inline-block;
width: 140rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 32rpx;
opacity: 1;
font-size: 28rpx;
background: #347bff;
color: #fff;
}
}
.btn-verification {
height: 80rpx;
line-height: 80rpx;
color: #fff;
border-radius: 12rpx;
opacity: 1;
background: #347bff;
margin: 30rpx;
}
.nothing {
padding: var(--fontSize100);
text-align: center;
color: #999;
.no-data-img {
width: var(--fontSize160);
height: var(--fontSize160);
}
.list-nothing,
.list-not {
text-align: center;
font-size: var(--fontSize28);
color: #BEC1C7;
}
}
\ No newline at end of file
/* packageEquity/pages/extract/extract/extract.wxss */
\ No newline at end of file
<!--packageEquity/pages/extract/extract/extract.wxml-->
<text>packageEquity/pages/extract/extract/extract.wxml</text>
\ No newline at end of file
<wxs src="filter.wxs" module="filter" />
<navigation-bar
class="navigation-header"
bindnavbarReady="navbarReady"
showBack="{{ !isLink }}"
bindback="back"
navStyle="{{ navStyle }}"
>
<view class="navigation-title">
<view class="navigation-title-text text-hide">{{type==1?'话术萃取':'话术核验'}}</view>
</view>
</navigation-bar>
<view class="bg-box"></view>
<view class="container" style="margin-top:{{ navBarHeight }}px; height:calc( 100vh - {{navBarHeight }}px )">
<!-- 顶部状态统计 -->
<view class="stats-bar">
<block wx:for="{{ barList }}">
<view class="stat-item" wx:if="{{ item.show }}">
<text class="label">{{ item.label }}</text>
<text class="percent">{{ item.count||0 }} <text class="unit">条</text></text>
</view>
</block>
</view>
<view class="filter-box">
<view
wx:for="{{ businessTypeList }}"
wx:key="*this"
class="filter-item {{ businessType === item.type ? 'active' : '' }}"
bindtap="switchType"
data-index="{{ item.type }}"
>{{ item.label }}</view>
</view>
<!-- 筛选标签 -->
<view class="filter-tabs">
<text wx:for="{{ barList }}" wx:key="*this" class="{{ activeTab == item.checkStatus ? 'active' : '' }}" bindtap="switchTab" data-index="{{ item.checkStatus }}">
{{ item.label }}
</text>
</view>
<!-- 话术卡片 -->
<scroll-view
style="height: calc(100% - var(--fontSize{{ type == 2 && activeTab == 1 && list.length?600:500 }}));"
scroll-y
enable-back-to-top
refresher-enabled="{{ true }}"
bindrefresherrefresh="search"
bindscrolltolower="onBottomRefresh"
class="list"
refresher-triggered="{{ triggered }}"
>
<block wx:if="{{ list.length }}">
<view class="card" wx:for="{{ list }}">
<view class="card-header">
<gl-image webp class="tag-icon" src="/aiCheck/tag.png"></gl-image>
<text class="title"> {{item.sceneLabelName}}</text>
<text class="status" style="{{ item.style }}">{{ item.label }}</text>
</view>
<view class="meta-info">
<block wx:for="{{ metaList }}" wx:for-item="i" wx:key="i">
<text wx:if="{{ !filter.showFunctions['show' + i.type]||(filter.showFunctions['show' + i.type] && filter.showFunctions['show' + i.type](item)) }}">{{ i.label }}:{{ item[i.value] }}</text>
</block>
</view>
<!-- 原文对照区域 -->
<view class="content-section">
<view class="section-title">
<view>原文</view>
<view class="excellent-tag" wx:if="{{ item.excellentFlag === 1 }}">优秀话术</view>
<view class="short-tag" wx:if="{{ item.excellentFlag === 0 }}">非优秀话术</view>
</view>
<view class="original-text">{{item.sourceContent}}</view>
</view>
<view class="content-section">
<view class="section-title">润色文本</view>
<view class="original-text">{{item.polishContent}}</view>
</view>
<view class="btn-warp" wx:if="{{ item.checkStatus===0 && type != 2 }}">
<button class="btn-box" bindtap="handleSure" data-item="{{ item }}">去确认</button>
</view>
<view class="btn-warp" wx:if="{{ item.checkStatus===1 && type == 2 }}">
<button class="btn-box" bindtap="handleSure" data-item="{{ item }}">去核验</button>
</view>
</view>
</block>
<view wx:else class="nothing">
<image class="no-data-img" src="/packageEquity/images/noData.png" />
<view class="list-not">暂无数据</view>
</view>
</scroll-view>
<button wx:if="{{ type == 2 && activeTab == 1 && list.length }}" class="btn-verification" bindtap="handleVerificatio">批量核验</button>
</view>
\ No newline at end of file
// filter.wxs
var showFunctions = {
showLabelName: function(item) {
return item.checkStatus != 3 && item.checkStatus != 0 && item.checkStatus != 4
},
showUpdatedBy: function(item) {
return item.checkStatus == 2 || item.checkStatus == 3 || item.checkStatus == 4
},
showUpdatedTime: function(item) {
return item.checkStatus == 2 || item.checkStatus == 3 || item.checkStatus == 4
},
showClassName: function(item) {
return item.checkStatus != 3 && item.checkStatus != 0 && item.checkStatus != 4
}
// 其他判断函数...
}
module.exports = {
showFunctions: showFunctions
}
\ No newline at end of file
// packageEquity/pages/extract/success/success.js
let timer = null
Page({
/**
* 页面的初始数据
*/
data: {
navStyle: "background-color: transparent;box-shadow:none",
second: 3,
},
// 头部返回上一级
back() {
wx.$router.back()
},
toList() {
wx.$router.back((page)=>{
page.initMethod()
},2)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
timer = setInterval(()=>{
let {second} = this.data
console.log(555)
if(second == 0) {
this.toList()
clearInterval(timer)
}
this.setData({
second:--second
})
},1000)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
clearInterval(timer)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationStyle": "custom"
}
\ No newline at end of file
/* integration/pages/point/success/success.wxss */
page {
background: #ffffff;
}
.bg-box {
position: fixed;
inset: 0;
z-index: -1;
width: 750rpx;
height: 300rpx;
background: linear-gradient(0deg, #e8f0fb00 0%, #dde8fb 100%);
}
.container {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 200rpx;
}
.icon {
width: 400rpx;
height: 400rpx;
margin-top: 64rpx;
}
.max_text {
font-weight: 600;
font-size: 40rpx;
color: #292D33;
margin-top: 16rpx;
margin-bottom: 24rpx;
}
.tip_text {
font-weight: 400;
font-size: 28rpx;
color: #7A8299;
}
.btn_group {
margin-top: 128rpx;
.btn_left {
width: 434rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 12rpx;
opacity: 1;
border: 2rpx solid #dee0e3;
background: #ffffff;
color: #292d33;
font-size: 32rpx;
}
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="{{ true }}" bindback="back" navStyle="{{navStyle}}">
<view class="navigation-title">
<view class="navigation-title-text text-hide">确认完成</view>
</view>
</navigation-bar>
<view class="bg-box"></view>
<view class="container">
<gl-image mode="widthFix" class="icon" src="/bankAccount/success_icon_1.png" />
<view class="max_text">你的话术已确认完成!</view>
<view class="tip_text">{{second}}秒后自动跳回话术萃取列表页</view>
<view class="btn_group flex_cc">
<view class="btn_left flex_cc" bind:tap="toList">我知道了</view>
</view>
</view>
\ No newline at end of file
......@@ -382,7 +382,7 @@ Component({
['form.staffRangeList']: storeRangeList
})
// 超管获取所有质检门店/员工
if (userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5) {
if (userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6) {
this.getStoreList()
}
},
......
......@@ -66,7 +66,7 @@
</view>
</view>
<!-- 超管选择4s店 -->
<view class="box" wx:if="{{userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5}}">
<view class="box" wx:if="{{userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5 || userInfo.loginRole == 6}}">
<view class="title">
<view class="title-left">
门店
......@@ -87,7 +87,7 @@
</view>
</view>
<!-- 超管选择员工 -->
<view class="box" wx:if="{{userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5}}">
<view class="box" wx:if="{{userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5 || userInfo.loginRole == 6}}">
<view class="title">
<view class="title-left">
员工
......
......@@ -218,7 +218,7 @@ Component({
if (i.firstClassify == '结束') i.firstClassify = '促成交'
})
} else {
if (!userInfo.isSuper && userInfo.loginRole != 3) {
if (!userInfo.isSuper && userInfo.loginRole != 3 && userInfo?.loginRole != 6) {
e.appealText = e.conversationDetailAppealId ? '已申诉' : '申诉'
e.appealClass = e.conversationDetailAppealId ? 'appeal-disabled' : ''
}
......
......@@ -30,7 +30,7 @@ Page({
*/
onLoad(options) {
let userInfo = wx.$util.getUserInfo() || {}
if (userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5) this.setData({
if (userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6) this.setData({
showEmployeeName: true,
isShowDefeatBtn: false
})
......@@ -38,7 +38,7 @@ Page({
this.setData({
nothing: false
})
if (userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5) {
if (userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6) {
this.getStoreList()
} else {
this.getReceptionList()
......@@ -86,8 +86,8 @@ Page({
orderResult: searchForm?.orderResult,
merchantNo: !searchForm?.merchantNo?.length ? (userInfo?.isSuper ? storeRangeList.map(v => {
if (v.merchantNo) return v.merchantNo
}) : userInfo?.loginRole == 3 || userInfo.loginRole == 5 ? '' : [userInfo?.default4SStoreInfo?.merchantId]) : searchForm?.merchantNo,
staffUuids: userInfo.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 ? searchForm?.staffUuids : [userInfo.uuid]
}) : userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6 ? '' : [userInfo?.default4SStoreInfo?.merchantId]) : searchForm?.merchantNo,
staffUuids: userInfo.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6 ? searchForm?.staffUuids : [userInfo.uuid]
}
return obj
},
......
......@@ -6,7 +6,7 @@
<block wx:else>
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack navStyle="{{'background-color: #FFFFFF;box-shadow:none;' }}" bindback="back">
<view class="navigation-title">
<view class="navigation-title-text text-hide">{{(userInfo && (userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5)) ? '接待记录' : (userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName)}}</view>
<view class="navigation-title-text text-hide">{{(userInfo && (userInfo.isSuper || userInfo.loginRole== 3 || userInfo.loginRole== 5 || userInfo.loginRole == 6)) ? '接待记录' : (userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName)}}</view>
</view>
</navigation-bar>
</block>
......@@ -14,7 +14,7 @@
<view class="screen-box">
<view>
<!-- <text class="title">接待记录</text> -->
<text class="name text-hide">{{searchForm.merchantNames.length > 1 ? '部分门店' : searchForm.merchantNames.length ? filter.filterMerchantName(searchForm.merchantNames) : !userInfo.isSuper && userInfo.loginRole != 3 ? userInfo.default4SStoreInfo.merchantName : '全部门店'}}</text>
<text class="name text-hide">{{searchForm.merchantNames.length > 1 ? '部分门店' : searchForm.merchantNames.length ? filter.filterMerchantName(searchForm.merchantNames) : !userInfo.isSuper && userInfo.loginRole != 3 && userInfo.loginRole != 6 ? userInfo.default4SStoreInfo.merchantName : '全部门店'}}</text>
</view>
<view bindtap="showScreenPop">
<text class="text">筛选</text>
......
// packageEquity/pages/sceneMarket/clue/clue.js
import methods from './methods'
Page({
...methods,
/**
* 页面的初始数据
*/
data: {
tab: [],
tabIndex: -1,
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
{
"usingComponents": {
"material-tab":"../components/materialTab/materialTab"
},
"navigationBarTitleText": "场景线索"
}
\ No newline at end of file
/* packageEquity/pages/sceneMarket/clue/clue.wxss */
page {
background: #f7f8fa;
}
.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;
}
}
.search-box {
padding-bottom: 24rpx;
}
.search-input-box {
margin: 16rpx 24rpx 0;
height: 72rpx;
border-radius: 38rpx;
background: #ffffff;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0 24rpx;
.icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
flex-shrink: 0;
}
.input {
font-size: 28rpx;
width: calc(100% - 44rpx);
height: 100%;
}
.placeholder {
color: #bec1c7;
}
}
.item {
background: #ffffff;
margin: 0 24rpx 24rpx;
padding: 16rpx 20rpx;
border-radius: 16rpx;
.name {
color: #333333;
font-size: 30rpx;
font-weight: 500;
padding-bottom: 4rpx;
}
.text {
color: #666666;
font-size: 24rpx;
margin-top: 4rpx;
}
}
.clue-list{
.list-nothing{
color: #999ea8;
font-size: 20rpx;
}
}
<view class="search-box">
<material-tab tabList="{{ tab }}" bindclick="tabBarClick" />
<view class="search-input-box">
<image src="/images/search.png" class="icon"></image>
<input type="text" class="input" placeholder="搜索门店名称" placeholder-class="placeholder" maxlength="50"
value="{{storeName}}" confirm-type="search" bindconfirm="inputSearch" />
</view>
</view>
<scroll-view scroll-y style="height:calc(100vh - {{searchBoxHeight}}px)" bindscrolltolower="viewScrollTolower" class="clue-list">
<block wx:if="{{flag}}">
<block wx:if="{{list[0].length}}">
<block wx:for="{{list}}" wx:key="index">
<block wx:for="{{item}}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
<view class="item" bindtap="jumpClue" data-id="{{i.id}}">
<view class="name text-hide">{{i.storeName}}</view>
<view class="text">品牌:{{i.storeBrand}}</view>
<view class="text">业务:{{i.businessCodeName}}</view>
<view class="text">提报日期:{{i.time}}</view>
</view>
</block>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing">没有更多了~</view>
</block>
</block>
<block wx:else>
<empty-data />
</block>
</block>
</scroll-view>
<view class="clue-btn" bindtap="jumpClue">
<image class="clue-icon" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/clue.png" />
</view>
\ No newline at end of file
import {
getSceneClueList,
getSceneMarketMaterialMenu
} from '../request'
import dayjs from 'dayjs'
export default {
inputSearch(e) {
let {
value
} = e.detail
this.setData({
currentPage: 1,
list: [],
flag: false,
nothing: false,
storeName: value
})
this.getSceneClueList()
},
search() {
this.setData({
currentPage: 1,
list: [],
flag: false,
nothing: false,
storeName: ''
})
this.getSceneClueList()
},
tabBarClick(e) {
if (this.data.tabIndex == e.detail) return
const tabIndex = e.detail
this.setData({
tabIndex
})
this.search()
},
jumpClue(e) {
let {
id
} = e.currentTarget.dataset,
url = '/packageEquity/pages/sceneMarket/clueForm/clueForm'
if (id) url += `?id=${id}`
wx.navigateTo({
url,
})
},
/**获取tab高度 */
getTabHeight() {
wx.$util.getViewInfo('.search-box', res => {
if (res?.height) this.setData({
searchBoxHeight: res.height
})
})
},
async getSceneMarketMaterialMenu() {
try {
const {
code,
message,
data
} = await getSceneMarketMaterialMenu()
if (code == 0) {
this.setData({
tab: data
})
this.tabBarClick({
detail: 0
})
} else throw message
} catch (error) {
wx.$util.showToast(error)
}
},
async getSceneClueList() {
try {
wx.$util.showLoading()
const {
tab,
storeName,
tabIndex,
pageSize,
currentPage
} = this.data, {
code,
message,
data
} = await getSceneClueList({
pageSize,
currentPage,
businessCode: tab[tabIndex].code,
storeName
})
wx.hideLoading()
if (code == 0) {
let {
list,
total
} = data
list?.map(e => {
e.time = dayjs(e.createdDate).format('YYYY-MM-DD')
})
this.setData({
[`list[${currentPage - 1}]`]: list || [],
total,
flag: true
}, () => {
setTimeout(() => {
wx.hideLoading()
}, 200)
})
} else throw message
} catch (error) {
wx.hideLoading()
this.setData({
flag: true
})
wx.$util.showToast(error)
}
},
viewScrollTolower() {
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
// packageEquity/pages/sceneMarket/clueForm/clueForm.js
import methods from './methods'
Page({
...methods,
/**
* 页面的初始数据
*/
data: {
formData: {},
dynamicFormData: {},
nextBtn: true,
dynamicForm: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getSceneMarketConfig(() => {
if (options.id) {
this.findSceneMarketLeadsById(options.id)
} else this.getSceneMarketMaterialMenu()
wx.setNavigationBarTitle({
title: options.id ? '线索详情' : '线索登记',
})
})
},
})
\ 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
/* 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
<view class="layout">
<view class="box">
<block wx:for="{{fixedForm}}" wx:key="index">
<view class="form-item">
<form-item item="{{item}}" readonly="{{readonly}}" 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 readonly="{{readonly}}" item="{{i}}" formData="{{dynamicFormData}}" bindKeyInput="bindKeyInput" formName="dynamicFormData" bindPickerChange="bindPickerChange"></form-item>
</view>
</block>
</view>
</block>
</block>
</view>
<block wx:if="{{!readonly}}">
<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>
</block>
\ No newline at end of file
import {
getSceneMarketMaterialMenu,
saveSceneMarketLead,
findSceneMarketLeadsById,
getSceneMarketConfig
} from '../request'
import dayjs from 'dayjs'
export default {
async getSceneMarketConfig(callBack) {
const {
sceneForm,
fixedForm
} = await getSceneMarketConfig()
this.setData({
sceneForm,
fixedForm
})
callBack()
},
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 businessCodeName = `${fixedForm[2].optionList[0][first].directoryName}-${fixedForm[2].optionList[1][second].directoryName}`,
businessCode = fixedForm[2].optionList[1][second].code
this.setData({
['formData.businessCodeName']: businessCodeName,
['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() {
if(this.submitStatus) return
try {
wx.$util.showLoading('提交中...')
this.submitStatus = true
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.hideLoading()
wx.$util.showToast(error)
this.submitStatus = false
}
},
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) {
this.submitStatus = false
wx.hideLoading()
wx.showToast({
title: '数据保存成功',
mask: true
})
setTimeout(() => {
wx.$router.back(page => {
page.search()
})
}, 1e3)
} else throw message
} else throw message
} catch (error) {
this.submitStatus = false
wx.hideLoading()
console.log(error)
wx.$util.showToast(error)
}
},
async findSceneMarketLeadsById(id) {
try {
const {
code,
message,
data
} = await findSceneMarketLeadsById({
id
})
if (code == 0) {
let {
sceneForm,
fixedForm
} = this.data,
dynamicForm = sceneForm[data.businessCode],
dynamicFormData = JSON.parse(data.extendedAttributes)
data.time = dayjs(data.createdDate).format('YYYY年MM月DD日')
let lastIndex = fixedForm.length - 1,
lastItem = JSON.parse(JSON.stringify(fixedForm.at(-1)))
fixedForm.splice(lastIndex, 1)
fixedForm = [
...fixedForm,
{
label: '员工姓名',
key: 'createdBy',
},
{
label: '提报日期',
key: 'time',
},
lastItem
]
this.setData({
formData: data,
dynamicForm,
dynamicFormData,
readonly: true,
fixedForm
})
} else throw message
} catch (error) {
wx.$util.showToast(error)
}
},
}
\ 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')
},
viewScroll(e){
this.triggerEvent('viewScroll')
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ 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" bindscroll="viewScroll">
<view class="content">
<slot name="content"></slot>
</view>
</scroll-view>
</view>
</view>
</view>
\ 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;
position: relative;
z-index: 3;
}
.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: #f7f8fa;
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
// packageEquity/pages/sceneMarket/components/audioComponent/audioComponent.js
Component({
/**
* 组件的属性列表
*/
properties: {
src: {
type: String,
observer(newval) {
if (newval) this.init(newval)
}
},
auto: Boolean,
audioKey: String
},
/**
* 组件的初始数据
*/
data: {
innerAudioContext: {},
currentTime: '00:00',
duration: '00:00',
paused: true,
progress: '0%',
loading: true
},
detached(){
this.data.innerAudioContext[this.data.audioKey].destroy()
},
/**
* 组件的方法列表
*/
methods: {
init(src) {
const innerAudioContext = wx.createInnerAudioContext(),
{
audioKey
} = this.data
innerAudioContext.src = src
innerAudioContext.onCanplay(() => {
let intervalTime = setInterval(() => {
if (innerAudioContext.duration != 0) {
this.setData({
duration: this.formatTime(innerAudioContext.duration),
loading: false
})
wx.$util.getViewInfo('.progress-box', ({
width: containerWidth,
left: barLeft
}) => {
this.barLeft = barLeft
this.containerWidth = containerWidth
}, this)
clearInterval(intervalTime)
}
}, 200)
})
innerAudioContext.onPlay(() => {
this.setData({
paused: false
})
})
innerAudioContext.onPause(() => {
this.setData({
paused: true
})
})
innerAudioContext.onEnded(() => {
this.stop()
})
innerAudioContext.onTimeUpdate(() => {
const {
duration,
currentTime
} = this.data.innerAudioContext[this.data.audioKey],
mergedOffset = Math.ceil(currentTime)
this.setData({
progress: `${mergedOffset / duration * 100}%`,
currentTime: this.formatTime(currentTime)
})
})
this.setData({
[`innerAudioContext.${audioKey}`]: innerAudioContext
})
},
formatTime(num) {
num = Math.floor(num);
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return `${minutes}:${seconds}`
},
play() {
if (this.data.paused) {
if (this.data.auto) this.data.innerAudioContext[this.data.audioKey].play()
this.triggerEvent('onPlay')
} else this.data.innerAudioContext[this.data.audioKey].pause()
},
stop() {
this.setData({
currentTime: '00:00',
paused: true,
progress: '0%'
})
this.data.innerAudioContext[this.data.audioKey].stop()
},
sliderChange(e) {
let [touches] = e.touches, {
barLeft,
containerWidth
} = this, {
duration
} = this.data.innerAudioContext[this.data.audioKey]
if (touches) {
let {
clientX
} = touches,
progress = (clientX - barLeft) / containerWidth * 100,
mergedOffset = Math.ceil(duration * progress) / 100
this.setData({
progress: `${progress}%`
})
this.data.innerAudioContext[this.data.audioKey].seek(mergedOffset)
if (this.data.paused) this.play()
}
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageEquity/pages/sceneMarket/components/audioComponent/audioComponent.wxss */
.audio-box {
display: flex;
align-items: center;
width: 100%;
height: 80rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/audio-bg.webp');
background-size: 100% 100%;
margin-bottom: 24rpx;
box-sizing: border-box;
padding: 0 32rpx;
font-size: 28rpx;
color: #333333;
.loading{
margin:0 auto;
}
.trumpet {
width: 48rpx;
height: 48rpx;
margin-right: 16rpx;
flex-shrink: 0;
}
.progress-box {
width: 58%;
height: 12rpx;
margin: 0;
background: #D8D8D8;
position: relative;
border-radius: 4rpx;
.line {
position: absolute;
top: 0;
left: 0;
width: 0;
height: 100%;
background-image: linear-gradient(90deg, #2c66f7 0%, #75bcff 100%);
border-radius: 4rpx;
}
.thumb {
width: 16rpx;
height: 16rpx;
border: 4rpx solid #2c66f7;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
border-radius: 100%;
box-sizing: border-box;
background-color: #fff;
}
}
.duration {
margin-left: auto;
flex-shrink: 0;
}
}
\ No newline at end of file
<view class="audio-box">
<block wx:if="{{loading}}">
<view class="loading">加载中...</view>
</block>
<block wx:else>
<view class="trumpet" bindtap="play">
<gl-image wx:if="{{!paused}}" webp src="/equity/stop.png" />
<gl-image wx:else webp src="/equity/play.png" />
</view>
<view class="progress-box" bindtap="sliderChange">
<view class="line" style="width: {{progress}}"></view>
<view class="thumb" style="left:{{progress}}"></view>
</view>
<view class="duration">{{currentTime}}/{{duration}}</view>
</block>
</view>
\ No newline at end of file
// packageEquity/pages/sceneMarket/components/filtrateBox/filtrateBox.js
import {
getSceneMarketMaterialTags
} from '../../request'
Component({
/**
* 组件的属性列表
*/
properties: {
minusHeight: String,
},
lifetimes: {
attached() {
if(!this.complete) this.getSceneMarketMaterialTags()
},
},
/**
* 组件的初始数据
*/
data: {
filtrateList: [{
activeValue: null,
active: false,
key: 'materialType',
typeName: '全部类型',
list: [{
text: '全部',
value: null,
},
{
text: '视频',
value: '1',
},
{
text: 'PDF',
value: '2',
},
{
text: '富文本',
value: '3',
},
{
text: 'Excel',
value: '4',
},
{
text: 'Word',
value: '5',
},
]
},
{
activeValue: null,
active: false,
key: 'readStatus',
typeName: '全部状态',
list: [{
text: '全部',
value: null,
},
{
text: '已查看',
value: '0',
},
{
text: '未查看',
value: '1',
},
]
},
{
activeValue: null,
active: false,
key: 'tag',
typeName: '全部标签',
list: []
}
]
},
/**
* 组件的方法列表
*/
methods: {
reset(){
const {filtrateList} = this.data
filtrateList.map((e,index) =>{
this.setData({
[`filtrateList[${index}].active`] :false,
[`filtrateList[${index}].activeValue`] :null,
[`filtrateList[${index}].title`]: e.typeName
})
})
},
async getSceneMarketMaterialTags() {
try {
const {
filtrateList
} = this.data, {
code,
message,
data
} = await getSceneMarketMaterialTags()
if (code == 0) {
let list = [{
text: '全部',
value: null,
}],
index = filtrateList.findIndex(i => i.key == 'tag')
data.map(e => {
list.push({
text: e.tagName,
value: e.id
})
})
this.setData({
[`filtrateList[${index}].list`]: list,
[`filtrateList[${index}].show`]: true
})
this.complete = true
} else throw message
} catch (error) {
wx.$util.showToast(error)
}
},
toggle(e) {
const {
index,
item
} = e.currentTarget.dataset, {
filtrateList
} = this.data
filtrateList.map((i, ind) => {
this.setData({
[`filtrateList[${ind}].active`]: item.active ? false : index == ind
})
})
},
close() {
const {
filtrateList
} = this.data
filtrateList.map((i, ind) => {
this.setData({
[`filtrateList[${ind}].active`]: false
})
})
},
choose(e) {
const {
typeName,
index,
item,
key
} = e.currentTarget.dataset, {
value,
text
} = item
this.setData({
[`filtrateList[${index}].activeValue`]: value,
[`filtrateList[${index}].title`]: value ? text : typeName
})
this.close()
this.triggerEvent('filtrate', {
[key]: value
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageEquity/pages/sceneMarket/components/filtrateBox/filtrateBox.wxss */
.search-box {
position: sticky;
top: 0;
left: 0;
width: 100%;
height: 88rpx;
z-index: 2;
padding-left: 24rpx;
box-sizing: border-box;
.search-tab-box {
width: 100%;
height: 100%;
background-color: #fff;
position: relative;
z-index: 3;
display: flex;
align-items: center;
gap: 0 12rpx;
}
.blcok {
position: relative;
padding: 0 16rpx;
height: 50rpx;
border-radius: 8rpx;
background: #f7f7f7;
display: flex;
align-items: center;
justify-content: center;
color: #666666;
font-size: 24rpx;
font-weight: 500;
z-index: 3;
.icon {
width: 26rpx;
height: 26rpx;
margin-left: 4rpx;
}
}
.active {
background: #347bff1a !important;
color: #347BFF !important;
}
.filtrate-box {
position: absolute;
width: 100%;
left: 0;
top: 0;
z-index: 2;
.filtrate-bg {
position: absolute;
top: 88rpx;
left: 0;
background-color: #00000080;
width: 100%;
height: calc(100% - 88rpx);
}
.filtrate-content {
width: 100%;
max-height: 60%;
position: absolute;
border-radius: 0 0 16rpx 16rpx;
background: #ffffff;
display: flex;
flex-wrap: wrap;
gap: 16rpx 12rpx;
box-sizing: border-box;
padding: 20rpx 24rpx 32rpx;
overflow-y: scroll;
animation: show-filtrate-box .15s forwards;
@keyframes show-filtrate-box {
0% {
top: -100%;
}
100% {
top: 88rpx;
}
}
.filtrate-item {
height: 50rpx;
border-radius: 8rpx;
background: #f7f7f7;
padding: 0 16rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
}
}
\ No newline at end of file
<view class="search-box">
<view class="search-tab-box">
<block wx:for="{{filtrateList}}" wx:key="index">
<view class="blcok {{item.active?'active':''}}" bindtap="toggle" data-index="{{index}}" data-item="{{item}}">
{{item.title || item.typeName}}
<image class="icon" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/{{item.active?'on':'off'}}.png"></image>
</view>
</block>
</view>
<block wx:for="{{filtrateList}}" wx:key="index">
<block wx:if="{{item.active}}">
<view class="filtrate-box" style="height:calc(100vh - {{minusHeight}}px)">
<view class="filtrate-bg" bindtap="close"></view>
<view class="filtrate-content">
<block wx:for="{{item.list}}" wx:for-item="i" wx:key="ind" wx:for-index="ind">
<view class="filtrate-item blcok {{i.value == item.activeValue?'active':''}}" bindtap="choose" data-item="{{i}}" data-index="{{index}}" data-type-name="{{item.typeName}}" data-key="{{item.key}}">{{i.text}}</view>
</block>
</view>
</view>
</block>
</block>
</view>
\ No newline at end of file
// packageEquity/pages/sceneMarket/components/formItem/formItem.js
Component({
/**
* 组件的属性列表
*/
properties: {
item: Object,
formData: Object,
formName: {
type: String,
value: 'formData'
},
readonly: Boolean
},
/**
* 组件的初始数据
*/
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
{
"component": true,
"usingComponents": {
}
}
\ 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;
}
.readonly{
color: #33333380;
}
.value {
display: flex;
align-items: center;
padding: 16rpx 0;
min-height: 32rpx;
font-size: 28rpx;
color: #333333;
word-break: break-all;
.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;
flex-shrink: 0;
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/arrow.png');
background-size: 100% 100%;
}
}
.textarea{
height: 192rpx;
padding: 16rpx 0;
}
}
\ No newline at end of file
<view class="item">
<view class="label {{readonly?'readonly':''}}">
{{item.label}}
<block wx:if="{{item.required && !readonly}}">
<text class="required">*</text>
</block>
</view>
<block wx:if="{{readonly}}">
<view class="value">
<view class="text-hide">
{{formData[item.labelName] || formData[item.key] || '-'}}
</view>
</view>
</block>
<block wx:else>
<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}}" value="{{formData[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>
<view class="arrow"></view>
</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>
<view class="arrow"></view>
</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>
<view class="arrow"></view>
</view>
</picker>
</block>
</view>
</block>
</block>
</view>
\ No newline at end of file
// 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 == 0 || item.type == 1 || item.type == 3) {
//视频、图片、富文本
wx.navigateTo({
url: `/packageEquity/pages/sceneMarket/materialPage/materialPage?id=${item.id}`,
})
} else {
wx.showToast({
title: '打开中...',
mask: true,
icon: 'loading',
duration: 99999999999
})
if (item.fileName) return this.openFile(item)
//PDF、Excel、Word
const {
code,
data,
message
} = await getMaterialById({
id: item.id
}),
_this = this
if (code == 0) {
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) {
item.fileName = fileName
_this.openFile(item)
},
fail(err) {
throw err
}
})
},
fail(err) {
throw err
}
})
} else throw message
}
this.triggerEvent('refreshPage')
} catch (error) {
wx.$util.showToast(error)
}
},
openFile(item) {
this.setData({
item
})
wx.showToast({
title: '请点击右上角『…』选择“保存到手机”',
mask: true,
icon: 'none'
})
this.triggerEvent('browsingDoc', item.id)
setTimeout(() => {
wx.openDocument({
filePath: wx.env.USER_DATA_PATH + '/' + item.fileName,
showMenu: true,
})
}, 1e3)
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ 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;
line-height: 40rpx;
width: fit-content;
padding: 0 12rpx;
font-size: 22rpx;
color: #999999;
background: #9999991a;
border-radius: 4rpx;
}
.status-green {
color: #35c376;
background: #35c3761a;
}
.icon {
width: 128rpx;
height: 128rpx;
margin-right: 16rpx;
flex-shrink: 0;
position: relative;
.image {
width: 100%;
height: 100%;
border-radius: 8rpx;
overflow: hidden;
}
.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
<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
// packageEquity/pages/sceneMarket/components/materialTab/materialTab.js
Component({
/**
* 组件的属性列表
*/
properties: {
tabList: Array,
},
/**
* 组件的初始数据
*/
data: {
tabIndex: 0
},
/**
* 组件的方法列表
*/
methods: {
change(e) {
const {
index,
} = e.currentTarget.dataset
this.setData({
tabIndex: index
})
this.triggerEvent('click', index)
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageEquity/pages/sceneMarket/components/materialTab/materialTab.wxss */
.scroll {
width: 100%;
height: 88rpx;
border-bottom: 1rpx solid #eff0f2;
background: #ffffff;
box-shadow: inset 0 -2rpx 0 0 #0000001a;
display: flex;
.tab-item {
display: flex;
align-items: center;
justify-content: center;
width: fit-content;
height: 100%;
flex-shrink: 0;
font-size: 28rpx;
color: #666;
text-align: center;
position: relative;
padding: 0 24rpx;
transition: all .15s;
}
.active {
color: #333333;
font-size: 36rpx;
font-weight: 500;
&::after {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
content: '';
width: 40rpx;
height: 8rpx;
border-radius: 596rpx;
background: #347bff;
}
}
}
\ No newline at end of file
<scroll-view class="scroll" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}">
<block wx:for="{{tabList}}" wx:key="index">
<view class="tab-item {{tabIndex==index?'active':''}}" bindtap="change" data-index="{{index}}">
{{ item.directoryName }}
</view>
</block>
</scroll-view>
\ No newline at end of file
// packageEquity/pages/sceneMarket/index/index.js
import methods from './methods'
import {
leavePageTrack
} from '../request'
Page({
...methods,
/**
* 页面的初始数据
*/
data: {
tabHeight: 36,
tab: [],
tabIndex: -1,
tagIndex: 0,
requestParams: {},
materialList: [],
showBtn: true
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getTabHeight()
this.getSceneMarketMaterialMenu()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
if (this.trackId) leavePageTrack({
id: this.trackId
}).then(res => {
this.trackId = null
})
if (this.refreshPageStatus) {
setTimeout(() => {
this.getSceneMarketMaterialList()
this.refreshPageStatus = false
}, 200)
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
})
\ No newline at end of file
{
"usingComponents": {
"material-tab":"../components/materialTab/materialTab",
"tab-view":"../components/TabView/TabView",
"material":"../components/material/material",
"filtrate-box":"../components/filtrateBox/filtrateBox"
},
"navigationBarTitleText": "场景集市"
}
\ No newline at end of file
/* packageEquity/pages/sceneMarket/index/index.wxss */
.material-box {
.list-nothing {
display: flex;
align-items: center;
flex-direction: column;
padding-top: 179rpx;
color: #999999;
font-size: 24rpx;
.icon {
width: 128rpx;
height: 80rpx;
margin-bottom: 16rpx;
}
}
}
.bottom {
color: #999ea8;
font-size: 20rpx;
text-align: center;
padding: 48rpx 0;
}
.fixed-btn-box {
position: fixed;
bottom: 206rpx;
right: 36rpx;
width: 256rpx;
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;
gap: 0 32rpx;
transition: all .25s;
.btn-icon {
width: 96rpx;
height: 96rpx;
}
.arrow {
width: 32rpx;
height: 32rpx;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%) rotate(180deg);
}
}
.hide-btn {
right: -224rpx;
}
\ No newline at end of file
<material-tab tabList="{{ tab }}" bindclick="tabBarClick" id="scene-market-tab" />
<tab-view tabList="{{tab[tabIndex].sceneMarketLevelTwoList}}" tagIndex="{{tagIndex}}" height="{{tabHeight}}" bindclick="tabClick" bindviewScroll="viewScroll">
<view class="tab-view-box" slot="content">
<filtrate-box minusHeight="{{tabHeight}}" bindfiltrate="filtrate" id="filtrate-box"></filtrate-box>
<block wx:if="{{requestComplete}}">
<view class="material-box">
<block wx:if="{{materialList.length}}">
<block wx:for="{{materialList}}" wx:key="index">
<view class="item">
<material item="{{item}}" bindbrowsingDoc="enterPageTrack" bindrefreshPage="refreshPage"></material>
</view>
</block>
<view class="bottom">没有更多了</view>
</block>
<block wx:else>
<view class="list-nothing">
<view class="icon">
<image src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/empty.png"></image>
</view>
{{isFiltrate ?'没有找到筛选结果':'暂无内容'}}
</view>
</block>
</view>
</block>
</view>
</tab-view>
<view class="fixed-btn-box flex {{showBtn?'':'hide-btn'}}" catchtap="showBtnFun">
<block wx:if="{{showBtn}}">
<image class="btn-icon" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/ai.png" catchtap="jumpAI" />
<image class="btn-icon" catchtap="jumpClueIndex" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/scene.png" />
</block>
<block wx:else>
<image class="arrow" src="/components/images/arrow-x.png" />
</block>
</view>
\ No newline at end of file
import {
getSceneMarketMaterialMenu,
getSceneMarketMaterialList,
enterPageTrack,
} from '../request'
import dayjs from 'dayjs'
export default {
enterPageTrack(e) {
const params = {
goodsId: e.detail,
goodsType: 0,
}
enterPageTrack(params).then(({
data
}) => {
this.trackId = data
})
},
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) {
this.setData({
tab: data
})
this.tabBarClick({
detail: 0
})
} else throw message
} catch (error) {
wx.$util.showToast(error)
}
},
tabBarClick(e) {
if (this.data.tabIndex == e.detail) return
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
}
}) {
if (this.data.requestParams.businessCode == businessCode) return
this.setData({
requestParams: {
businessCode,
},
requestComplete: false,
isFiltrate: 0
})
this.selectComponent('#filtrate-box').reset()
this.getSceneMarketMaterialList()
},
async getSceneMarketMaterialList() {
try {
wx.$util.showLoading('加载中')
const {
requestParams
} = this.data, {
code,
message,
data
} = await getSceneMarketMaterialList(requestParams)
if (code == 0) {
wx.hideLoading()
data?.map(e => {
e.date = dayjs(e.createdDate).format('YYYY-MM-DD')
})
this.setData({
materialList: data,
requestComplete: true
}, () => {
setTimeout(() => {
wx.hideLoading()
}, 200)
})
} else throw message
} catch (error) {
wx.hideLoading()
wx.$util.showToast(error)
}
},
filtrate(e) {
let {
detail
} = e, {
requestParams
} = this.data,
filtrateList = ['materialType', 'readStatus', 'tag'],
isFiltrate = 0
requestParams = {
...requestParams,
...detail
}
filtrateList.map(key => {
if (requestParams[key] != null) isFiltrate += 1
})
this.setData({
requestParams,
isFiltrate
})
this.getSceneMarketMaterialList()
},
refreshPage() {
this.refreshPageStatus = true
},
viewScroll(e) {
this.setData({
showBtn: false
})
},
showBtnFun() {
if (this.data.showBtn) return
this.setData({
showBtn: true
})
},
jumpAI() {
wx.navigateToMiniProgram({
appId: 'wx4cc95d0fd0729c32'
})
}
}
\ No newline at end of file
// packageEquity/pages/sceneMarket/materialPage/materialPage.js
import {
getMaterialById,
enterPageTrack,
leavePageTrack
} from '../request'
Page({
/**
* 页面的初始数据
*/
data: {
showMenuBtn: true
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getMaterialById(options.id)
this.enterPageTrack(options.id)
},
async getMaterialById(id) {
try {
const {
code,
data,
message
} = await getMaterialById({
id
})
if (code == 0) {
wx.setNavigationBarTitle({
title: data.title,
})
this.setData({
materialType: data.type
})
if (data.type == 3) {
let detailInfo = [],
imgLength = 0
data.richTextInfoList?.map(e => {
let imgList = []
if (e.content) e.content = this.highlightText(e.content)
if (e.pictureList && e.pictureList.length) {
imgLength += e.pictureList.length
e.pictureList.map(i => {
imgList.push({
// visible: false,
visible: true,
url: i
})
})
e.imgList = imgList
}
if (e.level == 1) detailInfo.push({
...e,
children: []
})
})
data.richTextInfoList?.map(e => {
if (e.level == 2) {
let index = detailInfo.findIndex(item => item.id == e.parentId)
if (index > -1) detailInfo[index].children.push(e)
}
})
this.setData({
detailInfo
})
} else {
this.setData({
materialUrl: data?.detailInfos[0]?.image || ''
})
}
console.log(data)
} else throw message
} catch (error) {
console.log(error)
wx.$util.showToast(error)
}
},
highlightText(text) {
text = text.replace(/<\/?br\s*\/?>|\n/g, '<br>')
const matches = text.match(/#/g)
if (!matches) return text
const spanCount = matches.length
let lastSpan = spanCount % 2 === 1,
parts = [],
currentIndex = 0
for (let i = 0; i < spanCount; i++) {
const matchIndex = text.indexOf('#', currentIndex)
parts.push(text.substring(currentIndex, matchIndex))
if (i === spanCount - 1 && lastSpan) parts.push('')
else {
if (i % 2 === 0) parts.push('<span style="color:#FF8D1A;font-weight: 500;">')
else parts.push('</span>')
}
currentIndex = matchIndex + 1
}
parts.push(text.substring(currentIndex))
return parts.join('')
},
contentScroll() {
this.setData({
showMenuBtn: false
})
},
clickMenu() {
const {
showMenuBtn
} = this.data
if (!showMenuBtn) {
this.setData({
showMenuBtn: true
})
return
}
this.setData({
showMenuPopup: true
})
},
onClose() {
this.setData({
showMenuPopup: false
})
},
menuClick(e) {
const {
id
} = e.currentTarget.dataset
this.setData({
contentId: `case-${id}`
})
this.onClose()
},
enterPageTrack(goodsId) {
const params = {
goodsId,
goodsType: 0,
}
enterPageTrack(params).then(({
data
}) => {
this.trackId = data
})
},
onPlay(item) {
console.log(item)
const {
id
} = item.currentTarget.dataset.item
this.selectAllComponents('.audio').map(e => {
if (`audio-${id}` != e.id) e.stop()
})
this.selectComponent(`#audio-${id}`).data.innerAudioContext[`key${id}`].play()
// Object.keys(this.$refs).map(key => {
// if (`audio-${item.id}` != key) this.$refs[key][0]?.stop()
// })
// let innerAudioContext = this.$refs[`audio-${item.id}`][0]?.innerAudioContext[`key${item.id}`]
// if (innerAudioContext) innerAudioContext.play()
console.log()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
if (this.trackId) leavePageTrack({
id: this.trackId
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ 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!