Commit 2f54ef0a by 张立顺

Merge branch 'SAAS-V4.37.0' into 'develop'

SAAS-V4.37.0上线代码合并

See merge request !251
2 parents 86231050 2e1014ae
Showing 110 changed files with 3161 additions and 273 deletions
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
"pages/tabMine/pages/index/index", "pages/tabMine/pages/index/index",
"pages/tabDateIndex/pages/tabDateIndex", "pages/tabDateIndex/pages/tabDateIndex",
"pages/log/log", "pages/log/log",
"pages/changeScene/changeScene" "pages/changeScene/changeScene",
"pages/materails/index"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
...@@ -26,7 +27,8 @@ ...@@ -26,7 +27,8 @@
"selectedColor": "#347BFF", "selectedColor": "#347BFF",
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"position": "bottom", "position": "bottom",
"list": [{ "list": [
{
"pagePath": "tabIndex/pages/index/index", "pagePath": "tabIndex/pages/index/index",
"text": "首页", "text": "首页",
"iconPath": "images/tab-home.png", "iconPath": "images/tab-home.png",
...@@ -45,6 +47,12 @@ ...@@ -45,6 +47,12 @@
"selectedIconPath": "images/tab-date-active.png" "selectedIconPath": "images/tab-date-active.png"
}, },
{ {
"pagePath": "pages/materails/index",
"text": "营销素材",
"iconPath": "images/tab-material.png",
"selectedIconPath": "images/tab-material-active.png"
},
{
"pagePath": "pages/tabMine/pages/index/index", "pagePath": "pages/tabMine/pages/index/index",
"text": "个人中心", "text": "个人中心",
"iconPath": "images/tab-mine.png", "iconPath": "images/tab-mine.png",
...@@ -52,15 +60,24 @@ ...@@ -52,15 +60,24 @@
} }
] ]
}, },
"subpackages": [{ "subpackages": [
{
"root": "tabDate", "root": "tabDate",
"name": "tabDate", "name": "tabDate",
"pages": ["pages/detail/detail", "pages/apprManage/apprManage", "pages/userPortrait/userPortrait"] "pages": [
"pages/detail/detail",
"pages/apprManage/apprManage",
"pages/userPortrait/userPortrait"
]
}, },
{ {
"root": "tabMine", "root": "tabMine",
"name": "tabMine", "name": "tabMine",
"pages": ["pages/technicianSetup/technicianSetup", "pages/completeBuild/completeBuild", "pages/collectCoupons/collectCoupons"] "pages": [
"pages/technicianSetup/technicianSetup",
"pages/completeBuild/completeBuild",
"pages/collectCoupons/collectCoupons"
]
}, },
{ {
"root": "tabWorkOrder", "root": "tabWorkOrder",
...@@ -107,18 +124,33 @@ ...@@ -107,18 +124,33 @@
"pages/residentTarget/residentTarget", "pages/residentTarget/residentTarget",
"pages/aiInspection/aiInspection", "pages/aiInspection/aiInspection",
"pages/aiInspectionDetail/aiInspectionDetail", "pages/aiInspectionDetail/aiInspectionDetail",
"pages/aiInspectionReception/aiInspectionReception" "pages/aiInspectionReception/aiInspectionReception",
"pages/trainingMaterials/trainingMaterials",
"pages/trainingMaterials/pages/playVideo/index"
] ]
}, },
{ {
"root": "tabOperating", "root": "tabOperating",
"name": "tabOperating", "name": "tabOperating",
"pages": ["pages/4sOverview/4sOverview", "pages/index/index", "pages/operatingShow/operatingShow"] "pages": [
"pages/4sOverview/4sOverview",
"pages/index/index",
"pages/operatingShow/operatingShow"
]
}, },
{ {
"root": "packageCrowdFunding", "root": "packageCrowdFunding",
"name": "packageCrowdFunding", "name": "packageCrowdFunding",
"pages": ["pages/TabBar/crowdFundingPage", "pages/activityPage/paidOrder/orderList", "pages/activityPage/activityList/activityList", "pages/activityPage/activityPay/activityPay", "pages/activityPage/paymentSuccess/paymentSuccess", "pages/activityPage/balanceNote/balanceNote", "pages/activityPage/newOrder/newOrder", "pages/activityPage/additionRecordOrder/additionRecordOrder"] "pages": [
"pages/TabBar/crowdFundingPage",
"pages/activityPage/paidOrder/orderList",
"pages/activityPage/activityList/activityList",
"pages/activityPage/activityPay/activityPay",
"pages/activityPage/paymentSuccess/paymentSuccess",
"pages/activityPage/balanceNote/balanceNote",
"pages/activityPage/newOrder/newOrder",
"pages/activityPage/additionRecordOrder/additionRecordOrder"
]
}, },
{ {
"root": "subvehicleConversion", "root": "subvehicleConversion",
...@@ -161,11 +193,15 @@ ...@@ -161,11 +193,15 @@
"preloadRule": { "preloadRule": {
"pages/tabWorkOrder/pages/index/index": { "pages/tabWorkOrder/pages/index/index": {
"network": "all", "network": "all",
"packages": ["tabWorkOrder"] "packages": [
"tabWorkOrder"
]
}, },
"tabIndex/pages/index/index": { "tabIndex/pages/index/index": {
"network": "all", "network": "all",
"packages": ["tabWorkOrder"] "packages": [
"tabWorkOrder"
]
} }
}, },
"resolveAlias": { "resolveAlias": {
......
...@@ -16,11 +16,13 @@ page { ...@@ -16,11 +16,13 @@ page {
@for $i from 1 through 1000 { @for $i from 1 through 1000 {
--fontSize#{$i}: calc(#{$i}vmin / 7.5); --fontSize#{$i}: calc(#{$i}vmin / 7.5);
--fontSizeContent#{$i}: calc(#{$i}vmin / 7.176);
} }
@media screen and (min-device-width: 768px) and (-webkit-min-device-pixel-ratio: 1) { @media screen and (min-device-width: 768px) and (-webkit-min-device-pixel-ratio: 1) {
@for $i from 1 through 1000 { @for $i from 1 through 1000 {
--fontSize#{$i}: calc(#{$i}vmin / 8.5); --fontSize#{$i}: calc(#{$i}vmin / 8.5);
--fontSizeContent#{$i}: calc(#{$i}vmin / 6.719);
} }
} }
...@@ -71,6 +73,7 @@ page { ...@@ -71,6 +73,7 @@ page {
.isFullSucreen { .isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important; padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important; padding-bottom: env(safe-area-inset-bottom) !important;
// padding-bottom: 34px !important;
} }
.isFullSucreen-bottom { .isFullSucreen-bottom {
......
...@@ -114,11 +114,13 @@ class Calendar { ...@@ -114,11 +114,13 @@ class Calendar {
let [next_year, next_month, next_day] = allowSameDay ? today.split(separator) : nextDay.split(separator) let [next_year, next_month, next_day] = allowSameDay ? today.split(separator) : nextDay.split(separator)
for (let i = 1; i <= days; i++) { for (let i = 1; i <= days; i++) {
let todayStr = `${year}${separator}${month}${separator}${now_day}` let todayStr = `${year}${separator}${month}${separator}${now_day}`
let dayStr = `${year}${separator}${month}${separator}${i < 10 ? `0${i}` : i}` let dayStr = `${year}${separator}${month}${separator}${i < 10 ? `0${i}` : i}`,
time = new Date(`${year}/${month}/${i}`).getTime()
let obj = { let obj = {
day: i, day: i,
data: dayStr, data: dayStr,
active: now_year == year && now_month == month && i == Number(now_day) active: now_year == year && now_month == month && i == Number(now_day),
time
} }
if ((minDate && Date.parse(minDate) > Date.parse(dayStr)) || (maxDate && Date.parse(maxDate) < Date.parse(dayStr))) obj.disable = true if ((minDate && Date.parse(minDate) > Date.parse(dayStr)) || (maxDate && Date.parse(maxDate) < Date.parse(dayStr))) obj.disable = true
if (dateType === 'multiple') multipleDate.push(todayStr) if (dateType === 'multiple') multipleDate.push(todayStr)
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
margin-left: var(--fontSize8); margin-left: var(--fontSize8);
} }
.titleBtn{ .titleBtn {
display: inline-block; display: inline-block;
background: #FFFFFF; background: #FFFFFF;
border: var(--fontSize1) solid #347BFF; border: var(--fontSize1) solid #347BFF;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
value="{{outTradeNo}}" value="{{outTradeNo}}"
placeholder="输入交易流水号" placeholder="输入交易流水号"
placeholder-class="outTradeNo_placeholder" placeholder-class="outTradeNo_placeholder"
maxlength="100" /> maxlength="150" />
</view> </view>
</view> </view>
<view class="upload-content"> <view class="upload-content">
......
...@@ -183,7 +183,7 @@ Component({ ...@@ -183,7 +183,7 @@ Component({
this.setData({ this.setData({
statisticsObj: data statisticsObj: data
}) })
console.log(this.data.statisticsObj) // console.log(this.data.statisticsObj)
} else { } else {
wx.$util.showToast(message || '接口异常') wx.$util.showToast(message || '接口异常')
} }
......
...@@ -83,6 +83,10 @@ module.exports = { ...@@ -83,6 +83,10 @@ module.exports = {
listByMerchantIdAndIds(data) { listByMerchantIdAndIds(data) {
return api.post('dj.api.smartcarlife.quotationGoods.listByMerchantIdAndIds', data) return api.post('dj.api.smartcarlife.quotationGoods.listByMerchantIdAndIds', data)
}, },
/** 根据商户号商品id获取可选升级商品列表 */
quotationGoodsList(data) {
return api.post('dj.api.smartcarlife.quotationGoods.list', data)
},
/** 待补录订单统计 */ /** 待补录订单统计 */
waitinputorder(data) { waitinputorder(data) {
let params = data || {} let params = data || {}
...@@ -166,6 +170,9 @@ module.exports = { ...@@ -166,6 +170,9 @@ module.exports = {
staffDailyReportMerchantValid(data) { staffDailyReportMerchantValid(data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data) // return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
return api.post('dj.api.smartcarlife.staff.daily.report.popup.need', data) return api.post('dj.api.smartcarlife.staff.daily.report.popup.need', data)
},
/** 员工是否需要推送开单预警 */
orderStaffValid(data) {
return api.post('dj.api.smartcarlife.order.staff.valid', data)
} }
} }
...@@ -89,10 +89,22 @@ export default { ...@@ -89,10 +89,22 @@ export default {
getCustomerClueStatistics(data) { getCustomerClueStatistics(data) {
return api.post('dj.api.smartcarlife.customer.clue.statistics.status', data) return api.post('dj.api.smartcarlife.customer.clue.statistics.status', data)
}, },
/** 根据手机号查询工牌设备号 */
getInspectionBadgeCode(data) {
return api.post('dj.api.smartcarlife.app.inspection.findBadgeByPhone', data)
},
/** 质检管理信息 */
getEmployeeBadge(data = {}) {
return api.post('dj.api.mindworkplate.app.badge.employeeBadgeReclistWithPage', data)
},
/**分页查询接待批次列表 */ /**分页查询接待批次列表 */
getInspectionList(data){ getInspectionList(data) {
return api.post('dj.api.smartcarlife.inspection.conversation.batch.page', data ,[], '/rop-dj-smartcarlife/router') return api.post('dj.api.smartcarlife.app.inspection.conversation.batch.page', data)
} },
/**
* 质检详情-质检分析
*/
getInspectionDetail(data) {
return api.post('dj.api.smartcarlife.app.inspection.conversation.check.detail', data)
},
} }
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/carEquity/components/GLForm/GLForm.wxss */ /* packageEquity/pages/carEquity/components/GLForm/GLForm.wxss */
.input-box { .input-box {
display: flex; display: flex;
align-items: center;
justify-content: space-between; justify-content: space-between;
align-items: center;
--cell-line-height: calc(28vmin / 7.5) !important; --cell-line-height: calc(28vmin / 7.5) !important;
} }
...@@ -14,8 +16,8 @@ ...@@ -14,8 +16,8 @@
.input-suffix { .input-suffix {
/* height: var(--fontSize88); /* height: var(--fontSize88);
line-height: var(--fontSize88); */ line-height: var(--fontSize88); */
height: var(--fontSize132); /* height: var(--fontSize132);
line-height: var(--fontSize132); line-height: var(--fontSize132); */
margin-left: var(--fontSize4); margin-left: var(--fontSize4);
} }
...@@ -71,3 +73,7 @@ ...@@ -71,3 +73,7 @@
.between .van-cell--borderless { .between .van-cell--borderless {
padding: var(--fontSize30) 0 !important; padding: var(--fontSize30) 0 !important;
} }
/* @media screen and (min-device-width: 600px) and (-webkit-min-device-pixel-ratio: 1) {
} */
\ No newline at end of file \ No newline at end of file
...@@ -25,10 +25,9 @@ Component({ ...@@ -25,10 +25,9 @@ Component({
*/ */
methods: { methods: {
btnTap(e) { btnTap(e) {
console.log(e) // console.log(e)
let { name } = e.currentTarget.dataset let { name } = e.currentTarget.dataset
console.log(name) // console.log(name)
// this.
this.triggerEvent('btnTap', { name }) this.triggerEvent('btnTap', { name })
} }
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</view> </view>
<view class="text" wx:elif="{{item.type == 'project' }}"> <view class="text" wx:elif="{{item.type == 'project' }}">
<block wx:for="{{orderInfo.quotationGoodsInfoList || orderInfo.subOrderList}}" wx:for-item="subItem" wx:key="idx"> <block wx:for="{{orderInfo.quotationGoodsInfoList || orderInfo.subOrderList}}" wx:for-item="subItem" wx:key="idx">
<view class="goodsName">{{subItem.goodsNameAlias||subItem.upgradeGoodsName||subItem.goodsName}} <text class="goodsItem">(包含{{subItem.serviceItems||subItem.position}})</text></view> <view class="goodsName">{{subItem.goodsNameAlias||subItem.upgradeGoodsName||subItem.goodsName}} <text class="goodsItem" wx:if="{{subItem.serviceItems||subItem.position}}">(包含{{subItem.serviceItems||subItem.position}})</text></view>
</block> </block>
</view> </view>
<view class="text" wx:else>{{orderInfo[item.key]||''}}</view> <view class="text" wx:else>{{orderInfo[item.key]||''}}</view>
......
...@@ -27,6 +27,11 @@ Page({ ...@@ -27,6 +27,11 @@ Page({
selectedIconPath: '/images/tab-equity-active.png' selectedIconPath: '/images/tab-equity-active.png'
}, },
{ {
name: '营销素材',
iconPath: '/images/tab-material.png',
selectedIconPath: '/images/tab-material-active.png'
},
{
name: '个人中心', name: '个人中心',
iconPath: '/images/tab-mine.png', iconPath: '/images/tab-mine.png',
selectedIconPath: '/images/tab-mine-active.png' selectedIconPath: '/images/tab-mine-active.png'
...@@ -39,7 +44,7 @@ Page({ ...@@ -39,7 +44,7 @@ Page({
typeText: '补录订单' typeText: '补录订单'
}, },
tabIndex: 0, tabIndex: 0,
pageShow: [true, false, false, false], pageShow: [true, false, false, false, false],
navBarHeight: 0, navBarHeight: 0,
showPicker: false, showPicker: false,
userInfo: {}, userInfo: {},
...@@ -79,14 +84,14 @@ Page({ ...@@ -79,14 +84,14 @@ Page({
staffDailyReportMerchantValid(userInfo) { staffDailyReportMerchantValid(userInfo) {
// let { userInfo } = this.data // let { userInfo } = this.data
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log(userInfo, 'userInfo') // console.log(userInfo, 'userInfo')
staffDailyReportMerchantValid({ staffDailyReportMerchantValid({
merchantId: userInfo.shopMerchantId, merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId, yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid staffUuid: userInfo.uuid
}) })
.then(res => { .then(res => {
console.log(res, 'staffDailyReportMerchantValid') // console.log(res, 'staffDailyReportMerchantValid')
resolve(res.data) resolve(res.data)
}) })
.catch(err => { .catch(err => {
...@@ -100,16 +105,15 @@ Page({ ...@@ -100,16 +105,15 @@ Page({
// 没有开启就不走下一步逻辑 // 没有开启就不走下一步逻辑
// if (!merchantStaffDailyReportMerchantValid) return false // if (!merchantStaffDailyReportMerchantValid) return false
if (merchantStaffDailyReportMerchantValid) { if (merchantStaffDailyReportMerchantValid) {
// 获取当前日期 // 获取当前日期
let currentDate = new Date(); let currentDate = new Date()
// 获取上一天的日期 // 获取上一天的日期
let previousDate = new Date(currentDate); let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1); previousDate.setDate(currentDate.getDate() - 1)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]; let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOREPORT_MODAL = true wx.__HAS_NOREPORT_MODAL = true
wx.showModal({ wx.showModal({
...@@ -506,7 +510,7 @@ Page({ ...@@ -506,7 +510,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log(options, 'onLoad') // console.log(options, 'onLoad')
}, },
/** /**
...@@ -519,7 +523,6 @@ Page({ ...@@ -519,7 +523,6 @@ Page({
*/ */
onShow() { onShow() {
this.initList() this.initList()
// let { tabIndex } = this.data // let { tabIndex } = this.data
// this.selectComponent(`#page-${tabIndex}`)?.onLoad && this.selectComponent(`#page-${tabIndex}`).onLoad() // this.selectComponent(`#page-${tabIndex}`)?.onLoad && this.selectComponent(`#page-${tabIndex}`).onLoad()
}, },
...@@ -529,6 +532,8 @@ Page({ ...@@ -529,6 +532,8 @@ Page({
*/ */
onHide() { onHide() {
time && clearTimeout(time) time && clearTimeout(time)
let { tabIndex } = this.data
this.selectComponent(`#page-${tabIndex}`)?.onHide && this.selectComponent(`#page-${tabIndex}`).onHide()
}, },
/** /**
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
"order-switchPopup": "/components/orderSwitchPopup/orderSwitchPopup", "order-switchPopup": "/components/orderSwitchPopup/orderSwitchPopup",
"order-no-popup":"../../components/OrderNoPopup/OrderNoPopup", "order-no-popup":"../../components/OrderNoPopup/OrderNoPopup",
"tab-mine": "/components/TabMine/TabMine", "tab-mine": "/components/TabMine/TabMine",
"home": "../index/index" "home": "../index/index",
"makert-material":"../trainingMaterials/components/Materials/materials"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }
<!-- pages/equity/index.wxml --> <!-- pages/equity/index.wxml -->
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showMenu="{{ true }}" navStyle="{{ tabIndex != 3 ? '' : 'background-color: rgba(0,0,0,0);box-shadow:none;' }}" bindback="back" bindshowMenuPopup="showMenuPopup"> <navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showMenu="{{ true }}" navStyle="{{ tabIndex !=4 ? '' : 'background-color: rgba(0,0,0,0);box-shadow:none;' }}" bindback="back" bindshowMenuPopup="showMenuPopup">
<view class="navigation-title" wx:if="{{ tabIndex != 3 }}"> <view class="navigation-title" wx:if="{{ tabIndex < 3 }}">
<view class="navigation-title-text text-hide">{{userInfo && userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName}}</view> <view class="navigation-title-text text-hide">{{userInfo && userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName}}</view>
</view> </view>
<view wx:elif="{{tabIndex==3}}">营销素材</view>
<view wx:else>我的</view> <view wx:else>我的</view>
</navigation-bar> </navigation-bar>
<!-- style="margin-top:{{navBarHeight}}px" --> <!-- style="margin-top:{{navBarHeight}}px" -->
...@@ -11,7 +12,8 @@ ...@@ -11,7 +12,8 @@
<home id="page-0" class="pagedetail {{ tabIndex == 0?'':'hide' }}" waitInputCount="{{waitInputCount}}" mode="{{ mode }}"></home> <home id="page-0" class="pagedetail {{ tabIndex == 0?'':'hide' }}" waitInputCount="{{waitInputCount}}" mode="{{ mode }}"></home>
<quotation-list id="page-1" navBarHeight="{{ navBarHeight }}" class="pagedetail {{ tabIndex == 1?'':'hide' }}" mode="{{ mode }}" /> <quotation-list id="page-1" navBarHeight="{{ navBarHeight }}" class="pagedetail {{ tabIndex == 1?'':'hide' }}" mode="{{ mode }}" />
<equity-list id="page-2" outTabIndex="{{ tabIndex }}" navBarHeight="{{ navBarHeight }}" class="pagedetail {{ tabIndex == 2?'':'hide' }}" /> <equity-list id="page-2" outTabIndex="{{ tabIndex }}" navBarHeight="{{ navBarHeight }}" class="pagedetail {{ tabIndex == 2?'':'hide' }}" />
<tab-mine showCollege="{{ enableBusinessSchool }}" id="page-3" class="pagedetail {{ tabIndex == 3?'':'hide' }}" navBarHeight="{{ navBarHeight }}"></tab-mine> <makert-material id="page-3" navBarHeight="{{ navBarHeight }}" class="pagedetail {{tabIndex == 3?'':'hide'}}"></makert-material>
<tab-mine showCollege="{{ enableBusinessSchool }}" id="page-4" class="pagedetail {{ tabIndex == 4?'':'hide' }}" navBarHeight="{{ navBarHeight }}"></tab-mine>
</block> </block>
</view> </view>
<view class="waitOrderCon" wx:if="{{ waitInputCount && mode == 1 && tabIndex == 0 }}"> <view class="waitOrderCon" wx:if="{{ waitInputCount && mode == 1 && tabIndex == 0 }}">
......
...@@ -58,7 +58,12 @@ ...@@ -58,7 +58,12 @@
.layout .pagedetail { .layout .pagedetail {
height: 100%; height: 100%;
} }
/* #page-3 {
overflow-y: scroll;
} */
.van-tabs__line{
border-radius: 2rpx 2rpx 0 0 !important;
}
.waitOrderCon { .waitOrderCon {
position: absolute; position: absolute;
/* bottom: env(safe-area-inset-bottom); */ /* bottom: env(safe-area-inset-bottom); */
......
...@@ -6,23 +6,125 @@ Page({ ...@@ -6,23 +6,125 @@ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {},
flag: true,
list: [new Array(10)],
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.getInspectionList() wx.$router.getData(({
params
}) => {
this.loadData(params)
})
if (options.badgeId) this.loadData(options)
},
loadData(params) {
const day = new Date().setDate(new Date().getDate() - 1)
this.setData({
badgeId: params.badgeId
})
this.searchDate = new Date(day).format('yyyy-MM-dd')
this.onLoadData()
},
onLoadData() {
wx.$util.showLoading()
this.getEmployeeBadge()
},
changeDate({
detail
}) {
this.searchDate = detail
this.onLoadData()
},
async getEmployeeBadge() {
try {
const {
searchDate,
data: {
badgeId
}
} = this, {
code,
data,
message
} = await carLifeApi.getEmployeeBadge({
searchdate: searchDate,
badgeId
})
wx.hideLoading()
if (code == 0) {
console.log(data)
let [inspectionInfo] = data.list
inspectionInfo = inspectionInfo || {}
this.setData({
inspectionInfo
})
const arcComponent = this.selectComponent('#arc')
arcComponent.init()
if (inspectionInfo.score != null) arcComponent.drawData()
this.getInspectionList(inspectionInfo.id)
} else throw message
} catch (error) {
wx.hideLoading()
wx.$util.showToast(error)
}
}, },
changeDate(e) { async getInspectionList(conversationDateId) {
console.log(e) try {
if(!conversationDateId) throw false
wx.$util.showLoading()
const {
searchDate
} = this, {
code,
data,
message
} = await carLifeApi.getInspectionList({
startTime: `${searchDate} 00:00:00`,
endTime: `${searchDate} 23:59:59`,
conversationDateId
})
if (code == 0) {
wx.hideLoading()
const rex = /\b\d{2}:\d{2}:\d{2}\b/
data.list?.map(e => {
if (e.startTime && e.endTime) e.time = `${e.startTime.match(rex)[0]}-${e.endTime.match(rex)[0]}`
if (e.duration) e._duration = this.formatTime(e.duration)
if (!e.estimatedResult) {
e.estimatedResult = '未知'
e.estimatedStatus = -1
} else e.estimatedStatus = e.estimatedResult == '成交' ? 1 : 0
})
this.setData({
list: data.list || [],
flag: true
})
} else throw message
} catch (error) {
wx.hideLoading()
this.setData({
flag: true,
list:[]
})
console.log(error)
if(error) wx.$util.showToast(error)
}
}, },
async getInspectionList() { formatTime(seconds) {
const res = await carLifeApi.getInspectionList({}) seconds = Math.floor(seconds / 1000)
console.log(res) let formattedTime = ''
if (seconds < 60) return seconds + 's'
else {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + 'h'
if (minutes > 0 || hours > 0) formattedTime += minutes + 'min'
if (remainingSeconds > 0) formattedTime += remainingSeconds + 's'
return formattedTime
}
}, },
/** /**
......
...@@ -55,18 +55,20 @@ page { ...@@ -55,18 +55,20 @@ page {
.arc-tips { .arc-tips {
position: absolute; position: absolute;
top: var(--fontSize202); top: var(--fontSize202);
left: 50%; left: 0;
transform: translateX(-50%);
font-weight: 600; font-weight: 600;
font-size: var(--fontSize24); font-size: var(--fontSize24);
color: #5A5E66; color: #5A5E66;
width: fit-content; width: 100%;
text-align: center;
} }
} }
} }
.content-box{
padding:var(--fontSize20) 0; .content-box {
padding: var(--fontSize20) 0;
} }
.padding-box { .padding-box {
font-weight: 500; font-weight: 500;
font-size: var(--fontSize28); font-size: var(--fontSize28);
......
...@@ -4,26 +4,24 @@ ...@@ -4,26 +4,24 @@
<gl-image webp src="/equity/aiInspection-bg.png" /> <gl-image webp src="/equity/aiInspection-bg.png" />
</view> </view>
<view class="info"> <view class="info">
<view class="name">你好,<text>恒河猴</text></view> <view class="name">你好,<text>{{userInfo.name}}</text></view>
<view class="merchant">服务门店:<text>安徽合肥凯越4S店</text></view> <view class="merchant">服务门店:<text>{{userInfo.default4SStoreInfo.merchantName}}</text></view>
<view class="no">工牌编号:806599260358</view> <view class="no">工牌编号:{{badgeId}}</view>
</view> </view>
<view class="arc-box"> <view class="arc-box">
<view class="arc"> <view class="arc">
<circular num="{{num}}" id="arc"></circular> <circular num="{{inspectionInfo.score || 0}}" id="arc"></circular>
</view> </view>
<view class="arc-tips">今日综合质检评分</view> <view class="arc-tips">今日综合质检评分</view>
</view> </view>
</view> </view>
<date-box bindchange="changeDate"></date-box> <date-box bindchange="changeDate" ></date-box>
<data-box></data-box> <data-box data="{{inspectionInfo}}"></data-box>
<view class="content-box"> <view class="content-box">
<block wx:if="{{flag}}"> <block wx:if="{{flag}}">
<block wx:if="{{list.length}}"> <block wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{list}}" wx:key="index">
<block wx:for="{{item}}" wx:key="ind" wx:for-item="i" wx:for-index="ind"> <content-item item="{{item}}"></content-item>
<content-item item="{{i}}"></content-item>
</block>
</block> </block>
<block wx:if="{{nothing}}"> <block wx:if="{{nothing}}">
<view class="list-nothing">到底了~</view> <view class="list-nothing">到底了~</view>
......
...@@ -96,7 +96,7 @@ Component({ ...@@ -96,7 +96,7 @@ Component({
num num
} = this.data } = this.data
this.part = Math.ceil(num / 20) this.part = Math.ceil(num / 20)
if (num) this.fillArc(Start_Angle, 0, Start_Angle + Angle) if (num != null) this.fillArc(Start_Angle, 0, num == 0 ? Start_Angle : Start_Angle + Angle)
}, },
drawTips(data) { drawTips(data) {
let { let {
...@@ -107,7 +107,7 @@ Component({ ...@@ -107,7 +107,7 @@ Component({
this.ctx.clearRect(x + 10, y / 2 + 20, this.toRpx(52), this.toRpx(30)) this.ctx.clearRect(x + 10, y / 2 + 20, this.toRpx(52), this.toRpx(30))
this.ctx.clearRect(x + 10, y / 2 + 60, this.toRpx(50), this.toRpx(30)) this.ctx.clearRect(x + 10, y / 2 + 60, this.toRpx(50), this.toRpx(30))
this.drawText({ this.drawText({
text: data || '···', text: data != null ? data : '···',
x, x,
y: y / 2, y: y / 2,
fontSize: 30, fontSize: 30,
...@@ -117,7 +117,7 @@ Component({ ...@@ -117,7 +117,7 @@ Component({
textBaseline: 'middle' textBaseline: 'middle'
}) })
this.drawText({ this.drawText({
text: data ? '分数' : '计算中…', text: data != null ? '分数' : '计算中…',
x, x,
y: (y + 44) / 2, y: (y + 44) / 2,
fontSize: 10, fontSize: 10,
...@@ -143,6 +143,7 @@ Component({ ...@@ -143,6 +143,7 @@ Component({
} }
} = this, } = this,
a = startAngle a = startAngle
if(num == 0) return this.drawTips(num)
let b = startAngle + Math.PI / 70 let b = startAngle + Math.PI / 70
ctx.beginPath() ctx.beginPath()
ctx.strokeStyle = Arc_Data_Background[index] ctx.strokeStyle = Arc_Data_Background[index]
......
...@@ -14,15 +14,15 @@ Component({ ...@@ -14,15 +14,15 @@ Component({
data: { data: {
contentObject: [{ contentObject: [{
label: '接待时间', label: '接待时间',
key: '' key: 'time'
}, },
{ {
label: '录音时长', label: '录音时长',
key: '' key: '_duration'
}, },
{ {
label: '预计营销结果', label: '预计营销结果',
key: '', key: 'estimatedResult',
colorEnum: { colorEnum: {
0: '#F24724', 0: '#F24724',
1: '#35C376' 1: '#35C376'
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<view class="title"> <view class="title">
<view class="sub"> <view class="sub">
接待批次 接待批次
<view class="num">1</view> <view class="num">{{item.num}}</view>
</view> </view>
<view class="sub"> <view class="sub">
得分 得分
<view class="num">1</view> <view class="num">{{item.score || 0}}</view>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<block wx:for="{{contentObject}}" wx:for-item="i" wx:for-index="ind"> <block wx:for="{{contentObject}}" wx:for-item="i" wx:for-index="ind">
<view class="sub-item"> <view class="sub-item">
<view class="label">{{i.label}}</view> <view class="label">{{i.label}}</view>
<view class="value" style="color:{{colorEnum?colorEnum[item.status]:''}};">{{item[i.key]||'恒河猴'}}</view> <view class="value" style="color:{{i.colorEnum?i.colorEnum[item.estimatedStatus]:''}};">{{item[i.key]||'-'}}</view>
</view> </view>
</block> </block>
<view class="btn" bindtap="jumpDetail">质检详情</view> <view class="btn" bindtap="jumpDetail">质检详情</view>
......
...@@ -5,7 +5,7 @@ Component({ ...@@ -5,7 +5,7 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
data: Object
}, },
/** /**
...@@ -15,17 +15,17 @@ Component({ ...@@ -15,17 +15,17 @@ Component({
dataObject: [{ dataObject: [{
title: '预计接待批次', title: '预计接待批次',
tips: 'AI根据当日提交的营销录音做出的预估接待批次数', tips: 'AI根据当日提交的营销录音做出的预估接待批次数',
key: '' key: 'batchNum'
}, },
{ {
title: '当日到店量', title: '当日到店量',
tips: '驻店员工在当日驻店日报中填写的到店流量(会员权益/延保),即本人在当天接待的权益延保业务客户数', tips: '驻店员工在当日驻店日报中填写的到店流量(会员权益/延保),即本人在当天接待的权益延保业务客户数',
key: '' key: 'enterReceptionBatch'
}, },
{ {
title: '异常占比', title: '异常占比',
tips: '异常占比=【预计接待批次 - 当日到店量(会员权益/延保)】/ 预计接待批次数', tips: '异常占比=【预计接待批次 - 当日到店量(会员权益/延保)】/ 预计接待批次数',
key: '', key: 'abnormalProportion',
unit: '%' unit: '%'
} }
] ]
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
color: #292D33; color: #292D33;
display: flex; display: flex;
align-items: baseline; align-items: baseline;
font-family: "numberBold";
.unit { .unit {
font-size: var(--fontSize24); font-size: var(--fontSize24);
margin-left: var(--fontSize4); margin-left: var(--fontSize4);
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</block> </block>
</view> </view>
<view class="data-value"> <view class="data-value">
12 {{data[item.key] != null ? data[item.key] : '-'}}
<block wx:if="{{item.unit}}"> <block wx:if="{{item.unit}}">
<view class="unit">{{item.unit}}</view> <view class="unit">{{item.unit}}</view>
</block> </block>
......
// packageEquity/pages/aiInspection/components/dateBox/dateBox.js // packageEquity/pages/aiInspection/components/dateBox/dateBox.js
const defaultDay = new Date().setDate(new Date().getDate() - 1)
Component({ Component({
/** /**
...@@ -16,7 +17,7 @@ Component({ ...@@ -16,7 +17,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
today: new Date().format('yyyy-MM-dd'), maxDate: new Date().format('yyyy-MM-dd'),
}, },
...@@ -25,13 +26,15 @@ Component({ ...@@ -25,13 +26,15 @@ Component({
*/ */
methods: { methods: {
init() { init() {
const now = new Date().format('yyyy/MM/dd') const now = new Date().format('yyyy/MM/dd'),
calendar = this.selectComponent('#calendar')
this.setData({ this.setData({
currentDay: new Date().format('yyyy年MM月dd日'), currentDay: new Date(defaultDay).format('yyyy年MM月dd日'),
todayTime: new Date(now).getTime(), maxDateTime: new Date(now).getTime(),
minTime: new Date('2024/1/1').getTime(), minTime: calendar.data.monthList[0].data[0].time,
currentDayTime: new Date(now).getTime() currentDayTime: new Date(defaultDay).getTime()
}) })
calendar.resetData(new Date(defaultDay).format('yyyy-MM-dd'))
}, },
selectDay(e) { selectDay(e) {
let { let {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
left: 50%; left: 50%;
top: 50%; top: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
width: calc(276 / 750 * 100%); min-width: calc(276 / 750 * 100%);
height: var(--fontSize64); height: var(--fontSize64);
background: #F7F8FA; background: #F7F8FA;
border-radius: var(--fontSize8); border-radius: var(--fontSize8);
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
font-size: var(--fontSize28); font-size: var(--fontSize28);
color: #181A1F; color: #181A1F;
line-height: var(--fontSize40); line-height: var(--fontSize40);
padding:0 var(--fontSize24);
box-sizing: border-box;
.icon{ .icon{
width: var(--fontSize40); width: var(--fontSize40);
height: var(--fontSize40); height: var(--fontSize40);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
{{currentDay}} {{currentDay}}
<gl-image class="icon" src="/equity/date-arrow.png" /> <gl-image class="icon" src="/equity/date-arrow.png" />
</view> </view>
<block wx:if="{{todayTime != currentDayTime}}"> <block wx:if="{{maxDateTime != currentDayTime}}">
<view class="date-btn next" bindtap="choose" data-index="1"> <view class="date-btn next" bindtap="choose" data-index="1">
下一天 下一天
<gl-image class="icon" src="/equity/arrow-right.png" /> <gl-image class="icon" src="/equity/arrow-right.png" />
...@@ -17,5 +17,5 @@ ...@@ -17,5 +17,5 @@
</block> </block>
</view> </view>
<calendar shortcut bindselect='selectDay' calenderColor='#347BFF' vertical minDate="2024-1-1" isComponents id="calendar" maxDate="{{today}}" > <calendar shortcut bindselect='selectDay' calenderColor='#347BFF' vertical isComponents id="calendar" maxDate="{{maxDate}}" >
</calendar> </calendar>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiInspectionDetail/aiInspectionDetail.js // packageEquity/pages/aiInspectionDetail/aiInspectionDetail.js
import carLifeApi from '../../carEquityApi'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
overviewList:[ overviewList: [{
{ title: '话术评分',
title:'话术评分', key: 'score'
key:''
}, },
{ {
title:'预计营销结果', title: '预计营销结果',
key:'', key: 'estimatedResult',
fontSize: 'var(--fontSize28)' fontSize: 'var(--fontSize28)'
}, },
{ {
title:'开始录音时间', title: '开始录音时间',
key:'' key: 'startTime'
}, },
{ {
title:'对话时长', title: '对话时长',
key:'' key: '_duration'
} }
], ]
list:new Array(10)
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
wx.$router.getData(res => {
if (!res.estimatedResult) res.estimatedResult = '未知'
if (res.startTime) res.startTime = res.startTime.match(/\b\d{2}:\d{2}:\d{2}\b/)[0]
if (res.duration) res._duration = this.formatTime(res.duration)
this.setData({
detailInfo: res
})
this.getInspectionDetail(res.id)
})
}, },
async getInspectionDetail(batchId) {
try {
wx.$util.showLoading()
const {
code,
data: {
list
},
message
} = await carLifeApi.getInspectionDetail({
batchId
})
if (code == 0 && list) {
let titleList = Array.from(new Set([...list.map(e => e.firstClassify)]))
const classifyList = titleList.map(i => {
let arr = [],
rawScore = 0,
score = 0
list.map(e => {
if (i == e.firstClassify) {
arr.push(e)
rawScore += e.rawScore
score += e.score
}
})
return {
list: arr,
title: i,
rawScore,
score,
}
})
console.log(classifyList)
this.setData({
list: classifyList
})
wx.hideLoading()
} else throw message
} catch (error) {
wx.hideLoading()
wx.$util.showToast(error)
}
},
formatTime(seconds) {
seconds = Math.floor(seconds / 1000)
let formattedTime = ''
if (seconds < 60) return seconds + '秒'
else {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
if (remainingSeconds > 0) formattedTime += remainingSeconds + '秒'
return formattedTime
}
},
jump(e) {
const {
item
} = e.currentTarget.dataset
wx.$router.go('aiInspectionReception', item)
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
......
...@@ -101,6 +101,7 @@ page { ...@@ -101,6 +101,7 @@ page {
color: #347BFF; color: #347BFF;
line-height: var(--fontSize44); line-height: var(--fontSize44);
} }
} }
} }
} }
...@@ -127,3 +128,7 @@ page { ...@@ -127,3 +128,7 @@ page {
} }
} }
} }
.red{
color: #F24724 !important;
}
\ No newline at end of file \ No newline at end of file
...@@ -5,26 +5,30 @@ ...@@ -5,26 +5,30 @@
<block wx:for="{{overviewList}}" wx:key="index"> <block wx:for="{{overviewList}}" wx:key="index">
<view class="overview-item flex"> <view class="overview-item flex">
<view class="title">{{item.title}}</view> <view class="title">{{item.title}}</view>
<view class="value">50</view> <view class="value">{{detailInfo[item.key] || '-'}}</view>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
<view class="content-box"> <view class="content-box">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{list}}" wx:key="index">
<view class="item"> <view class="item" bindtap="jump" data-item="{{item}}">
<view class="title flex"> <view class="title flex">
接待环节 {{item.title}}
<view class="score flex"> <view class="score flex">
得分: 得分:
<view class="num flex"><view class="highlight">15</view>/20</view> <view class="num flex">
<view class="highlight {{item.score == 0 ?'red':''}}">{{item.score}}</view>/{{item.rawScore}}
</view>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<block wx:for="{{item.list}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="sub-item flex"> <view class="sub-item flex">
<view class="label">介绍延保</view> <view class="label">{{i.secondClassify}}</view>
<view class="value">5/5</view> <view class="value">{{i.score}}/{{i.rawScore}}</view>
</view> </view>
</block>
</view> </view>
</view> </view>
</block> </block>
......
...@@ -5,16 +5,26 @@ Page({ ...@@ -5,16 +5,26 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
list:new Array(10) hitEnum: {
1: '命中',
0: '未命中'
}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
wx.$router.getData(res => {
console.log(res)
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '接待环节', title: res.title
})
this.setData({
detailInfo: res
}) })
})
}, },
/** /**
......
...@@ -14,7 +14,6 @@ page { ...@@ -14,7 +14,6 @@ page {
height: var(--fontSize80); height: var(--fontSize80);
padding: 0 var(--fontSize32); padding: 0 var(--fontSize32);
border-bottom: var(--fontSize1) solid #EFF0F2; border-bottom: var(--fontSize1) solid #EFF0F2;
margin-bottom: var(--fontSize16);
font-weight: 600; font-weight: 600;
font-size: var(--fontSize28); font-size: var(--fontSize28);
color: #292D33; color: #292D33;
...@@ -49,10 +48,11 @@ page { ...@@ -49,10 +48,11 @@ page {
box-shadow: 0 var(--fontSize4) var(--fontSize16) 0 #cdcdd180; box-shadow: 0 var(--fontSize4) var(--fontSize16) 0 #cdcdd180;
border-radius: var(--fontSize16); border-radius: var(--fontSize16);
margin: 0 auto var(--fontSize20); margin: 0 auto var(--fontSize20);
overflow: hidden;
.title { .title {
font-weight: 500; font-weight: 500;
height: var(--fontSize88); height: var(--fontSize88);
margin-bottom: var(--fontSize16);
} }
.content { .content {
...@@ -95,3 +95,7 @@ page { ...@@ -95,3 +95,7 @@ page {
} }
} }
} }
.red{
color: #F24724 !important;
}
\ No newline at end of file \ No newline at end of file
<view class="layout isFullSucreen"> <view class="layout isFullSucreen">
<view class="title flex"> <view class="title flex">
接待环节 {{detailInfo.title}}
<view class="score flex"> <view class="score flex">
得分: 得分:
<view class="num flex"> <view class="num flex">
<view class="highlight">15</view>/20 <view class="highlight {{detailInfo.score == 0 ?'red':''}}">{{detailInfo.score}}</view>/{{detailInfo.rawScore}}
</view> </view>
</view> </view>
</view> </view>
<view class="content-box"> <view class="content-box">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{detailInfo.list}}" wx:key="index">
<view class="item"> <view class="item">
<view class="title flex"> <view class="title flex">
接待环节 {{item.secondClassify}}
<view class="score flex"> <view class="score flex">
得分: 得分:
<view class="num flex"> <view class="num flex">
<view class="highlight">15</view>/20 <view class="highlight {{item.score == 0 ?'red':''}}">{{item.score}}</view>/{{item.rawScore}}
</view> </view>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<view class="sub-item flex"> <view class="sub-item flex">
<view class="label">是否命中</view> <view class="label">是否命中</view>
<view class="value">命中</view> <view class="value">{{hitEnum[item.hitResult]}}</view>
</view> </view>
<view class="sub-item flex"> <view class="sub-item flex">
<view class="label">命中文本</view> <view class="label">命中文本</view>
<view class="value">您好,XX先生/小姐/女士。</view> <text class="value">{{item.hitText || '-'}}</text>
</view> </view>
<view class="example"> <view class="example">
<view class="label">话术建议</view> <view class="label">话术建议</view>
<view class="value">稍后将向您介绍车辆使用注意事项以及保养车辆质保相关事项。</view> <text class="value">{{item.suggestions||'-'}}</text>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -129,7 +129,7 @@ Component({ ...@@ -129,7 +129,7 @@ Component({
merchantId: storeInfo?.merchantId merchantId: storeInfo?.merchantId
}) })
.then(res => { .then(res => {
console.log(res, '统计---') // console.log(res, '统计---')
if (res.code == '0') { if (res.code == '0') {
let { let {
data data
...@@ -264,7 +264,7 @@ Component({ ...@@ -264,7 +264,7 @@ Component({
if (code == 0) { if (code == 0) {
if (data.length == 1) { if (data.length == 1) {
carLifeApi.printContract(params).then(res => { carLifeApi.printContract(params).then(res => {
wx.hideLoading() wx.$util.hideLoading()
if (res.code == '0') { if (res.code == '0') {
this.setData({ this.setData({
url: res.data url: res.data
...@@ -279,6 +279,7 @@ Component({ ...@@ -279,6 +279,7 @@ Component({
} }
}) })
} else { } else {
wx.$util.hideLoading()
wx.$router.go('previewList', { wx.$router.go('previewList', {
list: data list: data
}) })
......
...@@ -24,15 +24,24 @@ ...@@ -24,15 +24,24 @@
<view class="search-box"> <view class="search-box">
<view class="search-input"> <view class="search-input">
<image src="/images/search.png" class="search-icon" /> <image src="/images/search.png" class="search-icon" />
<input type="text" placeholder="请输入客户名字搜索" class="input" confirm-type="search" value="{{customerName}}" placeholder-class="input-placeholder" bindinput="input" bindconfirm="search" /> <input
<block wx:if="{{customerName}}"> type="text"
placeholder="请输入客户名字搜索"
class="input"
confirm-type="search"
value="{{ customerName }}"
placeholder-class="input-placeholder"
bindinput="input"
bindconfirm="search"
/>
<block wx:if="{{ customerName }}">
<view bindtap="handleReset" class="clearBtn"> <view bindtap="handleReset" class="clearBtn">
<image src="/images/clear.png" class="search-clear" bindtap="handleReset" /> <image src="/images/clear.png" class="search-clear" bindtap="handleReset" />
</view> </view>
</block> </block>
</view> </view>
</view> </view>
<tab-bar tabList="{{tabList}}" bindclick="tabClick" /> <tab-bar tabList="{{ tabList }}" bindclick="tabClick" />
</view> </view>
<!-- <view class="total-box"> <!-- <view class="total-box">
总订单 · 总订单 ·
...@@ -42,45 +51,47 @@ ...@@ -42,45 +51,47 @@
提单失败 · 提单失败 ·
<text style="color: #D26F6B;">{{statisticsObj.failed}}</text> <text style="color: #D26F6B;">{{statisticsObj.failed}}</text>
</view> --> </view> -->
<view wx:if="{{tabIndex != 3 && list.length && isShowTips}}" class="tips-box"> <view wx:if="{{ tabIndex != 3 && list.length && isShowTips }}" class="tips-box">
<tips-bottom <tips-bottom
custom-class="tips-custom" custom-class="tips-custom"
style="width: 100%;box-sizing: border-box;" style="width: 100%;box-sizing: border-box;"
tipsProps="{{tipsProps}}" tipsProps="{{ tipsProps }}"
bind:closeTips="closeTips" /> bind:closeTips="closeTips"
/>
</view> </view>
<view wx:if="{{flag}}" class="order-box" style="height: {{tabIndex != 3 && list.length && isShowTips ? 'calc(100% - var(--fontSize160) - var(--fontSize68))' : 'calc(100% - var(--fontSize160))'}}"> <view
wx:if="{{ flag }}"
class="order-box"
style="height: {{ tabIndex != 3 && list.length && isShowTips ? 'calc(100% - var(--fontSize160) - var(--fontSize68))' : 'calc(100% - var(--fontSize160))' }}"
>
<scroll-view <scroll-view
scroll-y scroll-y
enable-back-to-top enable-back-to-top
refresher-enabled="{{true}}" refresher-enabled="{{ true }}"
bindrefresherrefresh="search" bindrefresherrefresh="search"
bindscrolltolower="onBottomRefresh" bindscrolltolower="onBottomRefresh"
class="list" class="list"
scroll-top="{{scrollTop}}" scroll-top="{{ scrollTop }}"
style="height: calc(100% - var(--fontSize2))" style="height: calc(100% - var(--fontSize2))"
refresher-threshold="104" refresher-threshold="104"
refresher-triggered="{{triggered}}"> refresher-triggered="{{ triggered }}"
<block wx:if="{{list.length > 0}}"> >
<view wx:for="{{list}}" wx:key="index" class="item"> <block wx:if="{{ list.length > 0 }}">
<view wx:for="{{ list }}" wx:key="index" class="item">
<view class="item-header">{{item.customerName}} | {{item.customerPhone}}</view> <view class="item-header">{{item.customerName}} | {{item.customerPhone}}</view>
<view class="item-content"> <view class="item-content">
<image class="status-icon" src="/packageEquity/images/equity-{{item.orderStatus}}.png" /> <image class="status-icon" src="/packageEquity/images/equity-{{ item.orderStatus }}.png" />
<!-- 内容 --> <!-- 内容 -->
<view class="order-list"> <view class="order-list">
<view class="good-name">{{item.goodName || ''}}</view> <view class="good-name">{{item.goodName || ''}}</view>
<view class="order-content"> <view class="order-content">
<image mode="aspectFill" class="pro-bg" src="{{item.thumbUrl || '/packageEquity/images/pro-bg.png'}}" /> <image mode="aspectFill" class="pro-bg" src="{{ item.thumbUrl || '/packageEquity/images/pro-bg.png' }}" />
<view> <view>
<view <view wx:for="{{ orderObj }}" wx:key="sindex" wx:for-index="sindex" wx:for-item="i">
wx:for="{{orderObj}}" <view class="order {{ orderObj.length == (sindex + 1) ? '' : 'm-b-16' }}">
wx:key="sindex"
wx:for-index="sindex"
wx:for-item="i">
<view class="order {{orderObj.length == (sindex + 1) ? '' : 'm-b-16'}}">
<view class="order-label">{{i.label}}</view> <view class="order-label">{{i.label}}</view>
<view class="order-value"> <view class="order-value">
<block wx:if="{{i.key == 'ywly'}}">车损升级</block> <block wx:if="{{ i.key == 'ywly' }}">车损升级</block>
<block wx:else>{{item[i.key] || ''}}{{i.suffix || ''}}</block> <block wx:else>{{item[i.key] || ''}}{{i.suffix || ''}}</block>
</view> </view>
</view> </view>
...@@ -93,35 +104,27 @@ ...@@ -93,35 +104,27 @@
<view class="item-footer"> <view class="item-footer">
<view>{{item.createdDate}}</view> <view>{{item.createdDate}}</view>
<!-- 超管isSuper/商户类型 userType 1账号不可操作 --> <!-- 超管isSuper/商户类型 userType 1账号不可操作 -->
<block wx:if="{{(!userInfo.isSuper && userInfo.userType == 2&&item.orderStatus!=4)||(item.orderStatus==2) }}"> <block wx:if="{{ (!userInfo.isSuper && userInfo.userType == 2&&item.orderStatus!=4)||(item.orderStatus==2) }}">
<view class="btn_box_class"> <view class="btn_box_class">
<view <view
wx:if="{{item.orderStatus == '2'}}" wx:if="{{ item.orderStatus == '2' }}"
class="order-btn" class="order-btn"
bindtap="handlePreviewContract" bindtap="handlePreviewContract"
data-target="{{item}}" data-target="{{ item }}"
data-type="download"> data-type="download"
下载合同 >下载合同</view>
</view>
<view <view
wx:if="{{item.orderStatus == '2'}}" wx:if="{{ item.orderStatus == '2' }}"
class="order-btn default-btn" class="order-btn default-btn"
bindtap="handlePreviewContract" bindtap="handlePreviewContract"
data-target="{{item}}"> data-target="{{ item }}"
{{btnTxt[item.orderStatus]}} >{{btnTxt[item.orderStatus]}}</view>
</view> <view wx:else class="order-btn" bindtap="handleRecordOrder" data-target="{{ item }}">{{btnTxt[item.orderStatus]}}</view>
<view
wx:else
class="order-btn"
bindtap="handleRecordOrder"
data-target="{{item}}">
{{btnTxt[item.orderStatus]}}
</view>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
<block wx:if="{{nothing}}"> <block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view> <view class="list-nothing">到底了~</view>
</block> </block>
</block> </block>
......
...@@ -249,6 +249,7 @@ ...@@ -249,6 +249,7 @@
.warranty { .warranty {
display: flex; display: flex;
align-items: center;
justify-content: flex-end; justify-content: flex-end;
height: var(--fontSize80); height: var(--fontSize80);
line-height: var(--fontSize80); line-height: var(--fontSize80);
...@@ -377,4 +378,3 @@ ...@@ -377,4 +378,3 @@
.pay-type .cell { .pay-type .cell {
padding-left: var(--fontSize20) !important; padding-left: var(--fontSize20) !important;
} }
\ No newline at end of file \ No newline at end of file
...@@ -48,18 +48,28 @@ Component({ ...@@ -48,18 +48,28 @@ Component({
}, },
observers: { observers: {
'orderInfo.mode': function (value) { 'orderInfo.mode': function (value) {
this.getYqStoreConfig() // 先注释掉
// this.getYqStoreConfig()
// if (n.mode) { // if (n.mode) {
console.log(value, data, data.firstObjSimple, 'mode') // console.log(value, data, data.firstObjSimple, 'mode')
console.log({ // console.log({
first: value ? data.firstObjSimple : data.firstObj // first: value ? data.firstObjSimple : data.firstObj
}, ' first: value ? data.firstObjSimple : data.firstObj,'); // }, ' first: value ? data.firstObjSimple : data.firstObj,');
// first: data.firstObj, // first: data.firstObj,
// let thisPage =
// let thisPage = wx.$router.getPageInstance()
// console.log(thisPage);
// if (thisPage.data.orderInfo.mode != value) {
this.setData({ this.setData({
first: value ? data.firstObjSimple : data.firstObj, first: value ? data.firstObjSimple : data.firstObj,
formRule: value ? data.formRuleSimple : data.formRule formRule: value ? data.formRuleSimple : data.formRule
}) })
// } // }
// }
}, },
// 'orderInfo.outTradeNo': function (value) { // 'orderInfo.outTradeNo': function (value) {
// console.log(value, 'outTradeNo') // console.log(value, 'outTradeNo')
...@@ -91,6 +101,7 @@ Component({ ...@@ -91,6 +101,7 @@ Component({
lifetimes: { lifetimes: {
attached() { attached() {
this.getEmployee() this.getEmployee()
this.getYqStoreConfig()
} }
}, },
...@@ -181,7 +192,7 @@ Component({ ...@@ -181,7 +192,7 @@ Component({
// }, // },
btnTap(e) { btnTap(e) {
console.log(e) // console.log(e)
let { let {
name name
} = e.detail } = e.detail
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<!-- filter.replaceItemText(i.upgradeGoodsAlias) || --> <!-- filter.replaceItemText(i.upgradeGoodsAlias) || -->
<view>{{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}}</view> <view>{{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}}</view>
<!-- <text wx:if="{{i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">{{'「' + i.positionStr+'」'}}</text> --> <!-- <text wx:if="{{i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">{{'「' + i.positionStr+'」'}}</text> -->
<view class="serveName">(包含{{i.serveName}})</view> <view class="serveName" wx:if="{{i.serveName}}">(包含{{i.serveName}})</view>
<!-- <text class="warning_text" wx:if="{{!i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">无部位</text> --> <!-- <text class="warning_text" wx:if="{{!i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">无部位</text> -->
</view> </view>
<view class="last" > <view class="last" >
......
import NP from 'number-precision'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function (n) {
console.log(n, 'show');
if (n) {
// this.getOrderBaseGoodsList(n)
let thisPage = wx.$router.getPageInstance()
thisPage.getQuotationInfo()
}
}
},
goodsData: {
type: Array,
observer: function (n) {
if (n.length > 0) {
this.getOrderBaseGoodsList(n)
}
}
},
chooseGoodsList: {
type: Array,
observer: function (n) {
console.log(n, 'chooseGoodsList');
this.setGoodsActive()
}
},
minPrice: {
type: Number
}
},
/**
* 组件的初始数据
*/
data: {
goodsList: [],
recordList: [],
// totalGoodsList:[],
},
/**
* 组件的方法列表
*/
methods: {
cancel() {
let {
goodsData
} = this.data
this.setData({
goodsList: goodsData,
})
this.setGoodsActive()
},
setGoodsActive() {
let {
chooseGoodsList,
goodsList,
recordList
} = this.data
if (chooseGoodsList.length == 0) {
goodsList.forEach(e => {
e.active = false
})
recordList.forEach(e => {
e.active = false
})
} else {
// let indexList = []
goodsList.map((e, index) => {
e.active = false
chooseGoodsList.map(s => {
if (s.goods && e.goods) {
// console.log(e);
if (s.goods.goodsId == e.goods.goodsId) {
console.log(s.goods.goodsId, e.goods.goodsId, 's.goods.goodsId');
e.active = true
}
}
if (s.packageGoods && e.packageGoods) {
if (s.packageGoods.packageCode == e.packageGoods.packageCode) {
e.active = true
}
}
})
})
recordList.map((e, index) => {
e.active = false
chooseGoodsList.map(s => {
// if (s.goodsId == e.id) {
// e.active = true
// }
if (s.goods && e.goods) {
if (s.goods.goodsId == e.goods.goodsId) {
e.active = true
}
}
if (s.packageGoods && e.packageGoods) {
if (s.packageGoods.packageCode == e.packageGoods.packageCode) {
e.active = true
}
}
})
})
}
this.setData({
goodsList,
recordList
})
},
getOrderBaseGoodsList(data) {
this.setData({
keyWord: '',
goodsList: data,
recordList: data
})
},
getChooseList() {
let {
recordList,
chooseGoodsList
} = this.data
let chooseList = []
recordList.map(c => {
// e.upgradeGoodsList.map(c => {
if (c.active) {
if (c.goods) {
if (!c.count) c.count = 1
c.goods.price = c.goods.sellPrice || 0
if (chooseGoodsList.length > 0) {
chooseGoodsList.map(x => {
if (x.goods && x.goods.goodsId == c.goods.goodsId) {
console.log(x)
c.goods.price = x.goods.price || 0
}
})
}
// if (!c.price) c.goods.price = c.sellPrice
// c.goodsId = c.id
chooseList.push(c)
}
if (c.packageGoods) {
if (!c.count) c.count = 1
if (chooseGoodsList.length > 0) {
chooseGoodsList.map(x => {
if (x.packageGoods && x.packageGoods.packageCode == c.packageGoods.packageCode) {
c.packageGoods.goodsList = c.packageGoods.goodsList.map(item => {
x.packageGoods.goodsList.map(ele => {
if (item.upgradeGoodsId == ele.upgradeGoodsId) {
console.log(item.price, ele.price);
item.price = ele.price || 0
console.log(item.price, ele.price);
}
})
return item
})
}
})
}
// else {
// c.goods.price = c.goods.sellPrice || 0
c.packageGoods.goodsList = c.packageGoods.goodsList.map(ele => {
if (ele?.price !== '' && ele?.price !== null && ele?.price !== undefined) {
ele.price = ele.price
} else {
ele.price = ele.sellPrice || 0
}
// ele.price = ele.price || ele.sellPrice || 0
// console.log(ele, 'ele');
return ele
})
// }
c.price = c.packageGoods.goodsList.reduce((total, item) => {
// total = total + item.price
// console.log(item.price, total, 'item.price');
// console.log(NP.plus(0.1, 0.2));
total = NP.plus(item.price, total)
return total
}, 0)
console.log(c.price, 'c.price ');
chooseList.push(c)
}
}
// })
})
return chooseList
},
choose(e) {
let {
item,
index,
ind
} = e.currentTarget.dataset
let {
active
} = item
let {
minPrice,
recordList
} = this.data
// console.log(item, 'item');
// console.log(item.goodsInfo.shopMinPrice)
// console.log(minPrice && minPrice < item.shopMinPrice)
// 如果有设置订单价格 那就不能选单个成本价比总价还高的
if (minPrice && minPrice / 100 < item.shopMinPrice) return false
let goodsType = item.goods ? 'goods' : 'packageGoods'
let target = `goodsList[${ind}].active`
let recordIndex = recordList.findIndex(el => {
if (item.goods && el.goods) {
return el[goodsType].goodsId == item[goodsType].goodsId
}
if (item.packageGoods && el.packageGoods) {
// console.log(el[goodsType], 'el[goodsType]');
return el[goodsType].packageCode == item[goodsType].packageCode
}
})
console.log(recordIndex, 'recordIndex');
this.setData({
[`recordList[${recordIndex}].active`]: !active,
[target]: !active
})
},
addCount(e) {
let {
index,
count,
item,
ind
} = e.currentTarget.dataset
let target = `goodsList[${index}].upgradeGoodsList[${ind}].count`
if (!item.count) item.count = 1
// item.count += count
item.count = NP.plus(item.count, count)
if (item.count < 1) item.count = 1
if (item.count > 999) item.count = 999
this.setData({
[target]: item.count
})
},
input(e) {
let {
index,
ind
} = e.currentTarget.dataset
let target = `goodsList[${index}].upgradeGoodsList[${ind}].count`
let {
value
} = e.detail
if (value < 1) value = 1
if (value > 999) value = 999
this.setData({
[target]: Number(value)
})
},
searchGoods(e) {
let {
goodsData,
recordList
} = this.data
let {
value
} = e.detail
if (!value) {
this.getOrderBaseGoodsList(recordList)
return
}
let _DATA_ = JSON.parse(JSON.stringify(recordList))
let arr = []
_DATA_.map(c => {
// let nameList = []
let name
if (c.goods) {
// nameList.push(c.goods.goodsAlias,c.goods.upgradeGoodsName,c.goods.goodsName)
name = c.goods.goodsAlias || c.goods.upgradeGoodsName || c.goods.goodsName
}
if (c.packageGoods) {
name = c.packageGoods.packageName
}
if (name.indexOf(value) != -1) {
arr.push(c)
}
})
// console.log(arr)
this.setData({
goodsList: arr
})
},
confirm() {
let chooseList = this.getChooseList()
// console.log(chooseList, 'chooseList');
let {
goodsList
} = this.data
if (goodsList.length < 1) return
if (!chooseList.length) return wx.$util.showToast('请勾选商品')
this.triggerEvent('confirm', chooseList)
let thisPage = wx.$router.getPageInstance()
// let total = 0
// chooseList.map(i => (total += i.count * i.price))
thisPage.setData({
['orderInfo.vdQuotationGoodsList']: chooseList,
// ['orderInfo.total']: wx.$util.decimal(total, 2)
}, () => {
// console.log(thisPage);
thisPage.totalFee()
})
this.setData({
show: false
})
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<wxs src="index.wxs" module="filter" />
<popup show="{{show}}" title="选择商品" bindconfirm="confirm" bindcancel="cancel">
<view class="coupon-box">
<search-input value="{{keyWord}}" bindsearch="searchGoods" />
<scroll-view class="coupon" scroll-y>
<block wx:if="{{goodsList.length > 0}}">
<!-- <block wx:for="{{goodsList}}" wx:key="index"> -->
<!-- <view class="title">
{{item.goodsTypeName}}
<text class="tips">|建议价</text>
</view> -->
<view class="box">
<block wx:for="{{goodsList}}" wx:key="ind" wx:for-index="ind" wx:for-item="i">
<view class="item {{minPrice?(minPrice/100)>= i.shopMinPrice ?'':'disableSelect':'' }}">
<view class="value " catchtap="choose" data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}">
<block wx:if="{{i.goods}}">
<view class="name text-hide ">
<view>{{filter.replaceItemText(i.goods.upgradeGoodsAlias) ||filter.replaceItemText(i.goods.upgradeGoodsName) || filter.replaceItemText(i.goods.goodsInfo.goodsName)}}</view>
<!-- <text wx:if="{{i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">{{'「' + i.positionStr+'」'}}</text> -->
<view class="serveName" wx:if="{{i.goods.serveName}}">(包含{{i.goods.serveName}})</view>
<!-- <text class="warning_text" wx:if="{{!i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">无部位</text> -->
</view>
<view class="last">
<text class="price">¥{{i.goods.sellPrice}}</text>
</view>
</block>
<block wx:if="{{i.packageGoods}}">
<view class="childbox">
<view class="item">
<view class="name text-hide ">
<view>{{i.packageGoods.packageName}}</view>
</view>
<view class="last">
<text class="price">¥{{i.packageGoods.sellPrice}}</text>
</view>
</view>
<view class="goodsChild">
<view class="goodsItem" wx:for="{{i.packageGoods.goodsList}}" wx:key="childind" wx:for-index="childind" wx:for-item="child">
<view class="goodsListName">{{filter.replaceItemText(child.goodsAlias) ||filter.replaceItemText(child.upgradeGoodsName) || filter.replaceItemText(child.goodsInfo.goodsName)}}</view>
<view class="goodsListPrice">¥{{child.sellPrice}}</view>
</view>
</view>
</view>
</block>
</view>
<view class="icon" catchtap="choose" data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}">
<block wx:if="{{i.active}}">
<image src="./images/radio.png" />
</block>
<block wx:else>
<view class="arc" />
</block>
</view>
</view>
</block>
</view>
<!-- </block> -->
</block>
<block wx:else>
<view class="nothing">暂无数据</view>
</block>
</scroll-view>
</view>
</popup>
\ No newline at end of file \ No newline at end of file
/* components/Goods/Goods.wxss */
/* @import '../Coupon/Coupon.wxss'; */
.coupon-box {
width: calc(100% + 64rpx);
height: 100%;
margin-left: -32rpx;
}
.coupon {
height: calc(100% - 104rpx);
}
.box {
border-bottom: 2rpx solid #EBEDF0;
padding-left: 72rpx;
}
.title {
padding: 18rpx 0 0 32rpx;
font-size: 32rpx;
color: #333333;
height: 88rpx;
box-sizing: border-box;
}
.text-center {
text-align: center;
}
.item {
box-sizing: border-box;
padding: 23rpx 0;
border-top: 2rpx solid #EBEDF0;
/* height: 84rpx; */
display: flex;
/* align-items: center; */
align-items: start;
font-size: 28rpx;
color: #888888;
position: relative;
}
.item.disabled {
color: #ccc;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.serveName {
width: 100%;
white-space: pre-wrap;
word-wrap: break-word;
overflow-wrap: break-word;
}
.item .icon {
display: none;
width: 32rpx;
height: 32rpx;
position: absolute;
top: 28rpx;
left: -52rpx;
/* transform: translateY(-50%); */
}
.item.active {
color: #347BFF;
}
.item.active .icon {
display: block;
}
.nothing {
padding: 100rpx;
text-align: center;
color: #999;
}
.item {
justify-content: space-between;
padding-right: 32rpx;
}
.title .tips {
font-size: 24rpx;
color: #999999;
}
.item .value {
/* width: calc(100% - 180rpx); */
width: 100%;
display: flex;
/* flex-direction: ; */
justify-content: space-between;
}
.item .labelWidth {
width: calc(100% - 180rpx);
/* display: flex; */
}
.item .value .name {
max-width: 85%;
}
.item .value .name .warning_text {
color: #F24724;
margin-left: 10rpx;
font-size: 22rpx;
}
.item .value .textWidth {
max-width: 100%;
}
.item .value .last {
max-width: 40%;
}
.item .value .price {
/* color: #347BFF; */
font-weight: 500;
font-size: 28rpx;
color: #EB4E4E;
}
.item .control {
display: flex;
align-items: center;
}
.item .control .minus,
.item .control .add {
width: 44rpx;
height: 44rpx;
color: #347BFF;
background: #F7F7F7;
border-radius: 6rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
font-weight: 700;
}
.item .control .input {
width: 72rpx;
height: 40rpx;
text-align: center;
font-size: 28rpx;
color: #333333;
margin: 0 5rpx;
}
.disableSelect {
opacity: 0.4;
}
.item .icon {
display: block;
}
.item .icon .arc {
width: 100%;
height: 100%;
border: 2rpx solid #979797;
border-radius: 100%;
box-sizing: border-box;
}
.nothing {
padding: 100rpx;
text-align: center;
color: #999;
}
.childbox {
width: 100%;
display: flex;
flex-direction: column;
}
.childbox .item {
border-top: none;
padding-top: 0;
padding-right: 0;
}
.goodsChild {
display: flex;
flex-wrap: wrap;
flex-direction: column;
}
.goodsItem {
box-sizing: border-box;
padding: 24rpx 24rpx 24rpx 48rpx;
/* width: 558rpx; */
width: 100%;
/* height: 208rpx; */
background: #F7F7F7;
border-radius: 4rpx;
display: flex;
flex-wrap: wrap;
/* flex-direction: column; */
justify-content: space-between;
align-items: center;
}
.goodsItem .goodsListName {
position: relative;
max-width: 60%;
word-wrap: break-word;
}
.goodsItem .goodsListName::before {
content: '';
position: absolute;
left: -24rpx;
top: 50%;
transform: (0, -50%);
border-radius: 6rpx;
width: 12rpx;
height: 12rpx;
background: #347BFF;
}
\ No newline at end of file \ No newline at end of file
var replaceItemText = function (item) {
var reg = getRegExp(';~;', 'g')
return item?item.replace(reg, ' '):''
}
/*
* 导出
*/
module.exports = {
replaceItemText: replaceItemText
}
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
value="{{outTradeNo}}" value="{{outTradeNo}}"
placeholder="输入交易流水号" placeholder="输入交易流水号"
placeholder-class="outTradeNo_placeholder" placeholder-class="outTradeNo_placeholder"
maxlength="100" /> maxlength="150" />
</view> </view>
</view> </view>
<view class="upload-content"> <view class="upload-content">
......
...@@ -306,7 +306,7 @@ Component({ ...@@ -306,7 +306,7 @@ Component({
}) })
}, },
btnTap(e) { btnTap(e) {
console.log(e) // console.log(e)
let { name } = e.detail let { name } = e.detail
// let { attrtype, attrname, typename } = this.data.tableObj // let { attrtype, attrname, typename } = this.data.tableObj
let { showError, insuranceCheck, orderInfo } = this.data let { showError, insuranceCheck, orderInfo } = this.data
......
...@@ -4,6 +4,7 @@ import data from '../constant/stepData' ...@@ -4,6 +4,7 @@ import data from '../constant/stepData'
import { import {
priceCounter priceCounter
} from '~/packageEquity/api' } from '~/packageEquity/api'
import NP from 'number-precision'
const defaultLabelWidth = 'var(--fontSize140)' const defaultLabelWidth = 'var(--fontSize140)'
Component({ Component({
options: { options: {
...@@ -20,16 +21,16 @@ Component({ ...@@ -20,16 +21,16 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
pageLifetimes: { pageLifetimes: {
show: function () {}, show: function () { },
attached: function () { attached: function () {
// 在组件实例进入页面节点树时执行 // 在组件实例进入页面节点树时执行
}, },
hide: function () {} hide: function () { }
}, },
properties: { properties: {
serviceInfo: { serviceInfo: {
type: Object, type: Object,
value: () => {} value: () => { }
}, },
orderInfo: { orderInfo: {
type: Object, type: Object,
...@@ -49,7 +50,7 @@ Component({ ...@@ -49,7 +50,7 @@ Component({
}, },
quotationGoodsList: { quotationGoodsList: {
type: Array, type: Array,
value: () => {} value: () => { }
} }
}, },
observers: { observers: {
...@@ -142,8 +143,45 @@ Component({ ...@@ -142,8 +143,45 @@ Component({
} = e.currentTarget.dataset } = e.currentTarget.dataset
console.log(item, 'item'); console.log(item, 'item');
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
let target = `orderInfo.vdQuotationGoodsList[${index}].price` let target = `orderInfo.vdQuotationGoodsList[${index}].goods.price`
// value = value || 0
// let [number, decimal] = value.split('.')
// if (decimal != undefined) {
// decimal = decimal.substring(0, 2)
// number += `.${decimal}`
// }
// console.log(item.shopMinPrice||0,'item?.shopMinPrice||0');
console.log(value, 'value');
let number = wx.$util.removeLeadingZerosAndEnsureNonNegative(value)
thisPage.setData({
[target]: number
})
// if (item.goods?.validMinSellPrice == 'Y' && (item.goods.minSellPrice || 0) > number) {
// thisPage.setData({
// [target]: item.goods.minSellPrice
// })
// wx.$util.showToast('价格不可低于商品最低价')
// }
this.setGoodsListTotal()
},
changePricePackage(e) {
let {
value
} = e.detail
let {
index,
item,
childind
} = e.currentTarget.dataset
// console.log(item, 'item');
let thisPage = wx.$router.getPageInstance()
let { orderInfo: { vdQuotationGoodsList } } = thisPage.data
// console.log(childind, 'childind');
// console.log(thisPage.data.orderInfo.vdQuotationGoodsList[index].packageGoods.goodsList[childind], 'orderInfo.vdQuotationGoodsList[${index}].packageGoods[${childind}]');
let target = `orderInfo.vdQuotationGoodsList[${index}].packageGoods.goodsList[${childind}].price`
let packagePriceStr = `orderInfo.vdQuotationGoodsList[${index}].price`
// value = value || 0
// let [number, decimal] = value.split('.') // let [number, decimal] = value.split('.')
// if (decimal != undefined) { // if (decimal != undefined) {
// decimal = decimal.substring(0, 2) // decimal = decimal.substring(0, 2)
...@@ -154,9 +192,37 @@ Component({ ...@@ -154,9 +192,37 @@ Component({
// wx.$util.showToast('单价不可低于商品最低价') // wx.$util.showToast('单价不可低于商品最低价')
// } // }
let number = wx.$util.removeLeadingZerosAndEnsureNonNegative(value) let number = wx.$util.removeLeadingZerosAndEnsureNonNegative(value)
let minSellPric = parseInt(vdQuotationGoodsList[index].packageGoods.goodsList[childind].minSellPric || 0)
// console.log((minSellPric || 0) > number);
// if ((minSellPric || 0) > number) {
// number = minSellPric
// wx.$util.showToast('价格不可低于商品最低价')
// }
vdQuotationGoodsList[index].packageGoods.goodsList[childind].price = number
let packagePrice = vdQuotationGoodsList[index].packageGoods.goodsList.reduce((num, item) => {
// num = num + parseFloat(item.price || 0)
num = NP.plus(num, parseFloat(item.price || 0))
// num = num + parseFloat(item.price || 0)
return num
}, 0)
// console.log(packagePrice);
thisPage.setData({ thisPage.setData({
[target]: number [target]: number,
[packagePriceStr]: packagePrice
}) })
// if (item.packageGoods?.goodsList[childind]?.validMinSellPrice == 'Y' && (item.packageGoods.goodsList[childind].minSellPrice || 0) > number) {
// wx.$util.showToast('价格不可低于商品最低价')
// thisPage.setData({
// [target]: item.packageGoods.goodsList[childind].minSellPrice
// })
// packagePrice = thisPage.data.orderInfo?.vdQuotationGoodsList[index].packageGoods.goodsList.reduce((num, item) => {
// num = num + parseFloat(item.price || 0)
// return num
// }, 0)
// thisPage.setData({
// [packagePriceStr]: packagePrice
// })
// }
this.setGoodsListTotal() this.setGoodsListTotal()
}, },
delGoodsList(e) { delGoodsList(e) {
...@@ -182,8 +248,21 @@ Component({ ...@@ -182,8 +248,21 @@ Component({
} = thisPage.data } = thisPage.data
// console.log(orderInfo,'orderInfo'); // console.log(orderInfo,'orderInfo');
let total = 0 let total = 0
orderInfo.vdQuotationGoodsList.map(i => (total += parseFloat(i.count || 1) * parseFloat(i.price))) orderInfo.vdQuotationGoodsList.map(i => {
// console.log(total,'total'); if (i.goods) {
// total += parseFloat(i.goods.count || 1) * parseFloat(i.goods.price)
total = NP.plus(total, NP.times(parseFloat(i.goods.count || 1), parseFloat(i.goods.price)))
}
if (i.packageGoods) {
console.log(i.packageGoods, 'i.packageGoods');
i.packageGoods.goodsList.map(ele => {
// total += parseFloat(ele.count || 1) * parseFloat(ele.price)
total = NP.plus(total, NP.times(parseFloat(ele.count || 1), parseFloat(ele.price)))
})
}
})
console.log(total, 'total');
thisPage.setData({ thisPage.setData({
['orderInfo.total']: wx.$util.decimal(total, 2) ['orderInfo.total']: wx.$util.decimal(total, 2)
}) })
...@@ -306,7 +385,7 @@ Component({ ...@@ -306,7 +385,7 @@ Component({
}) })
} }
}) })
.catch(err => {}) .catch(err => { })
}, },
//--------自定义方法---------- //--------自定义方法----------
// 选择年份的区域,弹出弹窗框 // 选择年份的区域,弹出弹窗框
...@@ -429,7 +508,7 @@ Component({ ...@@ -429,7 +508,7 @@ Component({
}) })
}, },
btnTap(e) { btnTap(e) {
console.log(e) // console.log(e)
let { let {
name name
} = e.detail } = e.detail
...@@ -441,7 +520,28 @@ Component({ ...@@ -441,7 +520,28 @@ Component({
orderInfo orderInfo
} = this.data } = this.data
if (showError) return wx.$util.showToast('权益价不能小于最低权益价') if (showError) return wx.$util.showToast('权益价不能小于最低权益价')
// 校验商品最低价
let goodsError = []
orderInfo?.vdQuotationGoodsList?.forEach(val => {
if (val.goods) {
val.goods.checkError = false
if (val.goods?.price < val.goods.minSellPrice && val.goods?.validMinSellPrice == 'Y') {
val.goods.checkError = true
goodsError.push(val.goods)
}
}
if (val.packageGoods) {
val.packageGoods?.goodsList.forEach(subV => {
subV.checkError = false
if (subV?.price < subV?.minSellPrice && subV?.validMinSellPrice == 'Y') {
subV.checkError = true
goodsError.push(val.goods)
}
})
}
})
this.setData({ orderInfo })
if (goodsError?.length) return wx.$util.showToast('价格不可低于商品最低价')
if (name == 'confirm') { if (name == 'confirm') {
// 不是修改报价时,需要勾选保险 // 不是修改报价时,需要勾选保险
// if (!insuranceCheck && !orderInfo.modifyEquityQuotation) return wx.$util.showToast('请先勾选保险') // if (!insuranceCheck && !orderInfo.modifyEquityQuotation) return wx.$util.showToast('请先勾选保险')
......
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
"van-collapse-item": "@vant/weapp/collapse-item/index", "van-collapse-item": "@vant/weapp/collapse-item/index",
"van-checkbox": "@vant/weapp/checkbox/index", "van-checkbox": "@vant/weapp/checkbox/index",
"popup-input": "../PopupInput/PopupInput", "popup-input": "../PopupInput/PopupInput",
"goods": "../Goods/Goods" "goods": "../GoodsPackage/Goods"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
font-size: var(--fontSize28); font-size: var(--fontSize28);
} }
.remarkTitle{ .remarkTitle {
margin-top: var(--fontSize20); margin-top: var(--fontSize20);
} }
...@@ -146,8 +146,10 @@ ...@@ -146,8 +146,10 @@
border-radius: var(--fontSize12); border-radius: var(--fontSize12);
overflow: hidden; overflow: hidden;
margin: var(--fontSize16) 0; margin: var(--fontSize16) 0;
van-cell{
van-cell {
width: 100%; width: 100%;
.van-field__body { .van-field__body {
padding-left: var(--fontSize8); padding-left: var(--fontSize8);
font-size: var(--fontSize28); font-size: var(--fontSize28);
...@@ -270,10 +272,19 @@ ...@@ -270,10 +272,19 @@
padding: 0 var(--fontSize28) 0 var(--fontSize90); padding: 0 var(--fontSize28) 0 var(--fontSize90);
justify-content: space-between; justify-content: space-between;
font-size: var(--fontSize28); font-size: var(--fontSize28);
background: #F5F5F7;
position: relative; position: relative;
color: #222222; color: #222222;
} }
.goods .package {
background: #fff;
}
.goods.total-box{
background: #fff;
}
.goods .icon { .goods .icon {
position: absolute; position: absolute;
top: 50%; top: 50%;
...@@ -289,27 +300,31 @@ ...@@ -289,27 +300,31 @@
} }
.goods-box .goods .price-box { .goods-box .goods .price-box {
display: flex; width: var(--fontSize240);
align-items: center; height: var(--fontSize64);
justify-content: space-between; background: #FFFFFF;
max-width: calc(100% - var(--fontSize36)); border: var(--fontSize2) solid #E6E6E6;
min-width: var(--fontSize104); border-radius: var(--fontSize8);
position: relative;
margin-right: var(--fontSize32);
margin-left: auto;
} }
.goods-box .goods .price { .goods-box .goods .price-box text{
max-width: 80%; position: absolute;
min-width: var(--fontSize104); left: var(--fontSize16);
height: var(--fontSize44); top: 50%;
border: var(--fontSize2) solid #C3C3C3; font-size: var(--fontSize24);
border-radius: var(--fontSize8); transform: translateY(-50%);
} }
.goods-box .goods .price input { .goods-box .goods .price input {
box-sizing: border-box;
width: 100%; width: 100%;
height: 100%; height: var(--fontSize64);
text-align: center;
min-height: 100%; min-height: 100%;
font-size: var(--fontSize28); font-size: var(--fontSize28);
padding: 0 var(--fontSize16) 0 var(--fontSize50);
} }
.goods-box .goods .price input.error { .goods-box .goods .price input.error {
...@@ -386,16 +401,18 @@ ...@@ -386,16 +401,18 @@
color: #fff; color: #fff;
} }
.pay-type, .goodsCom { .pay-type,
.goodsCom {
.cell { .cell {
padding-left: var(--fontSize20)!important; padding-left: var(--fontSize20) !important;
} }
} }
.van-cell:after { .van-cell:after {
border: none!important; border: none !important;
} }
.only-select-text{
.only-select-text {
width: var(--fontSize300); width: var(--fontSize300);
height: var(--fontSize60); height: var(--fontSize60);
display: flex; display: flex;
...@@ -406,3 +423,49 @@ ...@@ -406,3 +423,49 @@
margin-right: calc(-1 * var(--fontSize30)); margin-right: calc(-1 * var(--fontSize30));
position: relative; position: relative;
} }
.deleteicon {
// position: absolute;
// top: 50%;
// left: 40rpx;
// transform: translateY(-50%);
width: var(--fontSize40);
height: var(--fontSize40);
margin-right: 10rpx;
}
.goods-box .packageList {
height: auto;
display: flex;
flex-direction: column;
padding: 0;
.package {
width: 100%;
display: flex;
align-items: center;
height: 104rpx;
.package-price {
margin-left: auto;
}
}
}
.packageBox {
box-sizing: border-box;
width: 630rpx;
// height: 104rpx;
background: #F5F5F7;
.itemSty {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 40rpx;
}
.itemSty:nth-child(n+2) {
border-top: var(--fontSize1) solid #EFF0F2;
}
}
\ No newline at end of file \ No newline at end of file
<!-- packageEquity/pages/carEquity/components/SecondStep/SecondStep.wxml --> <!-- packageEquity/pages/carEquity/components/SecondStep/SecondStep.wxml -->
<view class="testFormCon"> <view class="testFormCon">
<van-collapse value="{{ activeNames }}"> <van-collapse value="{{ activeNames }}">
<view class="collapse"> <view class="collapse">
<van-collapse-item name="3" is-link="{{ false }}"> <van-collapse-item name="3" is-link="{{ false }}">
<view slot="title"> <view slot="title">
...@@ -18,22 +17,45 @@ ...@@ -18,22 +17,45 @@
<block wx:if="{{ orderInfo.vdQuotationGoodsList.length > 0 }}"> <block wx:if="{{ orderInfo.vdQuotationGoodsList.length > 0 }}">
<view class="goods-box"> <view class="goods-box">
<block wx:for="{{ orderInfo.vdQuotationGoodsList }}" wx:key="index"> <block wx:for="{{ orderInfo.vdQuotationGoodsList }}" wx:key="index">
<view class="goods"> <view class="goods" wx:if="{{ item.goods }}">
<view class="icon" bindtap="delGoodsList" data-index="{{ index }}"> <view class="icon" bindtap="delGoodsList" data-index="{{ index }}">
<image src="./images/del.png" /> <image src="./images/del.png" />
</view> </view>
<view class="name text-hide"> <view class="name text-hide">
{{item.goodsName}} {{item.goods.goodsAlias || item.goods.upgradeGoodsName || item.goods.goodsName }}
<!-- {{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}} --> <!-- {{filter.replaceItemText(item.goods.goodsAlias) ||filter.replaceItemText(item.goods.upgradeGoodsName) || filter.replaceItemText(item.goods.goodsName)}} -->
</view> </view>
<view class="price-box"> <view class="price-box">
¥ <text>¥</text>
<view class="price"> <view class="price">
<input type="digit" value="{{ item.price }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.price < 0 ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed /> <input type="digit" value="{{ item.goods.price }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.checkError ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view> </view>
</view> </view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view>
</view> </view>
<!-- {{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}} -->
<view class="goods packageList" wx:if="{{ item.packageGoods }}">
<view class="package">
<view class="deleteicon" bindtap="delGoodsList" data-index="{{ index }}">
<image src="./images/del.png" />
</view>
<view class="name text-hide">{{item.packageGoods.packageName}}</view>
<view class="package-price">¥{{item.price}}</view>
<!-- <view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view> -->
</view>
<view class="packageBox">
<view class="itemSty" wx:for="{{ item.packageGoods.goodsList }}" wx:key="childind" wx:for-index="childind" wx:for-item="child">
<view class="name text-hide">{{child.goodsAlias || child.goodsNameAlias || child.upgradeGoodsName ||child.goodsName }}</view>
<view class="price-box">
<text>¥</text>
<view class="price">
<input type="digit" value="{{ child.price }}" bindinput="changePricePackage" disabled="{{ orderObj.selectPayType ==0 }}" data-childind="{{ childind }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ child.checkError ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{child.count||1}}</view>
</view>
</view>
</view>
</block> </block>
<view class="goods total-box"> <view class="goods total-box">
<view>总价</view> <view>总价</view>
...@@ -51,8 +73,8 @@ ...@@ -51,8 +73,8 @@
<view class="label">其他信息</view> <view class="label">其他信息</view>
</view> </view>
</view> </view>
<gl-cell wx:if="{{!orderInfo.outTradeNo || orderInfo.resetOrder}}" border class="pay-type" label="支付方式" valueAlign="right" labelWidth="var(--fontSize140)"> <gl-cell wx:if="{{ !orderInfo.outTradeNo || orderInfo.resetOrder }}" border class="pay-type" label="支付方式" valueAlign="right" labelWidth="var(--fontSize140)">
<view class="only-select-text" wx:if="{{orderInfo.resetOrder}}">门店收款</view> <view class="only-select-text" wx:if="{{ orderInfo.resetOrder }}">门店收款</view>
<view wx:else class="switch-box"> <view wx:else class="switch-box">
<view class="block text-center {{ orderInfo.payType==1?'':'right' }}" /> <view class="block text-center {{ orderInfo.payType==1?'':'right' }}" />
<view class="left text-center {{ orderInfo.payType == 1?'active':'' }}" bindtap="changePayType" data-payType="1">线上支付</view> <view class="left text-center {{ orderInfo.payType == 1?'active':'' }}" bindtap="changePayType" data-payType="1">线上支付</view>
...@@ -61,8 +83,7 @@ ...@@ -61,8 +83,7 @@
</gl-cell> </gl-cell>
<view class="box"> <view class="box">
<view class="title remarkTitle">备注</view> <view class="title remarkTitle">备注</view>
<van-field type="textarea" maxlength="30" autosize class="inputBox" border="{{ false }}" data-hold-keyboard value="{{ orderInfo.notes }}" data-attrName="notes" placeholder="请输入(30字以内)" data-attrType="" bindinput="handleInput"> <van-field type="textarea" maxlength="30" autosize class="inputBox" border="{{ false }}" data-hold-keyboard value="{{ orderInfo.notes }}" data-attrName="notes" placeholder="请输入(30字以内)" data-attrType="" bindinput="handleInput"></van-field>
</van-field>
</view> </view>
</van-collapse-item> </van-collapse-item>
</view> </view>
......
...@@ -8,7 +8,8 @@ const orderStatusObj = { ...@@ -8,7 +8,8 @@ const orderStatusObj = {
'5': '已完成', '5': '已完成',
'-1': '战败', '-1': '战败',
'9':'已撤销', '9':'已撤销',
'11':'已失效' '11':'已失效',
'6': '已退款'
} }
const orderStatusList = [{ const orderStatusList = [{
confName: '待报价', confName: '待报价',
......
...@@ -220,7 +220,7 @@ Component({ ...@@ -220,7 +220,7 @@ Component({
this.setData({ this.setData({
statisticsObj: data statisticsObj: data
}) })
console.log(this.data.statisticsObj) // console.log(this.data.statisticsObj)
} else { } else {
wx.$util.showToast(message || '接口异常') wx.$util.showToast(message || '接口异常')
} }
...@@ -464,7 +464,7 @@ Component({ ...@@ -464,7 +464,7 @@ Component({
// 'waitCheck' // 'waitCheck'
labelList.splice(2, 0, 'waitCheck') labelList.splice(2, 0, 'waitCheck')
} }
console.log(labelList, 'labelList'); // console.log(labelList, 'labelList');
labelList.map((item, index) => { labelList.map((item, index) => {
tabList[index] = { tabList[index] = {
text: mode ? tabListTemplateSimple[index] : tabListTemplate[index], text: mode ? tabListTemplateSimple[index] : tabListTemplate[index],
......
...@@ -72,17 +72,18 @@ ...@@ -72,17 +72,18 @@
{{item.customerName}} {{item.customerName}}
<image wx:if="{{item.ownerGender}}" class="icon-sex" src="{{item.ownerGender == '男' ? '../../../images/icon-man.png' : '../../../images/icon-woman.png'}}" /> <image wx:if="{{item.ownerGender}}" class="icon-sex" src="{{item.ownerGender == '男' ? '../../../images/icon-man.png' : '../../../images/icon-woman.png'}}" />
</view> </view>
<view wx:if="{{item.orderStatus == '3'||item.orderStatus =='5' || item.orderStatus == '-1' }}" data-item="{{item}}" bindtap="jumpUpdate" class="updateInfo "> <!-- 标记为已开票的 不可编辑客户信息 invoicing 2已开票 -->
<view wx:if="{{item.orderStatus == '3'||item.orderStatus =='5' || item.orderStatus == '-1'}}" data-item="{{item}}" bindtap="jumpUpdate" class="updateInfo {{item.orderStatus == '6' || item.invoicing == '2' ? 'isHide' : ''}}">
<image src="{{IMG_URL}}/miniProgram/edit_icon.png" class="iconImage"></image>客户信息 <image src="{{IMG_URL}}/miniProgram/edit_icon.png" class="iconImage"></image>客户信息
</view> </view>
<view class="header-status"> <view class="header-status">
<!-- 0待报价、1待确认、2待支付、3已支付、-1战败 5已完成(已签名)--> <!-- 0待报价、1待确认、2待支付、3已支付、-1战败 5已完成(已签名)6已退款 -->
<!-- == '3' --> <!-- == '3' -->
<view wx:if="{{ item.orderStatus == '3'||item.orderStatus =='5'}}"> <view wx:if="{{ item.orderStatus == '3'||item.orderStatus =='5'}}">
<span class="green-txt">{{orderStatusObj[item.orderStatus]}}</span> <span class="green-txt">{{orderStatusObj[item.orderStatus]}}</span>
<!-- <span class="header-price">¥ {{item.quotedPriceUpdate || ''}}</span> --> <!-- <span class="header-price">¥ {{item.quotedPriceUpdate || ''}}</span> -->
</view> </view>
<view wx:elif="{{ item.orderStatus == '9'||item.orderStatus =='11'}}"> <view wx:elif="{{ item.orderStatus == '9'||item.orderStatus =='11' || item.orderStatus == '6'}}">
<span class="grey-txt">{{orderStatusObj[item.orderStatus]}}</span> <span class="grey-txt">{{orderStatusObj[item.orderStatus]}}</span>
<!-- <span class="header-price">¥ {{item.quotedPriceUpdate || ''}}</span> --> <!-- <span class="header-price">¥ {{item.quotedPriceUpdate || ''}}</span> -->
</view> </view>
...@@ -117,9 +118,11 @@ ...@@ -117,9 +118,11 @@
</block> </block>
<view class="order" wx:else> <view class="order" wx:else>
<view class="order-label">{{i.label}}</view> <view class="order-label">{{i.label}}</view>
<view class="order-value"> <view class="order-value ">
<view class="text-hide {{i.canCopy&&item[i.key]? 'text-hideWidth' : '' }}">
<block wx:if="{{i.mapValue}}">{{i.mapValue[item[i.key]] || ''}}</block> <block wx:if="{{i.mapValue}}">{{i.mapValue[item[i.key]] || ''}}</block>
<block wx:else>{{item[i.key]|| item[i.otherKey]|| ''}}</block> <block wx:else>{{item[i.key]|| item[i.otherKey]|| ''}}</block>
</view>
<image wx:if="{{i.canCopy&&item[i.key]}}" catch:tap="toCopyNumber" data-ordernum="{{item[i.key]}}" class="copy_icon" src="../../../images/copy_name.png" /> <image wx:if="{{i.canCopy&&item[i.key]}}" catch:tap="toCopyNumber" data-ordernum="{{item[i.key]}}" class="copy_icon" src="../../../images/copy_name.png" />
</view> </view>
</view> </view>
...@@ -163,7 +166,7 @@ ...@@ -163,7 +166,7 @@
<view wx:if="{{item.orderStatus == '-1' || item.orderStatus == '0'}}" class="order-btn" bindtap="handleClickBtn" data-target="{{item}}"> <view wx:if="{{item.orderStatus == '-1' || item.orderStatus == '0'}}" class="order-btn" bindtap="handleClickBtn" data-target="{{item}}">
{{btnTxt[item.orderStatus]}} {{btnTxt[item.orderStatus]}}
</view> </view>
<block wx:else> <block wx:elif="{{item.orderStatus != 6}}">
<block wx:if="{{item.orderStatus == '2' || item.orderStatus == '3' || item.orderStatus == '5'}}"> <block wx:if="{{item.orderStatus == '2' || item.orderStatus == '3' || item.orderStatus == '5'}}">
<view wx:if="{{item.orderStatus == '2'}}" class="order-btn default-btn padding_20" bindtap="handleClickBtn" data-target="{{item}}">战败</view> <view wx:if="{{item.orderStatus == '2'}}" class="order-btn default-btn padding_20" bindtap="handleClickBtn" data-target="{{item}}">战败</view>
<view wx:if="{{item.orderStatus == '2'}}" class="order-btn padding_20" bindtap="handleClickBtn" data-target="{{item}}" data-type="pay"> <view wx:if="{{item.orderStatus == '2'}}" class="order-btn padding_20" bindtap="handleClickBtn" data-target="{{item}}" data-type="pay">
...@@ -240,11 +243,7 @@ ...@@ -240,11 +243,7 @@
</block> </block>
</view> </view>
<remark-popup wx:if="{{showRemark}}" title="战败原因" show="{{showRemark}}" required="{{true}}" bindcancel="remarkCancel" bindconfirm="remarkConfirm" placeholder="请填写战败原因" maxlength="15" value="{{sufferReason}}" /> <remark-popup wx:if="{{showRemark}}" title="战败原因" show="{{showRemark}}" required="{{true}}" bindcancel="remarkCancel" bindconfirm="remarkConfirm" placeholder="请填写战败原因" maxlength="15" value="{{sufferReason}}" />
<modal <modal id="modal" class="modal" custom='true' btns="{{['返回','确定']}}">
id="modal"
class="modal"
custom='true'
btns="{{['返回','确定']}}">
<view class="modatcontent"> <view class="modatcontent">
<view class="orderCode"> <view class="orderCode">
<text class="code">订单编号:</text> <text class="code">订单编号:</text>
......
...@@ -682,6 +682,10 @@ ...@@ -682,6 +682,10 @@
margin-right: auto; margin-right: auto;
} }
.updateInfo.isHide {
display: none;
}
.iconImage { .iconImage {
width: var(--fontSize32); width: var(--fontSize32);
height: var(--fontSize32); height: var(--fontSize32);
...@@ -775,8 +779,19 @@ ...@@ -775,8 +779,19 @@
.modal .color { .modal .color {
color: #347BFF; color: #347BFF;
} }
.copy_icon{
.copy_icon {
width: var(--fontSize28); width: var(--fontSize28);
height: var(--fontSize28); height: var(--fontSize28);
margin-left: var(--fontSize12); margin-left: var(--fontSize12);
} }
/* .copy_icon {
width: 28rpx;
height: 28rpx;
margin-left: 12rpx;
} */
.text-hideWidth {
width: calc(100% - 36rpx);
}
\ No newline at end of file \ No newline at end of file
...@@ -3,9 +3,11 @@ const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-w ...@@ -3,9 +3,11 @@ const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-w
// import api from '~/packageCrowdFunding/api' // import api from '~/packageCrowdFunding/api'
import NP from 'number-precision' import NP from 'number-precision'
import { getBusinessSchoolScene } from '~/store/index' import { getBusinessSchoolScene } from '~/store/index'
import { getQuotationStatistics, outputValueStatistics, quotationPage, updateOrderStatus, merchantMode } from '../../api' import { getQuotationStatistics, outputValueStatistics, quotationPage, updateOrderStatus, merchantMode, orderStaffValid } from '../../api'
import commonApi from '~/api/api' import commonApi from '~/api/api'
const app = getApp() const app = getApp()
import carLifeApi from '../../carEquityApi'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -86,10 +88,11 @@ Component({ ...@@ -86,10 +88,11 @@ Component({
icon: 'icon_7' icon: 'icon_7'
} }
], ],
menuList: [ menuList: [{
menuText: '培训资料',
icon: 'peixun_icon',
], path: 'packageEquity.trainingMaterials'
}],
loginRoleLabel: { loginRoleLabel: {
1: '超管', 1: '超管',
2: '商户管理员', 2: '商户管理员',
...@@ -123,23 +126,19 @@ Component({ ...@@ -123,23 +126,19 @@ Component({
// let issta // let issta
let { menuList } = this.data let { menuList } = this.data
if (isStaff && menuList.every(item => item.menuText != '新建工单')) { if (isStaff && menuList.every(item => item.menuText != '新建工单')) {
menuList.unshift( menuList.unshift({
{
menuText: '新建工单', menuText: '新建工单',
icon: 'create_order', icon: 'create_order',
path: '' path: ''
} })
)
} }
if ((isStaff || userInfo.isSuper) && menuList.every(item => item.menuText != '驻店日报')) { if ((isStaff || userInfo.isSuper) && menuList.every(item => item.menuText != '驻店日报')) {
menuList.unshift( menuList.unshift({
{
menuText: '驻店日报', menuText: '驻店日报',
path: 'tabWorkOrder.staffDaily', path: 'tabWorkOrder.staffDaily',
recordId: 13, recordId: 13,
icon: 'supplementary_order' icon: 'supplementary_order'
} })
)
} }
getBusinessSchoolScene({}).then(res => { getBusinessSchoolScene({}).then(res => {
...@@ -159,22 +158,78 @@ Component({ ...@@ -159,22 +158,78 @@ Component({
this.getData() this.getData()
this.getTotal(this.data.dataActive) this.getTotal(this.data.dataActive)
this.getYqStoreConfig() this.getYqStoreConfig()
// 根据手机号查询工牌设备号
this.getInspectionBadgeCode()
// 获取驻店员工目标 // 获取驻店员工目标
if (isStaff) this.getStaffTargetTask() if (isStaff) this.getStaffTargetTask()
this.checkStaffOrderStatus()
},
checkStaffOrderStatus() {
let dateStaffPop = wx.$storage.get('dateStaffPop')
let nowDate = new Date().format('yyyy-MM-dd')
// let num = 0
// 当天已查询过
if (dateStaffPop?.date && nowDate == dateStaffPop?.date) {
// num = dateStaffPop?.num || 0
// num = num + 1
// num = 1
return
}
let userInfo = wx.$util.getUserInfo()
orderStaffValid({ sceneType: userInfo.sceneType })
.then(result => {
console.log(result, 'orderStaffValid')
if (result.data) {
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOREPORT_MODAL = true
wx.showModal({
title: '开单预警',
content: '您已超过三天未开单',
showCancel: false,
// cancelText: '取消', // '取消
cancelColor: '#292D33',
confirmText: '确定',
confirmColor: '#347BFF',
success(res) {
// if (res.confirm) {
// wx.$router.go('tabWorkOrder.staffDaily', {
// reportDate: hasNeedReport.date
// })
// }
},
complete: () => {
// 这个延迟的目的是为了避免短时间内重复弹出
// 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
setTimeout(() => {
wx.__HAS_NOREPORT_MODAL = false
}, 2000)
}
})
wx.$storage.set('dateStaffPop', {
date: new Date().format('yyyy-MM-dd')
// num
})
}
})
.catch(err => { })
}, },
getStaffTargetTask() { getStaffTargetTask() {
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
let { menuList } = this.data let { menuList } = this.data
commonApi.getStaffTargetTaskApi({ commonApi
.getStaffTargetTaskApi({
sceneType: 0, sceneType: 0,
merchantId: userInfo?.default4SStoreInfo?.merchantId merchantId: userInfo?.default4SStoreInfo?.merchantId
}).then(res => { })
.then(res => {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
// 切换门店 需删除入口 重新请求判断显示入口 // 切换门店 需删除入口 重新请求判断显示入口
let index = menuList.findIndex(v => v.menuText == '驻店目标') let index = menuList.findIndex(v => v.menuText == '驻店目标')
if (index > -1) menuList.splice(index, 1) if (index > -1) menuList.splice(index, 1)
if ((data?.length) && menuList.every(item => item.name != '驻店目标')) { if (data?.length && menuList.every(item => item.name != '驻店目标')) {
menuList.push({ menuList.push({
menuText: '驻店目标', menuText: '驻店目标',
path: 'packageEquity.residentTarget', path: 'packageEquity.residentTarget',
...@@ -193,8 +248,7 @@ Component({ ...@@ -193,8 +248,7 @@ Component({
taskInfo: data[0] taskInfo: data[0]
}) })
// 将当前周期的员工目标任务弹窗标记为已弹起 // 将当前周期的员工目标任务弹窗标记为已弹起
commonApi.setTaskDialog({ id: data[0]?.id }).then(() => { commonApi.setTaskDialog({ id: data[0]?.id }).then(() => { })
})
} }
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
...@@ -225,7 +279,7 @@ Component({ ...@@ -225,7 +279,7 @@ Component({
this.setData({ this.setData({
statisticsObj: data statisticsObj: data
}) })
console.log(this.data.statisticsObj) // console.log(this.data.statisticsObj)
} else { } else {
wx.$util.showToast(message || '接口异常') wx.$util.showToast(message || '接口异常')
} }
...@@ -260,6 +314,7 @@ Component({ ...@@ -260,6 +314,7 @@ Component({
data.avgPrice = NP.divide(data.avgPrice, 100) data.avgPrice = NP.divide(data.avgPrice, 100)
data.avgPrice = NP.round(data.avgPrice, 0) data.avgPrice = NP.round(data.avgPrice, 0)
data.totalOutputValue = NP.round(data.totalOutputValue, 0) data.totalOutputValue = NP.round(data.totalOutputValue, 0)
data.avgQuotationPrice = NP.round(data.avgQuotationPrice, 0)
this.setData({ this.setData({
staticData: data || {} staticData: data || {}
}) })
...@@ -297,9 +352,14 @@ Component({ ...@@ -297,9 +352,14 @@ Component({
let { item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
if (item.path) { if (item.path) {
if (item.menuText == '驻店目标') { if (item.menuText == '驻店目标') {
return wx.$router.go(item.path, { id: taskId }) return wx.$router.go(item.path, {
id: taskId
})
} else { } else {
return wx.$router.go(item.path, { scene: 0 }) return wx.$router.go(item.path, {
scene: 0,
params: item.params || {}
})
} }
} else { } else {
// 工资绩效特殊处理 // 工资绩效特殊处理
...@@ -365,6 +425,29 @@ Component({ ...@@ -365,6 +425,29 @@ Component({
[`menuList[${index}].tipsNum`]: data [`menuList[${index}].tipsNum`]: data
}) })
} }
},
/**根据手机号查询工牌设备号 */
async getInspectionBadgeCode() {
const { phone } = wx.$util.getUserInfo(),
{ menuList } = this.data,
{ data } = await carLifeApi.getInspectionBadgeCode({
phone
}),
index = menuList.findIndex(e => e.menuText == '话术质检')
if (data && index == -1)
menuList.push({
menuText: '话术质检',
icon: 'ai_inspection',
path: 'packageEquity.aiInspection',
default: true,
params: {
badgeId: data
}
})
if (!data && index != -1) menuList.splice(index, 1)
this.setData({
menuList
})
} }
} }
}) })
import api from '~/utils/request/request.js'
// const api = wx.$request
module.exports = {
/** 内容列表 */
materialListApi(data) {
let params = data || {}
return api.post('dj.api.smartcarlife.material.list', params)
},
/**进入页面增埋点 */
enterPageTrack(data) {
let params = data || {}
return api.post('dj.api.customer.dynamic.record.add', params)
},
/**退出页面增埋点 */
leavePageTrack(data) {
let params = data || {}
return api.post('dj.api.customer.dynamic.record.leave', params)
},
}
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
import { enterPageTrack } from "../../api/api"
Component({
properties: {
listItem: Object,
noResult: Boolean,
isMaxScreen:Boolean
},
data: {
templateInfo: {
IMG_URL,
}
},
methods: {
toDetail(e) {
console.log(e);
const { item, type } = e.currentTarget.dataset;
let url = '', tempArr = []
if (item.materialDetailInfoList && item.materialDetailInfoList.length) {
item.materialDetailInfoList.forEach(el => {
tempArr.push(el.image)
})
}
if (type == 'PDF') {
this.openPDF(tempArr[0],item)
return
}
url = JSON.stringify(tempArr)
wx.setStorageSync('pageQueryOfcontent', url);
let pageUrl = `/packageEquity/pages/trainingMaterials/pages/playVideo/index`
let target = pageUrl + `?type=${type}&title=${item.title}&id=${item.id}`
wx.navigateTo({
url: target
});
},
// 打开PDF
openPDF(url,item) {
wx.showLoading()
this.openPdf = false
let _this = this
wx.downloadFile({
url: url,
success: function (res) {
const manage = wx.getFileSystemManager()
let fileName = item.title
manage.saveFile({
tempFilePath: res.tempFilePath,
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
success: function (res) {
wx.openDocument({
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
fileType: 'pdf',
showMenu: false,
success: function (res) {
wx.hideLoading();
_this.openPdf = true
_this.toAddTrack(item.id)
}
})
}
})
},
fail() {
wx.hideLoading();
}
})
},
toAddTrack(id) {
const userInfo = wx.$util.getUserInfo()
const params = {
goodsId: id,
goodsType: 0,
merchantId: userInfo.default4SStoreInfo.merchantId,
merchantName: userInfo.default4SStoreInfo.merchantName
}
enterPageTrack(params).then(res => {
// this.trackId = res.data
wx.setStorageSync('pageQueryOfcontent_trackId', res.data);
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
.list-item-container {
width: 100%;
box-sizing: border-box;
padding: 0 var(--fontSize20);
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
// columns: 2;
// column-gap: 22rpx;
}
.list-item-container .left, .list-item-container .right {
display: inline-block;
vertical-align: top;
width: calc(50% - var(--fontSize10));
padding-top: var(--fontSize20);
}
.element {
width: 100%;
background: #FFFFFF;
border-radius: var(--fontSize16);
margin-bottom: var(--fontSize20);
padding-bottom: var(--fontSize20);
.cover{
height: var(--fontSize344);
background: #FFFFFF;
border-radius: var(--fontSize16);
position: relative;
.icon{
width: 100%;
height: var(--fontSize344);
}
.play-icon{
width: var(--fontSize48);
height: var(--fontSize48);
position: absolute;
left: var(--fontSize16);
bottom: var(--fontSize16);
}
.cover_icon{
height: var(--fontSize344);
border-radius: var(--fontSize16) var(--fontSize16) 0 0;
}
}
.title{
width: var(--fontSize344);
box-sizing: border-box;
padding: 0 var(--fontSize18);
font-weight: 400;
font-size: var(--fontSize28);
color: #292D33;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-top: var(--fontSize20);
margin-bottom: var(--fontSize16)
}
.footer{
box-sizing: border-box;
padding: 0 var(--fontSize18);
.view-box{
.icon{
width: var(--fontSize32);
height: var(--fontSize32);
margin-right: var(--fontSize8);
}
.text{
font-weight: 400;
font-size: var(--fontSize24);
color: #5A5E66;
}
}
.date-box{
font-weight: 400;
font-size: var(--fontSize20);
color: #5A5E66;
}
}
}
.flex_cc{
display: flex;
align-items: center;
justify-content: center;
}
.flex_scb{
display: flex;
align-items: center;
justify-content: space-between;
}
.no_data{
font-weight: 400;
font-size: var(--fontSize28);
color: #999;
text-align: center;
width: 100%;
padding-top: var(--fontSize220);
display: flex;
flex-direction: column;
align-items: center;
.no_icon{
width: var(--fontSize160);
height: var(--fontSize160);
}
}
// 平板
.maxScreen-container{
display: flex;
justify-content: center;
padding: 0 var(--fontSizeContent10);
.inner{
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
padding-top: var(--fontSize12);
}
.element{
box-sizing: border-box;
width: var(--fontSizeContent162);
margin: 0 var(--fontSizeContent6) var(--fontSizeContent12);
border-radius: var(--fontSizeContent8);
.cover{
height: var(--fontSizeContent162);
background: #FFFFFF;
position: relative;
.icon,.cover_icon{
width: var(--fontSizeContent162);
height: var(--fontSizeContent162);
border-radius: var(--fontSizeContent8) var(--fontSizeContent8) 0 0;
}
.max-play-icon{
width: var(--fontSizeContent53);
height: var(--fontSizeContent53);
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%)
}
}
.title{
width: var(--fontSizeContent162);
height: var(--fontSizeContent40);
box-sizing: border-box;
padding: 0 var(--fontSizeContent9);
font-weight: 400;
font-size: var(--fontSizeContent14);
color: #292D33;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-top: var(--fontSizeContent10);
margin-bottom: var(--fontSizeContent8)
}
.footer{
box-sizing: border-box;
padding: 0 var(--fontSizeContent9);
.view-box{
.icon{
width: var(--fontSizeContent16);
height: var(--fontSizeContent16);
margin-right: var(--fontSizeContent4);
}
.text{
font-weight: 400;
font-size: var(--fontSizeContent12);
color: #5A5E66;
}
}
.date-box{
font-weight: 400;
font-size: var(--fontSizeContent10);
color: #5A5E66;
}
}
}
.no_data{
font-weight: 400;
font-size: var(--fontSizeContent14);
color: #999;
text-align: center;
width: 100%;
padding-top: var(--fontSizeContent110);
display: flex;
flex-direction: column;
align-items: center;
.no_icon{
width: var(--fontSizeContent80);
height: var(--fontSizeContent80);
}
}
}
.flex-sc-pannel{
display: flex;
justify-content: flex-start;
}
<view class="list-item-container {{isMaxScreen?'maxScreen-container':''}} {{isMaxScreen&&listItem.list.length<6?'flex-sc-pannel':''}}">
<block wx:if="{{!onResult&&!isMaxScreen}}">
<view class="left">
<block wx:for="{{listItem.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="item">
<template is="item" data="{{item,...templateInfo,listItem,isMaxScreen}}" wx:if="{{idx%2==0}}" />
</block>
</view>
<view class="right">
<block wx:for="{{listItem.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="item">
<template is="item" data="{{item,...templateInfo,listItem,isMaxScreen}}" wx:if="{{idx%2==1}}" />
</block>
</view>
</block>
<block wx:elif="{{!onResult&&isMaxScreen}}">
<view class="inner">
<block wx:for="{{listItem.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="item">
<template is="item" data="{{item,...templateInfo,listItem,isMaxScreen}}" />
</block>
</view>
</block>
<block wx:if="{{noResult}}">
<view class="no_data">
<image class="no_icon" src="/packageEquity/images/noData.png" />
<text>暂无数据</text>
</view>
</block>
<template name="item">
<view bind:tap="toDetail" data-item="{{item}}" data-type="{{listItem.name}}" class="element">
<view class="cover flex_cc">
<image wx:if="{{!item.cover}}" class="icon" src="{{IMG_URL}}peixun/{{listItem.icon}}.png?v=2" />
<image wx:if="{{item.cover}}" mode="aspectFill" class="cover_icon" src="{{item.cover}}" />
<image wx:if="{{listItem.name=='video'}}" class="{{isMaxScreen?'max-':''}}play-icon" src="{{IMG_URL}}peixun/play_icon.png" />
</view>
<view class="title two-text">{{item.title}}</view>
<view class="footer flex_scb">
<view class="view-box flex_cc">
<view class="icon">
<image src="{{IMG_URL}}peixun/eye_icon.png" />
</view>
<view class="text">{{item.views || 0}}人</view>
</view>
<view class="date-box">{{item.createdDate}}</view>
</view>
</view>
</template>
</view>
\ No newline at end of file \ No newline at end of file
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
import { materialListApi,leavePageTrack } from "../../api/api"
let currentTabType = 'video';
Component({
properties: {
navBarHeight: Number
},
data: {
IMG_URL,
userInfo: {},
menuList: [{
title: '视频',
name: 'video',
icon: 'default_video',
list: []
}, {
title: 'PDF',
name: 'PDF',
icon: 'default_pdf',
list: []
}, {
title: '图片',
name: 'image',
icon: 'default_img',
list: []
}],
searchKey: '',
showPage: false,
noResult: false,
isNeedFixed: false
},
methods: {
async onLoad() {
this.pdfPageTrack()
setTimeout(async () => {
this.setData({
showPage: true,
userInfo: wx.$util.getUserInfo() || {}
})
// await this.getScroviewHeight()
this.getListData()
}, 300);
this.intaval = setInterval(() => {
this.selectComponent('#tabID').resize();
}, 500);
},
onChangeTab(e) {
currentTabType = e.detail.name
this.initData()
},
async getScroviewHeight() {
let query = wx.createSelectorQuery().in(this)
let heightArr = []
let s = 0, navBarHeight = this.data.navBarHeight
query
.selectAll('.scroll_height_d_part')
.boundingClientRect(react => {
react.forEach(item => {
s += item.height
heightArr.push(s)
})
const last = heightArr.pop()
let systemInfo = wx.getSystemInfoSync()
const scroll_height = systemInfo.safeArea.height - last - navBarHeight
this.setData({
scroll_height
})
})
.exec()
},
getListData() {
const userInfo = wx.$util.getUserInfo()
// 登录信息映射值: 0 会员权益升级 1 精品升级 3 售后众筹 ,2次新车转化
// 0-图片;1-视频;2-pdf;
const newType = currentTabType == 'video' ? 1 : currentTabType == 'PDF' ? 2 : 0
let { searchKey, noResult } = this.data
let params = {
merchantId: userInfo.default4SStoreInfo.merchantId,
scene: userInfo.sceneType,
showChannel: 1,
type: newType,
title: searchKey,
sortedBy: 1
}
let list = [], listNameMap = {
0: 'menuList[2].list',
1: 'menuList[0].list',
2: 'menuList[1].list',
}
const target = listNameMap[newType]
this.currentTarget = target
materialListApi(params).then(res => {
if (res && res.data) {
res.data.forEach(el => {
if (el.createdDate) el.createdDate = new Date(el.createdDate).format('yyyy-MM-dd')
})
}
list = res.data || []
noResult = list.length ? false : true
this.setData({
[target]: list,
noResult
})
})
},
onChangeSearch(e) {
},
onSearch(e) {
this.setData({
searchKey: e.detail
}, () => {
this.getListData()
})
},
onCancel(e) {
this.onSearch(e)
},
initData() {
this.setData({
[this.currentTarget]: [],
searchKey: ''
}, () => {
this.getListData()
})
},
pdfPageTrack() {
const id = wx.getStorageSync('pageQueryOfcontent_trackId')
if (id) {
leavePageTrack({ id }).then(res => {
wx.removeStorageSync('pageQueryOfcontent_trackId');
})
}
},
onHide(){
clearInterval(this.intaval)
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-search": "@vant/weapp/search/index",
"list-item":"../ListItem/index"
}
}
\ No newline at end of file \ No newline at end of file
page {
background: #F7F8FA;
}
.min-screen-close{
display: none;
}
.pos-container {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
overflow-y: scroll;
}
.bg {
width: 100%;
height: 444rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/peixun/bg_banner.png');
background-size: 100% 100%;
background-color: #fff;
}
@media screen and (min-device-width: 600px) and (-webkit-min-device-pixel-ratio: 1) {
.max-screen-close{
display: none;
}
.max-screen-open{
display: block;
}
.max-bg {
width: 100%;
height: var(--fontSizeContent140);
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/peixun/max-banner.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.tab-class{
flex: 0 0 var(--fontSize120);
}
}
<view class="pos-container .max-screen-close">
<view class="bg scroll_height_d_part"></view>
<view wx:if="{{showPage}}" class="main">
<view class="main-box">
<van-tabs wrap-class="scroll_height_d_part" sticky bind:change="onChangeTab" border title-inactive-color="#5A5E66" title-active-color="#347BFF" color="#347BFF" active="video">
<van-search left-icon="/images/search.png" shape="round" bind:clear="onCancel" bind:change="onChangeSearch" bind:search="onSearch" class="scroll_height_d_part" value="{{ searchKey }}" placeholder="标题" />
<block wx:for="{{menuList}}" wx:key="index">
<van-tab title="{{item.title}}" name="{{item.name}}">
<view class="content-box">
<scroll-view style="height:calc(100vh - 180px - var(--fontSize300))" scroll-y class="list">
<list-item noResult="{{noResult}}" listItem="{{item}}"></list-item>
</scroll-view>
</view>
</van-tab>
</block>
</van-tabs>
</view>
</view>
</view>
<!-- 平板 -->
<view class="pos-container min-screen-close .max-screen-open">
<view class="" style="height:{{navBarHeight}}px;background:white"></view>
<view class="max-bg scroll_height_d_part"></view>
<view wx:if="{{showPage}}" class="main">
<view class="main-box">
<van-tabs id="tabID" line-width="34px" tab-class="tab-class" wrap-class="scroll_height_d_part" sticky bind:change="onChangeTab" border title-inactive-color="#5A5E66" title-active-color="#347BFF" color="#347BFF" active="video">
<van-search left-icon="/images/search.png" shape="round" bind:clear="onCancel" bind:change="onChangeSearch" bind:search="onSearch" class="scroll_height_d_part" value="{{ searchKey }}" placeholder="标题" />
<block wx:for="{{menuList}}" wx:key="index">
<van-tab title="{{item.title}}" name="{{item.name}}">
<view class="content-box">
<scroll-view style="height:calc(100vh - var(--fontSize300)) - {{navBarHeight}}px" scroll-y class="list">
<list-item noResult="{{noResult}}" isMaxScreen="{{true}}" listItem="{{item}}"></list-item>
</scroll-view>
</view>
</van-tab>
</block>
</van-tabs>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
import { enterPageTrack, leavePageTrack } from "../../api/api"
Page({
data: {
martrialURL: ''
},
onLoad(options) {
if (options) {
const sys = wx.getSystemInfoSync()
const styleCss = `width:100%;height:100vh`
const { type, title, id } = options
const _tempArr = JSON.parse(wx.getStorageSync('pageQueryOfcontent'))
this.id = id
wx.removeStorageSync('pageQueryOfcontent');
// 添加埋点
this.toAddTrack(id)
let url = ''
if (type == 'video' || type == 'PDF') {
url = _tempArr[0]
}
wx.setNavigationBarTitle({
title
})
if (type == 'PDF') {
wx.showLoading()
this.openPdf = false
let _this = this
wx.downloadFile({
url: url,
success: function (res) {
const manage = wx.getFileSystemManager()
let file = url.split('/')
let fileName = title
manage.saveFile({
tempFilePath: res.tempFilePath,
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
success: function (res) {
console.log(fileName);
wx.openDocument({
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
fileType: 'pdf',
showMenu: true,
success: function (res) {
wx.hideLoading();
_this.openPdf = true
}
})
}
})
// const filePath = res.tempFilePath
// wx.openDocument({
// filePath: filePath,
// fileType: 'pdf',
// success: function (res) {
// wx.hideLoading();
// _this.openPdf = true
// }
// })
},
fail() {
wx.hideLoading();
}
})
return
}
this.setData({
styleCss,
martrialURL: url,
type: type,
materials: _tempArr
})
}
},
onShow() {
if (this.openPdf) {
wx.navigateBack({
delta: 1
});
}
},
toAddTrack(id) {
const userInfo = wx.$util.getUserInfo()
const params = {
goodsId: id,
goodsType: 0,
merchantId: userInfo.default4SStoreInfo.merchantId,
merchantName: userInfo.default4SStoreInfo.merchantName
}
enterPageTrack(params).then(res => {
this.trackId = res.data
})
},
toLeaveTrack() {
const params = {
id: this.trackId
}
leavePageTrack(params).then(res => { })
},
onUnload() {
this.toLeaveTrack()
},
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
.video-container{
width: 100%;
display: flex;
justify-content: center;
flex-direction: column;
}
\ No newline at end of file \ No newline at end of file
<view class="video-container">
<block wx:if="{{martrialURL&&type=='video'}}">
<video style="{{styleCss}}" autoplay="{{true}}" src="{{martrialURL}}" />
</block>
<!-- <block wx:if="{{martrialURL&&type=='PDF'}}">
<web-view style="{{styleCss}}" src="{{martrialURL}}" />
</block> -->
<block wx:if="{{type=='image'}}">
<block wx:for="{{materials}}" wx:key="index">
<image mode="widthFix" src="{{item}}" />
</block>
</block>
</view>
\ No newline at end of file \ No newline at end of file
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
import { materialListApi, leavePageTrack } from "./api/api"
let currentTabType = 'video'
Page({
data: {
IMG_URL,
userInfo: {},
menuList: [{
title: '视频',
name: 'video',
icon: 'default_video',
list: []
}, {
title: 'PDF',
name: 'PDF',
icon: 'default_pdf',
list: []
}, {
title: '图片',
name: 'image',
icon: 'default_img',
list: []
}],
searchKey: '',
sortValue: 0,
sortMap: {
0: 'sort_default',
1: 'sort_desc',
2: 'sort_asc',
},
noResult: false
},
onLoad() {
currentTabType = 'video'
},
async onShow() {
this.pdfPageTrack()
this.getScroviewHeight()
this.getListData()
this.intaval = setInterval(() => {
this.selectComponent('#tabID').resize();
}, 500);
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
onChangeTab(e) {
currentTabType = e.detail.name
this.initData()
},
async getScroviewHeight() {
let query = wx.createSelectorQuery().in(this)
let heightArr = []
let s = 0
query
.selectAll('.scroll_height_d_part')
.boundingClientRect(react => {
react.forEach(item => {
s += item.height
heightArr.push(s)
})
const last = heightArr.pop()
let systemInfo = wx.getSystemInfoSync()
const scroll_height = systemInfo.safeArea.height - last * 3
this.setData({
scroll_height
})
})
.exec()
},
getListData() {
const userInfo = wx.$util.getUserInfo()
// 登录信息映射值: 0 会员权益升级 1 精品升级 3 售后众筹 ,2次新车转化
// 0-图片;1-视频;2-pdf;
const newType = currentTabType == 'video' ? 1 : currentTabType == 'PDF' ? 2 : 0
let { searchKey, sortValue, noResult } = this.data
let params = {
merchantId: userInfo.default4SStoreInfo.merchantId,
scene: userInfo.sceneType,
showChannel: 0,
type: newType,
title: searchKey,
sortedBy: sortValue ? 2 : 1
}
if (sortValue == 2) params.sortedOrder = 'asc'
if (sortValue == 1) params.sortedOrder = 'desc'
let list = [], listNameMap = {
0: 'menuList[2].list',
1: 'menuList[0].list',
2: 'menuList[1].list',
}
const target = listNameMap[newType]
this.currentTarget = target
materialListApi(params).then(res => {
if (res && res.data) {
res.data.forEach(el => {
if (el.createdDate) el.createdDate = new Date(el.createdDate).format('yyyy-MM-dd')
})
}
list = res.data
noResult = list.length ? false : true
this.setData({
[target]: list,
noResult
})
})
},
onChangeSearch(e) {
},
onSearch(e) {
this.setData({
searchKey: e.detail
}, () => {
this.getListData()
})
},
onCancel(e) {
this.onSearch(e)
},
toFilterSort() {
let { sortValue } = this.data
this.setData({
sortValue: sortValue == 2 ? 1 : 2
}, () => {
this.getListData()
})
},
initData() {
this.setData({
[this.currentTarget]: [],
sortValue: 0,
searchKey: ''
}, () => {
this.getListData()
})
},
pdfPageTrack() {
const id = wx.getStorageSync('pageQueryOfcontent_trackId')
if (id) {
leavePageTrack({ id }).then(res => {
wx.removeStorageSync('pageQueryOfcontent_trackId');
})
}
},
onHide(){
clearInterval(this.intaval)
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-search": "@vant/weapp/search/index",
"list-item":"./components/ListItem/index"
},
"navigationBarTitleText":"培训资料"
}
\ No newline at end of file \ No newline at end of file
page{
background: #F7F8FA;
}
.min-screen-close{
display: none;
}
.main-box {
.list{
box-sizing: border-box;
width: 100%;
padding-bottom: 0;
// padding-top: var(--fontSize20);
}
}
.filter{
width: var(--fontSize188);
display: flex;
align-items: center;
justify-content: center;
}
.filter-text{
font-weight: 400;
font-size: var(--fontSize28);
color: #181A1F;
}
.filter-icon{
width: var(--fontSize40);
height: var(--fontSize40);
}
.filter-text-active{
color: #347BFF;
}
.van-tabs__line{
border-radius: var(--fontSize2) var(--fontSize2) 0 0 !important;
}
@media screen and (min-device-width: 600px) and (-webkit-min-device-pixel-ratio: 1) {
.max-screen-close{
display: none;
}
.max-screen-open{
display: block;
.filter{
width: var(--fontSizeContent99);
display: flex;
align-items: center;
justify-content: center;
}
.filter-text{
font-size: var(--fontSizeContent14);
}
.filter-icon{
width: var(--fontSizeContent20);
height: var(--fontSizeContent20);
}
}
.tab-class{
flex: 0 0 var(--fontSize120) !important;
}
}
<!-- 非大屏 -->
<view class="main-box .max-screen-close">
<van-tabs bind:change="onChangeTab" sticky border title-inactive-color="#5A5E66" title-active-color="#347BFF" color="#347BFF" active="video">
<van-search shape="round" left-icon="/images/search.png" bind:clear="onCancel" use-action-slot bind:change="onChangeSearch" bind:search="onSearch" class="scroll_height_d_part" value="{{ searchKey }}" placeholder="标题" >
<view bind:tap="toFilterSort" slot="action" class="filter">
<view class="filter-text {{sortValue?'filter-text-active':''}}">浏览量</view>
<image class="filter-icon" src="./images/{{sortMap[sortValue]}}.png" />
</view>
</van-search>
<block wx:for="{{menuList}}" wx:key="index">
<van-tab title="{{item.title}}" name="{{item.name}}">
<view class="content-box">
<scroll-view style="height:{{scroll_height}}px" scroll-y class="list">
<list-item noResult="{{noResult}}" listItem="{{item}}"></list-item>
</scroll-view>
</view>
</van-tab>
</block>
</van-tabs>
</view>
<!-- 平板 -->
<view class="main-box min-screen-close .max-screen-open">
<van-tabs id="tabID" line-width="34px" tab-class="tab-class" bind:change="onChangeTab" sticky border title-inactive-color="#5A5E66" title-active-color="#347BFF" color="#347BFF" active="video">
<van-search shape="round" left-icon="/images/search.png" bind:clear="onCancel" use-action-slot bind:change="onChangeSearch" bind:search="onSearch" class="scroll_height_d_part" value="{{ searchKey }}" placeholder="标题" >
<view bind:tap="toFilterSort" slot="action" class="filter">
<view class="filter-text {{sortValue?'filter-text-active':''}}">浏览量</view>
<image class="filter-icon" src="./images/{{sortMap[sortValue]}}.png" />
</view>
</van-search>
<block wx:for="{{menuList}}" wx:key="index">
<van-tab title="{{item.title}}" name="{{item.name}}">
<view class="content-box">
<scroll-view style="height:{{scroll_height}}px" scroll-y class="list">
<list-item noResult="{{noResult}}" isMaxScreen="{{true}}" listItem="{{item}}"></list-item>
</scroll-view>
</view>
</van-tab>
</block>
</van-tabs>
</view>
\ No newline at end of file \ No newline at end of file
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
import api from '~/utils/request/request.js'
Component({
properties: {
listItem: Object,
onResult: Boolean,
isMaxScreen:Boolean
},
data: {
templateInfo: {
IMG_URL,
}
},
methods: {
toDetail(e) {
console.log(e);
const { item, type } = e.currentTarget.dataset;
let url = '', tempArr = []
if (item.materialDetailInfoList && item.materialDetailInfoList.length) {
item.materialDetailInfoList.forEach(el => {
tempArr.push(el.image)
})
}
if (type == 'PDF') {
this.openPDF(tempArr[0], item)
return
}
url = JSON.stringify(tempArr)
wx.setStorageSync('pageQueryOfcontent', url);
let pageUrl = `/packageEquity/pages/trainingMaterials/pages/playVideo/index`
let target = pageUrl + `?type=${type}&title=${item.title}&id=${item.id}`
wx.navigateTo({
url: target
});
},
// 打开PDF
openPDF(url, item) {
wx.showLoading()
this.openPdf = false
let _this = this
wx.downloadFile({
url: url,
success: function (res) {
const manage = wx.getFileSystemManager()
let fileName = item.title
manage.saveFile({
tempFilePath: res.tempFilePath,
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
success: function (res) {
wx.openDocument({
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
fileType: 'pdf',
showMenu: false,
success: function (res) {
wx.hideLoading();
_this.openPdf = true
_this.toAddTrack(item.id)
}
})
}
})
},
fail() {
wx.hideLoading();
}
})
},
toAddTrack(id) {
const userInfo = wx.$util.getUserInfo()
const params = {
goodsId: id,
goodsType: 0,
merchantId: userInfo.default4SStoreInfo.merchantId,
merchantName: userInfo.default4SStoreInfo.merchantName
}
this.enterPageTrack(params).then(res => {
wx.setStorageSync('pageQueryOfcontent_trackId', res.data);
})
},
/**进入页面增埋点 */
enterPageTrack(data) {
let params = data || {}
return api.post('dj.api.customer.dynamic.record.add', params)
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
.list-item-container {
width: 100%;
box-sizing: border-box;
padding: var(--fontSize20);
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
overflow-y: scroll;
// columns: 2;
// column-gap: 22rpx;
}
.list-item-container .left, .list-item-container .right {
display: inline-block;
vertical-align: top;
width: calc(50% - var(--fontSize10));
// padding-top: var(--fontSize20);
}
.element {
width: var(--fontSize344);
background: #FFFFFF;
border-radius: var(--fontSize16);
margin-bottom: var(--fontSize20);
padding-bottom: var(--fontSize20);
.cover{
height: var(--fontSize344);
background: #FFFFFF;
position: relative;
.icon{
width: var(--fontSize344);
height: var(--fontSize344);
border-radius: var(--fontSize16) var(--fontSize16) 0 0;
}
.play-icon{
width: var(--fontSize48);
height: var(--fontSize48);
position: absolute;
left: var(--fontSize16);
bottom: var(--fontSize16);
}
.cover_icon{
height: var(--fontSize344);
border-radius: var(--fontSize16) var(--fontSize16) 0 0;
}
}
.title{
width: var(--fontSize344);
box-sizing: border-box;
padding: 0 var(--fontSize18);
font-weight: 400;
font-size: var(--fontSize28);
color: #292D33;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-top: var(--fontSize20);
margin-bottom: var(--fontSize16)
}
.footer{
box-sizing: border-box;
padding: 0 var(--fontSize18);
.view-box{
.icon{
width: var(--fontSize32);
height: var(--fontSize32);
margin-right: var(--fontSize8);
}
.text{
font-weight: 400;
font-size: var(--fontSize24);
color: #5A5E66;
}
}
.date-box{
font-weight: 400;
font-size: var(--fontSize20);
color: #5A5E66;
}
}
}
.flex_cc{
display: flex;
align-items: center;
justify-content: center;
}
.flex_scb{
display: flex;
align-items: center;
justify-content: space-between;
}
.no_data{
font-weight: 400;
font-size: var(--fontSize28);
color: #999;
text-align: center;
width: 100%;
padding-top: var(--fontSize220);
display: flex;
flex-direction: column;
align-items: center;
.no_icon{
width: var(--fontSize160);
height: var(--fontSize160);
}
}
.maxScreen-container{
display: flex;
justify-content: center;
padding: 0 var(--fontSizeContent10);
.inner{
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
padding-top: var(--fontSize12);
}
.element{
box-sizing: border-box;
width: var(--fontSizeContent162);
margin: 0 var(--fontSizeContent6) var(--fontSizeContent12);
border-radius: var(--fontSizeContent8);
.cover{
height: var(--fontSizeContent162);
background: #FFFFFF;
position: relative;
.icon,.cover_icon{
width: var(--fontSizeContent162);
height: var(--fontSizeContent162);
border-radius: var(--fontSizeContent8) var(--fontSizeContent8) 0 0;
}
.max-play-icon{
width: var(--fontSizeContent53);
height: var(--fontSizeContent53);
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%)
}
}
.title{
width: var(--fontSizeContent162);
height: var(--fontSizeContent40);
box-sizing: border-box;
padding: 0 var(--fontSizeContent9);
font-weight: 400;
font-size: var(--fontSizeContent14);
color: #292D33;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-top: var(--fontSizeContent10);
margin-bottom: var(--fontSizeContent8)
}
.footer{
box-sizing: border-box;
padding: 0 var(--fontSizeContent9);
.view-box{
.icon{
width: var(--fontSizeContent16);
height: var(--fontSizeContent16);
margin-right: var(--fontSizeContent4);
}
.text{
font-weight: 400;
font-size: var(--fontSizeContent12);
color: #5A5E66;
}
}
.date-box{
font-weight: 400;
font-size: var(--fontSizeContent10);
color: #5A5E66;
}
}
}
.no_data{
font-weight: 400;
font-size: var(--fontSizeContent14);
color: #999;
text-align: center;
width: 100%;
padding-top: var(--fontSizeContent110);
display: flex;
flex-direction: column;
align-items: center;
.no_icon{
width: var(--fontSizeContent80);
height: var(--fontSizeContent80);
}
}
}
.flex-sc-pannel{
display: flex;
justify-content: flex-start;
}
\ No newline at end of file \ No newline at end of file
<view class="list-item-container {{isMaxScreen?'maxScreen-container':''}} {{isMaxScreen&&listItem.list.length<6?'flex-sc-pannel':''}}">
<block wx:if="{{!onResult&&!isMaxScreen}}">
<view class="left">
<block wx:for="{{listItem.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="item">
<template is="item" data="{{item,...templateInfo,listItem,isMaxScreen}}" wx:if="{{idx%2==0}}" />
</block>
</view>
<view class="right">
<block wx:for="{{listItem.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="item">
<template is="item" data="{{item,...templateInfo,listItem,isMaxScreen}}" wx:if="{{idx%2==1}}" />
</block>
</view>
</block>
<block wx:elif="{{!onResult&&isMaxScreen}}">
<view class="inner">
<block wx:for="{{listItem.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="item">
<template is="item" data="{{item,...templateInfo,listItem,isMaxScreen}}" />
</block>
</view>
</block>
<block wx:if="{{onResult}}">
<view class="no_data">
<image class="no_icon" src="../../images/noData.png" />
<text>暂无数据</text>
</view>
</block>
<template name="item">
<view bind:tap="toDetail" data-item="{{item}}" data-type="{{listItem.name}}" class="element">
<view class="cover flex_cc">
<image wx:if="{{!item.cover}}" class="icon" src="{{IMG_URL}}peixun/{{listItem.icon}}.png?v=2" />
<image wx:if="{{item.cover}}" mode="aspectFill" class="cover_icon" src="{{item.cover}}" />
<image wx:if="{{listItem.name=='video'}}" class="{{isMaxScreen?'max-':''}}play-icon" src="{{IMG_URL}}peixun/play_icon.png" />
</view>
<view class="title two-text">{{item.title}}</view>
<view class="footer flex_scb">
<view class="view-box flex_cc">
<view class="icon">
<image src="{{IMG_URL}}peixun/eye_icon.png" />
</view>
<view class="text">{{item.views || 0}}人</view>
</view>
<view class="date-box">{{item.createdDate}}</view>
</view>
</view>
</template>
</view>
\ No newline at end of file \ No newline at end of file
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
import api from '~/utils/request/request.js'
let currentTabType = 'video'
Component({
properties: {
navBarHeight: Number,
navStyle: String,
scrollTop: Number
},
data: {
IMG_URL,
userInfo: {},
menuList: [{
title: '视频',
name: 'video',
icon: 'default_video',
list: []
}, {
title: 'PDF',
name: 'PDF',
icon: 'default_pdf',
list: []
}, {
title: '图片',
name: 'image',
icon: 'default_img',
list: []
}],
searchKey: '',
showPage: false,
onResult: false
},
methods: {
async onLoad() {
this.pdfPageTrack()
setTimeout(async () => {
this.setData({
showPage: true,
userInfo: wx.$util.getUserInfo() || {}
})
this.getListData()
}, 300);
this.intaval = setInterval(() => {
this.selectComponent('#tabID').resize();
}, 500);
},
onChangeTab(e) {
currentTabType = e.detail.name
this.initData()
},
getListData() {
const userInfo = wx.$util.getUserInfo()
// 登录信息映射值: 0 会员权益升级 1 精品升级 3 售后众筹 ,2次新车转化
// 0-图片;1-视频;2-pdf;
const newType = currentTabType == 'video' ? 1 : currentTabType == 'PDF' ? 2 : 0
let { searchKey, onResult } = this.data
let params = {
merchantId: userInfo.default4SStoreInfo.merchantId,
scene: userInfo.sceneType,
showChannel: 1,
type: newType,
title: searchKey,
sortedBy: 1
}
let list = [], listNameMap = {
0: 'menuList[2].list',
1: 'menuList[0].list',
2: 'menuList[1].list',
}
const target = listNameMap[newType]
this.currentTarget = target
this.materialListApi(params).then(res => {
if (res && res.data) {
res.data.forEach(el => {
if (el.createdDate) el.createdDate = new Date(el.createdDate).format('yyyy-MM-dd')
})
}
list = res.data
onResult = list.length ? false : true
this.setData({
[target]: list,
onResult
})
})
},
onChangeSearch(e) {
},
onSearch(e) {
this.setData({
searchKey: e.detail
}, () => {
this.getListData()
})
},
onCancel(e) {
this.onSearch(e)
},
initData() {
this.setData({
[this.currentTarget]: [],
searchKey: ''
}, () => {
this.getListData()
})
},
/** 内容列表 */
materialListApi(data) {
let params = data || {}
return api.post('dj.api.smartcarlife.material.list', params)
},
/**退出页面增埋点 */
leavePageTrack(data) {
let params = data || {}
return api.post('dj.api.customer.dynamic.record.leave', params)
},
pdfPageTrack() {
const id = wx.getStorageSync('pageQueryOfcontent_trackId')
if (id) {
this.leavePageTrack({ id }).then(res => {
wx.removeStorageSync('pageQueryOfcontent_trackId');
})
}
},
onHide(){
clearInterval(this.intaval)
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-search": "@vant/weapp/search/index",
"list-item":"../ListItem/index"
}
}
\ No newline at end of file \ No newline at end of file
page {
background: #F7F8FA;
}
.min-screen-close{
display: none;
}
.pos-container {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
overflow-y: scroll;
}
.bg {
width: 100%;
height: var(--fontSize444);
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/peixun/bg_banner.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
@media screen and (min-device-width: 600px) and (-webkit-min-device-pixel-ratio: 1) {
.max-screen-close{
display: none;
}
.max-screen-open{
display: block;
}
.max-bg {
width: 100%;
height: var(--fontSizeContent140);
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/peixun/max-banner.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.tab-class{
flex: 0 0 var(--fontSize120);
}
}
<!-- 非大屏 -->
<view class="pos-container .max-screen-close">
<view class="bg"></view>
<view wx:if="{{showPage}}" class="main">
<view class="main-box">
<van-tabs sticky bind:change="onChangeTab" border title-inactive-color="#5A5E66" title-active-color="#347BFF" color="#347BFF" active="video">
<van-search left-icon="/images/search.png" shape="round" bind:clear="onCancel" bind:change="onChangeSearch" bind:search="onSearch" class="scroll_height_d_part" value="{{ searchKey }}" placeholder="标题" />
<block wx:for="{{menuList}}" wx:key="index">
<van-tab title="{{item.title}}" name="{{item.name}}">
<view class="content-box">
<scroll-view style="height:calc(100vh - 180px - var(--fontSize300))" scroll-y class="list">
<list-item onResult="{{onResult}}" isMaxScreen="{{false}}" listItem="{{item}}"></list-item>
</scroll-view>
</view>
</van-tab>
</block>
</van-tabs>
</view>
</view>
</view>
<!-- 平板 -->
<view class="pos-container min-screen-close .max-screen-open">
<view class="" style="height:{{navBarHeight}}px;background:white"></view>
<view class="max-bg"></view>
<view wx:if="{{showPage}}" class="main">
<view class="main-box">
<van-tabs id="tabID" line-width="34px" tab-class="tab-class" sticky bind:change="onChangeTab" border title-inactive-color="#5A5E66" title-active-color="#347BFF" color="#347BFF" active="video">
<van-search left-icon="/images/search.png" shape="round" bind:clear="onCancel" bind:change="onChangeSearch" bind:search="onSearch" class="scroll_height_d_part" value="{{ searchKey }}" placeholder="标题" />
<block wx:for="{{menuList}}" wx:key="index">
<van-tab title="{{item.title}}" name="{{item.name}}">
<view class="content-box">
<scroll-view style="height:calc(100vh - var(--fontSize300)) - {{navBarHeight}}px" scroll-y class="list">
<list-item onResult="{{onResult}}" isMaxScreen="{{true}}" listItem="{{item}}"></list-item>
</scroll-view>
</view>
</van-tab>
</block>
</van-tabs>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
const navStyle = "background-color: transparent;box-shadow:none;";
Page({
data: {
navStyle,
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
onShow() {
this.selectComponent(`#materails`)?.onLoad && this.selectComponent(`#materails`).onLoad()
},
// 处理滚动事件
onPageScroll(e) {
const { navBarHeight } = this.data
this.setData({
navStyle: e.scrollTop >= navBarHeight ? '' : navStyle,
scrollTop:e.scrollTop
})
},
onHide(){
this.selectComponent(`#materails`)?.onHide && this.selectComponent(`#materails`).onHide()
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"makert-material":"./components/Materials/materials"
},
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
<view>营销素材</view>
</navigation-bar>
<makert-material id="materails" scrollTop="{{scrollTop}}" navStyle="{{navStyle}}" navBarHeight="{{ navBarHeight }}" ></makert-material>
\ No newline at end of file \ No newline at end of file
.van-tabs__line{
border-radius: 2rpx 2rpx 0 0 !important;
}
\ No newline at end of file \ No newline at end of file
...@@ -256,14 +256,21 @@ Page({ ...@@ -256,14 +256,21 @@ Page({
chooseAccount(e) { chooseAccount(e) {
if (this.data.jumpPageFlag) return if (this.data.jumpPageFlag) return
this.setData({ jumpPageFlag: true }) this.setData({ jumpPageFlag: true })
let { item } = e.currentTarget.dataset let { item, type } = e.currentTarget.dataset
let { loginUserInfoList, customStoreList, selectIndex } = this.data let { loginUserInfoList, customStoreList, selectIndex } = this.data
let listArr = selectIndex == 0 ? loginUserInfoList : customStoreList let listArr = selectIndex == 0 ? loginUserInfoList : customStoreList
listArr.map(i => { listArr.map(i => {
i.active = false i.active = false
// 搜客户
if (type == 1) {
if (i.id == item.id) {
i.active = true
}
} else { // 搜门店
if (i.merchantId == item?.merchantId) { if (i.merchantId == item?.merchantId) {
i.active = true i.active = true
} }
}
return i return i
}) })
this.setData({ this.setData({
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<!-- 搜客户 --> <!-- 搜客户 -->
<scroll-view wx:elif="{{customStoreList.length && selectIndex == 1}}" class="list" scroll-y style="height: calc(100% - var(--fontSize120));" bindscrolltolower="scrollonReachBottom"> <scroll-view wx:elif="{{customStoreList.length && selectIndex == 1}}" class="list" scroll-y style="height: calc(100% - var(--fontSize120));" bindscrolltolower="scrollonReachBottom">
<block wx:for="{{customStoreList}}" wx:key="index"> <block wx:for="{{customStoreList}}" wx:key="index">
<view class="items custom_items {{item.active?'active':''}}" bindtap="chooseAccount" data-index="{{index}}" data-item="{{item}}"> <view class="items custom_items {{item.active?'active':''}}" bindtap="chooseAccount" data-index="{{index}}" data-item="{{item}}" data-type='1'>
<view class="left"> <view class="left">
<view class="icon"> <view class="icon">
<image src="{{IMG_URL}}/user_avatar.png"/> <image src="{{IMG_URL}}/user_avatar.png"/>
......
{ {
"appid": "wx24ebae5768e74138", "appid": "wx570d9331f9ace0bd",
"projectname": "%E7%B2%BE%E5%93%81%E5%8D%87%E7%BA%A7", "projectname": "%E7%B2%BE%E5%93%81%E5%8D%87%E7%BA%A7",
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.29.2", "libVersion": "2.29.2",
......
...@@ -4,9 +4,16 @@ ...@@ -4,9 +4,16 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "packageEquity/pages/cleD", "name": "质检",
"pathName": "packageEquity/pages/clueDetail/clueDetail", "pathName": "packageEquity/pages/aiInspection/aiInspection",
"query": "id=27", "query": "badgeId=4827E2F0CD24",
"launchMode": "default",
"scene": null
},
{
"name": "19",
"pathName": "packageEquity/pages/aiInspectionDetail/aiInspectionDetail",
"query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
...@@ -105,7 +112,8 @@ ...@@ -105,7 +112,8 @@
} }
}, },
"setting": { "setting": {
"compileHotReLoad": false "compileHotReLoad": true
}, },
"projectname": "%E7%B2%BE%E5%93%81%E5%8D%87%E7%BA%A7" "projectname": "%E7%B2%BE%E5%93%81%E5%8D%87%E7%BA%A7",
"libVersion": "3.2.5"
} }
\ No newline at end of file \ No newline at end of file
...@@ -386,7 +386,7 @@ export const getYQList = () => { ...@@ -386,7 +386,7 @@ export const getYQList = () => {
// debugger // debugger
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const app = getApp() const app = getApp()
console.log(app.globalData.YQList, 'app.globalData.YQList') // console.log(app.globalData.YQList, 'app.globalData.YQList')
// 如果有 直接返回 // 如果有 直接返回
if (app.globalData.YQList) { if (app.globalData.YQList) {
return resolve(app.globalData.YQList) return resolve(app.globalData.YQList)
......
...@@ -52,9 +52,13 @@ module.exports = { ...@@ -52,9 +52,13 @@ module.exports = {
/** 查询当周员工日报是否填写列表 */ /** 查询当周员工日报是否填写列表 */
staffDailyReportDetailWeeklyList(data) { staffDailyReportDetailWeeklyList(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.weekly.list', data) return api.post('dj.api.smartcarlife.staff.daily.report.weekly.list', data)
}, },
/** 查询该店员工日报是否开启 */ /** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid(data) { staffDailyReportMerchantValid(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data) return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
},
/** 员工是否需要推送开单预警 */
orderStaffValid(data) {
return api.post('dj.api.smartcarlife.order.staff.valid', data)
} }
} }
...@@ -577,6 +577,62 @@ Page({ ...@@ -577,6 +577,62 @@ Page({
} }
} }
}, },
checkStaffOrderStatus() {
let dateStaffPop = wx.$storage.get('dateStaffPop')
let nowDate = new Date().format('yyyy-MM-dd')
// let num = 0
// 当天已查询过
if (dateStaffPop?.date && nowDate == dateStaffPop?.date) {
// num = dateStaffPop?.num || 0
// num = num + 1
// num = 1
return
}
let userInfo = wx.$util.getUserInfo()
api
.orderStaffValid({ sceneType: userInfo.sceneType })
.then(result => {
console.log(result)
if (result.data) {
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOREPORT_MODAL = true
wx.showModal({
title: '开单预警',
content: '您已超过三天未开单',
showCancel: false,
// cancelText: '取消', // '取消
cancelColor: '#292D33',
confirmText: '确定',
confirmColor: '#347BFF',
success(res) {
// if (res.confirm) {
// wx.$router.go('tabWorkOrder.staffDaily', {
// reportDate: hasNeedReport.date
// })
// }
},
complete: () => {
// 这个延迟的目的是为了避免短时间内重复弹出
// 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
setTimeout(() => {
wx.__HAS_NOREPORT_MODAL = false
}, 2000)
}
})
}
wx.$storage.set('dateStaffPop', {
date: new Date().format('yyyy-MM-dd')
// num
})
// else {
// num = num + 1
// }
// if (result) {
// }
})
.catch(err => { })
},
checkDailyRecport() { checkDailyRecport() {
let { tabIndex } = this.data let { tabIndex } = this.data
const isStaff = app.globalData.isStaff const isStaff = app.globalData.isStaff
...@@ -597,6 +653,8 @@ Page({ ...@@ -597,6 +653,8 @@ Page({
} }
// 产品需求:该场景无需再放开入口 // 产品需求:该场景无需再放开入口
// this.checkDailyRecport() // this.checkDailyRecport()
this.checkStaffOrderStatus()
// this.checkDailyRecport()
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -679,12 +737,13 @@ Page({ ...@@ -679,12 +737,13 @@ Page({
staffDailyReportMerchantValid(userInfo) { staffDailyReportMerchantValid(userInfo) {
// let { userInfo } = this.data // let { userInfo } = this.data
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log(userInfo, 'userInfo') // console.log(userInfo, 'userInfo')
api.staffDailyReportMerchantValid({ api
.staffDailyReportMerchantValid({
merchantId: userInfo.shopMerchantId merchantId: userInfo.shopMerchantId
}) })
.then(res => { .then(res => {
console.log(res, 'staffDailyReportMerchantValid') // console.log(res, 'staffDailyReportMerchantValid')
resolve(res.data) resolve(res.data)
}) })
.catch(err => { .catch(err => {
...@@ -695,7 +754,7 @@ Page({ ...@@ -695,7 +754,7 @@ Page({
async staffDailyReport(userInfo) { async staffDailyReport(userInfo) {
// debugger // debugger
let merchantStaffDailyReportMerchantValid = await this.staffDailyReportMerchantValid(userInfo) let merchantStaffDailyReportMerchantValid = await this.staffDailyReportMerchantValid(userInfo)
console.log(merchantStaffDailyReportMerchantValid, 'merchantStaffDailyReportMerchantValid'); console.log(merchantStaffDailyReportMerchantValid, 'merchantStaffDailyReportMerchantValid')
// 没有开启就不走下一步逻辑 // 没有开启就不走下一步逻辑
if (!merchantStaffDailyReportMerchantValid) return false if (!merchantStaffDailyReportMerchantValid) return false
let { isStaff } = this.data let { isStaff } = this.data
...@@ -724,7 +783,7 @@ Page({ ...@@ -724,7 +783,7 @@ Page({
// return item // return item
// }) // })
// timeBean // timeBean
let dateStaffPop = wx.$storage.get('dateStaffPop') // let dateStaffPop = wx.$storage.get('dateStaffPop')
// 判断 有没有填写日报 // 判断 有没有填写日报
let hasNeedReport = timeBean.weekDayList.find((item, index) => { let hasNeedReport = timeBean.weekDayList.find((item, index) => {
// item.hasDailyValue = // item.hasDailyValue =
...@@ -732,13 +791,13 @@ Page({ ...@@ -732,13 +791,13 @@ Page({
}) })
console.log(hasNeedReport, 'hasNeedReport') console.log(hasNeedReport, 'hasNeedReport')
let nowDate = new Date().format('yyyy-MM-dd') let nowDate = new Date().format('yyyy-MM-dd')
let num = 0 // let num = 0
if (dateStaffPop?.date && nowDate == dateStaffPop?.date) { // if (dateStaffPop?.date && nowDate == dateStaffPop?.date) {
num = dateStaffPop?.num || 0 // num = dateStaffPop?.num || 0
num = num + 1 // num = num + 1
} else { // } else {
num = num + 1 // num = num + 1
} // }
// num <= 2 // num <= 2
if (hasNeedReport && isStaff) { if (hasNeedReport && isStaff) {
// if (num <= 2) { // if (num <= 2) {
...@@ -872,7 +931,13 @@ Page({ ...@@ -872,7 +931,13 @@ Page({
if (checklist.includes(userInfo?.accountName)) { if (checklist.includes(userInfo?.accountName)) {
menu = menu.filter(e => e.name != '预约管理') menu = menu.filter(e => e.name != '预约管理')
} }
// 新加培训资料
menu.push({
name: '培训资料',
url: 'packageEquity.trainingMaterials',
recordId: 14,
icon: 'peixun_icon'
})
this.setData({ this.setData({
menu, menu,
isNoStaff isNoStaff
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!