Commit 0bf0b1ce by 张立顺

Merge branch 'dev_v4.26.0' of http://192.168.3.233:8090/saas_plus/dj-car-boutiqu…

…e-work-wechat into dev_v4.26.0
2 parents e6ac6bfa 98ec6274
Showing 91 changed files with 2232 additions and 433 deletions
...@@ -167,5 +167,10 @@ module.exports = { ...@@ -167,5 +167,10 @@ module.exports = {
//插入埋点记录 //插入埋点记录
burialPointRecord(data) { burialPointRecord(data) {
return api.get('dj.api.smartcarlife.common.insertRecord', data) return api.get('dj.api.smartcarlife.common.insertRecord', data)
},
// 获取精品升级场景 太阳膜类商品部位数据
getPositionList(data) {
return api.post('dj.api.smartcarlife.goodsPosition.list', data)
} }
} }
...@@ -45,7 +45,7 @@ App({ ...@@ -45,7 +45,7 @@ App({
getUpdateManager() getUpdateManager()
if (options) { if (options) {
// console.log('options', options) console.log('options', options)
let res = checkScene(options) let res = checkScene(options)
// console.log(res, 'res') // console.log(res, 'res')
// 如果需要重新登录 // 如果需要重新登录
...@@ -54,6 +54,9 @@ App({ ...@@ -54,6 +54,9 @@ App({
}, },
login(relogin, context) { login(relogin, context) {
// debugger // debugger
// util.debounce( this.test,1000)
// return
// console.log(relogin, 'relogin') // console.log(relogin, 'relogin')
let that = this let that = this
// 清空多账号信息 // 清空多账号信息
...@@ -78,6 +81,9 @@ App({ ...@@ -78,6 +81,9 @@ App({
} }
}) })
} else { } else {
// 标志位 解决安卓查复弹框问题
if (wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOTLOGIN_MODAL = true
wx.showModal({ wx.showModal({
title: '温馨提示', title: '温馨提示',
content: context || '登录过期,请重新登录。', content: context || '登录过期,请重新登录。',
...@@ -92,6 +98,13 @@ App({ ...@@ -92,6 +98,13 @@ App({
wx.$relogin = relogin wx.$relogin = relogin
router.reLaunch('pages.wxLogin') router.reLaunch('pages.wxLogin')
} }
},
complete: () => {
// 这个延迟的目的是为了避免短时间内重复弹出
// 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
setTimeout(() => {
wx.__HAS_NOTLOGIN_MODAL = false;
}, 2000);
} }
}) })
} }
...@@ -104,12 +117,77 @@ App({ ...@@ -104,12 +117,77 @@ App({
router.reLaunch('pages.wxLogin') router.reLaunch('pages.wxLogin')
} }
}, },
test (){
// console.log('loginOut');
// this.debounceWithParams()
const count = this.globalData.count
console.log(this.globalData.count);
let that = this
console.log(this.globalData.count,'globalData.count');
if (count) {
clearTimeout(this.globalData.count)
this.globalData.count = setTimeout(()=>{
// console.log('object');
console.log(that.globalData.count);
that.globalData.count = null
console.log('that.globalData.count',that.globalData.count);
},2000)
}else{
this.globalData.count = setTimeout(()=>{
// console.log('object');
console.log(that.globalData.count);
that.globalData.count = null
console.log('that.globalData.count',that.globalData.count);
},2000)
}
// globalData.count = setTimeout(()=>{
// console.log('object');
// console.log(globalData.count);
// },2000)
// globalData.count++
// setTimeout
// let timeCount
// console.log(timeCount);
// if (timeCount) {
// clearTimeout(timeCount)
// timeCount = setTimeout(()=>{
// console.log('这是一个寂寞的天');
// },1000)
// }else{
// timeCount = setTimeout(()=>{
// console.log('这是一个寂寞的天');
// },1000)
// }
// function doSomething() {
// console.log("Doing something!");
// }
// const debouncedDoSomething = util.debounce(doSomething, 500, false);
// debouncedDoSomething()
},
debounceWithParams(callback, delay) {
let timeoutId; // 用于保存定时器ID
return function (...args) {
const executeLater = function () {
// 定义一个延迟执行的函数
timeoutId = null; // 清空定时器ID,用于标记函数可以再次执行
callback(...args); // 执行回调函数,并将参数传递给回调函数
};
clearTimeout(timeoutId); // 清除之前的定时器
timeoutId = setTimeout(executeLater, delay); // 创建一个新的定时器
};
},
globalData: { globalData: {
statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'], // 头部导航栏的高度 statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'], // 头部导航栏的高度
yqdInfo: {}, yqdInfo: {},
isYqdSuper: true, isYqdSuper: true,
isStaff: false, isStaff: false,
YQorderSetting: '' YQorderSetting: '',
count:'',
} }
}) })
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
"pages/carQuotation/createOrderCarQuotation/createOrderCarQuotation", "pages/carQuotation/createOrderCarQuotation/createOrderCarQuotation",
"pages/carQuotation/createOrderCarQuotationSimple/createOrderCarQuotationSimple", "pages/carQuotation/createOrderCarQuotationSimple/createOrderCarQuotationSimple",
"pages/ocrEquityModules/ocrEquityModules", "pages/ocrEquityModules/ocrEquityModules",
"pages/carEquity/previewList/previewList",
"pages/carEquity/serviceInfo/serviceInfo", "pages/carEquity/serviceInfo/serviceInfo",
"pages/carEquity/carBrands/carBrands", "pages/carEquity/carBrands/carBrands",
"pages/carEquity/carSeries/carSeries", "pages/carEquity/carSeries/carSeries",
......
...@@ -62,7 +62,7 @@ Component({ ...@@ -62,7 +62,7 @@ Component({
copyArtificerList.map(i => { copyArtificerList.map(i => {
i.active = false i.active = false
if (i.id == selectedTechnicianId) i.active = true if (i.id == selectedTechnicianId) i.active = true
if (i.technicianName.indexOf(value) != -1) { if (i.staffName.indexOf(value) != -1) {
arr.push(i) arr.push(i)
} }
}) })
...@@ -106,8 +106,9 @@ Component({ ...@@ -106,8 +106,9 @@ Component({
if (!arr.length) { if (!arr.length) {
return wx.$util.showToast('请选择技师') return wx.$util.showToast('请选择技师')
} }
orderInfo.technicianUuid = arr[0]?.uuid || ''
orderInfo.technicianId = arr[0]?.id || '' orderInfo.technicianId = arr[0]?.id || ''
orderInfo.technicianName = arr[0]?.technicianName || '' orderInfo.technicianName = arr[0]?.staffName || ''
this.triggerEvent('confirm', orderInfo) this.triggerEvent('confirm', orderInfo)
} }
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view class="checked_img"> <view class="checked_img">
<image wx:if="{{item.active}}" src="{{IMG_URL}}checked.png"></image> <image wx:if="{{item.active}}" src="{{IMG_URL}}checked.png"></image>
</view> </view>
<view class="text_box"><view class="text-hide">{{item.technicianName}}</view></view> <view class="text_box"><view class="text-hide">{{item.staffName}}</view></view>
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
......
...@@ -17,6 +17,10 @@ Component({ ...@@ -17,6 +17,10 @@ Component({
placeholder: String, placeholder: String,
iconSrc: String, iconSrc: String,
labelStyle: String, labelStyle: String,
background: {
type: String,
value: '#FFFFFF',
},
cellHeight: { cellHeight: {
type: Boolean, type: Boolean,
value: true value: true
......
<view class='cell-box'> <view class='cell-box' style="background:{{background}}">
<view class="cell {{cellHeight?'cellHeight': ''}} {{border?'border':''}}" bindtap="click"> <view class="cell {{cellHeight?'cellHeight': ''}} {{border?'border':''}}" bindtap="click">
<view class='cell-label title-style' style="width:{{labelWidth}};{{labelStyle}}" bindtap="titleClick"> <view class='cell-label title-style' style="width:{{labelWidth}};{{labelStyle}}" bindtap="titleClick">
<text wx:if='{{required&&requiredBefore}}' class='required'>*</text> <text wx:if='{{required&&requiredBefore}}' class='required'>*</text>
......
...@@ -47,7 +47,7 @@ Component({ ...@@ -47,7 +47,7 @@ Component({
e.upgradeGoodsList.map((c, ind) => { e.upgradeGoodsList.map((c, ind) => {
c.active = false c.active = false
chooseGoodsList.map(s => { chooseGoodsList.map(s => {
if (s.baseGoodsId == c.baseGoodsId && s.id == c.id) { if (s.merchantGoodsId == c.id || s.id == c.id) {
c.count = s.count c.count = s.count
indexList.push({ indexList.push({
index, index,
...@@ -105,6 +105,8 @@ Component({ ...@@ -105,6 +105,8 @@ Component({
// console.log(minPrice && minPrice < item.shopMinPrice) // console.log(minPrice && minPrice < item.shopMinPrice)
// 如果有设置订单价格 那就不能选单个成本价比总价还高的 // 如果有设置订单价格 那就不能选单个成本价比总价还高的
if (minPrice && minPrice / 100 < item.shopMinPrice) return false if (minPrice && minPrice / 100 < item.shopMinPrice) return false
// 太阳膜类商品 未配置部位不可选择
// if (item?.goodsInfo?.goodsType == 1 && !item.merchantGoodsPosition) return false
let target = `goodsList[${index}].upgradeGoodsList[${ind}].active` let target = `goodsList[${index}].upgradeGoodsList[${ind}].active`
this.setData({ this.setData({
[target]: !active [target]: !active
......
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
data-ind="{{ind}}" data-ind="{{ind}}"
data-item="{{i}}"> data-item="{{i}}">
<view class="name text-hide {{i.active?'textWidth':''}}"> <view class="name text-hide {{i.active?'textWidth':''}}">
{{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}} <text>{{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}}</text>
<text wx:if="{{i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">{{'「' + i.positionStr+'」'}}</text>
<text class="warning_text" wx:if="{{!i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">无部位</text>
</view> </view>
<view class="last" wx:if="{{!i.active}}"> <view class="last" wx:if="{{!i.active}}">
<!-- | --> <!-- | -->
......
...@@ -28,6 +28,12 @@ ...@@ -28,6 +28,12 @@
max-width: 85%; max-width: 85%;
} }
.item .value .name .warning_text{
color: #F24724;
margin-left: 10rpx;
font-size: 22rpx;
}
.item .value .textWidth { .item .value .textWidth {
max-width: 100%; max-width: 100%;
} }
......
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
min-height: 160rpx; min-height: 400rpx;
margin-bottom: 14rpx; margin-bottom: 14rpx;
} }
.qr-box .qrImg { .qr-box .qrImg {
width: 160rpx; width: 400rpx;
height: 160rpx; height: 400rpx;
display: inline-block; display: inline-block;
} }
.loadingBox { .loadingBox {
width: 160rpx; width: 400rpx;
height: 160rpx; height: 400rpx;
position: relative; position: relative;
} }
.loader { .loader {
......
...@@ -47,7 +47,6 @@ if (systemInfo.platform != 'devtools') { ...@@ -47,7 +47,6 @@ if (systemInfo.platform != 'devtools') {
break break
} }
} }
} }
export const env = envName export const env = envName
...@@ -56,14 +55,13 @@ export const envIndex = index ...@@ -56,14 +55,13 @@ export const envIndex = index
const createQuotedUrl = { const createQuotedUrl = {
develop: `http://192.168.1.178:9528/dj-scrm-wx-work-main-zhangls/#/equityPoster?id=`, develop: `http://192.168.1.178:9528/dj-scrm-wx-work-main-zhangls/#/equityPoster?id=`,
trial: `http://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`, trial: `http://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`,
release: `https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=` release: `https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`,
preRelease: `https://dj.beta.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`
} }
const target = ['ip', 'develop', 'trial', 'release', 'preRelease'] const target = ['ip', 'develop', 'trial', 'release', 'preRelease']
// 报价单图片地址 // 报价单图片地址
export const quotedImgUrl = createQuotedUrl[target[envIndex]] export const quotedImgUrl = createQuotedUrl[target[envIndex]]
// sentry Dsn 地址 // sentry Dsn 地址
export const dsnUrl = 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23' export const dsnUrl = 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
<!-- 超管isSuper/商户号类型 userType 2(员工号)账号不可操作 --> <!-- 超管isSuper/商户号类型 userType 2(员工号)账号不可操作 -->
<view class="item-footer" wx:if="{{(item.tailOrderStatus == '0' || item.tailOrderStatus == '1' || item.tailOrderStatus == '4') && !userInfo.isSuper && userInfo.userType == 2}}"> <view class="item-footer" wx:if="{{(item.tailOrderStatus == '0' || item.tailOrderStatus == '1' || item.tailOrderStatus == '4') && !userInfo.isSuper && userInfo.userType == 2}}">
<!-- 待支付 --> <!-- 待支付 -->
<view wx:if="{{item.tailOrderStatus == '0'}}" class="order-btn default-btn mar-btn" bindtap="handlefinalPayment" data-target="{{item}}"> <view wx:if="{{item.tailOrderStatus == '0'&& item.supplementOrderFlag != 1}}" class="order-btn default-btn mar-btn" bindtap="handlefinalPayment" data-target="{{item}}">
关联尾款单 关联尾款单
</view> </view>
<!-- 待支付/已支付/退定金 --> <!-- 待支付/已支付/退定金 -->
......
...@@ -65,7 +65,7 @@ Page({ ...@@ -65,7 +65,7 @@ Page({
paramsActivityPrice: '', paramsActivityPrice: '',
showRemark: false, showRemark: false,
customOutTradeNo: '', // 门店收款交易流水号 customOutTradeNo: '', // 门店收款交易流水号
customPayVoucher: '', // 门店收款付款凭证 customPayVoucher: [], // 门店收款付款凭证
textAreaValue: '', // 备注回显 textAreaValue: '', // 备注回显
goodsNumber: 1 // 购买商品数量 默认购买一个 goodsNumber: 1 // 购买商品数量 默认购买一个
}, },
...@@ -115,7 +115,7 @@ Page({ ...@@ -115,7 +115,7 @@ Page({
}, },
input(e) { input(e) {
let { value } = e.detail let { value } = e.detail
let val = value.replace(/[^a-zA-Z0-9]/g, '') let val = value.replace(/[^\a-\z\A-\Z0-9\/]/g, '')
this.setData({ this.setData({
customOutTradeNo: val customOutTradeNo: val
}) })
...@@ -123,6 +123,7 @@ Page({ ...@@ -123,6 +123,7 @@ Page({
// 上传付款凭证 // 上传付款凭证
upLoad() { upLoad() {
let _this = this let _this = this
let { customPayVoucher } = _this.data
wx.chooseImage({ wx.chooseImage({
count: 1, count: 1,
success(res) { success(res) {
...@@ -140,8 +141,9 @@ Page({ ...@@ -140,8 +141,9 @@ Page({
wx.$util.hideLoading() wx.$util.hideLoading()
let { code, data, message } = img let { code, data, message } = img
if (code == 0) { if (code == 0) {
customPayVoucher.push(data)
_this.setData({ _this.setData({
customPayVoucher: data customPayVoucher
}) })
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
...@@ -152,13 +154,38 @@ Page({ ...@@ -152,13 +154,38 @@ Page({
} }
}) })
}, },
// 付款凭证预览
previewImage(e) {
let { url, index } = e.currentTarget.dataset
wx.previewImage({
urls: url,
current: url[index]
})
},
// 删除付款凭证
delCustomPayVoucher(e) {
let _this = this
let { index } = e.currentTarget.dataset
let { customPayVoucher } = _this.data
customPayVoucher.splice(index, 1)
this.setData({customPayVoucher})
},
// 门店收款确认 // 门店收款确认
confirm() { confirm() {
let { customOutTradeNo, customPayVoucher, orderCode, orderPaySource, shopmallGoodsId, orderDetail } = this.data let { customOutTradeNo, customPayVoucher, orderCode, orderPaySource, shopmallGoodsId, orderDetail } = this.data
if (!customOutTradeNo) { if (!customOutTradeNo) {
return wx.$util.showToast('请输入交易流水号') return wx.$util.showToast('请输入交易流水号')
} }
if (!customPayVoucher) { let customOutTradeNoArr = customOutTradeNo.split('/') || []
if (customOutTradeNoArr?.length > 5) return wx.$util.showToast('最多5笔交易流水号')
try {
customOutTradeNoArr?.forEach(v => {
if (v?.length > 32) throw v
})
} catch (error) {
return wx.$util.showToast('每个交易流水号最大支持32位字符')
}
if (!customPayVoucher?.length) {
return wx.$util.showToast('请上传付款凭证') return wx.$util.showToast('请上传付款凭证')
} }
wx.showModal({ wx.showModal({
...@@ -174,7 +201,7 @@ Page({ ...@@ -174,7 +201,7 @@ Page({
selectPayType: 2, // 线下收款 (门店收款) selectPayType: 2, // 线下收款 (门店收款)
updatedBy: accountName, updatedBy: accountName,
outTradeNo: customOutTradeNo, // 交易流水号 outTradeNo: customOutTradeNo, // 交易流水号
payVoucher: customPayVoucher, // 付款凭证 payVoucherList: customPayVoucher, // 付款凭证
remark: orderDetail?.remark // 备注 remark: orderDetail?.remark // 备注
} }
wx.showLoading() wx.showLoading()
......
page { page {
height: 100vh; height: calc(100vh-20rpx);
background-color: #f3f5f7 background-color: #f3f5f7;
padding-bottom: 20rpx;
} }
.big-img { .big-img {
...@@ -48,7 +49,6 @@ page { ...@@ -48,7 +49,6 @@ page {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
width: 710rpx; width: 710rpx;
height: 716rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 16rpx; border-radius: 16rpx;
margin: -34rpx auto 34rpx; margin: -34rpx auto 34rpx;
...@@ -101,6 +101,7 @@ page { ...@@ -101,6 +101,7 @@ page {
.tab-desc { .tab-desc {
margin-top: 20rpx; margin-top: 20rpx;
margin-bottom: 40rpx;
font-size: 24rpx; font-size: 24rpx;
color: #666666; color: #666666;
} }
...@@ -109,10 +110,11 @@ page { ...@@ -109,10 +110,11 @@ page {
flex-shrink: 0; flex-shrink: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 38rpx 44rpx; padding: 38rpx 40rpx;
box-sizing: border-box; box-sizing: border-box;
.input-item{ .input-item{
display: flex; display: flex;
flex-flow: column;
margin-bottom: 36rpx; margin-bottom: 36rpx;
.label{ .label{
flex-shrink: 0; flex-shrink: 0;
...@@ -120,14 +122,13 @@ page { ...@@ -120,14 +122,13 @@ page {
height: 68rpx; height: 68rpx;
line-height: 68rpx; line-height: 68rpx;
font-size: 24rpx; font-size: 24rpx;
text-align: right; text-align: left;
margin-right: 16rpx;
color: #222222; color: #222222;
} }
.input_content{ .input_content{
box-sizing: border-box; box-sizing: border-box;
flex-shrink: 0; flex-shrink: 0;
width: 456rpx; width: 100%;
height: 68rpx; height: 68rpx;
border: 2rpx solid #DCDCDC; border: 2rpx solid #DCDCDC;
border-radius: 8rpx; border-radius: 8rpx;
...@@ -139,22 +140,44 @@ page { ...@@ -139,22 +140,44 @@ page {
height: 100%; height: 100%;
} }
} }
.tips_text{
font-weight: 400;
font-size: 22rpx;
color: #9B9B9E;
margin-top: 16rpx;
}
.upload_box{
display: flex;
flex-wrap: wrap;
gap: 20rpx;
.payVoucher_image{ .payVoucher_image{
width: 456rpx; flex-shrink: 0;
height: 316rpx; width: 304rpx;
border: 2rpx dashed #999999; height: 192rpx;
border-radius: 20rpx; border-radius: 20rpx;
position: relative;
image{
width: 100%;
height: 100%;
}
.del_icon{
width: 40rpx;
height: 40rpx;
position: absolute;
top: 16rpx;
right: 16rpx;
}
} }
.camera-box{ .camera-box{
flex-shrink: 0; flex-shrink: 0;
width: 460rpx; width: 304rpx;
height: 320rpx; height: 192rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/pay-voucher-bg.png'); background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/pay-voucher-bg.png');
background-size: 100% 100%; background-size: 100% 100%;
position: relative; position: relative;
.camera-icon{ .camera-icon{
width: 96rpx; width: 72rpx;
height: 96rpx; height: 72rpx;
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 50%; top: 50%;
...@@ -162,6 +185,8 @@ page { ...@@ -162,6 +185,8 @@ page {
} }
} }
} }
}
.confirm-btn{ .confirm-btn{
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -208,7 +233,7 @@ page { ...@@ -208,7 +233,7 @@ page {
border-radius: 16rpx; border-radius: 16rpx;
padding: 32rpx 40rpx; padding: 32rpx 40rpx;
box-sizing: border-box; box-sizing: border-box;
margin: 100rpx auto; margin: 20rpx auto;
.order-title { .order-title {
font-weight: 600; font-weight: 600;
......
...@@ -49,18 +49,22 @@ ...@@ -49,18 +49,22 @@
<input <input
type="text" type="text"
bindinput="input" bindinput="input"
value="{{customOutTradeNo}}" maxlength="-1"
maxlength="32" /> value="{{customOutTradeNo}}" />
</view> </view>
<view class="tips_text">多笔交易流水号之间以“/”号隔开,最多可上传5笔交易流水</view>
</view> </view>
<view class="input-item"> <view class="input-item">
<view class="label">上传付款凭证</view> <view class="label">上传付款凭证</view>
<view bindtap="upLoad"> <view class="upload_box">
<block wx:if="{{customPayVoucher}}"> <block wx:if="{{customPayVoucher.length > 0}}">
<image class="payVoucher_image" src="{{customPayVoucher}}" /> <view class="payVoucher_image" wx:for="{{customPayVoucher}}" wx:key="index">
<image bindtap="previewImage" data-index="{{index}}" data-url="{{customPayVoucher}}" src="{{item}}"/>
<image class="del_icon" src="../../images/del_icon.png" mode="" bindtap="delCustomPayVoucher" data-index="{{index}}"/>
</view>
</block> </block>
<block wx:else> <block wx:if="{{customPayVoucher.length < 5}}">
<view class="camera-box"> <view class="camera-box" bindtap="upLoad">
<gl-image <gl-image
class="camera-icon" class="camera-icon"
webp webp
......
...@@ -11,7 +11,7 @@ Component({ ...@@ -11,7 +11,7 @@ Component({
if (n) { if (n) {
this.setData({ this.setData({
outTradeNo: '', outTradeNo: '',
payVoucher: '' payVoucher: []
}) })
} }
} }
...@@ -23,7 +23,7 @@ Component({ ...@@ -23,7 +23,7 @@ Component({
*/ */
data: { data: {
outTradeNo: '', outTradeNo: '',
payVoucher: '' payVoucher: []
}, },
/** /**
...@@ -32,7 +32,7 @@ Component({ ...@@ -32,7 +32,7 @@ Component({
methods: { methods: {
input(e) { input(e) {
let { value } = e.detail let { value } = e.detail
let val = value.replace(/[^a-zA-Z0-9]/g, '') let val = value.replace(/[^\a-\z\A-\Z0-9\/]/g, '')
this.setData({ this.setData({
outTradeNo: val outTradeNo: val
}) })
...@@ -40,6 +40,7 @@ Component({ ...@@ -40,6 +40,7 @@ Component({
// 上传付款凭证 // 上传付款凭证
upLoad() { upLoad() {
let _this = this let _this = this
let { payVoucher } = _this.data
wx.chooseImage({ wx.chooseImage({
count: 1, count: 1,
success(res) { success(res) {
...@@ -59,8 +60,9 @@ Component({ ...@@ -59,8 +60,9 @@ Component({
console.log(img) console.log(img)
let { code, data, message } = img let { code, data, message } = img
if (code == 0) { if (code == 0) {
payVoucher.push(data)
_this.setData({ _this.setData({
payVoucher: data payVoucher
}) })
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
...@@ -71,6 +73,14 @@ Component({ ...@@ -71,6 +73,14 @@ Component({
} }
}) })
}, },
// 删除付款凭证
delCustomPayVoucher(e) {
let _this = this
let { index } = e.currentTarget.dataset
let { payVoucher } = _this.data
payVoucher.splice(index, 1)
this.setData({payVoucher})
},
confirm() { confirm() {
let { outTradeNo, payVoucher } = this.data let { outTradeNo, payVoucher } = this.data
if (!outTradeNo) { if (!outTradeNo) {
...@@ -79,6 +89,18 @@ Component({ ...@@ -79,6 +89,18 @@ Component({
if (!payVoucher) { if (!payVoucher) {
return wx.$util.showToast('请上传付款凭证') return wx.$util.showToast('请上传付款凭证')
} }
let customOutTradeNoArr = outTradeNo.split('/') || []
if (customOutTradeNoArr?.length > 5) return wx.$util.showToast('最多5笔交易流水号')
try {
customOutTradeNoArr?.forEach(v => {
if (v?.length > 32) throw v
})
} catch (error) {
return wx.$util.showToast('每个交易流水号最大支持32位字符')
}
if (!payVoucher?.length) {
return wx.$util.showToast('请上传付款凭证')
}
this.triggerEvent('payVoucherConfirm', {outTradeNo, payVoucher}) this.triggerEvent('payVoucherConfirm', {outTradeNo, payVoucher})
}, },
cancel() { cancel() {
......
...@@ -3,10 +3,11 @@ ...@@ -3,10 +3,11 @@
flex-shrink: 0; flex-shrink: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 38rpx 44rpx; padding: 38rpx 0;
box-sizing: border-box; box-sizing: border-box;
.input-item{ .input-item{
display: flex; display: flex;
flex-flow: column;
margin-bottom: 36rpx; margin-bottom: 36rpx;
.label{ .label{
flex-shrink: 0; flex-shrink: 0;
...@@ -14,14 +15,13 @@ ...@@ -14,14 +15,13 @@
height: 68rpx; height: 68rpx;
line-height: 68rpx; line-height: 68rpx;
font-size: 24rpx; font-size: 24rpx;
text-align: right; text-align: left;
margin-right: 16rpx;
color: #222222; color: #222222;
} }
.input_content{ .input_content{
box-sizing: border-box; box-sizing: border-box;
flex-shrink: 0; flex-shrink: 0;
width: 456rpx; width: 100%;
height: 68rpx; height: 68rpx;
border: 2rpx solid #DCDCDC; border: 2rpx solid #DCDCDC;
border-radius: 8rpx; border-radius: 8rpx;
...@@ -33,22 +33,44 @@ ...@@ -33,22 +33,44 @@
height: 100%; height: 100%;
} }
} }
.tips_text{
font-weight: 400;
font-size: 22rpx;
color: #9B9B9E;
margin-top: 16rpx;
}
.upload_box{
display: flex;
flex-wrap: wrap;
gap: 20rpx;
.payVoucher_image{ .payVoucher_image{
width: 456rpx; flex-shrink: 0;
height: 316rpx; width: 304rpx;
border: 2rpx dashed #999999; height: 192rpx;
border-radius: 20rpx; border-radius: 20rpx;
position: relative;
image{
width: 100%;
height: 100%;
}
.del_icon{
width: 40rpx;
height: 40rpx;
position: absolute;
top: 16rpx;
right: 16rpx;
}
} }
.camera-box{ .camera-box{
flex-shrink: 0; flex-shrink: 0;
width: 460rpx; width: 304rpx;
height: 320rpx; height: 192rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/pay-voucher-bg.png'); background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/pay-voucher-bg.png');
background-size: 100% 100%; background-size: 100% 100%;
position: relative; position: relative;
.camera-icon{ .camera-icon{
width: 96rpx; width: 72rpx;
height: 96rpx; height: 72rpx;
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 50%; top: 50%;
...@@ -56,4 +78,17 @@ ...@@ -56,4 +78,17 @@
} }
} }
} }
}
.confirm-btn{
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
color: #FFFFFF;
width: 100%;
height: 88rpx;
background: #3582EE;
border-radius: 12rpx;
}
} }
\ No newline at end of file \ No newline at end of file
<!--packageCrowdFunding/pages/newOrder/components/paymentVoucherPopup.wxml--> <!--packageCrowdFunding/pages/newOrder/components/paymentVoucherPopup.wxml-->
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="750rpx" title="上传付款凭证"> <popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="auto" title="上传付款凭证">
<view class="input-box"> <view class="input-box">
<view class="input-item"> <view class="input-item">
<view class="label">交易流水号</view> <view class="label">交易流水号</view>
...@@ -7,18 +7,22 @@ ...@@ -7,18 +7,22 @@
<input <input
type="text" type="text"
bindinput="input" bindinput="input"
value="{{outTradeNo}}" maxlength="-1"
maxlength="32" /> value="{{customOutTradeNo}}" />
</view> </view>
<view class="tips_text">多笔交易流水号之间以“/”号隔开,最多可上传5笔交易流水</view>
</view> </view>
<view class="input-item"> <view class="input-item">
<view class="label">上传付款凭证</view> <view class="label">上传付款凭证</view>
<view bindtap="upLoad"> <view class="upload_box">
<block wx:if="{{payVoucher}}"> <block wx:if="{{payVoucher.length > 0}}">
<image class="payVoucher_image" src="{{payVoucher}}" /> <view class="payVoucher_image" wx:for="{{payVoucher}}" wx:key="index">
<image bindtap="previewImage" data-index="{{index}}" data-url="{{payVoucher}}" src="{{item}}"/>
<image class="del_icon" src="../../../images/del_icon.png" mode="" bindtap="delCustomPayVoucher" data-index="{{index}}"/>
</view>
</block> </block>
<block wx:else> <block wx:if="{{payVoucher.length < 5}}">
<view class="camera-box"> <view class="camera-box" bindtap="upLoad">
<gl-image <gl-image
class="camera-icon" class="camera-icon"
webp webp
......
...@@ -159,7 +159,7 @@ Page({ ...@@ -159,7 +159,7 @@ Page({
merchantId: merchantInfo.merchantId, merchantId: merchantInfo.merchantId,
merchantName: merchantInfo.merchantName, merchantName: merchantInfo.merchantName,
outTradeNo: obj.outTradeNo, outTradeNo: obj.outTradeNo,
payVoucher: obj.payVoucher payVoucherList: obj.payVoucher
} }
this.setData({ this.setData({
confirmFlag: true confirmFlag: true
......
...@@ -52,6 +52,11 @@ export default { ...@@ -52,6 +52,11 @@ export default {
let params = data || {} let params = data || {}
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.print', params) return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.print', params)
}, },
/** 查询合同*/
equityOrderList(data) {
let params = data || {}
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.listContracts', params)
},
/** 商品详情 */ /** 商品详情 */
goodsInfoGetDetailById(data) { goodsInfoGetDetailById(data) {
let params = data || {} let params = data || {}
......
// packageEquity/pages/carEquity/components/GLForm/GLForm.js // packageEquity/pages/carEquity/components/GLForm/GLForm.js
Component({ Component({
externalClasses: ['custom-class'],
options: { options: {
multipleSlots: true // 在组件定义时的选项中启用多 slot 支持 multipleSlots: true // 在组件定义时的选项中启用多 slot 支持
}, },
...@@ -9,7 +10,7 @@ Component({ ...@@ -9,7 +10,7 @@ Component({
properties: { properties: {
formData: { formData: {
type: Object, type: Object,
value: () => {}, value: () => { },
observer: function (n) { observer: function (n) {
this.setData({ this.setData({
formData: n formData: n
...@@ -32,6 +33,15 @@ Component({ ...@@ -32,6 +33,15 @@ Component({
disable: { disable: {
type: Boolean, type: Boolean,
value: false value: false
},
glCellClass: {
type: String,
value: false
},
// 背景色
background: {
type: String,
value: '#FFFFFF'
} }
}, },
...@@ -82,22 +92,37 @@ Component({ ...@@ -82,22 +92,37 @@ Component({
}, },
handleInput(e) { handleInput(e) {
let value = e.detail let value = e.detail
let { attr } = e.target.dataset let { attr, item } = e.target.dataset
const trimValue = value.trim()
if (value != trimValue ) {
value = trimValue
}
let { dataAttrName } = this.data let { dataAttrName } = this.data
if (attr=='price' && value>=2000000) { // if (attr == 'price') {
value = '2000000' // value = value >= 2000000 ? '2000000' : value
wx.$eventbus.emit('delete_goodsSelect') // // wx.$eventbus.emit('delete_goodsSelect')
} // }
// console.log(item,'handleInput');
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
if (item.inputLimit && item.inputLimit.maxVal) {
value = value >= item.inputLimit.maxVal ? item.inputLimit.maxVal : value
}
if (item.inputLimit && item.inputLimit.minVal) {
value = value <= item.inputLimit.minVal ? item.inputLimit.minVal : value
}
if (item.inputLimit && item.inputLimit.type == 'digit') {
let [number, decimal] = value.toString().split('.')
if (decimal != undefined) {
decimal = decimal.substring(0, 2)
number += `.${decimal}`
value = number
}
}
const diffValue = value.toString()
const trimValue = value.toString().trim()
if (diffValue != trimValue) {
value = trimValue
}
thisPage.setData({ thisPage.setData({
[dataAttrName + '.' + attr]: value [dataAttrName + '.' + attr]: value
// [dataAttrName + '.' + attr]: value
}) })
}, },
handlePickerChange(e) { handlePickerChange(e) {
let idx = e.detail.value || 0 let idx = e.detail.value || 0
......
<!-- packageEquity/pages/carEquity/components/GLForm/GLForm.wxml --> <!-- packageEquity/pages/carEquity/components/GLForm/GLForm.wxml -->
<view wx:for="{{formDataList}}" wx:key="index"> <wxs src="./GLForm.wxs" module="filterUtils" />
<view wx:for="{{formDataList}}" wx:key="index" class="custom-class">
<gl-cell <gl-cell
wx:if="{{filterUtils.isShowFn(formData, item)}}"
border="{{!item.noBorder}}" border="{{!item.noBorder}}"
class="{{item.name}}" class="{{item.name}}"
haveArrow="{{item.haveArrow || false}}" haveArrow="{{item.haveArrow || false}}"
...@@ -11,6 +13,7 @@ ...@@ -11,6 +13,7 @@
bindclick="handleCellClick" bindclick="handleCellClick"
data-target="{{item}}" data-target="{{item}}"
data-idx="{{index}}" data-idx="{{index}}"
background="{{background}}"
required="{{item.required}}" required="{{item.required}}"
requiredAfter="{{item.requiredAfter}}" requiredAfter="{{item.requiredAfter}}"
cellHeight="{{!item.noCellHeight}}"> cellHeight="{{!item.noCellHeight}}">
...@@ -21,7 +24,7 @@ ...@@ -21,7 +24,7 @@
<!-- rows="1" --> <!-- rows="1" -->
<van-field <van-field
class="textarea" class="textarea"
custom-style="padding: 20rpx 0;" custom-style="padding: 20rpx 0; background: {{background}};"
border="{{ false}}" border="{{ false}}"
value="{{formData[item.name]}}" value="{{formData[item.name]}}"
input-align="{{itme.inputAlign || 'right'}}" input-align="{{itme.inputAlign || 'right'}}"
...@@ -33,6 +36,7 @@ ...@@ -33,6 +36,7 @@
disabled="{{item.disabled||disable}}" disabled="{{item.disabled||disable}}"
readonly="{{item.readonly}}" readonly="{{item.readonly}}"
data-attr="{{item.name}}" data-attr="{{item.name}}"
data-item="{{item}}"
bindinput="handleInput" /> bindinput="handleInput" />
<text wx:if="{{item.suffix}}" class="input-suffix">{{item.suffix}}</text> <text wx:if="{{item.suffix}}" class="input-suffix">{{item.suffix}}</text>
</view> </view>
......
var isShowFn = function (formData, targetItem) {
var flag = false
if (targetItem.isShowObj && formData) {
for (var i = 0; i <= targetItem.isShowObj.list.length; i++) {
var item = targetItem.isShowObj.list[i]
if (item == formData[targetItem.isShowObj.attr]) {
flag = true
break
}
}
} else {
flag = true
}
return flag
}
module.exports = {
isShowFn: isShowFn
}
\ No newline at end of file \ No newline at end of file
...@@ -15,8 +15,10 @@ ...@@ -15,8 +15,10 @@
<!-- test --> <!-- test -->
</view> </view>
<view class="text" wx:elif="{{item.type == 'project' }}"> <view class="text" wx:elif="{{item.type == 'project' }}">
<view class="goodsName">{{orderInfo.subOrderList[0].upgradeGoodsName}}</view> <block wx:for="{{orderInfo.subOrderList}}" wx:for-item="subItem" wx:key="idx">
<view class="goodsItem">包含{{orderInfo.subOrderList[0].serviceItems}}</view> <view class="goodsName">{{subItem.upgradeGoodsName}} <text class="goodsItem">(包含{{subItem.serviceItems}})</text></view>
</block>
<!-- <view class="goodsItem">包含{{orderInfo.subOrderList[0].serviceItems}}</view> -->
</view> </view>
<view class="text" wx:else>{{orderInfo[item.key]||''}}</view> <view class="text" wx:else>{{orderInfo[item.key]||''}}</view>
</view> </view>
......

1.9 KB | W: | H:

292 Bytes | W: | H:

packageEquity/images/arrow-left.png
packageEquity/images/arrow-left.png
packageEquity/images/arrow-left.png
packageEquity/images/arrow-left.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -35,7 +35,7 @@ Page({ ...@@ -35,7 +35,7 @@ Page({
shopSideSelectPopup: false, shopSideSelectPopup: false,
mode: 1, mode: 1,
tipsProps: false, tipsProps: false,
waitInputCount: 1, waitInputCount: 0,
isStaff: false isStaff: false
// hasMode:true // hasMode:true
}, },
...@@ -200,7 +200,6 @@ Page({ ...@@ -200,7 +200,6 @@ Page({
[`pageShow[${tabIndex}]`]: true, [`pageShow[${tabIndex}]`]: true,
tabIndex tabIndex
}) })
// this.onShow()
this.initList() this.initList()
}, },
...@@ -212,9 +211,11 @@ Page({ ...@@ -212,9 +211,11 @@ Page({
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), default4SStoreInfo }) wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), default4SStoreInfo })
this.setData({ this.setData({
userInfo: { ...wx.$util.getUserInfo(), default4SStoreInfo } userInfo: { ...wx.$util.getUserInfo(), default4SStoreInfo },
waitInputCount: 0
}) })
this.getMerchant4SMode() this.getMerchant4SMode()
this.initList()
}, },
initList() { initList() {
let { tabIndex } = this.data let { tabIndex } = this.data
...@@ -267,6 +268,12 @@ Page({ ...@@ -267,6 +268,12 @@ Page({
} }
}, },
onRoute(options) {
// console.log(options,'options');
if (options&&options.tabIndex) {
this.changeTabBar({detail:options.tabIndex})
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
......
...@@ -212,12 +212,17 @@ Component({ ...@@ -212,12 +212,17 @@ Component({
}) })
}, },
// 查看/下载合同 // 查看/下载合同
handlePreviewContract(e) { async handlePreviewContract(e) {
let { target, type } = e.currentTarget.dataset let { target, type } = e.currentTarget.dataset
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
let params = { let params = {
contractNo: target.contractNo contractNo: target.contractNo
// contractNo: 'car679883190869172224' //开发测试用
} }
let result = await carLifeApi.equityOrderList({ orderId: target.orderId })
let { code, data } = result
if (code == 0) {
if (data.length == 1) {
carLifeApi.printContract(params).then(res => { carLifeApi.printContract(params).then(res => {
wx.hideLoading() wx.hideLoading()
if (res.code == '0') { if (res.code == '0') {
...@@ -233,6 +238,12 @@ Component({ ...@@ -233,6 +238,12 @@ Component({
wx.$util.showToast(res.message || '接口异常') wx.$util.showToast(res.message || '接口异常')
} }
}) })
} else {
wx.$router.go('previewList', { list: data })
}
}
console.log(result, 'result')
return
}, },
// 复制链接 // 复制链接
......
...@@ -16,6 +16,7 @@ Component({ ...@@ -16,6 +16,7 @@ Component({
this.setData({ this.setData({
formData: n formData: n
}) })
this.dealFormRule()
} }
}, },
// 页面存放表单对象的对象名,用于直接变更page的值 // 页面存放表单对象的对象名,用于直接变更page的值
...@@ -63,6 +64,19 @@ Component({ ...@@ -63,6 +64,19 @@ Component({
// }) // })
// }, // },
dealFormRule() {
var { formData, formRule } = this.data
const list = ['tireBrand', 'frontTireSpecification', 'rearTireSpecification']
if(formData && formData.tireFlag == 0) {
list.forEach(item => {
formRule[item][0].required = false
})
}
this.setData({
formRule
})
},
// 删除图片 // 删除图片
handleDelete(e) { handleDelete(e) {
let { attr } = e.currentTarget.dataset let { attr } = e.currentTarget.dataset
......
...@@ -9,7 +9,10 @@ Component({ ...@@ -9,7 +9,10 @@ Component({
properties: { properties: {
serviceInfo: { serviceInfo: {
type: Object, type: Object,
value: () => { } value: () => { },
observer: function (n) {
this.dealFormRule()
}
}, },
// 页面存放表单对象的对象名 // 页面存放表单对象的对象名
dataAttrName: { dataAttrName: {
...@@ -53,6 +56,20 @@ Component({ ...@@ -53,6 +56,20 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
dealFormRule() {
let formData = this.getPageData()
var { formRule } = this.data
const list = ['tireBrand', 'frontTireSpecification', 'rearTireSpecification']
if(formData && formData.tireFlag == 0) {
list.forEach(item => {
formRule[item][0].required = false
})
}
console.log(formRule);
this.setData({
formRule
})
},
handleUpDown(e) { handleUpDown(e) {
let { attr } = e.currentTarget.dataset let { attr } = e.currentTarget.dataset
this.setData({ this.setData({
...@@ -92,6 +109,13 @@ Component({ ...@@ -92,6 +109,13 @@ Component({
// } // }
return return
} }
for(let i = 0; i < formData.goodInfoList.length; i++) {
let item = formData.goodInfoList[i]
if(item.entityCardFlag == 'Y' && !/[a-zA-Z0-9]{6}/.test(item.card)) {
wx.$util.showToast(item.goodName + '商品卡号请输入6位字母或数字')
return
}
}
this.triggerEvent('confirm', { type: 'confirm' }) this.triggerEvent('confirm', { type: 'confirm' })
}, },
handleDraft() { handleDraft() {
......
...@@ -43,7 +43,20 @@ ...@@ -43,7 +43,20 @@
</view> </view>
</view> </view>
</view> </view>
<gl-form wx:if="{{isShowObj.product}}" id="product" formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{secondObj.productFormList}}"></gl-form> <gl-form wx:if="{{isShowObj.product}}" id="product" formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{secondObj.productFormList}}">
<!-- 多商品 -->
<view slot="goodInfoList">
<view wx:for="{{serviceInfo.goodInfoList}}" wx:key="index">
<view class="pro-head">
<view>{{item.goodName}}</view>
<view class="pro-service">包含{{item.items}}</view>
</view>
<view class="pro-list">
<gl-form id="proList" background="#F4F5F7" formData="{{item}}" dataAttrName="{{'serviceInfo.goodInfoList[' + index +']'}}" formDataList="{{secondObj.productFormList[0].proFormList}}"></gl-form>
</view>
</view>
</view>
</gl-form>
</view> </view>
<view class="box m-b-40"> <view class="box m-b-40">
<view class="title"> <view class="title">
......
...@@ -178,3 +178,18 @@ ...@@ -178,3 +178,18 @@
.h-40 { .h-40 {
height: 40rpx; height: 40rpx;
} }
.pro-head {
margin: 30rpx 0;
}
.pro-head .pro-service {
font-size: 24rpx;
color: #999999;
}
.pro-list {
border: 4rpx solid #F4F5F7;
border-radius: 8rpx;
margin: 30rpx 0;
}
\ No newline at end of file \ No newline at end of file
...@@ -27,23 +27,39 @@ const secondObj = { ...@@ -27,23 +27,39 @@ const secondObj = {
label: '轮胎品牌', label: '轮胎品牌',
name: 'tireBrand', name: 'tireBrand',
type: 'input', type: 'input',
maxlength: '20' maxlength: '20',
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
}, { }, {
label: '规格型号(前轮)', label: '规格型号(前轮)',
name: 'frontTireSpecification', name: 'frontTireSpecification',
type: 'input', type: 'input',
maxlength: '20' maxlength: '20',
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
}, { }, {
label: '规格型号(后轮)', label: '规格型号(后轮)',
name: 'rearTireSpecification', name: 'rearTireSpecification',
type: 'input', type: 'input',
maxlength: '20' maxlength: '20',
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
}, { }, {
label: ' ', label: ' ',
name: 'tireUrl', name: 'tireUrl',
type: 'slot', type: 'slot',
labelWidth: '0rpx', labelWidth: '0rpx',
noCellHeight: true noCellHeight: true,
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
}], }],
} }
......
...@@ -45,7 +45,7 @@ const formRule = { ...@@ -45,7 +45,7 @@ const formRule = {
], ],
customerAddress: [{ required: true, message: '联系地址不能为空' }], customerAddress: [{ required: true, message: '联系地址不能为空' }],
effectiveDate: [{ required: true, message: '生效日期不能为空' }], effectiveDate: [{ required: true, message: '生效日期不能为空' }],
card: [{ required: true, message: '卡号不能为空' }], // card: [{ required: true, message: '卡号不能为空' }],
tireBrand: [{ required: true, message: '轮胎品牌不能为空' }], tireBrand: [{ required: true, message: '轮胎品牌不能为空' }],
frontTireSpecification: [{ required: true, message: '规格型号(前轮)不能为空' }], frontTireSpecification: [{ required: true, message: '规格型号(前轮)不能为空' }],
rearTireSpecification: [{ required: true, message: '规格型号(后轮)不能为空' }], rearTireSpecification: [{ required: true, message: '规格型号(后轮)不能为空' }],
...@@ -155,42 +155,95 @@ const secondObj = { ...@@ -155,42 +155,95 @@ const secondObj = {
], ],
productFormList: [ productFormList: [
{ {
label: ' ',
name: 'goodInfoList',
type: 'slot',
labelWidth: '0rpx',
noCellHeight: true,
proFormList: [{
label: '服务年限', label: '服务年限',
name: 'servicePeriod', name: 'servicePeriod',
type: 'input', type: 'input',
disabled: true, disabled: true,
suffix: '年' suffix: '年',
noCellHeight: true
}, {
label: '无忧保障服务费',
name: 'actualSalesPrice',
placeholder: '非必填',
type: 'input',
fieldType: 'digit',
inputLimit: {
type: 'digit',
maxVal: 100000,
minVal: 0
}, },
labelWidth: '220rpx',
maxlength: '9',
noCellHeight: true
}, {
label: '无忧卡卡号',
name: 'card',
type: 'input',
maxlength: '6',
noBorder: true,
noCellHeight: true,
isJudgeShow: true,
isShowObj: {
attr: 'entityCardFlag',
list: ['Y']
}
}]
},
// {
// label: '服务年限',
// name: 'servicePeriod',
// type: 'input',
// disabled: true,
// suffix: '年'
// },
{ {
label: '生效日期', label: '生效日期',
name: 'effectiveDate', name: 'effectiveDate',
type: 'pickerTime', type: 'pickerTime',
start: Util.tsFormatTime(new Date(new Date().setDate(new Date(new Date()).getDate() + 1)),'Y-M-D') start: Util.tsFormatTime(new Date(new Date().setDate(new Date(new Date()).getDate() + 1)), 'Y-M-D')
// .toLocaleDateString().replace('/','-') // .toLocaleDateString().replace('/','-')
}, },
{ // {
label: '卡号', // label: '卡号',
name: 'card', // name: 'card',
type: 'input', // type: 'input',
maxlength: '20' // maxlength: '20'
}, // },
{ {
label: '轮胎品牌', label: '轮胎品牌',
name: 'tireBrand', name: 'tireBrand',
type: 'input', type: 'input',
maxlength: '20' maxlength: '20',
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
}, },
{ {
label: '规格型号(前轮)', label: '规格型号(前轮)',
name: 'frontTireSpecification', name: 'frontTireSpecification',
type: 'input', type: 'input',
maxlength: '20' maxlength: '20',
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
}, },
{ {
label: '规格型号(后轮)', label: '规格型号(后轮)',
name: 'rearTireSpecification', name: 'rearTireSpecification',
type: 'input', type: 'input',
maxlength: '20' maxlength: '20',
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
}, },
{ {
label: '购车类型', label: '购车类型',
......
// packageEquity/pages/carEquity/previewList/previewList.js
import carLifeApi from '~/packageEquity/carEquityApi'
Page({
/**
* 页面的初始数据
*/
data: {
list: []
},
// 查看/下载合同
async handlePreviewContract(e) {
let { target, type } = e.currentTarget.dataset
wx.$util.showLoading('加载中...')
let params = {
contractNo: target.contractNo
// contractNo: 'car679883190869172224' //开发测试用
}
carLifeApi.printContract(params).then(res => {
wx.hideLoading()
if (res.code == '0') {
this.setData({
url: res.data
})
if (type == 'download') {
// 复制合同链接
this.copyContractUrl(res.data)
} else this.handleDownload()
console.log(this.data.url)
} else {
wx.$util.showToast(res.message || '接口异常')
}
})
},
// 复制链接
copyContractUrl(e) {
if (!e) {
wx.$util.showToast('没有合同')
return
}
wx.showModal({
title: '温馨提示',
content: '如需下载PDF报告单,请复制下载地址后到手机浏览器中打开。下载地址5分钟内有效',
confirmText: '复制地址',
confirmColor: '#3582EE',
success(res) {
if (res.confirm) {
wx.setClipboardData({
data: e
})
}
}
})
},
handleDownload() {
let { url } = this.data
let _this = this
if (!url) {
wx.$util.showToast('没有合同')
return
}
console.log('handleDownload')
wx.downloadFile({
// 示例 url,并非真实存在
url: url,
success: function (res) {
const manage = wx.getFileSystemManager()
let file = url.split('/')
let fileName = file[file.length - 1]
manage.saveFile({
tempFilePath: res.tempFilePath,
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
success: function (res) {
console.log('保存成功')
wx.openDocument({
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
fileType: 'pdf',
showMenu: true,
success: function (res) {
console.log('打开文档成功')
}
})
}
})
// console.log(wx.env.USER_DATA_PATH + "/" + fileName,'wx.env.USER_DATA_PATH + "/" + fileName');
}
})
},
onRoute(options) {
// console.log(e)
let { list } = options
console.log(list, 'list')
list.label = this.numberToChinese(list.label)
list.forEach((element, index) => {
element.label = this.numberToChinese(index + 1)
})
this.setData({
list
})
},
// 辅助函数,用于将数字转换为对应的中文数字
numberToChinese(number) {
const chineseNumbers = ['一', '二', '三', '四', '五', '六', '七', '八', '九']
const chineseUnits = ['', '十', '百', '千']
const chineseBigUnits = ['', '万', '亿', '兆']
let result = ''
let unitIndex = 0
while (number > 0) {
const digit = number % 10
if (digit !== 0) {
result = chineseNumbers[digit - 1] + chineseUnits[unitIndex] + result
}
unitIndex++
number = Math.floor(number / 10)
}
return result
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
})
{
"navigationBarTitleText": "选择合同",
"usingComponents": {}
}
/* packageEquity/pages/carEquity/previewList/previewList.wxss */
page {
background: #f3f5f7;
}
.item_box {
box-sizing: border-box;
padding: 32rpx;
width: 710rpx;
height: 120rpx;
margin: 20rpx auto 0;
display: flex;
align-items: center;
justify-content: space-between;
background: #FFFFFF;
box-shadow: 0 6rpx 16rpx 0 #cdcdd159;
border-radius: 16rpx;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 32rpx;
color: #222222;
}
.arrow {
width: 20rpx;
height: 20rpx;
border-top: 2rpx solid transparent;
border-right: 2rpx solid #ccc;
border-bottom: 2rpx solid #ccc;
border-left: 2rpx solid transparent;
transform: rotate(-45deg) translateY(-4rpx);
margin-left: 16rpx;
transition: all .3s;
}
.prevIcon {
margin-left: auto;
margin-right: 40rpx;
}
.downloadIcon{
margin-left: 40prx;}
.icon {
width: 40rpx;
height: 40rpx;
}
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/carEquity/previewList/previewList.wxml-->
<!-- <text>packageEquity/pages/carEquity/previewList/previewList.wxml</text> -->
<view class="box">
<view class="list_container" wx:for="{{ list }}" wx:key="index">
<view class="item_box">
<view wx:if="{{ item.goodName }}">合同:{{item.goodName}}</view>
<view wx:else>合同{{item.label}}</view>
<!-- <image src="" binderror="" bindload=""></image> -->
<!-- <view class="arrow"></view> -->
<view class="icon prevIcon" bindtap="handlePreviewContract" data-target="{{ item }}">
<image wepb="true" src="../../image/previewIcon.png" mode="" binderror="" bindload=""></image>
</view>
<view class="icon downloadIcon" bindtap="handlePreviewContract" data-target="{{ item }}" data-type="download">
<image wepb="true" src="../../image/downloadIcon.png" mode="" binderror="" bindload=""></image>
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -30,7 +30,7 @@ Page({ ...@@ -30,7 +30,7 @@ Page({
// 页面存放表单对象的对象名 // 页面存放表单对象的对象名
dataAttrName: 'serviceInfo', dataAttrName: 'serviceInfo',
// step: 'first', // step: 'first',
step: 'second', step: '',
routeInfo: {}, routeInfo: {},
contractNo: '', contractNo: '',
url: '', url: '',
...@@ -43,7 +43,7 @@ Page({ ...@@ -43,7 +43,7 @@ Page({
isDialogShow: false, isDialogShow: false,
dialogObj: {}, dialogObj: {},
scrollTop: 0, scrollTop: 0,
cardSetting:true cardSetting: true
}, },
getPickerObj(obj) { getPickerObj(obj) {
...@@ -84,6 +84,12 @@ Page({ ...@@ -84,6 +84,12 @@ Page({
obj[item] = (obj[item] / 100).toFixed(2) obj[item] = (obj[item] / 100).toFixed(2)
} }
}) })
// 商品服务费,分-元
obj.goodInfoList.forEach((item, idx) => {
if (item.actualSalesPrice) {
obj.goodInfoList[idx].actualSalesPrice = (item.actualSalesPrice / 100).toFixed(2)
}
})
// picker-label处理 // picker-label处理
let pickerList = [] let pickerList = []
Object.keys(secondStepData.secondObj).forEach(item => { Object.keys(secondStepData.secondObj).forEach(item => {
...@@ -146,9 +152,31 @@ Page({ ...@@ -146,9 +152,31 @@ Page({
// 权益卡 // 权益卡
this.getInterestCardSetting(data.goodId) this.getInterestCardSetting(data.goodId)
} }
// goodInfoList,数据结构 - 删
// data.goodInfoList = [{
// items: ['xx服务', '哈哈服务', '嘻嘻服务'],
// goodName: '商品名称',
// actualSalesPrice: 3 || data.actualSalesPrice,
// card: data.card,
// contractNo: data.contractNo,
// packageCode: data.packageCode,
// servicePeriod: data.servicePeriod,
// goodId: data.goodId,
// entityCardFlag: 'Y'
// }, {
// items: ['xx服务', '哈哈服务', '嘻嘻服务'],
// goodName: '商品名称22',
// actualSalesPrice: data.actualSalesPrice,
// card: data.card,
// contractNo: data.contractNo,
// packageCode: data.packageCode,
// servicePeriod: data.servicePeriod,
// goodId: data.goodId,
// entityCardFlag: 'N'
// }]
this.setData({ this.setData({
serviceInfo: data, serviceInfo: data,
// step: data.mode ? 'second' : 'first' step: data.mode ? 'second' : 'first'
// 先调试 // 先调试
}) })
} else { } else {
...@@ -156,19 +184,21 @@ Page({ ...@@ -156,19 +184,21 @@ Page({
} }
}) })
}, },
getInterestCardSetting(id) { // 是否要新增实体卡 字段 Y要 N不要 getInterestCardSetting(id) {
// 是否要新增实体卡 字段 Y要 N不要
carLifeApi.goodsInfoGetDetailById({ id }).then(res => { carLifeApi.goodsInfoGetDetailById({ id }).then(res => {
console.log('res', res) console.log('res', res)
// this.setData({ // this.setData({
// cardSetting:false // cardSetting:false
// }) // })
let {code,data} = res let { code, data } = res
console.log(data,'data'); console.log(data, 'data')
if (res.code == 0) { if (res.code == 0) {
const entityCardFlag = data.upgradeGoods.entityCardFlag const entityCardFlag = data.upgradeGoods.entityCardFlag
console.log(entityCardFlag,'entityCardFlag'); console.log(entityCardFlag, 'entityCardFlag')
entityCardFlag !='Y' && this.setData({ entityCardFlag != 'Y' &&
cardSetting:false this.setData({
cardSetting: false
}) })
// let data = res.data[0] // let data = res.data[0]
// this.setData({ // this.setData({
...@@ -227,6 +257,12 @@ Page({ ...@@ -227,6 +257,12 @@ Page({
obj[item] = (obj[item] * 100).toFixed(0) obj[item] = (obj[item] * 100).toFixed(0)
} }
}) })
// 商品服务费,分-元
obj.goodInfoList.forEach((item, idx) => {
if (item.actualSalesPrice) {
obj.goodInfoList[idx].actualSalesPrice = (item.actualSalesPrice * 100).toFixed(0)
}
})
return obj return obj
}, },
...@@ -248,10 +284,12 @@ Page({ ...@@ -248,10 +284,12 @@ Page({
this.setData({ this.setData({
dialogObj: JSON.parse(JSON.stringify(sussObj)), dialogObj: JSON.parse(JSON.stringify(sussObj)),
isDialogShow: true, isDialogShow: true,
contractNo: res.data contractNo: res.data[0].contractNo,
contractNoList: res.data
}) })
} else { } else {
wx.$router.reLaunch('packageEquity.equityPage') // wx.$router.reLaunch('packageEquity.equityPage')
wx.$router.reLaunch('packageEquity.equityPage',{tabIndex:1})
} }
} else { } else {
wx.$util.showToast(res.message || '接口异常') wx.$util.showToast(res.message || '接口异常')
...@@ -266,7 +304,6 @@ Page({ ...@@ -266,7 +304,6 @@ Page({
scrollTop: height // 滚动到的位置(距离顶部 px) scrollTop: height // 滚动到的位置(距离顶部 px)
}) })
}, },
handleSecondConfirm(e) { handleSecondConfirm(e) {
let { serviceInfo, conSecondObj } = this.data let { serviceInfo, conSecondObj } = this.data
if (e.detail?.type == 'confirm') { if (e.detail?.type == 'confirm') {
...@@ -308,7 +345,9 @@ Page({ ...@@ -308,7 +345,9 @@ Page({
handleTipClick(e) { handleTipClick(e) {
let { type } = e.currentTarget.dataset let { type } = e.currentTarget.dataset
if (type == 'success') { if (type == 'success') {
this.getUrl() let { contractNoList } = this.data
contractNoList.length == 1 ? this.getUrl() : wx.$router.redirectTo('previewList', { list: contractNoList })
// this.getUrl()
return true return true
} }
let params = { let params = {
...@@ -328,6 +367,7 @@ Page({ ...@@ -328,6 +367,7 @@ Page({
this.setData({ this.setData({
isDialogShow: false isDialogShow: false
}) })
wx.$router.reLaunch('packageEquity.equityPage',{tabIndex:1})
}, },
// 合同地址 // 合同地址
...@@ -426,7 +466,7 @@ Page({ ...@@ -426,7 +466,7 @@ Page({
onShow() { onShow() {
let { isBack } = this.data let { isBack } = this.data
if (isBack) { if (isBack) {
wx.$router.reLaunch('packageEquity.equityPage') wx.$router.reLaunch('packageEquity.equityPage',{tabIndex:1})
} }
}, },
......
...@@ -12,6 +12,10 @@ Page({ ...@@ -12,6 +12,10 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
payItems: [
{ id: 1, name: '微信支付', icon: 'wxPay' },
{ id: 3, name: 'POS机', icon: 'posPay' },
],
orderCode: '', orderCode: '',
wxqrcode: '', wxqrcode: '',
posqrcode: '', posqrcode: '',
...@@ -29,6 +33,9 @@ Page({ ...@@ -29,6 +33,9 @@ Page({
}, },
selectPayType: 1 selectPayType: 1
}, },
back() {
wx.$router.back()
},
async changePayType(e) { async changePayType(e) {
console.log(e) console.log(e)
// pos支付 // pos支付
...@@ -201,7 +208,8 @@ Page({ ...@@ -201,7 +208,8 @@ Page({
onRoute(options) { onRoute(options) {
// console.log(options = 19) // console.log(options = 19)
let { data, id } = options let { data, id } = options
// id = 14 // id = 123
// orderCode: 230724111753590
this.setData({ id }) this.setData({ id })
this.getQuotationInfoById() this.getQuotationInfoById()
}, },
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
"usingComponents": { "usingComponents": {
"order-detail": "../../../components/orderInfoCom/orderInfoCom" "order-detail": "../../../components/orderInfoCom/orderInfoCom"
}, },
"navigationBarTitleText": "订单支付" "navigationStyle": "custom"
} }
/* packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.wxss */ /* packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.wxss */
page { page {
background: #f3f5f7; height: 100vh;
background-color: #f3f5f7
} }
.big-img {
box-sizing: border-box;
position: relative;
width: 100%;
height: 320rpx;
padding: 24rpx 36rpx 32rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/headerBg-l.png');
background-size: 100% 100%;
}
.big-img .money {
color: #fff;
font-size: 28rpx;
display: flex;
margin-top: 40rpx;
}
.big-img .money .sum {
font-size: 34rpx
}
.big-img .titleBox {
display: flex;
padding-top: 80rpx;
align-items: center;
width: 55%;
justify-content: space-between;
color: #fff;
}
.big-img .titleBox .imgBox image {
width: 22rpx;
height: 32rpx;
display: inline-block;
vertical-align: middle;
}
.box {
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
width: 710rpx;
height: 716rpx;
background: #FFFFFF;
border-radius: 16rpx;
margin: -34rpx auto 34rpx;
}
.box .right image {
width: 14rpx;
height: 24rpx;
display: inline-block;
vertical-align: middle;
}
.box .tab-head {
display: flex;
width: 100%;
height: 100rpx;
overflow: hidden;
border-radius: 16rpx 16rpx 0 0;
overflow: hidden;
flex-shrink: 0;
}
.box .tab-head .tab-item {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
font-weight: 600;
font-size: 32rpx;
color: #222222;
background-color: #ebf2fd;
z-index: 2;
}
.box .tab-head .tab-item.active {
background: #fff;
}
.box .pay-box{
flex-shrink: 0;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
}
.box .pay-box .tab-title {
margin: 36rpx 0;
}
.box .pay-box .tab-qrcode {
width: 430rpx;
height: 430rpx;
}
.box .pay-box .tab-desc {
margin-top: 20rpx;
font-size: 24rpx;
color: #666666;
}
.OrderInfoPay { .OrderInfoPay {
// background-color: #f5f5f5; // background-color: #f5f5f5;
padding: 20rpx; padding:0 20rpx 20rpx;
.payType { .payType {
display: flex; display: flex;
......
<!-- packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.wxml --> <!-- packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.wxml -->
<view class="big-img page-box isFullSucreen">
<view class="titleBox">
<view class="imgBox" bind:tap="back">
<image src="../../../images/arrow-left.png" />
</view>
<view class="navigation-title-text">订单支付</view>
</view>
<view class="money">总保费{{orderDetail.totalPrice}}元/年</view>
</view>
<view class="OrderInfoPay"> <view class="OrderInfoPay">
<view class="qrCodeCom"> <view class=" box">
<view class="tab-head">
<view
class="tab-item {{selectPayType === item.id?'active':'' }}"
wx:for="{{payItems}}"
wx:key="index"
data-item="{{item}}"
data-value="{{item.id}}"
catchtap="changePayType">
<gl-image
class="btn_icon"
data-item="{{item}}"
webp
src="/miniProgram/{{item.icon}}.png"></gl-image>
{{item.name}}
</view>
</view>
<!-- 微信/pos机支付 -->
<block wx:if="{{selectPayType == 1 || selectPayType == 3}}">
<view class="pay-box">
<view class="tab-title">{{orderDetail.merchantName}}</view>
<view class="tab-qrcode">
<image src="{{selectPayType==1?wxqrcode:posqrcode}}" mode="widthFix" />
</view>
<view class="tab-desc" hidden="{{selectPayType==3}}">请让客户打开微信扫描上方付款码进行支付</view>
<view class="tab-desc" hidden="{{selectPayType==1}}">请使用POS机扫描此码,再向客户收款</view>
</view>
</block>
</view>
<!-- <view class="qrCodeCom">
<view class="title"> <view class="title">
<image <image
show-menu-by-longpress show-menu-by-longpress
...@@ -9,8 +48,6 @@ ...@@ -9,8 +48,6 @@
mode="widthFix" mode="widthFix"
binderror="" binderror=""
bindload="" /> bindload="" />
<view class="label">待支付</view>
<view class="price">总保费{{orderDetail.totalPrice}}元/年</view>
</view> </view>
<view class="payType"> <view class="payType">
<image class="payIcon" src="{{payType[selectPayType].imgUrl}}" /> <image class="payIcon" src="{{payType[selectPayType].imgUrl}}" />
...@@ -36,7 +73,7 @@ ...@@ -36,7 +73,7 @@
class="arrow right" /> class="arrow right" />
<view class="MerchantName">{{orderDetail.merchantName||''}}</view> <view class="MerchantName">{{orderDetail.merchantName||''}}</view>
<view class="bg" /> <view class="bg" />
</view> </view> -->
<view class="orderInfo"> <view class="orderInfo">
<order-detail OderType="pay" orderInfo="{{orderDetail}}" /> <order-detail OderType="pay" orderInfo="{{orderDetail}}" />
</view> </view>
......
...@@ -49,7 +49,7 @@ Component({ ...@@ -49,7 +49,7 @@ Component({
observers: { observers: {
'orderInfo.mode': function (value) { 'orderInfo.mode': function (value) {
// if (n.mode) { // if (n.mode) {
console.log(value, 'mode') // console.log(value, 'mode')
// first: data.firstObj, // first: data.firstObj,
this.setData({ this.setData({
first: value ? data.firstObjSimple : data.firstObj, first: value ? data.firstObjSimple : data.firstObj,
...@@ -57,15 +57,15 @@ Component({ ...@@ -57,15 +57,15 @@ Component({
}) })
// } // }
}, },
'orderInfo.outTradeNo': function (value) { // 'orderInfo.outTradeNo': function (value) {
console.log(value, 'outTradeNo') // console.log(value, 'outTradeNo')
this.setData({ // value && this.setData({
textNameObj: { // textNameObj: {
confirmName: '下一步(1/4)' // confirmName: '下一步(1/4)'
// cancelName: '存草稿' // // cancelName: '存草稿'
} // }
}) // })
} // }
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
......
Component({
/**
* 组件的属性列表
*/
properties: {
show: Boolean,
goodsData: {
type: Array,
observer: function (n) {
if (n.length > 0) {
this.getOrderBaseGoodsList(n)
}
}
},
chooseGoodsList: {
type: Array,
observer: function (n) {
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.goodsId == e.id) {
e.active = true
}
})
})
recordList.map((e, index) => {
e.active = false
chooseGoodsList.map(s => {
if (s.goodsId == e.id) {
e.active = true
}
})
})
}
this.setData({
goodsList,
recordList
})
},
getOrderBaseGoodsList(data) {
this.setData({
goodsList: data,
recordList: data
})
},
getChooseList() {
let {
// goodsList,
recordList,
chooseGoodsList
} = this.data
let chooseList = []
recordList.map(c => {
// e.upgradeGoodsList.map(c => {
if (c.active) {
if (!c.count) c.count = 1
if (chooseGoodsList.length > 0) {
chooseGoodsList.map(x => {
if (x.id == c.id) {
console.log(x)
c.price = x.price || 0
}
})
} else {
c.price = c.upgradePrice || 0
}
if (!c.price) c.price = c.upgradePrice
c.goodsId = c.id
chooseList.push(c)
}
// })
})
return chooseList
},
choose(e) {
let {
item,
index,
ind
} = e.currentTarget.dataset
let {
active
} = item
let {
minPrice,
recordList
} = this.data
// item
// console.log(item)
// console.log(minPrice)
// console.log(item.goodsInfo.shopMinPrice)
// console.log(minPrice && minPrice < item.shopMinPrice)
// 如果有设置订单价格 那就不能选单个成本价比总价还高的
if (minPrice && minPrice / 100 < item.shopMinPrice) return false
// 太阳膜类商品 未配置部位不可选择
// if (item?.goodsInfo?.goodsType == 1 && !item.merchantGoodsPosition) return false
let target = `goodsList[${ind}].active`
let recordIndex = recordList.findIndex(el=>el.id == item.id )
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
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)
// setTimeout(() => {
// this.setGoodsActive()
// }, 500)
return
}
let _DATA_ = JSON.parse(JSON.stringify(recordList))
let arr = []
_DATA_.map(c => {
let upgradeGoodsList = []
// i.upgradeGoodsList.map(c => {
// console.log(c);
let name = c.upgradeGoodsAlias || c.upgradeGoodsName || c.goodsInfo.goodsName
if (name.indexOf(value) != -1) {
arr.push(c)
}
// })
// if (i.goodsTypeName.indexOf(value) != -1 || upgradeGoodsList.length > 0) {
// i.upgradeGoodsList = upgradeGoodsList.length > 0 ? upgradeGoodsList : i.upgradeGoodsList
// arr.push(i)
// }
})
console.log(arr)
this.setData({
goodsList: arr
})
},
confirm() {
let chooseList = this.getChooseList()
let {
goodsList
} = this.data
if (goodsList.length < 1) return
if (!chooseList.length) return wx.$util.showToast('请勾选商品')
this.triggerEvent('confirm', chooseList)
// thisPage.setGoodsTotal&&thisPage.setGoodsTotal(chooseList)
// console.log(chooseList)
// setGoodsTotal(goodsList) {
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)
})
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 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':'' }}">
<!-- {{i.shopMinPrice}} -->
<view
class="value "
catchtap="choose"
data-index="{{index}}"
data-ind="{{ind}}"
data-item="{{i}}">
<view class="name text-hide ">
<!-- filter.replaceItemText(i.upgradeGoodsAlias) || -->
<view>{{filter.replaceItemText(i.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}}</view>
<!-- <text wx:if="{{i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">{{'「' + i.positionStr+'」'}}</text> -->
<view class="serveName">(包含{{i.serveName}})</view>
<!-- <text class="warning_text" wx:if="{{!i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">无部位</text> -->
</view>
<view class="last" >
<text class="price">¥{{i.upgradePrice}}</text>
</view>
</view>
<!-- <block wx:if="{{i.active}}">
<view class="control">
<view
class="minus"
catchtap="addCount"
data-count="{{-1}}"
data-index="{{index}}"
data-ind="{{ind}}"
data-item="{{i}}">
-
</view>
<input
type="number"
catchtap="noScroll"
class="input"
value="{{i.count || 1}}"
catchinput="input"
data-index="{{index}}"
data-ind="{{ind}}" />
<view
class="add"
catchtap="addCount"
data-count="{{1}}"
data-index="{{index}}"
data-ind="{{ind}}"
data-item="{{i}}">
+
</view>
</view>
</block> -->
<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>
/* 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: #3582EE;
}
.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: 15%;
}
.item .value .price {
/* color: #3582EE; */
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: #3582EE;
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;
}
\ 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
}
...@@ -114,6 +114,7 @@ Component({ ...@@ -114,6 +114,7 @@ Component({
// }, // },
onChangeInsurance(e) { onChangeInsurance(e) {
console.log(e) console.log(e)
// vdQuotationGoodsList
let { detail } = e let { detail } = e
let { id } = e.currentTarget.dataset let { id } = e.currentTarget.dataset
console.log(detail, 'detail') console.log(detail, 'detail')
...@@ -156,6 +157,7 @@ Component({ ...@@ -156,6 +157,7 @@ Component({
// if (params?.quotedPriceUpdate) { // if (params?.quotedPriceUpdate) {
// } // }
params.insureList = []
console.log(params, 'params') console.log(params, 'params')
wx.$util.showLoading() wx.$util.showLoading()
priceCounter(params) priceCounter(params)
...@@ -164,7 +166,7 @@ Component({ ...@@ -164,7 +166,7 @@ Component({
console.log('result', result) console.log('result', result)
let { data, code, message } = result let { data, code, message } = result
if (code) { if (code == 0) {
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
thisPage.setData({ thisPage.setData({
......
...@@ -51,13 +51,15 @@ Component({ ...@@ -51,13 +51,15 @@ Component({
}, },
observers: { observers: {
'orderInfo.outTradeNo': function (value) { 'orderInfo.outTradeNo': function (value) {
console.log(value, 'outTradeNo') // console.log(value, 'outTradeNo')
this.setData({ // if (value) {
value && this.setData({
textNameObj: { textNameObj: {
confirmName: '确认', confirmName: '确认',
cancelName: '放弃', cancelName: '放弃',
} }
}) })
// }
} }
}, },
/** /**
...@@ -104,10 +106,70 @@ Component({ ...@@ -104,10 +106,70 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
// test() { changePrice(e) {
// let { activeNames } = this.data let { value } = e.detail
// console.log('activeNames', activeNames) let { index, item } = e.currentTarget.dataset
// }, console.log(item,'item');
let thisPage = wx.$router.getPageInstance()
let target = `orderInfo.vdQuotationGoodsList[${index}].price`
let [number, decimal] = value.split('.')
if (decimal != undefined) {
decimal = decimal.substring(0, 2)
number += `.${decimal}`
}
console.log(item.shopMinPrice||0,'item?.shopMinPrice||0');
if ((item.shopMinPrice||0) > value) {
wx.$util.showToast('单价不可低于商品最低价')
}
thisPage.setData({
[target]: number
})
this.setGoodsListTotal()
},
delGoodsList(e) {
let { index } = e.currentTarget.dataset
let thisPage = wx.$router.getPageInstance()
let {orderInfo} = thisPage.data
// console.log(orderInfo,'orderInfo');
orderInfo.vdQuotationGoodsList.splice(index, 1)
thisPage.setData({
['orderInfo.vdQuotationGoodsList']:orderInfo.vdQuotationGoodsList,
// ['orderInfo.total']:wx.$util.decimal(total, 2)
})
this.setGoodsListTotal()
},
setGoodsListTotal () {
let thisPage = wx.$router.getPageInstance()
let {orderInfo} = thisPage.data
// console.log(orderInfo,'orderInfo');
let total = 0
orderInfo.vdQuotationGoodsList.map(i => (total += parseFloat(i.count||1) * parseFloat(i.price)))
// console.log(total,'total');
thisPage.setData({
['orderInfo.total']:wx.$util.decimal(total, 2)
})
},
chooseGoods (e) {
console.log(e);
// let {}
this.setData({
chooseGoods:e.detail
})
// chooseGoods
},
showPopup(e) {
let {
quotationGoodsList,
} = this.data
let { showName } = e.currentTarget.dataset
if (showName == 'goodsBox' && quotationGoodsList.length < 1 ) {
return wx.$util.showToast( '门店无配置商品')
}
this.setData({
[showName]: true
})
},
onChangeInsurance(e) { onChangeInsurance(e) {
console.log(e) console.log(e)
let { detail } = e let { detail } = e
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"van-collapse": "@vant/weapp/collapse/index", "van-collapse": "@vant/weapp/collapse/index",
"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"
} }
} }
...@@ -249,3 +249,71 @@ ...@@ -249,3 +249,71 @@
.required { .required {
color: #f00; color: #f00;
} }
.goods-box .goods {
height: 118rpx;
border-bottom: 2rpx solid rgba(195, 195, 195, .3);
display: flex;
align-items: center;
padding: 0 28rpx 0 90rpx;
justify-content: space-between;
font-size: 28rpx;
position: relative;
color: #222222;
}
.goods .icon {
position: absolute;
top: 50%;
left: 40rpx;
width: 40rpx;
height: 40rpx;
transform: translateY(-50%);
}
.goods-box .goods .name {
color: #FF6601;
width: 306rpx;
}
.goods-box .goods .price-box {
display: flex;
align-items: center;
justify-content: space-between;
max-width: calc(100% - 436rpx);
min-width: 104rpx;
}
.goods-box .goods .price {
max-width: 80%;
min-width: 104rpx;
height: 44rpx;
border: 2rpx solid #C3C3C3;
border-radius: 8rpx;
}
.goods-box .goods .price input {
width: 100%;
height: 100%;
text-align: center;
min-height: 100%;
font-size: 28rpx;
}
.goods-box .goods .price input.error {
color: red;
}
.goods-box .goods .price input.disabled {
/* color: red; */
background-color: #f0f0f0;
color: #dcdcdc;
}
.goods-box .total-box {
padding: 0 40rpx;
}
.goods-box .goods .total {
color: #F24724;
}
\ 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="1" is-link="{{ false }}"> <van-collapse-item name="1" is-link="{{ false }}">
<view slot="title"> <view slot="title">
<view class="collapseBoxTitle"> <view class="collapseBoxTitle">
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
<view class="label">商业险信息</view> <view class="label">商业险信息</view>
</view> </view>
</view> </view>
<!-- <text class='required'>*</text> -->
<view class="box"> <view class="box">
<view class="title">商业险总价</view> <view class="title">商业险总价</view>
<van-field <van-field
...@@ -31,7 +30,7 @@ ...@@ -31,7 +30,7 @@
</van-field> </van-field>
</view> </view>
</van-collapse-item> </van-collapse-item>
</view> </view> -->
<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">
...@@ -42,87 +41,64 @@ ...@@ -42,87 +41,64 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <van-checkbox
value="{{ insuranceCheck }}"
wx:if="{{!orderInfo.modifyEquityQuotation}}"
shape="square"
bind:change="onChangeInsurance">
请勾选增值车损险服务
</van-checkbox> -->
<!-- <block wx:if="{{insuranceCheck}}"> -->
<!-- <van-radio-group value="{{orderInfo.goodsId}}" bind:change="onChangeInsurance"> -->
<block wx:for="{{ quotationGoodsList }}" wx:key="index" name="{{ item.id }}" wx:for-item="item">
<view class="goodsCheckItem">
<view class="check">
<van-checkbox value="{{ orderInfo.goodsId ==item.id }}" data-id="{{ item.id }}" bind:change="onChangeInsurance"></van-checkbox>
</view>
<view class="goodsInfo">
<view class="incrementInfo">
<image class="img" src="{{ item.titlePictureUrl }}" />
<view class="info">
<view class="infoTitle">{{item.goodsName}}</view>
<view> <view>
<text>包含</text> <gl-cell
<block border
wx:for-index="itemIndex" valueAlign="right"
wx:for-item="i" label="购买商品"
wx:key="itemIndex" labelWidth="140rpx"
wx:for="{{ item.quotationGoodsServiceItemsRelationDTOList }}" haveArrow
> requiredAfter
<text>{{i.serviceName}}{{i.quotationGoodsServiceItemsRelationDTOList.length-1==itemIndex?'':'、'}}</text> required
</block> placeholder="点击选择"
</view> bindclick="showPopup"
data-show-name="goodsBox"
/>
</view>
<block wx:if="{{ orderInfo.vdQuotationGoodsList.length > 0 }}">
<view class="goods-box">
<block wx:for="{{ orderInfo.vdQuotationGoodsList }}" wx:key="index">
<view class="goods">
<view class="icon" bindtap="delGoodsList" data-index="{{ index }}">
<image src="./images/del.png" />
</view>
<view class="name text-hide">
{{item.goodsName}}
<!-- {{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}} -->
</view>
<view class="price-box">
¥
<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 < item.shopMinPrice && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}"
always-embed
/>
</view> </view>
</view> </view>
<block wx:if="{{ orderInfo.goodsId == item.id&& !orderInfo.outTradeNo }}"> <view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view>
<view class="title">增值权益价格</view>
<!-- disabled -->
<van-field
class="inputBox customInput"
border="{{ false }}"
value="{{ orderInfo.quotedPriceUpdate }}"
data-attrType=""
data-attrName="quotedPriceUpdate"
maxlength="10"
bindinput="handleInput"
data-type="number"
type="digit"
>
<view slot="left-icon">
<view>¥</view>
</view> </view>
</van-field>
<view class="errorMessage" wx:if="{{ showError }}">金额小于最低限制</view>
</block> </block>
<view class="goods total-box">
<view>总价</view>
<view class="total">¥{{orderInfo.total || 0}}</view>
</view> </view>
</view> </view>
</block> </block>
<!-- </van-radio-group> -->
<!-- </block> -->
</van-collapse-item> </van-collapse-item>
</view> </view>
</van-collapse> </van-collapse>
<Gl-Button-Group bindbtnTap="btnTap" textNameObj="{{ textNameObj }}" /> <Gl-Button-Group bindbtnTap="btnTap" textNameObj="{{ textNameObj }}" />
</view> </view>
<!-- <popup-select
show="{{popupShow}}"
popObj="{{popObj}}"
typeName="{{popObj.typename}}"
bindconfirm="cancelInsuranceCheck" />
<popup-input show="{{popupInputShow}}" popInputObj="{{popInputObj}}" bindconfirm="cancelInsuranceCheck" />
<van-popup
show="{{ showYear }}"
position="bottom"
custom-style="height: 40%;"
bind:close="onClose">
<van-picker
columns="{{ columns }}"
default-index="{{ currentIndex }}"
bind:change="onChange"
show-toolbar
adjust-position="{{false}}"
always-embed="{{true}}"
title="选择年份"
bind:cancel="onCancel"
bind:confirm="onConfirm" />
</van-popup> -->
\ No newline at end of file \ No newline at end of file
<goods
show="{{ goodsBox }}"
bindconfirm="chooseGoods"
goodsData="{{ quotationGoodsList }}"
chooseGoodsList="{{ orderInfo.vdQuotationGoodsList }}"
/>
\ No newline at end of file \ No newline at end of file
...@@ -2,91 +2,124 @@ import constantList from './constantList' ...@@ -2,91 +2,124 @@ import constantList from './constantList'
import data from './data' import data from './data'
const formRule = { const formRule = {
owner: [{ required: true, message: '姓名不能为空' }], owner: [{
phone: [ required: true,
{ required: true, message: '联系电话不能为空' }, message: '姓名不能为空'
}],
phone: [{
required: true,
message: '联系电话不能为空'
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
return !data.phoneRex.test(value) ? { message: '请输入正确的手机号' } : null return !data.phoneRex.test(value) ? {
message: '请输入正确的手机号'
} : null
} }
} }
], ],
certificateNo: [ certificateNo: [{
{
validator: (rule, value) => { validator: (rule, value) => {
if (value) { if (value) {
return value.length != 18 ? { message: '请输入正确的18位证件号' } : null return value.length != 18 ? {
} message: '请输入正确的18位证件号'
} : null
} }
} }
], }],
carVin: [ carVin: [{
{ required: true, message: '车架号不能为空' }, required: true,
message: '车架号不能为空'
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
return value.length != 17 ? { message: '请输入正确的17位车架号' } : null return value.length != 17 ? {
message: '请输入正确的17位车架号'
} : null
} }
} }
], ],
seat: [{ required: true, message: '座位数不能为空' }], seat: [{
price: [ required: true,
{ required: true, message: '车辆发票价不能为空' }, message: '座位数不能为空'
}],
price: [{
required: true,
message: '车辆发票价不能为空'
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
return value > 2000000 ? { message: '车辆发票价最高不能超过200万' } : null return value > 2000000 ? {
message: '车辆发票价最高不能超过200万'
} : null
} }
} }
] ]
} }
const formRuleSimple = { const formRuleSimple = {
owner: [{ required: true, message: '姓名不能为空' }], owner: [{
phone: [ required: true,
{ required: true, message: '联系电话不能为空' }, message: '姓名不能为空'
}],
phone: [{
required: true,
message: '联系电话不能为空'
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
return !data.phoneRex.test(value) ? { message: '请输入正确的手机号' } : null return !data.phoneRex.test(value) ? {
message: '请输入正确的手机号'
} : null
} }
} }
], ],
certificateNo: [ certificateNo: [{
{
validator: (rule, value) => { validator: (rule, value) => {
if (value) { if (value) {
return value.length != 18 ? { message: '请输入正确的18位证件号' } : null return value.length != 18 ? {
message: '请输入正确的18位证件号'
} : null
} }
} }
} }],
],
carVin: [ carVin: [
// { required: true, message: '车架号不能为空' }, // { required: true, message: '车架号不能为空' },
{ {
validator: (rule, value) => { validator: (rule, value) => {
return value?value.length != 17 ? { message: '请输入正确的17位车架号' } : null:null return value ? value.length != 17 ? {
message: '请输入正确的17位车架号'
} : null : null
} }
} }
], ],
seat: [{ required: true, message: '座位数不能为空' }], seat: [{
price: [ required: true,
{ required: true, message: '车辆发票价不能为空' }, message: '座位数不能为空'
}],
price: [{
required: true,
message: '车辆发票价不能为空'
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
return value > 2000000 ? { message: '车辆发票价最高不能超过200万' } : null return value > 2000000 ? {
message: '车辆发票价最高不能超过200万'
} : null
} }
} }
] ]
} }
const firstObj = { const firstObj = {
customerFormList: [ customerFormList: [{
{
label: '姓名', label: '姓名',
name: 'owner', name: 'owner',
type: 'input', type: 'input',
maxlength: '10', maxlength: '10',
noCellHeight: true, noCellHeight: true,
fieldType: 'textarea', fieldType: 'textarea',
required:true, required: true,
requiredAfter:true requiredAfter: true
}, },
{ {
label: '联系电话', label: '联系电话',
...@@ -94,8 +127,8 @@ const firstObj = { ...@@ -94,8 +127,8 @@ const firstObj = {
type: 'input', type: 'input',
fieldType: 'number', fieldType: 'number',
maxlength: '11', maxlength: '11',
required:true, required: true,
requiredAfter:true requiredAfter: true
}, },
{ {
label: '证件号码', label: '证件号码',
...@@ -105,14 +138,13 @@ const firstObj = { ...@@ -105,14 +138,13 @@ const firstObj = {
placeholder: '请输入(非必填)' placeholder: '请输入(非必填)'
} }
], ],
carFormList: [ carFormList: [{
{
label: '车架号', label: '车架号',
name: 'carVin', name: 'carVin',
type: 'input', type: 'input',
maxlength: '17', maxlength: '17',
required:true, required: true,
requiredAfter:true requiredAfter: true
}, },
{ {
...@@ -130,24 +162,25 @@ const firstObj = { ...@@ -130,24 +162,25 @@ const firstObj = {
type: 'input', type: 'input',
fieldType: 'digit', fieldType: 'digit',
maxlength: '8', maxlength: '8',
required:true, required: true,
requiredAfter:true, requiredAfter: true,
labelWidth:80 labelWidth: 80,
// fieldType: 'digit' inputLimit: {
maxVal: 2000000
}
} }
] ]
} }
const firstObjSimple = { const firstObjSimple = {
customerFormList: [ customerFormList: [{
{
label: '姓名', label: '姓名',
name: 'owner', name: 'owner',
type: 'input', type: 'input',
maxlength: '10', maxlength: '10',
noCellHeight: true, noCellHeight: true,
fieldType: 'textarea', fieldType: 'textarea',
required:true, required: true,
requiredAfter:true requiredAfter: true
}, },
{ {
label: '联系电话', label: '联系电话',
...@@ -155,8 +188,8 @@ const firstObjSimple = { ...@@ -155,8 +188,8 @@ const firstObjSimple = {
type: 'input', type: 'input',
fieldType: 'number', fieldType: 'number',
maxlength: '11', maxlength: '11',
required:true, required: true,
requiredAfter:true requiredAfter: true
}, },
{ {
label: '证件号码', label: '证件号码',
...@@ -166,8 +199,7 @@ const firstObjSimple = { ...@@ -166,8 +199,7 @@ const firstObjSimple = {
placeholder: '请输入(非必填)' placeholder: '请输入(非必填)'
} }
], ],
carFormList: [ carFormList: [{
{
label: '车架号', label: '车架号',
name: 'carVin', name: 'carVin',
type: 'input', type: 'input',
...@@ -191,16 +223,18 @@ const firstObjSimple = { ...@@ -191,16 +223,18 @@ const firstObjSimple = {
type: 'input', type: 'input',
fieldType: 'digit', fieldType: 'digit',
maxlength: '8', maxlength: '8',
required:true, required: true,
requiredAfter:true, requiredAfter: true,
labelWidth:80 labelWidth: 80,
inputLimit: {
maxVal: 2000000
}
// fieldType: 'digit' // fieldType: 'digit'
} }
] ]
} }
const optionsSelect = { const optionsSelect = {
companyType: [ companyType: [{
{
label: '中国平安' label: '中国平安'
}, },
{ {
...@@ -210,8 +244,7 @@ const optionsSelect = { ...@@ -210,8 +244,7 @@ const optionsSelect = {
label: '中国人保' label: '中国人保'
} }
], ],
thirdPartType: [ thirdPartType: [{
{
value: 1, value: 1,
label: '100万' label: '100万'
}, },
...@@ -232,8 +265,7 @@ const optionsSelect = { ...@@ -232,8 +265,7 @@ const optionsSelect = {
label: '500万' label: '500万'
} }
], ],
busRideDriverType: [ busRideDriverType: [{
{
value: 1, value: 1,
label: '1万' label: '1万'
}, },
...@@ -246,8 +278,7 @@ const optionsSelect = { ...@@ -246,8 +278,7 @@ const optionsSelect = {
label: '5万' label: '5万'
} }
], ],
busRideFareType: [ busRideFareType: [{
{
value: 1, value: 1,
label: '1万' label: '1万'
}, },
......
...@@ -198,6 +198,10 @@ Page({ ...@@ -198,6 +198,10 @@ Page({
insurance.forEach(item => { insurance.forEach(item => {
delete orderInfo[item] delete orderInfo[item]
}) })
if (!orderInfo.vdQuotationGoodsList) {
//修复为null或则空时,后台报错
orderInfo.vdQuotationGoodsList = []
}
// delete orderInfo.quotedPriceUpdate // delete orderInfo.quotedPriceUpdate
return orderInfo return orderInfo
}, },
......
No preview for this file type
No preview for this file type
...@@ -287,7 +287,9 @@ Page({ ...@@ -287,7 +287,9 @@ Page({
// 只开通一个场景直接跳转页面 // 只开通一个场景直接跳转页面
if (openSceneArr.length === 1) { if (openSceneArr.length === 1) {
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), selectedSceneType: openSceneArr.includes(1) ? 1 : 0 }) wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), selectedSceneType: openSceneArr.includes(1) ? 1 : 0 })
wx.$router.reLaunch(openSceneArr.includes(1) ? 'tabIndex.index' : 'packageEquity.equityPage') let pageUrl = ['packageEquity.equityPage', 'tabIndex.index', 'subvehicleConversion.index', 'packageCrowdFunding.paidOrder']
wx.$router.reLaunch(pageUrl[openSceneArr[0]])
// wx.$router.reLaunch(openSceneArr.includes(1) ? 'tabIndex.index' : 'packageEquity.equityPage')
} else if (openSceneArr.length > 1) { } else if (openSceneArr.length > 1) {
wx.$router.reLaunch('pages.sceneIndex') wx.$router.reLaunch('pages.sceneIndex')
} }
......
...@@ -212,7 +212,10 @@ export const checkScene = options => { ...@@ -212,7 +212,10 @@ export const checkScene = options => {
} }
console.log(options, 'options') console.log(options, 'options')
wx.$SCENE = options wx.$SCENE = options
if (!userInfo) { if (!userInfo && options.path != 'pages/accountItems/accountItems') {
// if (!userInfo) {
// console.log(userInfo);
console.log('未登录,请登录。');
return '未登录,请登录。' return '未登录,请登录。'
} }
} }
...@@ -310,3 +313,22 @@ export const getStaffListByMerchant = options => { ...@@ -310,3 +313,22 @@ export const getStaffListByMerchant = options => {
}) })
}) })
} }
/** 获取精品升级场景 太阳膜类商品部位数据 */
export const getPositionList = options => {
return new Promise((resolve, reject) => {
const app = getApp()
// 如果有 直接返回
if (app.globalData.positionTypeList) {
return resolve(app.globalData.positionTypeList)
} else {
api.getPositionList({}).then(res => {
let { code, data } = res
if (code == 0) {
app.globalData.positionTypeList = data
}
resolve(app.globalData.positionTypeList)
})
}
})
}
// tabIndex/pages/index/index.js // tabIndex/pages/index/index.js
import mixins from './index_mixins' import mixins from './index_mixins'
import api from '../../api.js' import api from '../../api.js'
// import apiother from '~/api/api.js'
import NP from 'number-precision' import NP from 'number-precision'
import { env } from '~/config' import { env } from '~/config'
import { getYQInfo } from '~/store/index' import { getYQInfo } from '~/store/index'
...@@ -583,6 +584,27 @@ Page({ ...@@ -583,6 +584,27 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
// console.log(options) // console.log(options)
// let { wxqrcode } = this.data
// if (wxqrcode) return
// let _this = this
// // "appId": "wxc50d04ae5aa9984a",
// // "path": "login/loading/loading?url=/packagesList/packageOutput/pages/summary&userName=djqgzj&password=djqgzj123&sceneCode=SC002&merchantId=44206511&merchantName=轻改专家",
// // "pageName": "看产值"
// let oParams = {}
// oParams.appId = 'wx570d9331f9ace0bd'
// oParams.qrcodeType = 'QR_WXA_UNLIMIT'
// oParams.path = 'login/loading/loading'
// oParams.scene = `params=test`
// oParams.channelType = 1
// // B端小程序调用接口生成领券码时,传参userId用uuid,类型由int变string
// apiother.createQrcodeImage(oParams).then(res => {
// console.log(res.data)
// console.log(res.code)
// _this.setData({
// wxqrcode: res.data
// })
// })
options && this.checkShowOrderPop(options) options && this.checkShowOrderPop(options)
......
...@@ -127,5 +127,15 @@ module.exports = { ...@@ -127,5 +127,15 @@ module.exports = {
/** 查询园区店是否开启签名配置 */ /** 查询园区店是否开启签名配置 */
getSignatureSwitch(data) { getSignatureSwitch(data) {
return api.post('dj.api.smartcarlife.serviceMerchant.getSignatureSwitch', data) return api.post('dj.api.smartcarlife.serviceMerchant.getSignatureSwitch', data)
},
/** 根据客户优惠券id查询订单 */
getOrderByCustomerCouponId(data) {
// return api.post('dj.api.smartcarlife.order.getOrderByCustomerCouponId ', data)
return api.get('dj.api.smartcarlife.order.getOrderByCustomerCouponId', data)
},
/** 获取园区店配置技师数据 */
getQYTechnicianList(data) {
return api.post('dj.api.smartcarlife.technician.list', data)
} }
} }
// tabWorkOrder/pages/createOrder/createOrder.js // tabWorkOrder/pages/createOrder/createOrder.js
// import deepClone from '~/utils/deepClone' // import deepClone from '~/utils/deepClone'
import api from '../../api' import api from '../../api'
import { getYQorderInfo } from '~/store/index' import { getYQorderInfo, getPositionList } from '~/store/index'
import NP from 'number-precision' import NP from 'number-precision'
const app = getApp() const app = getApp()
let toastList = { let toastList = {
...@@ -69,7 +69,8 @@ Page({ ...@@ -69,7 +69,8 @@ Page({
accountDate: '', accountDate: '',
priceSpread: '', priceSpread: '',
showTips: true, showTips: true,
isShowSubShopMerchant: false isShowSubShopMerchant: false,
positionTypeList: []
}, },
showCustomPop() { showCustomPop() {
this.setData({ this.setData({
...@@ -632,7 +633,7 @@ Page({ ...@@ -632,7 +633,7 @@ Page({
// }) // })
// }, // },
getOrderBaseGoodsList(merchantId) { getOrderBaseGoodsList(merchantId) {
let { first } = this.data let { first, positionTypeList } = this.data
api api
.getOrderBaseGoodsList({ .getOrderBaseGoodsList({
merchantId merchantId
...@@ -642,6 +643,11 @@ Page({ ...@@ -642,6 +643,11 @@ Page({
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
wx.hideLoading() wx.hideLoading()
data?.forEach(item => {
item.upgradeGoodsList?.forEach(val => {
val.positionStr = positionTypeList.filter(v=> v.positionValue == val.merchantGoodsPosition)[0]?.positionName
})
})
this.setData({ this.setData({
goodsData: data goodsData: data
}) })
...@@ -791,7 +797,16 @@ Page({ ...@@ -791,7 +797,16 @@ Page({
.catch(err => {}) .catch(err => {})
} }
}, },
// 获取太阳膜类商品部位数据
getGoodsPosition() {
getPositionList().then(res => {
this.setData({
positionTypeList: res || []
})
})
},
onRoute(options) { onRoute(options) {
this.getGoodsPosition()
let { outTradeNo, totalFee, accountDate, supplementId } = options let { outTradeNo, totalFee, accountDate, supplementId } = options
console.log(options) console.log(options)
// 如果是扫码进来的 // 如果是扫码进来的
......
...@@ -242,32 +242,29 @@ ...@@ -242,32 +242,29 @@
<view class="goods-box"> <view class="goods-box">
<block wx:for="{{goodsList}}" wx:key="index"> <block wx:for="{{goodsList}}" wx:key="index">
<view class="goods"> <view class="goods">
<view class="icon" bindtap="delGoodsList" data-index="{{index}}"> <view class="name_box">
<image src="../../images/del.png" />
</view>
<view class="name text-hide"> <view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias)||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}} {{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
</view> </view>
<view class="price-box">
¥
<view class="price">
<input
type="digit"
value="{{item.price}}"
bindinput="changePrice"
data-item="{{item}}"
bindblur="priceBlur"
data-index="{{index}}"
class="{{item.price < item.shopMinPrice? 'error':''}}"
always-embed />
</view> </view>
<view class="bottom_box">
<view class="position">{{item.positionStr}}</view>
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{item.price}}" bindinput="changePrice" disabled="{{orderObj.selectPayType ==0}}" data-item="{{item}}" bindblur="priceBlur" data-index="{{index}}" class="{{item.price < item.shopMinPrice && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':''}}" always-embed />
</view> </view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox"> <view class="count" catchtap="showPopup" data-show-name="goodsBox">
x{{item.count}} x{{item.count}}
</view> </view>
</view> </view>
</view>
<view class="icon" bindtap="delGoodsList" data-index="{{index}}">
<image src="../../images/del.png" />
</view>
</view>
</block> </block>
<view class="goods total-box"> <view class="total-box">
总价 总价
<view class="priceLabel" wx:if="{{priceSpread}}"> <view class="priceLabel" wx:if="{{priceSpread}}">
差值 差值
......
...@@ -161,11 +161,13 @@ page { ...@@ -161,11 +161,13 @@ page {
} }
.goods-box .goods { .goods-box .goods {
height: 118rpx; opacity: 0.7;
border-bottom: 2rpx solid rgba(195, 195, 195, .3); background: #F8F9F9;
border-radius: 16rpx;
margin: 16rpx 20rpx;
display: flex; display: flex;
align-items: center; flex-flow: column;
padding: 0 28rpx 0 90rpx; padding: 24rpx;
justify-content: space-between; justify-content: space-between;
font-size: 28rpx; font-size: 28rpx;
position: relative; position: relative;
...@@ -173,11 +175,12 @@ page { ...@@ -173,11 +175,12 @@ page {
.goods .icon { .goods .icon {
position: absolute; position: absolute;
top: 50%; top: 0;
left: 40rpx; right: 0;
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
transform: translateY(-50%); background: #3582ee1a;
border-radius: 0 16rpx 0 16rpx;
} }
.goods-box .goods .name { .goods-box .goods .name {
...@@ -185,36 +188,62 @@ page { ...@@ -185,36 +188,62 @@ page {
width: 306rpx; width: 306rpx;
} }
.goods-box .goods .price-box { .goods-box .goods .bottom_box {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
max-width: calc(100% - 436rpx); }
min-width: 104rpx;
.goods-box .goods .bottom_box .position{
color: #888888;
}
.goods-box .goods .bottom_box .price_count {
display: flex;
align-items: center;
justify-content: flex-start;
} }
.goods-box .goods .price { .goods-box .goods .price {
max-width: 80%; width: 240rpx;
min-width: 104rpx; height: 64rpx;
height: 44rpx; background: #FFFFFF;
border: 2rpx solid #C3C3C3; border: 2rpx solid #E6E6E6;
border-radius: 8rpx; border-radius: 8rpx;
position: relative;
margin-right: 32rpx;
}
.goods-box .goods .price text{
position: absolute;
left: 16rpx;
top: 50%;
font-size: 24rpx;
transform: translateY(-50%);
} }
.goods-box .goods .price input { .goods-box .goods .price input {
box-sizing: border-box;
width: 100%; width: 100%;
height: 100%; height: 100%;
text-align: center; text-align: end;
min-height: 100%; min-height: 100%;
font-size: 28rpx; font-size: 28rpx;
padding: 0 16rpx 0 50rpx;
} }
.goods-box .goods .price input.error { .goods-box .goods .price input.error {
color: red; color: red;
} }
.goods-box .goods.total-box { .goods-box .goods .price input.disabled {
padding: 0 40rpx; /* color: red; */
background-color: #f0f0f0;
color: #dcdcdc;
}
.goods-box .goods .count{
min-width: 64rpx;
} }
.goods-box .priceLabel { .goods-box .priceLabel {
...@@ -224,9 +253,17 @@ page { ...@@ -224,9 +253,17 @@ page {
font-size: 24rpx; font-size: 24rpx;
} }
.goods-box .goods .total { .goods-box .total-box {
/* color: #F24724; */ height: 118rpx;
border-top: 2rpx solid rgba(195, 195, 195, .3);
border-bottom: 2rpx solid rgba(195, 195, 195, .3);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 40rpx;
}
.goods-box .total-box .total {
color: #3582EE; color: #3582EE;
} }
......
import api from '../../api.js' import api from '../../api.js'
import order_mixins from '../order_mixins.js' import order_mixins from '../order_mixins.js'
import { setWebSocket } from '~/store/index' import { setWebSocket, getPositionList } from '~/store/index'
let time = null let time = null
let app = getApp() let app = getApp()
Page({ Page({
...@@ -56,7 +56,7 @@ Page({ ...@@ -56,7 +56,7 @@ Page({
if (!orderInfo?.customer?.orderCode) { if (!orderInfo?.customer?.orderCode) {
delete orderInfo?.customer?.orderCode delete orderInfo?.customer?.orderCode
} }
let paramsList = ['orderCode', 'customerId', 'customerName', 'customerPhone', 'customerSex', 'carBrandId', 'carBrand', 'carChildsBrandId', 'carChildsBrandName', 'carSeriesId', 'carSeriesName', 'standNo', 'plateNumber', 'experienceFlag', 'remark', 'technicianId', 'technicianName'] let paramsList = ['orderCode', 'customerId', 'customerName', 'customerPhone', 'customerSex', 'carBrandId', 'carBrand', 'carChildsBrandId', 'carChildsBrandName', 'carSeriesId', 'carSeriesName', 'standNo', 'plateNumber', 'experienceFlag', 'remark', 'technicianUuid', 'technicianId', 'technicianName']
let userInfo = {} let userInfo = {}
orderInfo = Object.assign(orderInfo, orderInfo.customer) orderInfo = Object.assign(orderInfo, orderInfo.customer)
paramsList.map(item => { paramsList.map(item => {
...@@ -229,9 +229,10 @@ Page({ ...@@ -229,9 +229,10 @@ Page({
this.getDetail(options.orderCode) this.getDetail(options.orderCode)
} }
}, },
getDetail(orderCode) { async getDetail(orderCode) {
// console.log(orderCode) // console.log(orderCode)
let _this = this let _this = this
const positionTypeList = await getPositionList() || []
api api
.getOrderDetail({ .getOrderDetail({
orderCode orderCode
...@@ -254,6 +255,7 @@ Page({ ...@@ -254,6 +255,7 @@ Page({
data.subOrderList.map(e => { data.subOrderList.map(e => {
total_price += e.totalPrice total_price += e.totalPrice
e.price = Number(wx.$util.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2) e.price = Number(wx.$util.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2)
e.positionStr = positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
if (e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) { if (e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) {
warrantyCardList.push({ warrantyCardList.push({
warrantyPeriod: e.upgradeWarrantyPeriod, warrantyPeriod: e.upgradeWarrantyPeriod,
...@@ -293,10 +295,16 @@ Page({ ...@@ -293,10 +295,16 @@ Page({
customerObj customerObj
}) })
} }
// 有配置技师 // // 有配置技师
if (data?.technicianConfigDTOList?.length > 0) { // if (data?.technicianConfigDTOList?.length > 0) {
this.isArtificer(data) // this.isArtificer(data)
// }
// 获取园区店技师配置信息
api.getQYTechnicianList({yqMerchantId: wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId}).then(respone => {
if (respone?.code == 0) {
if (respone?.data.length > 0) this.isArtificer(respone.data)
} }
})
} else { } else {
wx.showModal({ wx.showModal({
title: '温馨提示', title: '温馨提示',
...@@ -327,7 +335,8 @@ Page({ ...@@ -327,7 +335,8 @@ Page({
} }
this.setData({ this.setData({
customerObj, customerObj,
artificerList: orderInfo?.technicianConfigDTOList, artificerList: data, // 园区店配置的技师数据
// artificerList: orderInfo?.technicianConfigDTOList,
orderInfo orderInfo
}) })
}, },
......
...@@ -33,16 +33,21 @@ ...@@ -33,16 +33,21 @@
<view class="goods"> <view class="goods">
<block wx:for="{{orderInfo.subOrderList}}" wx:key="index"> <block wx:for="{{orderInfo.subOrderList}}" wx:key="index">
<view class="item"> <view class="item">
<view class="subItem_box goods_name">
<view class="name text-hide"> <view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}} {{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}}
</view> </view>
<view class="type">x{{item.number}}</view>
<view class="price">¥{{item.price}}</view> <view class="price">¥{{item.price}}</view>
</view> </view>
<view class="subItem_box">
<view class="position">{{item.positionStr}}</view>
<view class="type">x{{item.number}}</view>
</view>
</view>
</block> </block>
</view> </view>
<view class="cell"> <view class="cell">
<view class="label">抵用券:</view> <view class="label icon"><image src="../../images/voucher_icon.png" mode=""/></view>
<view class="value"> <view class="value">
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}}) {{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}})
</view> </view>
......
// tabWorkOrder/pages/orderDetail/orderDetail.js // tabWorkOrder/pages/orderDetail/orderDetail.js
import api from '../../api.js' import api from '../../api.js'
import order_mixins, { data } from '../order_mixins.js' import order_mixins, { data } from '../order_mixins.js'
import { getPositionList } from '~/store/index'
const app = getApp() const app = getApp()
Page({ Page({
/** /**
...@@ -143,6 +144,7 @@ Page({ ...@@ -143,6 +144,7 @@ Page({
isStaff: app.globalData.isStaff isStaff: app.globalData.isStaff
}) })
}, },
checkPhoneShow(config) { checkPhoneShow(config) {
console.log('config', config) console.log('config', config)
// 有就屏蔽手机号的显示 // 有就屏蔽手机号的显示
...@@ -154,8 +156,9 @@ Page({ ...@@ -154,8 +156,9 @@ Page({
}) })
} }
}, },
getOrderDetail(orderCode) { async getOrderDetail(orderCode) {
let _this = this let _this = this
const positionTypeList = await getPositionList() || []
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
api api
.getOrderDetail({ .getOrderDetail({
...@@ -172,6 +175,7 @@ Page({ ...@@ -172,6 +175,7 @@ Page({
data.subOrderList.map(e => { data.subOrderList.map(e => {
total_price += e.totalPrice total_price += e.totalPrice
e.price = Number(wx.$util.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2) e.price = Number(wx.$util.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2)
e.positionStr = positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
if ((e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) && data.selectPayType != 0) { if ((e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) && data.selectPayType != 0) {
warrantyCardList.push({ warrantyCardList.push({
warrantyPeriod: e.upgradeWarrantyPeriod, warrantyPeriod: e.upgradeWarrantyPeriod,
...@@ -234,6 +238,12 @@ Page({ ...@@ -234,6 +238,12 @@ Page({
if (data?.technicianConfigDTOList?.length > 0) { if (data?.technicianConfigDTOList?.length > 0) {
this.isArtificer(data) this.isArtificer(data)
} }
// 获取园区店技师配置数据 wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId
api.getQYTechnicianList({yqMerchantId: wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId}).then(respone => {
if (respone?.code == 0) {
if (respone?.data.length > 0) this.isArtificer(respone.data)
}
})
} else { } else {
wx.showModal({ wx.showModal({
title: '温馨提示', title: '温馨提示',
...@@ -254,6 +264,7 @@ Page({ ...@@ -254,6 +264,7 @@ Page({
isArtificer(data) { isArtificer(data) {
let { customerObj, orderInfo } = this.data let { customerObj, orderInfo } = this.data
orderInfo.isOpenArtificer = true orderInfo.isOpenArtificer = true
orderInfo.technicianList = data || [] // 技师数据
if (customerObj.findIndex(val => val?.key && val.key == 'technicianName') < 0) { if (customerObj.findIndex(val => val?.key && val.key == 'technicianName') < 0) {
customerObj[customerObj.length] = { customerObj[customerObj.length] = {
label: '选择技师:', label: '选择技师:',
......
...@@ -40,16 +40,21 @@ ...@@ -40,16 +40,21 @@
<view class="goods"> <view class="goods">
<block wx:for="{{orderInfo.subOrderList}}" wx:key="index"> <block wx:for="{{orderInfo.subOrderList}}" wx:key="index">
<view class="item"> <view class="item">
<view class="subItem_box goods_name">
<view class="name text-hide"> <view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}} {{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}}
</view> </view>
<view class="type">x{{item.number}}</view>
<view class="price">¥{{item.price}}</view> <view class="price">¥{{item.price}}</view>
</view> </view>
<view class="subItem_box">
<view class="position">{{item.positionStr}}</view>
<view class="type">x{{item.number}}</view>
</view>
</view>
</block> </block>
</view> </view>
<view class="cell"> <view class="cell">
<view class="label">抵用券:</view> <view class="label icon"><image src="../../images/voucher_icon.png" mode=""/></view>
<view class="value"> <view class="value">
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}}) {{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}})
</view> </view>
......
...@@ -72,7 +72,7 @@ page { ...@@ -72,7 +72,7 @@ page {
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10); box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10);
border-radius: 16rpx; border-radius: 16rpx;
padding: 40rpx 40rpx 20rpx; padding: 40rpx 40rpx 2rpx;
position: relative; position: relative;
margin: 20rpx 20rpx 0; margin: 20rpx 20rpx 0;
} }
...@@ -157,7 +157,7 @@ page { ...@@ -157,7 +157,7 @@ page {
} }
.box .line { .box .line {
display: inline-block; /* display: inline-block; */
height: 1rpx; height: 1rpx;
width: 355rpx; width: 355rpx;
width: 100%; width: 100%;
...@@ -166,7 +166,7 @@ page { ...@@ -166,7 +166,7 @@ page {
} }
.box .cell.total { .box .cell.total {
padding-top: 30rpx; padding-top: 32rpx;
align-items: center; align-items: center;
} }
...@@ -174,28 +174,50 @@ page { ...@@ -174,28 +174,50 @@ page {
border-bottom: 1px solid #C3C3C3; border-bottom: 1px solid #C3C3C3;
} */ } */
.box .goods { .box .goods {
font-size: 24rpx; font-size: 28rpx;
margin-bottom: 30rpx; margin-bottom: 32rpx;
} }
.box .goods .item { .box .goods .item {
margin: 16rpx -20rpx;
padding: 20rpx;
background: #F8F9F9;
border-radius: 16rpx;
display: flex; display: flex;
flex-flow: column;
align-items: center; align-items: center;
color: #888888; color: #888888;
} }
.box .goods .item:first-child{
margin-top: 0;
}
.box .goods .item:last-child{
margin-bottom: 0;
}
.box .goods .item .subItem_box{
display: flex;
justify-content: space-between;
width: 100%;
}
.box .goods .item .goods_name{
color: #333333;
}
.box .goods .item .name { .box .goods .item .name {
width: 256rpx;
font-size: 28rpx; font-size: 28rpx;
width: 492rpx;
} }
.box .goods .item .type { .box .goods .item .price {
margin-left: 140rpx; font-weight: 600;
} }
.box .goods .item .price { .box .goods .item .type {
color: #333333; margin-left: 140rpx;
margin-left: auto;
} }
.box .cell { .box .cell {
...@@ -203,7 +225,7 @@ page { ...@@ -203,7 +225,7 @@ page {
color: #888888; color: #888888;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
margin-bottom: 20rpx; margin-bottom: 32rpx;
} }
.box .cell .label { .box .cell .label {
...@@ -211,6 +233,12 @@ page { ...@@ -211,6 +233,12 @@ page {
width: 180rpx; width: 180rpx;
} }
.box .cell .label.icon{
width: 96rpx;
height: 36rpx;
margin-right: 8rpx;
}
.box .cell .image-box{ .box .cell .image-box{
display: flex; display: flex;
flex-flow: wrap; flex-flow: wrap;
...@@ -219,8 +247,8 @@ page { ...@@ -219,8 +247,8 @@ page {
.box .cell .value { .box .cell .value {
color: #333333; color: #333333;
max-width: 370rpx;
display: flex; display: flex;
flex-flow: wrap;
align-items: center; align-items: center;
} }
......
// tabWorkOrder/pages/createOrder/createOrder.js // tabWorkOrder/pages/createOrder/createOrder.js
// import deepClone from '~/utils/deepClone' // import deepClone from '~/utils/deepClone'
import api from '../../api' import api from '../../api'
import { getYQorderInfo } from '~/store/index' import { getYQorderInfo, getPositionList } from '~/store/index'
const app = getApp() const app = getApp()
let toastList = { let toastList = {
userId: '销售顾问不能为空', userId: '销售顾问不能为空',
...@@ -73,7 +73,8 @@ Page({ ...@@ -73,7 +73,8 @@ Page({
showTips: true, showTips: true,
type: 1 type: 1
}, },
isShowSubShopMerchant: false isShowSubShopMerchant: false,
positionTypeList: []
}, },
showCustomPop() { showCustomPop() {
this.setData({ this.setData({
...@@ -296,6 +297,14 @@ Page({ ...@@ -296,6 +297,14 @@ Page({
delete submitObj.customer[element] delete submitObj.customer[element]
}) })
} }
// for (let k = 0; k < goodsList; k++) {
// let item = goodsList[k]
// try {
// if (item.goodsType == 1 && (!item.merchantGoodsPosition || !item.upgradeGoodsPosition)) throw i
// } catch (err) {
// return this.showToast('商品无配置部位属性,请联系总部运营配置上架')
// }
// }
this.showLoading('提交中...') this.showLoading('提交中...')
let apiName = save && !isErrorOrder ? 'createPrerecordedOrder' : isErrorOrder ? 'correctionOrder' : 'createWithPay' let apiName = save && !isErrorOrder ? 'createPrerecordedOrder' : isErrorOrder ? 'correctionOrder' : 'createWithPay'
...@@ -535,9 +544,11 @@ Page({ ...@@ -535,9 +544,11 @@ Page({
} }
// console.log(this.data) // console.log(this.data)
// console.log(scene); // console.log(scene);
if (scene) { if (scene) {
if (userInfo.userType == 2) { if (userInfo.userType == 2) {
let id = scene.split('=')[1] let id = scene.split('=')[1]
api api
.getCouponDeatil({ .getCouponDeatil({
id id
...@@ -558,6 +569,18 @@ Page({ ...@@ -558,6 +569,18 @@ Page({
return return
} }
this.setOrderObj(data) this.setOrderObj(data)
api.getOrderByCustomerCouponId({ customerCouponId: id }).then(res => {
let { code, data, message } = res
if (code == 0) {
console.log(data.orderCode, 'getOrderByCustomerCouponId')
// this.setOrderObj(data)
this.setData({
['orderObj.orderCode']: data.orderCode
})
} else {
this.showToast(message)
}
})
} else { } else {
this.showToast(message) this.showToast(message)
} }
...@@ -580,10 +603,14 @@ Page({ ...@@ -580,10 +603,14 @@ Page({
} }
}, },
getOrderBaseGoodsList(merchantId) { async getOrderBaseGoodsList(merchantId) {
let { first, orderObj } = this.data let { first, orderObj } = this.data
let { subOrderList } = orderObj let { subOrderList } = orderObj
const selectPayType = orderObj.selectPayType == 0 const selectPayType = orderObj.selectPayType == 0
const positionTypeList = await getPositionList() || []
this.setData({
positionTypeList
})
api api
.getOrderBaseGoodsList({ .getOrderBaseGoodsList({
merchantId, merchantId,
...@@ -599,7 +626,9 @@ Page({ ...@@ -599,7 +626,9 @@ Page({
// 筛选出是当前门店的商品 // 筛选出是当前门店的商品
let goodsData = data let goodsData = data
const filterList = goodsData.reduce((list, item) => { const filterList = goodsData.reduce((list, item) => {
// console.log(item, 'item') item.upgradeGoodsList.forEach(val => {
val.positionStr = positionTypeList.filter(v => v.positionValue == val.merchantGoodsPosition)[0]?.positionName
})
item.upgradeGoodsList && list.push(...item.upgradeGoodsList) item.upgradeGoodsList && list.push(...item.upgradeGoodsList)
return list return list
}, []) }, [])
...@@ -694,25 +723,20 @@ Page({ ...@@ -694,25 +723,20 @@ Page({
// app . // app .
getYQorderInfo() getYQorderInfo()
.then(merchantSettingInfo => { .then(merchantSettingInfo => {
// console.log(merchantSettingInfo, 'merchantSettingInfo')
let dictionaryObj = { let dictionaryObj = {
carTypeRequiredFlag: 'carBrand', carTypeRequiredFlag: 'carBrand',
standNoRequiredFlag: 'standNo', standNoRequiredFlag: 'standNo',
plateNumRequiredFlag: 'plateNumber' plateNumRequiredFlag: 'plateNumber'
} }
// let requiredList = []
for (const key in dictionaryObj) { for (const key in dictionaryObj) {
if (merchantSettingInfo[key] == 'Y') { if (merchantSettingInfo[key] == 'Y') {
requiredList.push(dictionaryObj[key]) requiredList.push(dictionaryObj[key])
} }
} }
// console.log(merchantSettingInfo.yqPhoneConfig, 'merchantSettingInfo.yqPhoneConfig')
// console.log(deepClone(merchantSettingInfo.yqPhoneConfig), 'deepClone(merchantSettingInfo.yqPhoneConfig)')
this.setData({ this.setData({
requiredList: [...new Set(requiredList)], requiredList: [...new Set(requiredList)],
phoneShow: wx.$util.deepClone(merchantSettingInfo.yqPhoneConfig) phoneShow: wx.$util.deepClone(merchantSettingInfo.yqPhoneConfig)
}) })
// this.setData({ merchantSettingInfo })
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err)
...@@ -740,6 +764,7 @@ Page({ ...@@ -740,6 +764,7 @@ Page({
}) })
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
...@@ -754,7 +779,8 @@ Page({ ...@@ -754,7 +779,8 @@ Page({
}, },
async onRoute(res) { async onRoute(res) {
// debugger // debugger
console.log(res, 'onroute') // console.log(res, 'onroute')
// res.scene = 'scene=1384'
// console.log() // console.log()
if (res.orderCode && res.page) { if (res.orderCode && res.page) {
let result = await api.getOrderDetail({ let result = await api.getOrderDetail({
......
...@@ -261,33 +261,33 @@ ...@@ -261,33 +261,33 @@
<view class="goods-box"> <view class="goods-box">
<block wx:for="{{ goodsList }}" wx:key="index"> <block wx:for="{{ goodsList }}" wx:key="index">
<view class="goods"> <view class="goods">
<view class="icon" bindtap="delGoodsList" data-index="{{ index }}"> <view class="name_box">
<image src="../../images/del.png" />
</view>
<view class="name text-hide"> <view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}} {{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
</view> </view>
<view class="price-box"> </view>
¥ <view class="bottom_box">
<!-- merchantGoodsPosition商品列表部位字段 upgradeGoodsPosition订单详情部位字段 -->
<view class="position" wx:if="{{(item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1)}}">{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view class="position red_text" wx:if="{{(item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition}}">无部位属性</view>
<view class="position" wx:else></view>
<view class="price_count">
<view class="price"> <view class="price">
<input <text>¥</text>
type="digit" <input type="digit" value="{{item.price}}" bindinput="changePrice" disabled="{{orderObj.selectPayType ==0}}" data-item="{{item}}" bindblur="priceBlur" data-index="{{index}}" class="{{item.price < item.shopMinPrice && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':''}}" always-embed />
value="{{ item.price }}" </view>
bindinput="changePrice" <view class="count" catchtap="showPopup" data-show-name="goodsBox">
disabled="{{ orderObj.selectPayType ==0 }}" x{{item.count}}
data-item="{{ item }}"
bindblur="priceBlur"
data-index="{{ index }}"
class="{{ item.price < item.shopMinPrice && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}"
always-embed
/>
</view> </view>
</view> </view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count}}</view> </view>
<view class="icon" bindtap="delGoodsList" data-index="{{index}}">
<image src="../../images/del.png" />
</view>
</view> </view>
</block> </block>
<view class="goods total-box" wx:if="{{ orderObj.selectPayType != 0 }}"> <view class="total-box">
总价 <view>总价</view>
<view class="total">¥{{total || 0}}</view> <view class="total">¥{{total || 0}}</view>
</view> </view>
</view> </view>
......
...@@ -137,7 +137,7 @@ page { ...@@ -137,7 +137,7 @@ page {
.payType-box .item { .payType-box .item {
box-sizing: border-box; box-sizing: border-box;
border: 2rpx solid #999999; border: 2rpx solid #999999;
border-radius: 8rpx; border-radius: 12rpx;
font-size: 28rpx; font-size: 28rpx;
color: #999999; color: #999999;
height: 56rpx; height: 56rpx;
...@@ -169,11 +169,13 @@ page { ...@@ -169,11 +169,13 @@ page {
} }
.goods-box .goods { .goods-box .goods {
height: 118rpx; opacity: 0.7;
border-bottom: 2rpx solid rgba(195, 195, 195, .3); background: #F8F9F9;
border-radius: 16rpx;
margin: 16rpx 20rpx;
display: flex; display: flex;
align-items: center; flex-flow: column;
padding: 0 28rpx 0 90rpx; padding: 24rpx;
justify-content: space-between; justify-content: space-between;
font-size: 28rpx; font-size: 28rpx;
position: relative; position: relative;
...@@ -181,40 +183,66 @@ page { ...@@ -181,40 +183,66 @@ page {
.goods .icon { .goods .icon {
position: absolute; position: absolute;
top: 50%; top: 0;
left: 40rpx; right: 0;
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
transform: translateY(-50%); background: #3582ee1a;
border-radius: 0 16rpx 0 16rpx;
} }
.goods-box .goods .name { .goods-box .goods .name {
color: #FF6601; color: #FF6601;
width: 306rpx; width: 100%;
margin-bottom: 8rpx;
} }
.goods-box .goods .price-box { .goods-box .goods .bottom_box {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
max-width: calc(100% - 436rpx); }
min-width: 104rpx;
.goods-box .goods .bottom_box .position{
color: #888888;
}
.goods-box .goods .bottom_box .red_text{
color: red;
}
.goods-box .goods .bottom_box .price_count {
display: flex;
align-items: center;
justify-content: flex-start;
} }
.goods-box .goods .price { .goods-box .goods .price {
max-width: 80%; width: 240rpx;
min-width: 104rpx; height: 64rpx;
height: 44rpx; background: #FFFFFF;
border: 2rpx solid #C3C3C3; border: 2rpx solid #E6E6E6;
border-radius: 8rpx; border-radius: 8rpx;
position: relative;
margin-right: 32rpx;
}
.goods-box .goods .price text{
position: absolute;
left: 16rpx;
top: 50%;
font-size: 24rpx;
transform: translateY(-50%);
} }
.goods-box .goods .price input { .goods-box .goods .price input {
box-sizing: border-box;
width: 100%; width: 100%;
height: 100%; height: 100%;
text-align: center; text-align: end;
min-height: 100%; min-height: 100%;
font-size: 28rpx; font-size: 28rpx;
padding: 0 16rpx 0 50rpx;
} }
.goods-box .goods .price input.error { .goods-box .goods .price input.error {
...@@ -227,12 +255,23 @@ page { ...@@ -227,12 +255,23 @@ page {
color: #dcdcdc; color: #dcdcdc;
} }
.goods-box .goods.total-box { .goods-box .goods .count{
min-width: 64rpx;
}
.goods-box .total-box {
height: 118rpx;
border-top: 2rpx solid rgba(195, 195, 195, .3);
border-bottom: 2rpx solid rgba(195, 195, 195, .3);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 40rpx; padding: 0 40rpx;
} }
.goods-box .goods .total { .goods-box .total-box .total {
color: #F24724; color: #F24724;
font-weight: 600;
} }
.btns { .btns {
......
...@@ -10,10 +10,18 @@ var replaceItemText = function (item) { ...@@ -10,10 +10,18 @@ var replaceItemText = function (item) {
return item?item.replace(reg, ' '):item return item?item.replace(reg, ' '):item
} }
var formatPosition = function (item, positionTypeList) {
var filterData = positionTypeList.filter(function(v) {
return v.positionValue == item
})
return (filterData.length && filterData[0] && filterData[0].positionName) || ''
}
/* /*
* 导出 * 导出
*/ */
module.exports = { module.exports = {
isIncludesItem: isIncludesItem, isIncludesItem: isIncludesItem,
replaceItemText: replaceItemText replaceItemText: replaceItemText,
formatPosition: formatPosition
} }
// tabWorkOrder/pages/orderDetail/orderDetail.js // tabWorkOrder/pages/orderDetail/orderDetail.js
import api from '../../api.js' import api from '../../api.js'
import order_mixins from '../order_mixins.js' import order_mixins from '../order_mixins.js'
import { getPositionList } from '~/store/index'
const app = getApp() const app = getApp()
Page({ Page({
/** /**
...@@ -86,11 +87,10 @@ Page({ ...@@ -86,11 +87,10 @@ Page({
onRoute(options) { onRoute(options) {
// console.log(options) // console.log(options)
if (options.orderCode) { if (options.orderCode) {
this.getOrderDetail(options.orderCode)
this.setData({ this.setData({
orderCode: options.orderCode orderCode: options.orderCode
}) })
this.getOrderDetail(options.orderCode)
// this.getGrass(options.orderCode)
} }
}, },
/** /**
...@@ -126,9 +126,10 @@ Page({ ...@@ -126,9 +126,10 @@ Page({
}) })
} }
}, },
getOrderDetail(orderCode) { async getOrderDetail(orderCode) {
// console.log(orderCode) // console.log(orderCode)
let _this = this let _this = this
const positionTypeList = await getPositionList() || []
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
api api
...@@ -145,6 +146,7 @@ Page({ ...@@ -145,6 +146,7 @@ Page({
data.subOrderList.map(e => { data.subOrderList.map(e => {
total_price += e.totalPrice total_price += e.totalPrice
e.price = Number(wx.$util.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2) e.price = Number(wx.$util.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2)
e.positionStr = positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
if ((e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) && data.selectPayType != 0) { if ((e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) && data.selectPayType != 0) {
warrantyCardList.push({ warrantyCardList.push({
warrantyPeriod: e.upgradeWarrantyPeriod, warrantyPeriod: e.upgradeWarrantyPeriod,
...@@ -197,10 +199,16 @@ Page({ ...@@ -197,10 +199,16 @@ Page({
customerObj customerObj
}) })
} }
// 门店是否配置技师 // // 门店是否配置技师
if (data?.technicianConfigDTOList?.length > 0) { // if (data?.technicianConfigDTOList?.length > 0) {
this.isArtificer(data) // this.isArtificer(data)
// }
// 获取园区店技师配置数据 wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId
api.getQYTechnicianList({yqMerchantId: wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId}).then(respone => {
if (respone?.code == 0) {
if (respone?.data.length > 0) this.isArtificer(respone.data)
} }
})
} else { } else {
wx.showModal({ wx.showModal({
title: '温馨提示', title: '温馨提示',
...@@ -221,6 +229,7 @@ Page({ ...@@ -221,6 +229,7 @@ Page({
isArtificer(data) { isArtificer(data) {
let { customerObj, orderInfo } = this.data let { customerObj, orderInfo } = this.data
orderInfo.isOpenArtificer = true orderInfo.isOpenArtificer = true
orderInfo.technicianList = data || [] // 技师数据
if (customerObj.findIndex(val =>val?.key && val.key == 'technicianName') < 0) { if (customerObj.findIndex(val =>val?.key && val.key == 'technicianName') < 0) {
customerObj[customerObj.length] = { customerObj[customerObj.length] = {
label: '选择技师:', label: '选择技师:',
......
...@@ -31,16 +31,21 @@ ...@@ -31,16 +31,21 @@
<view class="goods"> <view class="goods">
<block wx:for="{{orderInfo.subOrderList}}" wx:key="index"> <block wx:for="{{orderInfo.subOrderList}}" wx:key="index">
<view class="item"> <view class="item">
<view class="subItem_box goods_name">
<view class="name text-hide"> <view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}} {{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}}
</view> </view>
<view class="type">x{{item.number}}</view>
<view class="price">¥{{item.price}}</view> <view class="price">¥{{item.price}}</view>
</view> </view>
<view class="subItem_box">
<view class="position">{{item.positionStr}}</view>
<view class="type">x{{item.number}}</view>
</view>
</view>
</block> </block>
</view> </view>
<view class="cell"> <view class="cell">
<view class="label">抵用券:</view> <view class="label icon"><image src="../../images/voucher_icon.png" mode=""/></view>
<view class="value"> <view class="value">
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}}) {{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}})
</view> </view>
......
...@@ -41,7 +41,7 @@ page { ...@@ -41,7 +41,7 @@ page {
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10); box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10);
border-radius: 16rpx; border-radius: 16rpx;
padding: 40rpx 40rpx 20rpx; padding: 40rpx 40rpx 2rpx;
position: relative; position: relative;
margin: 20rpx 20rpx 0; margin: 20rpx 20rpx 0;
} }
...@@ -66,32 +66,49 @@ page { ...@@ -66,32 +66,49 @@ page {
} }
.box .goods { .box .goods {
font-size: 24rpx; font-size: 28rpx;
margin-bottom: 30rpx; margin-bottom: 32rpx;
} }
.box .goods .item { .box .goods .item {
margin: 16rpx -20rpx;
padding: 20rpx;
background: #F8F9F9;
border-radius: 16rpx;
display: flex; display: flex;
flex-flow: column;
align-items: center; align-items: center;
color: #888888; color: #888888;
} }
.box .goods .item .name { .box .goods .item:first-child{
width: 256rpx; margin-top: 0;
font-size: 28rpx;
} }
.box .goods .item .type { .box .goods .item:last-child{
margin-left: 140rpx; margin-bottom: 0;
} }
.box .goods .item .price { .box .goods .item .subItem_box{
display: flex;
justify-content: space-between;
width: 100%;
}
.box .goods .item .goods_name{
color: #333333; color: #333333;
margin-left: auto; }
.box .goods .item .goods_name .name {
width: 492rpx;
}
.box .goods .item .goods_name .price{
font-weight: 600;
} }
.box .line { .box .line {
display: inline-block; /* display: inline-block; */
height: 1rpx; height: 1rpx;
width: 355rpx; width: 355rpx;
width: 100%; width: 100%;
...@@ -109,7 +126,7 @@ page { ...@@ -109,7 +126,7 @@ page {
color: #888888; color: #888888;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
margin-bottom: 20rpx; margin-bottom: 32rpx;
} }
...@@ -118,6 +135,12 @@ page { ...@@ -118,6 +135,12 @@ page {
width: 180rpx; width: 180rpx;
} }
.box .cell .label.icon{
width: 96rpx;
height: 36rpx;
margin-right: 8rpx;
}
.box .cell .image-box{ .box .cell .image-box{
display: flex; display: flex;
flex-flow: wrap; flex-flow: wrap;
...@@ -126,8 +149,8 @@ page { ...@@ -126,8 +149,8 @@ page {
.box .cell .value { .box .cell .value {
color: #333333; color: #333333;
max-width: 370rpx;
display: flex; display: flex;
flex-flow: wrap;
align-items: center; align-items: center;
} }
......
...@@ -167,7 +167,7 @@ Page({ ...@@ -167,7 +167,7 @@ Page({
delete orderObj.customer.createdDate delete orderObj.customer.createdDate
this.showLoading('提交中...') this.showLoading('提交中...')
let paramsList = ['orderCode', 'customerId', 'customerName', 'customerPhone', 'customerSex', 'carBrandId', 'carBrand', 'carChildsBrandId', 'carChildsBrandName', 'carSeriesId', 'carSeriesName', 'standNo', 'plateNumber', 'experienceFlag', 'remark', 'technicianId', 'technicianName'] let paramsList = ['orderCode', 'customerId', 'customerName', 'customerPhone', 'customerSex', 'carBrandId', 'carBrand', 'carChildsBrandId', 'carChildsBrandName', 'carSeriesId', 'carSeriesName', 'standNo', 'plateNumber', 'experienceFlag', 'remark', 'technicianUuid', 'technicianId', 'technicianName']
let userInfo = {} let userInfo = {}
orderObj = Object.assign(orderObj, orderObj.customer) orderObj = Object.assign(orderObj, orderObj.customer)
paramsList.map(item => { paramsList.map(item => {
...@@ -239,7 +239,8 @@ Page({ ...@@ -239,7 +239,8 @@ Page({
orderObj, orderObj,
first: true, first: true,
flag: true, flag: true,
artificerList: orderObj?.technicianConfigDTOList // artificerList: orderObj?.technicianConfigDTOList
artificerList: orderObj?.technicianList
}) })
}, },
getSetting() { getSetting() {
......
...@@ -46,8 +46,8 @@ const scrmSecretKey_items = { ...@@ -46,8 +46,8 @@ const scrmSecretKey_items = {
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b' secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
}, },
preRelease: { preRelease: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022', appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353' secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
}, },
cdptest:{ cdptest:{
appKey: '48e5e13229b82c1b4e6e8c96151f0637', appKey: '48e5e13229b82c1b4e6e8c96151f0637',
...@@ -57,10 +57,10 @@ const scrmSecretKey_items = { ...@@ -57,10 +57,10 @@ const scrmSecretKey_items = {
const domain_items = { const domain_items = {
ip: { ip: {
// dj: 'http://192.168.1.165:8292', // dj: 'http://192.168.1.165:8292',
// dj: 'http://192.168.1.170:8292', //叶立庆 dj: 'http://192.168.1.170:8292', //叶立庆
// dj: 'http://192.168.1.169:8292',//蔡远明 // dj: 'http://192.168.1.169:8292',//蔡远明
// dj: 'http://192.168.1.174:8292',//范富荣 // dj: 'http://192.168.1.174:8292',//范富荣
dj: 'http://192.168.1.203:8292',//周杭 // dj: 'http://192.168.1.203:8292',//周杭
// dj: 'http://192.168.1.53:8292',//陈希 // dj: 'http://192.168.1.53:8292',//陈希
// dj:'http://192.168.2.59:8292/',//周立明 // dj:'http://192.168.2.59:8292/',//周立明
// scrm: 'http://192.168.1.165:8292' // scrm: 'http://192.168.1.165:8292'
......
...@@ -48,11 +48,6 @@ class Request { ...@@ -48,11 +48,6 @@ class Request {
getApp().login(true) getApp().login(true)
} }
} }
// else if (code == 32){
// resolve(data)
// // console.log(subErrors);
// throw subErrors
// }
else if (code == -1) { else if (code == -1) {
wx.showToast({ wx.showToast({
title: message || '网络请求失败', title: message || '网络请求失败',
...@@ -60,6 +55,8 @@ class Request { ...@@ -60,6 +55,8 @@ class Request {
}) })
resolve(data) resolve(data)
} else { } else {
// util.debounce( getApp().test(true),500)
// getApp().test()
resolve(data) resolve(data)
} }
}, },
......
...@@ -226,6 +226,38 @@ const pointRecord = clickEventType => { ...@@ -226,6 +226,38 @@ const pointRecord = clickEventType => {
console.log('burialPointRecord', res) console.log('burialPointRecord', res)
}) })
} }
/**
* 函数防抖:在指定的时间内,如果连续触发事件,则只执行一次,避免频繁触发。
* @param {Function} func - 要防抖的函数。
* @param {number} delay - 防抖的时间间隔,单位毫秒。
* @param {boolean} immediate - 是否立即执行一次。若为true,第一次触发会立即执行一次函数。
* @returns {Function} - 返回一个经过防抖处理的函数。
*/
const debounce = (func, delay, immediate)=> {
let timeoutId; // 用于保存定时器ID
return function (...args) {
const context = this; // 保存函数执行时的上下文环境
const executeLater = function () {
// 定义一个延迟执行的函数
timeoutId = null; // 清空定时器ID,用于标记函数可以再次执行
if (!immediate) {
// 如果不是立即执行模式,则执行函数
func.apply(context, args);
}
};
const callNow = immediate && !timeoutId; // 是否立即执行的条件
clearTimeout(timeoutId); // 清除之前的定时器
timeoutId = setTimeout(executeLater, delay); // 创建一个新的定时器
if (callNow) {
// 如果满足立即执行的条件,则立即执行函数
func.apply(context, args);
}
};
}
const util = { const util = {
onReachBottom, onReachBottom,
...@@ -247,7 +279,8 @@ const util = { ...@@ -247,7 +279,8 @@ const util = {
deepClone, deepClone,
getTimeState, getTimeState,
checkRule, checkRule,
pointRecord pointRecord,
debounce
} }
const Util = Object.assign(util, wxApi, format) const Util = Object.assign(util, wxApi, format)
// console.log('Util', Util) // console.log('Util', Util)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!