Commit 043dd2ce by zhangxw

Merge remote-tracking branch 'origin/dev_v4.25.02' into dev_v4.26.0

2 parents 67da339c 39e1eba1
Showing 88 changed files with 2196 additions and 456 deletions
......@@ -167,5 +167,10 @@ module.exports = {
//插入埋点记录
burialPointRecord(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({
getUpdateManager()
if (options) {
// console.log('options', options)
console.log('options', options)
let res = checkScene(options)
// console.log(res, 'res')
// 如果需要重新登录
......@@ -54,6 +54,9 @@ App({
},
login(relogin, context) {
// debugger
// util.debounce( this.test,1000)
// return
// console.log(relogin, 'relogin')
let that = this
// 清空多账号信息
......@@ -78,6 +81,9 @@ App({
}
})
} else {
// 标志位 解决安卓查复弹框问题
if (wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOTLOGIN_MODAL = true
wx.showModal({
title: '温馨提示',
content: context || '登录过期,请重新登录。',
......@@ -92,7 +98,14 @@ App({
wx.$relogin = relogin
router.reLaunch('pages.wxLogin')
}
}
},
complete: () => {
// 这个延迟的目的是为了避免短时间内重复弹出
// 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
setTimeout(() => {
wx.__HAS_NOTLOGIN_MODAL = false;
}, 2000);
}
})
}
} else {
......@@ -104,12 +117,77 @@ App({
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: {
statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'], // 头部导航栏的高度
yqdInfo: {},
isYqdSuper: true,
isStaff: false,
YQorderSetting: ''
YQorderSetting: '',
count:'',
}
})
......@@ -57,6 +57,7 @@
"pages/carQuotation/createOrderCarQuotation/createOrderCarQuotation",
"pages/carQuotation/createOrderCarQuotationSimple/createOrderCarQuotationSimple",
"pages/ocrEquityModules/ocrEquityModules",
"pages/carEquity/previewList/previewList",
"pages/carEquity/serviceInfo/serviceInfo",
"pages/carEquity/carBrands/carBrands",
"pages/carEquity/carSeries/carSeries",
......
......@@ -17,6 +17,10 @@ Component({
placeholder: String,
iconSrc: String,
labelStyle: String,
background: {
type: String,
value: '#FFFFFF',
},
cellHeight: {
type: Boolean,
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-label title-style' style="width:{{labelWidth}};{{labelStyle}}" bindtap="titleClick">
<text wx:if='{{required&&requiredBefore}}' class='required'>*</text>
......
......@@ -47,7 +47,7 @@ Component({
e.upgradeGoodsList.map((c, ind) => {
c.active = false
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
indexList.push({
index,
......@@ -105,6 +105,8 @@ Component({
// 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[${index}].upgradeGoodsList[${ind}].active`
this.setData({
[target]: !active
......
......@@ -24,7 +24,9 @@
data-ind="{{ind}}"
data-item="{{i}}">
<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 class="last" wx:if="{{!i.active}}">
<!-- | -->
......
......@@ -28,6 +28,12 @@
max-width: 85%;
}
.item .value .name .warning_text{
color: #F24724;
margin-left: 10rpx;
font-size: 22rpx;
}
.item .value .textWidth {
max-width: 100%;
}
......
......@@ -3,17 +3,17 @@
display: flex;
justify-content: center;
align-items: center;
min-height: 160rpx;
min-height: 400rpx;
margin-bottom: 14rpx;
}
.qr-box .qrImg {
width: 160rpx;
height: 160rpx;
width: 400rpx;
height: 400rpx;
display: inline-block;
}
.loadingBox {
width: 160rpx;
height: 160rpx;
width: 400rpx;
height: 400rpx;
position: relative;
}
.loader {
......
......@@ -47,7 +47,6 @@ if (systemInfo.platform != 'devtools') {
break
}
}
}
export const env = envName
......@@ -56,14 +55,13 @@ export const envIndex = index
const createQuotedUrl = {
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=`,
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']
// 报价单图片地址
export const quotedImgUrl = createQuotedUrl[target[envIndex]]
// sentry Dsn 地址
export const dsnUrl = 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'
......
......@@ -133,7 +133,7 @@
<!-- 超管isSuper/商户号类型 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>
<!-- 待支付/已支付/退定金 -->
......
......@@ -65,7 +65,7 @@ Page({
paramsActivityPrice: '',
showRemark: false,
customOutTradeNo: '', // 门店收款交易流水号
customPayVoucher: '', // 门店收款付款凭证
customPayVoucher: [], // 门店收款付款凭证
textAreaValue: '', // 备注回显
goodsNumber: 1 // 购买商品数量 默认购买一个
},
......@@ -115,7 +115,7 @@ Page({
},
input(e) {
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({
customOutTradeNo: val
})
......@@ -123,6 +123,7 @@ Page({
// 上传付款凭证
upLoad() {
let _this = this
let { customPayVoucher } = _this.data
wx.chooseImage({
count: 1,
success(res) {
......@@ -140,8 +141,9 @@ Page({
wx.$util.hideLoading()
let { code, data, message } = img
if (code == 0) {
customPayVoucher.push(data)
_this.setData({
customPayVoucher: data
customPayVoucher
})
} else {
wx.$util.showToast(message)
......@@ -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() {
let { customOutTradeNo, customPayVoucher, orderCode, orderPaySource, shopmallGoodsId, orderDetail } = this.data
if (!customOutTradeNo) {
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('请上传付款凭证')
}
wx.showModal({
......@@ -174,7 +201,7 @@ Page({
selectPayType: 2, // 线下收款 (门店收款)
updatedBy: accountName,
outTradeNo: customOutTradeNo, // 交易流水号
payVoucher: customPayVoucher, // 付款凭证
payVoucherList: customPayVoucher, // 付款凭证
remark: orderDetail?.remark // 备注
}
wx.showLoading()
......
page {
height: 100vh;
background-color: #f3f5f7
height: calc(100vh-20rpx);
background-color: #f3f5f7;
padding-bottom: 20rpx;
}
.big-img {
......@@ -48,7 +49,6 @@ page {
flex-direction: column;
align-items: center;
width: 710rpx;
height: 716rpx;
background: #FFFFFF;
border-radius: 16rpx;
margin: -34rpx auto 34rpx;
......@@ -101,6 +101,7 @@ page {
.tab-desc {
margin-top: 20rpx;
margin-bottom: 40rpx;
font-size: 24rpx;
color: #666666;
}
......@@ -109,10 +110,11 @@ page {
flex-shrink: 0;
width: 100%;
height: 100%;
padding: 38rpx 44rpx;
padding: 38rpx 40rpx;
box-sizing: border-box;
.input-item{
display: flex;
flex-flow: column;
margin-bottom: 36rpx;
.label{
flex-shrink: 0;
......@@ -120,14 +122,13 @@ page {
height: 68rpx;
line-height: 68rpx;
font-size: 24rpx;
text-align: right;
margin-right: 16rpx;
text-align: left;
color: #222222;
}
.input_content{
box-sizing: border-box;
flex-shrink: 0;
width: 456rpx;
width: 100%;
height: 68rpx;
border: 2rpx solid #DCDCDC;
border-radius: 8rpx;
......@@ -139,28 +140,52 @@ page {
height: 100%;
}
}
.payVoucher_image{
width: 456rpx;
height: 316rpx;
border: 2rpx dashed #999999;
border-radius: 20rpx;
.tips_text{
font-weight: 400;
font-size: 22rpx;
color: #9B9B9E;
margin-top: 16rpx;
}
.camera-box{
flex-shrink: 0;
width: 460rpx;
height: 320rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/pay-voucher-bg.png');
background-size: 100% 100%;
position: relative;
.camera-icon{
width: 96rpx;
height: 96rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
.upload_box{
display: flex;
flex-wrap: wrap;
gap: 20rpx;
.payVoucher_image{
flex-shrink: 0;
width: 304rpx;
height: 192rpx;
border-radius: 20rpx;
position: relative;
image{
width: 100%;
height: 100%;
}
.del_icon{
width: 40rpx;
height: 40rpx;
position: absolute;
top: 16rpx;
right: 16rpx;
}
}
.camera-box{
flex-shrink: 0;
width: 304rpx;
height: 192rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/pay-voucher-bg.png');
background-size: 100% 100%;
position: relative;
.camera-icon{
width: 72rpx;
height: 72rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
}
}
.confirm-btn{
display: flex;
......@@ -208,7 +233,7 @@ page {
border-radius: 16rpx;
padding: 32rpx 40rpx;
box-sizing: border-box;
margin: 100rpx auto;
margin: 20rpx auto;
.order-title {
font-weight: 600;
......
......@@ -49,18 +49,22 @@
<input
type="text"
bindinput="input"
value="{{customOutTradeNo}}"
maxlength="32" />
maxlength="-1"
value="{{customOutTradeNo}}" />
</view>
<view class="tips_text">多笔交易流水号之间以“/”号隔开,最多可上传5笔交易流水</view>
</view>
<view class="input-item">
<view class="label">上传付款凭证</view>
<view bindtap="upLoad">
<block wx:if="{{customPayVoucher}}">
<image class="payVoucher_image" src="{{customPayVoucher}}" />
<view class="upload_box">
<block wx:if="{{customPayVoucher.length > 0}}">
<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 wx:else>
<view class="camera-box">
<block wx:if="{{customPayVoucher.length < 5}}">
<view class="camera-box" bindtap="upLoad">
<gl-image
class="camera-icon"
webp
......
......@@ -11,7 +11,7 @@ Component({
if (n) {
this.setData({
outTradeNo: '',
payVoucher: ''
payVoucher: []
})
}
}
......@@ -23,7 +23,7 @@ Component({
*/
data: {
outTradeNo: '',
payVoucher: ''
payVoucher: []
},
/**
......@@ -32,7 +32,7 @@ Component({
methods: {
input(e) {
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({
outTradeNo: val
})
......@@ -40,6 +40,7 @@ Component({
// 上传付款凭证
upLoad() {
let _this = this
let { payVoucher } = _this.data
wx.chooseImage({
count: 1,
success(res) {
......@@ -59,8 +60,9 @@ Component({
console.log(img)
let { code, data, message } = img
if (code == 0) {
payVoucher.push(data)
_this.setData({
payVoucher: data
payVoucher
})
} else {
wx.$util.showToast(message)
......@@ -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() {
let { outTradeNo, payVoucher } = this.data
if (!outTradeNo) {
......@@ -79,6 +89,18 @@ Component({
if (!payVoucher) {
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})
},
cancel() {
......
......@@ -3,10 +3,11 @@
flex-shrink: 0;
width: 100%;
height: 100%;
padding: 38rpx 44rpx;
padding: 38rpx 0;
box-sizing: border-box;
.input-item{
display: flex;
flex-flow: column;
margin-bottom: 36rpx;
.label{
flex-shrink: 0;
......@@ -14,14 +15,13 @@
height: 68rpx;
line-height: 68rpx;
font-size: 24rpx;
text-align: right;
margin-right: 16rpx;
text-align: left;
color: #222222;
}
.input_content{
box-sizing: border-box;
flex-shrink: 0;
width: 456rpx;
width: 100%;
height: 68rpx;
border: 2rpx solid #DCDCDC;
border-radius: 8rpx;
......@@ -33,27 +33,62 @@
height: 100%;
}
}
.payVoucher_image{
width: 456rpx;
height: 316rpx;
border: 2rpx dashed #999999;
border-radius: 20rpx;
.tips_text{
font-weight: 400;
font-size: 22rpx;
color: #9B9B9E;
margin-top: 16rpx;
}
.camera-box{
flex-shrink: 0;
width: 460rpx;
height: 320rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/pay-voucher-bg.png');
background-size: 100% 100%;
position: relative;
.camera-icon{
width: 96rpx;
height: 96rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
.upload_box{
display: flex;
flex-wrap: wrap;
gap: 20rpx;
.payVoucher_image{
flex-shrink: 0;
width: 304rpx;
height: 192rpx;
border-radius: 20rpx;
position: relative;
image{
width: 100%;
height: 100%;
}
.del_icon{
width: 40rpx;
height: 40rpx;
position: absolute;
top: 16rpx;
right: 16rpx;
}
}
.camera-box{
flex-shrink: 0;
width: 304rpx;
height: 192rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/pay-voucher-bg.png');
background-size: 100% 100%;
position: relative;
.camera-icon{
width: 72rpx;
height: 72rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
}
}
.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
<!--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-item">
<view class="label">交易流水号</view>
<view class="input_content">
<input
type="text"
bindinput="input"
value="{{outTradeNo}}"
maxlength="32" />
</view>
<view class="input-item">
<view class="label">交易流水号</view>
<view class="input_content">
<input
type="text"
bindinput="input"
maxlength="-1"
value="{{customOutTradeNo}}" />
</view>
<view class="input-item">
<view class="label">上传付款凭证</view>
<view bindtap="upLoad">
<block wx:if="{{payVoucher}}">
<image class="payVoucher_image" src="{{payVoucher}}" />
</block>
<block wx:else>
<view class="camera-box">
<gl-image
class="camera-icon"
webp
src="/miniProgram/camera-icon.png"></gl-image>
</view>
</block>
</view>
<view class="tips_text">多笔交易流水号之间以“/”号隔开,最多可上传5笔交易流水</view>
</view>
<view class="input-item">
<view class="label">上传付款凭证</view>
<view class="upload_box">
<block wx:if="{{payVoucher.length > 0}}">
<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 wx:if="{{payVoucher.length < 5}}">
<view class="camera-box" bindtap="upLoad">
<gl-image
class="camera-icon"
webp
src="/miniProgram/camera-icon.png"></gl-image>
</view>
</block>
</view>
</view>
</view>
</popup>
......@@ -159,7 +159,7 @@ Page({
merchantId: merchantInfo.merchantId,
merchantName: merchantInfo.merchantName,
outTradeNo: obj.outTradeNo,
payVoucher: obj.payVoucher
payVoucherList: obj.payVoucher
}
this.setData({
confirmFlag: true
......
......@@ -52,6 +52,11 @@ export default {
let params = data || {}
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) {
let params = data || {}
......
// packageEquity/pages/carEquity/components/GLForm/GLForm.js
Component({
externalClasses: ['custom-class'],
options: {
multipleSlots: true // 在组件定义时的选项中启用多 slot 支持
},
......@@ -9,7 +10,7 @@ Component({
properties: {
formData: {
type: Object,
value: () => {},
value: () => { },
observer: function (n) {
this.setData({
formData: n
......@@ -32,6 +33,15 @@ Component({
disable: {
type: Boolean,
value: false
},
glCellClass: {
type: String,
value: false
},
// 背景色
background: {
type: String,
value: '#FFFFFF'
}
},
......@@ -82,22 +92,37 @@ Component({
},
handleInput(e) {
let value = e.detail
let { attr } = e.target.dataset
const trimValue = value.trim()
if (value != trimValue ) {
value = trimValue
}
let { attr, item } = e.target.dataset
let { dataAttrName } = this.data
if (attr=='price' && value>=2000000) {
value = '2000000'
wx.$eventbus.emit('delete_goodsSelect')
}
// if (attr == 'price') {
// value = value >= 2000000 ? '2000000' : value
// // wx.$eventbus.emit('delete_goodsSelect')
// }
// console.log(item,'handleInput');
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({
[dataAttrName + '.' + attr]: value
// [dataAttrName + '.' + attr]: value
[dataAttrName + '.' + attr]: value
})
},
handlePickerChange(e) {
let idx = e.detail.value || 0
......
<!-- 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
wx:if="{{filterUtils.isShowFn(formData, item)}}"
border="{{!item.noBorder}}"
class="{{item.name}}"
haveArrow="{{item.haveArrow || false}}"
......@@ -11,8 +13,9 @@
bindclick="handleCellClick"
data-target="{{item}}"
data-idx="{{index}}"
required="{{item.required}}"
requiredAfter="{{item.requiredAfter}}"
background="{{background}}"
required="{{item.required}}"
requiredAfter="{{item.requiredAfter}}"
cellHeight="{{!item.noCellHeight}}">
<!-- slot -->
<slot wx:if="{{item.type == 'slot'}}" name="{{item.name}}" />
......@@ -21,7 +24,7 @@
<!-- rows="1" -->
<van-field
class="textarea"
custom-style="padding: 20rpx 0;"
custom-style="padding: 20rpx 0; background: {{background}};"
border="{{ false}}"
value="{{formData[item.name]}}"
input-align="{{itme.inputAlign || 'right'}}"
......@@ -33,6 +36,7 @@
disabled="{{item.disabled||disable}}"
readonly="{{item.readonly}}"
data-attr="{{item.name}}"
data-item="{{item}}"
bindinput="handleInput" />
<text wx:if="{{item.suffix}}" class="input-suffix">{{item.suffix}}</text>
</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
......@@ -15,8 +15,10 @@
<!-- test -->
</view>
<view class="text" wx:elif="{{item.type == 'project' }}">
<view class="goodsName">{{orderInfo.subOrderList[0].upgradeGoodsName}}</view>
<view class="goodsItem">包含{{orderInfo.subOrderList[0].serviceItems}}</view>
<block wx:for="{{orderInfo.subOrderList}}" wx:for-item="subItem" wx:key="idx">
<view class="goodsName">{{subItem.upgradeGoodsName}} <text class="goodsItem">(包含{{subItem.serviceItems}})</text></view>
</block>
<!-- <view class="goodsItem">包含{{orderInfo.subOrderList[0].serviceItems}}</view> -->
</view>
<view class="text" wx:else>{{orderInfo[item.key]||''}}</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({
shopSideSelectPopup: false,
mode: 1,
tipsProps: false,
waitInputCount: 1,
waitInputCount: 0,
isStaff: false
// hasMode:true
},
......@@ -200,7 +200,6 @@ Page({
[`pageShow[${tabIndex}]`]: true,
tabIndex
})
// this.onShow()
this.initList()
},
......@@ -212,9 +211,11 @@ Page({
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), default4SStoreInfo })
this.setData({
userInfo: { ...wx.$util.getUserInfo(), default4SStoreInfo }
userInfo: { ...wx.$util.getUserInfo(), default4SStoreInfo },
waitInputCount: 0
})
this.getMerchant4SMode()
this.initList()
},
initList() {
let { tabIndex } = this.data
......@@ -267,6 +268,12 @@ Page({
}
},
onRoute(options) {
// console.log(options,'options');
if (options&&options.tabIndex) {
this.changeTabBar({detail:options.tabIndex})
}
},
/**
* 生命周期函数--监听页面加载
*/
......
......@@ -212,27 +212,38 @@ Component({
})
},
// 查看/下载合同
handlePreviewContract(e) {
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
let result = await carLifeApi.equityOrderList({ orderId: target.orderId })
let { code, data } = result
if (code == 0) {
if (data.length == 1) {
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 || '接口异常')
}
})
if (type == 'download') {
// 复制合同链接
this.copyContractUrl(res.data)
} else this.handleDownload()
console.log(this.data.url)
} else {
wx.$util.showToast(res.message || '接口异常')
wx.$router.go('previewList', { list: data })
}
})
}
console.log(result, 'result')
return
},
// 复制链接
......
......@@ -16,6 +16,7 @@ Component({
this.setData({
formData: n
})
this.dealFormRule()
}
},
// 页面存放表单对象的对象名,用于直接变更page的值
......@@ -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) {
let { attr } = e.currentTarget.dataset
......
......@@ -9,7 +9,10 @@ Component({
properties: {
serviceInfo: {
type: Object,
value: () => { }
value: () => { },
observer: function (n) {
this.dealFormRule()
}
},
// 页面存放表单对象的对象名
dataAttrName: {
......@@ -53,6 +56,20 @@ Component({
* 组件的方法列表
*/
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) {
let { attr } = e.currentTarget.dataset
this.setData({
......@@ -92,6 +109,13 @@ Component({
// }
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' })
},
handleDraft() {
......
......@@ -43,7 +43,20 @@
</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 class="box m-b-40">
<view class="title">
......
......@@ -177,4 +177,19 @@
.h-40 {
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
......@@ -27,23 +27,39 @@ const secondObj = {
label: '轮胎品牌',
name: 'tireBrand',
type: 'input',
maxlength: '20'
maxlength: '20',
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
}, {
label: '规格型号(前轮)',
name: 'frontTireSpecification',
type: 'input',
maxlength: '20'
maxlength: '20',
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
}, {
label: '规格型号(后轮)',
name: 'rearTireSpecification',
type: 'input',
maxlength: '20'
maxlength: '20',
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
}, {
label: ' ',
name: 'tireUrl',
type: 'slot',
labelWidth: '0rpx',
noCellHeight: true
noCellHeight: true,
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
}],
}
......
......@@ -45,7 +45,7 @@ const formRule = {
],
customerAddress: [{ required: true, message: '联系地址不能为空' }],
effectiveDate: [{ required: true, message: '生效日期不能为空' }],
card: [{ required: true, message: '卡号不能为空' }],
// card: [{ required: true, message: '卡号不能为空' }],
tireBrand: [{ required: true, message: '轮胎品牌不能为空' }],
frontTireSpecification: [{ required: true, message: '规格型号(前轮)不能为空' }],
rearTireSpecification: [{ required: true, message: '规格型号(后轮)不能为空' }],
......@@ -155,42 +155,95 @@ const secondObj = {
],
productFormList: [
{
label: '服务年限',
name: 'servicePeriod',
type: 'input',
disabled: true,
suffix: '年'
label: ' ',
name: 'goodInfoList',
type: 'slot',
labelWidth: '0rpx',
noCellHeight: true,
proFormList: [{
label: '服务年限',
name: 'servicePeriod',
type: 'input',
disabled: true,
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: '生效日期',
name: 'effectiveDate',
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('/','-')
},
{
label: '卡号',
name: 'card',
type: 'input',
maxlength: '20'
},
// {
// label: '卡号',
// name: 'card',
// type: 'input',
// maxlength: '20'
// },
{
label: '轮胎品牌',
name: 'tireBrand',
type: 'input',
maxlength: '20'
maxlength: '20',
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
},
{
label: '规格型号(前轮)',
name: 'frontTireSpecification',
type: 'input',
maxlength: '20'
maxlength: '20',
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
},
{
label: '规格型号(后轮)',
name: 'rearTireSpecification',
type: 'input',
maxlength: '20'
maxlength: '20',
isShowObj: {
attr: 'tireFlag',
list: ['1']
}
},
{
label: '购车类型',
......@@ -225,8 +278,8 @@ const secondObj = {
name: 'merchantAddress',
type: 'input',
fieldType: 'input',
// fieldType: 'textarea',
// noCellHeight: true,
// fieldType: 'textarea',
// noCellHeight: true,
maxlength: '100'
}
]
......
// 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
<!--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
......@@ -30,7 +30,7 @@ Page({
// 页面存放表单对象的对象名
dataAttrName: 'serviceInfo',
// step: 'first',
step: 'second',
step: '',
routeInfo: {},
contractNo: '',
url: '',
......@@ -43,7 +43,7 @@ Page({
isDialogShow: false,
dialogObj: {},
scrollTop: 0,
cardSetting:true
cardSetting: true
},
getPickerObj(obj) {
......@@ -84,6 +84,12 @@ Page({
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处理
let pickerList = []
Object.keys(secondStepData.secondObj).forEach(item => {
......@@ -146,9 +152,31 @@ Page({
// 权益卡
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({
serviceInfo: data,
// step: data.mode ? 'second' : 'first'
step: data.mode ? 'second' : 'first'
// 先调试
})
} else {
......@@ -156,20 +184,22 @@ Page({
}
})
},
getInterestCardSetting(id) { // 是否要新增实体卡 字段 Y要 N不要
getInterestCardSetting(id) {
// 是否要新增实体卡 字段 Y要 N不要
carLifeApi.goodsInfoGetDetailById({ id }).then(res => {
console.log('res', res)
// this.setData({
// cardSetting:false
// })
let {code,data} = res
console.log(data,'data');
let { code, data } = res
console.log(data, 'data')
if (res.code == 0) {
const entityCardFlag = data.upgradeGoods.entityCardFlag
console.log(entityCardFlag,'entityCardFlag');
entityCardFlag !='Y' && this.setData({
cardSetting:false
})
console.log(entityCardFlag, 'entityCardFlag')
entityCardFlag != 'Y' &&
this.setData({
cardSetting: false
})
// let data = res.data[0]
// this.setData({
// 'serviceInfo.interestCardSetting':data.interestCardSetting
......@@ -227,6 +257,12 @@ Page({
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
},
......@@ -248,10 +284,12 @@ Page({
this.setData({
dialogObj: JSON.parse(JSON.stringify(sussObj)),
isDialogShow: true,
contractNo: res.data
contractNo: res.data[0].contractNo,
contractNoList: res.data
})
} else {
wx.$router.reLaunch('packageEquity.equityPage')
// wx.$router.reLaunch('packageEquity.equityPage')
wx.$router.reLaunch('packageEquity.equityPage',{tabIndex:1})
}
} else {
wx.$util.showToast(res.message || '接口异常')
......@@ -266,7 +304,6 @@ Page({
scrollTop: height // 滚动到的位置(距离顶部 px)
})
},
handleSecondConfirm(e) {
let { serviceInfo, conSecondObj } = this.data
if (e.detail?.type == 'confirm') {
......@@ -308,7 +345,9 @@ Page({
handleTipClick(e) {
let { type } = e.currentTarget.dataset
if (type == 'success') {
this.getUrl()
let { contractNoList } = this.data
contractNoList.length == 1 ? this.getUrl() : wx.$router.redirectTo('previewList', { list: contractNoList })
// this.getUrl()
return true
}
let params = {
......@@ -328,6 +367,7 @@ Page({
this.setData({
isDialogShow: false
})
wx.$router.reLaunch('packageEquity.equityPage',{tabIndex:1})
},
// 合同地址
......@@ -426,7 +466,7 @@ Page({
onShow() {
let { isBack } = this.data
if (isBack) {
wx.$router.reLaunch('packageEquity.equityPage')
wx.$router.reLaunch('packageEquity.equityPage',{tabIndex:1})
}
},
......
......@@ -12,6 +12,10 @@ Page({
* 页面的初始数据
*/
data: {
payItems: [
{ id: 1, name: '微信支付', icon: 'wxPay' },
{ id: 3, name: 'POS机', icon: 'posPay' },
],
orderCode: '',
wxqrcode: '',
posqrcode: '',
......@@ -29,6 +33,9 @@ Page({
},
selectPayType: 1
},
back() {
wx.$router.back()
},
async changePayType(e) {
console.log(e)
// pos支付
......@@ -201,7 +208,8 @@ Page({
onRoute(options) {
// console.log(options = 19)
let { data, id } = options
// id = 14
// id = 123
// orderCode: 230724111753590
this.setData({ id })
this.getQuotationInfoById()
},
......
......@@ -2,5 +2,5 @@
"usingComponents": {
"order-detail": "../../../components/orderInfoCom/orderInfoCom"
},
"navigationBarTitleText": "订单支付"
"navigationStyle": "custom"
}
/* packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.wxss */
page {
background: #f3f5f7;
page {
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 {
// background-color: #f5f5f5;
padding: 20rpx;
padding:0 20rpx 20rpx;
.payType {
display: flex;
......
<!-- 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="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">
<image
show-menu-by-longpress
......@@ -9,8 +48,6 @@
mode="widthFix"
binderror=""
bindload="" />
<view class="label">待支付</view>
<view class="price">总保费{{orderDetail.totalPrice}}元/年</view>
</view>
<view class="payType">
<image class="payIcon" src="{{payType[selectPayType].imgUrl}}" />
......@@ -36,7 +73,7 @@
class="arrow right" />
<view class="MerchantName">{{orderDetail.merchantName||''}}</view>
<view class="bg" />
</view>
</view> -->
<view class="orderInfo">
<order-detail OderType="pay" orderInfo="{{orderDetail}}" />
</view>
......
......@@ -49,7 +49,7 @@ Component({
observers: {
'orderInfo.mode': function (value) {
// if (n.mode) {
console.log(value, 'mode')
// console.log(value, 'mode')
// first: data.firstObj,
this.setData({
first: value ? data.firstObjSimple : data.firstObj,
......@@ -57,15 +57,15 @@ Component({
})
// }
},
'orderInfo.outTradeNo': function (value) {
console.log(value, 'outTradeNo')
this.setData({
textNameObj: {
confirmName: '下一步(1/4)'
// cancelName: '存草稿'
}
})
}
// 'orderInfo.outTradeNo': function (value) {
// console.log(value, 'outTradeNo')
// value && this.setData({
// textNameObj: {
// confirmName: '下一步(1/4)'
// // 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
{
"component": true,
"usingComponents": {}
}
\ 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
var replaceItemText = function (item) {
var reg = getRegExp(';~;', 'g')
return item?item.replace(reg, ' '):''
}
/*
* 导出
*/
module.exports = {
replaceItemText: replaceItemText
}
......@@ -114,6 +114,7 @@ Component({
// },
onChangeInsurance(e) {
console.log(e)
// vdQuotationGoodsList
let { detail } = e
let { id } = e.currentTarget.dataset
console.log(detail, 'detail')
......@@ -156,6 +157,7 @@ Component({
// if (params?.quotedPriceUpdate) {
// }
params.insureList = []
console.log(params, 'params')
wx.$util.showLoading()
priceCounter(params)
......@@ -164,7 +166,7 @@ Component({
console.log('result', result)
let { data, code, message } = result
if (code) {
if (code == 0) {
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
......
......@@ -51,13 +51,15 @@ Component({
},
observers: {
'orderInfo.outTradeNo': function (value) {
console.log(value, 'outTradeNo')
this.setData({
textNameObj: {
confirmName: '确认',
cancelName: '放弃',
}
})
// console.log(value, 'outTradeNo')
// if (value) {
value && this.setData({
textNameObj: {
confirmName: '确认',
cancelName: '放弃',
}
})
// }
}
},
/**
......@@ -104,10 +106,70 @@ Component({
* 组件的方法列表
*/
methods: {
// test() {
// let { activeNames } = this.data
// console.log('activeNames', activeNames)
// },
changePrice(e) {
let { value } = e.detail
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) {
console.log(e)
let { detail } = e
......
......@@ -6,6 +6,7 @@
"van-collapse": "@vant/weapp/collapse/index",
"van-collapse-item": "@vant/weapp/collapse-item/index",
"van-checkbox": "@vant/weapp/checkbox/index",
"popup-input": "../PopupInput/PopupInput"
"popup-input": "../PopupInput/PopupInput",
"goods": "../Goods/Goods"
}
}
......@@ -248,4 +248,72 @@
.required {
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
<!-- packageEquity/pages/carEquity/components/SecondStep/SecondStep.wxml -->
<view class="testFormCon">
<van-collapse value="{{ activeNames }}">
<view class="collapse">
<!-- <view class="collapse">
<van-collapse-item name="1" is-link="{{ false }}">
<view slot="title">
<view class="collapseBoxTitle">
......@@ -9,7 +9,6 @@
<view class="label">商业险信息</view>
</view>
</view>
<!-- <text class='required'>*</text> -->
<view class="box">
<view class="title">商业险总价</view>
<van-field
......@@ -31,7 +30,7 @@
</van-field>
</view>
</van-collapse-item>
</view>
</view> -->
<view class="collapse">
<van-collapse-item name="3" is-link="{{ false }}">
<view slot="title">
......@@ -42,87 +41,64 @@
</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>
<text>包含</text>
<block
wx:for-index="itemIndex"
wx:for-item="i"
wx:key="itemIndex"
wx:for="{{ item.quotationGoodsServiceItemsRelationDTOList }}"
>
<text>{{i.serviceName}}{{i.quotationGoodsServiceItemsRelationDTOList.length-1==itemIndex?'':'、'}}</text>
</block>
<view>
<gl-cell
border
valueAlign="right"
label="购买商品"
labelWidth="140rpx"
haveArrow
requiredAfter
required
placeholder="点击选择"
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 class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view>
</view>
<block wx:if="{{ orderInfo.goodsId == item.id&& !orderInfo.outTradeNo }}">
<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>
</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>
</block>
<!-- </van-radio-group> -->
<!-- </block> -->
</van-collapse-item>
</view>
</van-collapse>
<Gl-Button-Group bindbtnTap="btnTap" textNameObj="{{ textNameObj }}" />
</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
<goods
show="{{ goodsBox }}"
bindconfirm="chooseGoods"
goodsData="{{ quotationGoodsList }}"
chooseGoodsList="{{ orderInfo.vdQuotationGoodsList }}"
/>
\ No newline at end of file
......@@ -198,6 +198,10 @@ Page({
insurance.forEach(item => {
delete orderInfo[item]
})
if (!orderInfo.vdQuotationGoodsList) {
//修复为null或则空时,后台报错
orderInfo.vdQuotationGoodsList = []
}
// delete orderInfo.quotedPriceUpdate
return orderInfo
},
......
No preview for this file type
No preview for this file type
......@@ -287,7 +287,9 @@ Page({
// 只开通一个场景直接跳转页面
if (openSceneArr.length === 1) {
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) {
wx.$router.reLaunch('pages.sceneIndex')
}
......
......@@ -212,7 +212,10 @@ export const checkScene = options => {
}
console.log(options, 'options')
wx.$SCENE = options
if (!userInfo) {
if (!userInfo && options.path != 'pages/accountItems/accountItems') {
// if (!userInfo) {
// console.log(userInfo);
console.log('未登录,请登录。');
return '未登录,请登录。'
}
}
......@@ -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
import mixins from './index_mixins'
import api from '../../api.js'
// import apiother from '~/api/api.js'
import NP from 'number-precision'
import { env } from '~/config'
import { getYQInfo } from '~/store/index'
......@@ -583,7 +584,28 @@ Page({
*/
onLoad: function (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)
let today = new Date()
......
......@@ -127,5 +127,10 @@ module.exports = {
/** 查询园区店是否开启签名配置 */
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)
}
}
// tabWorkOrder/pages/createOrder/createOrder.js
// import deepClone from '~/utils/deepClone'
import api from '../../api'
import { getYQorderInfo } from '~/store/index'
import { getYQorderInfo, getPositionList } from '~/store/index'
import NP from 'number-precision'
const app = getApp()
let toastList = {
......@@ -69,7 +69,8 @@ Page({
accountDate: '',
priceSpread: '',
showTips: true,
isShowSubShopMerchant: false
isShowSubShopMerchant: false,
positionTypeList: []
},
showCustomPop() {
this.setData({
......@@ -632,7 +633,7 @@ Page({
// })
// },
getOrderBaseGoodsList(merchantId) {
let { first } = this.data
let { first, positionTypeList } = this.data
api
.getOrderBaseGoodsList({
merchantId
......@@ -642,6 +643,11 @@ Page({
let { code, data, message } = res
if (code == 0) {
wx.hideLoading()
data?.forEach(item => {
item.upgradeGoodsList?.forEach(val => {
val.positionStr = positionTypeList.filter(v=> v.positionValue == val.merchantGoodsPosition)[0]?.positionName
})
})
this.setData({
goodsData: data
})
......@@ -791,7 +797,16 @@ Page({
.catch(err => {})
}
},
// 获取太阳膜类商品部位数据
getGoodsPosition() {
getPositionList().then(res => {
this.setData({
positionTypeList: res || []
})
})
},
onRoute(options) {
this.getGoodsPosition()
let { outTradeNo, totalFee, accountDate, supplementId } = options
console.log(options)
// 如果是扫码进来的
......
......@@ -242,32 +242,29 @@
<view class="goods-box">
<block wx:for="{{goodsList}}" 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">
{{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"
data-item="{{item}}"
bindblur="priceBlur"
data-index="{{index}}"
class="{{item.price < item.shopMinPrice? 'error':''}}"
always-embed />
</view>
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox">
x{{item.count}}
</view>
<view class="name_box">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
</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 class="count" catchtap="showPopup" data-show-name="goodsBox">
x{{item.count}}
</view>
</view>
</view>
<view class="icon" bindtap="delGoodsList" data-index="{{index}}">
<image src="../../images/del.png" />
</view>
</view>
</block>
<view class="goods total-box">
<view class="total-box">
总价
<view class="priceLabel" wx:if="{{priceSpread}}">
差值
......
......@@ -161,11 +161,13 @@ page {
}
.goods-box .goods {
height: 118rpx;
border-bottom: 2rpx solid rgba(195, 195, 195, .3);
opacity: 0.7;
background: #F8F9F9;
border-radius: 16rpx;
margin: 16rpx 20rpx;
display: flex;
align-items: center;
padding: 0 28rpx 0 90rpx;
flex-flow: column;
padding: 24rpx;
justify-content: space-between;
font-size: 28rpx;
position: relative;
......@@ -173,11 +175,12 @@ page {
.goods .icon {
position: absolute;
top: 50%;
left: 40rpx;
top: 0;
right: 0;
width: 40rpx;
height: 40rpx;
transform: translateY(-50%);
background: #3582ee1a;
border-radius: 0 16rpx 0 16rpx;
}
.goods-box .goods .name {
......@@ -185,36 +188,62 @@ page {
width: 306rpx;
}
.goods-box .goods .price-box {
.goods-box .goods .bottom_box {
display: flex;
align-items: center;
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 {
max-width: 80%;
min-width: 104rpx;
height: 44rpx;
border: 2rpx solid #C3C3C3;
width: 240rpx;
height: 64rpx;
background: #FFFFFF;
border: 2rpx solid #E6E6E6;
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 {
box-sizing: border-box;
width: 100%;
height: 100%;
text-align: center;
text-align: end;
min-height: 100%;
font-size: 28rpx;
padding: 0 16rpx 0 50rpx;
}
.goods-box .goods .price input.error {
color: red;
}
.goods-box .goods.total-box {
padding: 0 40rpx;
.goods-box .goods .price input.disabled {
/* color: red; */
background-color: #f0f0f0;
color: #dcdcdc;
}
.goods-box .goods .count{
min-width: 64rpx;
}
.goods-box .priceLabel {
......@@ -224,9 +253,17 @@ page {
font-size: 24rpx;
}
.goods-box .goods .total {
/* color: #F24724; */
.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;
}
.goods-box .total-box .total {
color: #3582EE;
}
......
import api from '../../api.js'
import order_mixins from '../order_mixins.js'
import { setWebSocket } from '~/store/index'
import { setWebSocket, getPositionList } from '~/store/index'
let time = null
let app = getApp()
Page({
......@@ -229,9 +229,10 @@ Page({
this.getDetail(options.orderCode)
}
},
getDetail(orderCode) {
async getDetail(orderCode) {
// console.log(orderCode)
let _this = this
const positionTypeList = await getPositionList() || []
api
.getOrderDetail({
orderCode
......@@ -254,6 +255,7 @@ Page({
data.subOrderList.map(e => {
total_price += e.totalPrice
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) {
warrantyCardList.push({
warrantyPeriod: e.upgradeWarrantyPeriod,
......
......@@ -33,16 +33,21 @@
<view class="goods">
<block wx:for="{{orderInfo.subOrderList}}" wx:key="index">
<view class="item">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}}
</view>
<view class="type">x{{item.number}}</view>
<view class="price">¥{{item.price}}</view>
</view>
<view class="subItem_box goods_name">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}}
</view>
<view class="price">¥{{item.price}}</view>
</view>
<view class="subItem_box">
<view class="position">{{item.positionStr}}</view>
<view class="type">x{{item.number}}</view>
</view>
</view>
</block>
</view>
<view class="cell">
<view class="label">抵用券:</view>
<view class="label icon"><image src="../../images/voucher_icon.png" mode=""/></view>
<view class="value">
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}})
</view>
......
// tabWorkOrder/pages/orderDetail/orderDetail.js
import api from '../../api.js'
import order_mixins, { data } from '../order_mixins.js'
import { getPositionList } from '~/store/index'
const app = getApp()
Page({
/**
......@@ -143,6 +144,7 @@ Page({
isStaff: app.globalData.isStaff
})
},
checkPhoneShow(config) {
console.log('config', config)
// 有就屏蔽手机号的显示
......@@ -154,8 +156,9 @@ Page({
})
}
},
getOrderDetail(orderCode) {
async getOrderDetail(orderCode) {
let _this = this
const positionTypeList = await getPositionList() || []
wx.$util.showLoading('加载中...')
api
.getOrderDetail({
......@@ -172,6 +175,7 @@ Page({
data.subOrderList.map(e => {
total_price += e.totalPrice
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) {
warrantyCardList.push({
warrantyPeriod: e.upgradeWarrantyPeriod,
......
......@@ -40,16 +40,21 @@
<view class="goods">
<block wx:for="{{orderInfo.subOrderList}}" wx:key="index">
<view class="item">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}}
</view>
<view class="type">x{{item.number}}</view>
<view class="price">¥{{item.price}}</view>
<view class="subItem_box goods_name">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}}
</view>
<view class="price">¥{{item.price}}</view>
</view>
<view class="subItem_box">
<view class="position">{{item.positionStr}}</view>
<view class="type">x{{item.number}}</view>
</view>
</view>
</block>
</view>
<view class="cell">
<view class="label">抵用券:</view>
<view class="label icon"><image src="../../images/voucher_icon.png" mode=""/></view>
<view class="value">
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}})
</view>
......
......@@ -72,7 +72,7 @@ page {
background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10);
border-radius: 16rpx;
padding: 40rpx 40rpx 20rpx;
padding: 40rpx 40rpx 2rpx;
position: relative;
margin: 20rpx 20rpx 0;
}
......@@ -157,7 +157,7 @@ page {
}
.box .line {
display: inline-block;
/* display: inline-block; */
height: 1rpx;
width: 355rpx;
width: 100%;
......@@ -166,7 +166,7 @@ page {
}
.box .cell.total {
padding-top: 30rpx;
padding-top: 32rpx;
align-items: center;
}
......@@ -174,28 +174,50 @@ page {
border-bottom: 1px solid #C3C3C3;
} */
.box .goods {
font-size: 24rpx;
margin-bottom: 30rpx;
font-size: 28rpx;
margin-bottom: 32rpx;
}
.box .goods .item {
margin: 16rpx -20rpx;
padding: 20rpx;
background: #F8F9F9;
border-radius: 16rpx;
display: flex;
flex-flow: column;
align-items: center;
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 {
width: 256rpx;
font-size: 28rpx;
width: 492rpx;
}
.box .goods .item .type {
margin-left: 140rpx;
.box .goods .item .price {
font-weight: 600;
}
.box .goods .item .price {
color: #333333;
margin-left: auto;
.box .goods .item .type {
margin-left: 140rpx;
}
.box .cell {
......@@ -203,7 +225,7 @@ page {
color: #888888;
display: flex;
align-items: flex-start;
margin-bottom: 20rpx;
margin-bottom: 32rpx;
}
.box .cell .label {
......@@ -211,6 +233,12 @@ page {
width: 180rpx;
}
.box .cell .label.icon{
width: 96rpx;
height: 36rpx;
margin-right: 8rpx;
}
.box .cell .image-box{
display: flex;
flex-flow: wrap;
......@@ -219,8 +247,8 @@ page {
.box .cell .value {
color: #333333;
max-width: 370rpx;
display: flex;
flex-flow: wrap;
align-items: center;
}
......
// tabWorkOrder/pages/createOrder/createOrder.js
// import deepClone from '~/utils/deepClone'
import api from '../../api'
import { getYQorderInfo } from '~/store/index'
import { getYQorderInfo, getPositionList } from '~/store/index'
const app = getApp()
let toastList = {
userId: '销售顾问不能为空',
......@@ -73,7 +73,8 @@ Page({
showTips: true,
type: 1
},
isShowSubShopMerchant: false
isShowSubShopMerchant: false,
positionTypeList: []
},
showCustomPop() {
this.setData({
......@@ -296,6 +297,14 @@ Page({
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('提交中...')
let apiName = save && !isErrorOrder ? 'createPrerecordedOrder' : isErrorOrder ? 'correctionOrder' : 'createWithPay'
......@@ -535,9 +544,11 @@ Page({
}
// console.log(this.data)
// console.log(scene);
if (scene) {
if (userInfo.userType == 2) {
let id = scene.split('=')[1]
api
.getCouponDeatil({
id
......@@ -558,6 +569,18 @@ Page({
return
}
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 {
this.showToast(message)
}
......@@ -580,10 +603,14 @@ Page({
}
},
getOrderBaseGoodsList(merchantId) {
async getOrderBaseGoodsList(merchantId) {
let { first, orderObj } = this.data
let { subOrderList } = orderObj
const selectPayType = orderObj.selectPayType == 0
const positionTypeList = await getPositionList() || []
this.setData({
positionTypeList
})
api
.getOrderBaseGoodsList({
merchantId,
......@@ -599,7 +626,9 @@ Page({
// 筛选出是当前门店的商品
let goodsData = data
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)
return list
}, [])
......@@ -694,25 +723,20 @@ Page({
// app .
getYQorderInfo()
.then(merchantSettingInfo => {
// console.log(merchantSettingInfo, 'merchantSettingInfo')
let dictionaryObj = {
carTypeRequiredFlag: 'carBrand',
standNoRequiredFlag: 'standNo',
plateNumRequiredFlag: 'plateNumber'
}
// let requiredList = []
for (const key in dictionaryObj) {
if (merchantSettingInfo[key] == 'Y') {
requiredList.push(dictionaryObj[key])
}
}
// console.log(merchantSettingInfo.yqPhoneConfig, 'merchantSettingInfo.yqPhoneConfig')
// console.log(deepClone(merchantSettingInfo.yqPhoneConfig), 'deepClone(merchantSettingInfo.yqPhoneConfig)')
this.setData({
requiredList: [...new Set(requiredList)],
phoneShow: wx.$util.deepClone(merchantSettingInfo.yqPhoneConfig)
})
// this.setData({ merchantSettingInfo })
})
.catch(err => {
console.log(err)
......@@ -740,6 +764,7 @@ Page({
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
......@@ -754,7 +779,8 @@ Page({
},
async onRoute(res) {
// debugger
console.log(res, 'onroute')
// console.log(res, 'onroute')
// res.scene = 'scene=1384'
// console.log()
if (res.orderCode && res.page) {
let result = await api.getOrderDetail({
......
......@@ -261,33 +261,33 @@
<view class="goods-box">
<block wx:for="{{ goodsList }}" 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">
{{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 class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count}}</view>
<view class="name_box">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
</view>
</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">
<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 class="count" catchtap="showPopup" data-show-name="goodsBox">
x{{item.count}}
</view>
</view>
</view>
<view class="icon" bindtap="delGoodsList" data-index="{{index}}">
<image src="../../images/del.png" />
</view>
</view>
</block>
<view class="goods total-box" wx:if="{{ orderObj.selectPayType != 0 }}">
总价
<view class="total-box">
<view>总价</view>
<view class="total">¥{{total || 0}}</view>
</view>
</view>
......
......@@ -137,7 +137,7 @@ page {
.payType-box .item {
box-sizing: border-box;
border: 2rpx solid #999999;
border-radius: 8rpx;
border-radius: 12rpx;
font-size: 28rpx;
color: #999999;
height: 56rpx;
......@@ -169,11 +169,13 @@ page {
}
.goods-box .goods {
height: 118rpx;
border-bottom: 2rpx solid rgba(195, 195, 195, .3);
opacity: 0.7;
background: #F8F9F9;
border-radius: 16rpx;
margin: 16rpx 20rpx;
display: flex;
align-items: center;
padding: 0 28rpx 0 90rpx;
flex-flow: column;
padding: 24rpx;
justify-content: space-between;
font-size: 28rpx;
position: relative;
......@@ -181,40 +183,66 @@ page {
.goods .icon {
position: absolute;
top: 50%;
left: 40rpx;
top: 0;
right: 0;
width: 40rpx;
height: 40rpx;
transform: translateY(-50%);
background: #3582ee1a;
border-radius: 0 16rpx 0 16rpx;
}
.goods-box .goods .name {
color: #FF6601;
width: 306rpx;
width: 100%;
margin-bottom: 8rpx;
}
.goods-box .goods .price-box {
.goods-box .goods .bottom_box {
display: flex;
align-items: center;
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 {
max-width: 80%;
min-width: 104rpx;
height: 44rpx;
border: 2rpx solid #C3C3C3;
width: 240rpx;
height: 64rpx;
background: #FFFFFF;
border: 2rpx solid #E6E6E6;
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 {
box-sizing: border-box;
width: 100%;
height: 100%;
text-align: center;
text-align: end;
min-height: 100%;
font-size: 28rpx;
padding: 0 16rpx 0 50rpx;
}
.goods-box .goods .price input.error {
......@@ -227,12 +255,23 @@ page {
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;
}
.goods-box .goods .total {
.goods-box .total-box .total {
color: #F24724;
font-weight: 600;
}
.btns {
......
......@@ -10,10 +10,18 @@ var replaceItemText = function (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 = {
isIncludesItem: isIncludesItem,
replaceItemText: replaceItemText
replaceItemText: replaceItemText,
formatPosition: formatPosition
}
// tabWorkOrder/pages/orderDetail/orderDetail.js
import api from '../../api.js'
import order_mixins from '../order_mixins.js'
import { getPositionList } from '~/store/index'
const app = getApp()
Page({
/**
......@@ -86,11 +87,10 @@ Page({
onRoute(options) {
// console.log(options)
if (options.orderCode) {
this.getOrderDetail(options.orderCode)
this.setData({
orderCode: options.orderCode
})
this.getOrderDetail(options.orderCode)
// this.getGrass(options.orderCode)
}
},
/**
......@@ -126,9 +126,10 @@ Page({
})
}
},
getOrderDetail(orderCode) {
async getOrderDetail(orderCode) {
// console.log(orderCode)
let _this = this
const positionTypeList = await getPositionList() || []
wx.$util.showLoading('加载中...')
api
......@@ -145,6 +146,7 @@ Page({
data.subOrderList.map(e => {
total_price += e.totalPrice
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) {
warrantyCardList.push({
warrantyPeriod: e.upgradeWarrantyPeriod,
......
......@@ -31,16 +31,21 @@
<view class="goods">
<block wx:for="{{orderInfo.subOrderList}}" wx:key="index">
<view class="item">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}}
</view>
<view class="type">x{{item.number}}</view>
<view class="price">¥{{item.price}}</view>
</view>
<view class="subItem_box goods_name">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || ''}}
</view>
<view class="price">¥{{item.price}}</view>
</view>
<view class="subItem_box">
<view class="position">{{item.positionStr}}</view>
<view class="type">x{{item.number}}</view>
</view>
</view>
</block>
</view>
<view class="cell">
<view class="label">抵用券:</view>
<view class="label icon"><image src="../../images/voucher_icon.png" mode=""/></view>
<view class="value">
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}})
</view>
......
......@@ -41,7 +41,7 @@ page {
background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10);
border-radius: 16rpx;
padding: 40rpx 40rpx 20rpx;
padding: 40rpx 40rpx 2rpx;
position: relative;
margin: 20rpx 20rpx 0;
}
......@@ -66,32 +66,49 @@ page {
}
.box .goods {
font-size: 24rpx;
margin-bottom: 30rpx;
font-size: 28rpx;
margin-bottom: 32rpx;
}
.box .goods .item {
margin: 16rpx -20rpx;
padding: 20rpx;
background: #F8F9F9;
border-radius: 16rpx;
display: flex;
flex-flow: column;
align-items: center;
color: #888888;
}
.box .goods .item .name {
width: 256rpx;
font-size: 28rpx;
.box .goods .item:first-child{
margin-top: 0;
}
.box .goods .item .type {
margin-left: 140rpx;
.box .goods .item:last-child{
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;
margin-left: auto;
}
.box .goods .item .goods_name .name {
width: 492rpx;
}
.box .goods .item .goods_name .price{
font-weight: 600;
}
.box .line {
display: inline-block;
/* display: inline-block; */
height: 1rpx;
width: 355rpx;
width: 100%;
......@@ -109,7 +126,7 @@ page {
color: #888888;
display: flex;
align-items: flex-start;
margin-bottom: 20rpx;
margin-bottom: 32rpx;
}
......@@ -118,6 +135,12 @@ page {
width: 180rpx;
}
.box .cell .label.icon{
width: 96rpx;
height: 36rpx;
margin-right: 8rpx;
}
.box .cell .image-box{
display: flex;
flex-flow: wrap;
......@@ -126,8 +149,8 @@ page {
.box .cell .value {
color: #333333;
max-width: 370rpx;
display: flex;
flex-flow: wrap;
align-items: center;
}
......
......@@ -46,8 +46,8 @@ const scrmSecretKey_items = {
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
preRelease: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
cdptest:{
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
......@@ -57,10 +57,10 @@ const scrmSecretKey_items = {
const domain_items = {
ip: {
// 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.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.2.59:8292/',//周立明
// scrm: 'http://192.168.1.165:8292'
......
......@@ -48,11 +48,6 @@ class Request {
getApp().login(true)
}
}
// else if (code == 32){
// resolve(data)
// // console.log(subErrors);
// throw subErrors
// }
else if (code == -1) {
wx.showToast({
title: message || '网络请求失败',
......@@ -60,6 +55,8 @@ class Request {
})
resolve(data)
} else {
// util.debounce( getApp().test(true),500)
// getApp().test()
resolve(data)
}
},
......
......@@ -226,6 +226,38 @@ const pointRecord = clickEventType => {
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 = {
onReachBottom,
......@@ -247,7 +279,8 @@ const util = {
deepClone,
getTimeState,
checkRule,
pointRecord
pointRecord,
debounce
}
const Util = Object.assign(util, wxApi, format)
// 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!