Commit 68abf93f by zhangxw

需求开发

1 parent 44a9ac76
...@@ -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)
} }
} }
...@@ -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
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
wx:key="ind" wx:key="ind"
wx:for-index="ind" wx:for-index="ind"
wx:for-item="i"> wx:for-item="i">
<view class="item {{minPrice?(minPrice/100)>= i.shopMinPrice ?'':'disableSelect':'' }}"> <view class="item {{minPrice?(minPrice/100)>= i.shopMinPrice ?'':'disableSelect':'' }} {{!i.merchantGoodsPosition && i.goodsInfo.goodsType == 1 ? 'disableSelect' : ''}}">
<!-- {{i.shopMinPrice}} --> <!-- {{i.shopMinPrice}} -->
<view <view
class="value {{i.active?'labelWidth':''}}" class="value {{i.active?'labelWidth':''}}"
...@@ -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%;
} }
......
...@@ -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 > 16) throw v
})
} catch (error) {
return wx.$util.showToast('每个交易流水号最大支持16位字符')
}
if (!customPayVoucher?.length) {
return wx.$util.showToast('请上传付款凭证') return wx.$util.showToast('请上传付款凭证')
} }
wx.showModal({ wx.showModal({
......
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,21 @@ ...@@ -49,18 +49,21 @@
<input <input
type="text" type="text"
bindinput="input" bindinput="input"
value="{{customOutTradeNo}}" value="{{customOutTradeNo}}" />
maxlength="32" />
</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
......
...@@ -308,3 +308,22 @@ export const getStaffListByMerchant = options => { ...@@ -308,3 +308,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)
})
}
})
}
// 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({
...@@ -10,7 +10,8 @@ Page({ ...@@ -10,7 +10,8 @@ Page({
data: { data: {
...order_mixins.data, ...order_mixins.data,
orderInfo: {}, orderInfo: {},
showTips: true showTips: true,
positionTypeList: []
}, },
closeTips() { closeTips() {
this.setData({ this.setData({
...@@ -224,14 +225,24 @@ Page({ ...@@ -224,14 +225,24 @@ Page({
setWebSocket() setWebSocket()
}, },
onRoute(options) { onRoute(options) {
this.getGoodsPosition(options)
},
// 获取太阳膜类商品部位数据
getGoodsPosition(options) {
getPositionList().then(res => {
this.setData({
positionTypeList: res || []
})
if (options.orderCode) { if (options.orderCode) {
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
this.getDetail(options.orderCode) this.getDetail(options.orderCode)
} }
})
}, },
getDetail(orderCode) { getDetail(orderCode) {
// console.log(orderCode) // console.log(orderCode)
let _this = this let _this = this
let { positionTypeList } = _this.data
api api
.getOrderDetail({ .getOrderDetail({
orderCode orderCode
...@@ -254,6 +265,7 @@ Page({ ...@@ -254,6 +265,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,
......
...@@ -33,12 +33,17 @@ ...@@ -33,12 +33,17 @@
<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">{{item.number}}件</view>
</view>
</view>
</block> </block>
</view> </view>
<view class="cell"> <view class="cell">
......
// 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({
/** /**
...@@ -19,7 +20,8 @@ Page({ ...@@ -19,7 +20,8 @@ Page({
showTip: false, showTip: false,
warrantyCardVisible: true, warrantyCardVisible: true,
showRatingPopup: false, showRatingPopup: false,
showRatingCard: true // 显示评价卡片 showRatingCard: true, // 显示评价卡片
positionTypeList: []
}, },
RatingPopupSetting() { RatingPopupSetting() {
this.setData({ this.setData({
...@@ -118,13 +120,7 @@ Page({ ...@@ -118,13 +120,7 @@ Page({
onRoute(options) { onRoute(options) {
console.log(options) console.log(options)
// options.orderCode = '230331185108355' // options.orderCode = '230331185108355'
if (options.orderCode) { this.getGoodsPosition(options)
this.setData({
orderCode: options.orderCode
})
this.getOrderDetail(options.orderCode)
// this.getGrass(options.orderCode)
}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -132,9 +128,7 @@ Page({ ...@@ -132,9 +128,7 @@ Page({
onLoad: function (options) { onLoad: function (options) {
console.log(options) console.log(options)
// debugger // debugger
if (options.orderCode) { this.getGoodsPosition(options)
this.getOrderDetail(options.orderCode)
}
let o = wx.$util.getStorageSync('dj_boutique_user_info') let o = wx.$util.getStorageSync('dj_boutique_user_info')
this.checkPhoneShow(app.globalData.YQorderSetting?.yqPhoneConfig) this.checkPhoneShow(app.globalData.YQorderSetting?.yqPhoneConfig)
this.setData({ this.setData({
...@@ -143,6 +137,20 @@ Page({ ...@@ -143,6 +137,20 @@ Page({
isStaff: app.globalData.isStaff isStaff: app.globalData.isStaff
}) })
}, },
// 获取太阳膜类商品部位数据
getGoodsPosition(options) {
getPositionList().then(res => {
this.setData({
positionTypeList: res || []
})
if (options.orderCode) {
this.setData({
orderCode: options.orderCode
})
this.getOrderDetail(options.orderCode)
}
})
},
checkPhoneShow(config) { checkPhoneShow(config) {
console.log('config', config) console.log('config', config)
// 有就屏蔽手机号的显示 // 有就屏蔽手机号的显示
...@@ -156,6 +164,7 @@ Page({ ...@@ -156,6 +164,7 @@ Page({
}, },
getOrderDetail(orderCode) { getOrderDetail(orderCode) {
let _this = this let _this = this
let { positionTypeList } = _this.data
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
api api
.getOrderDetail({ .getOrderDetail({
...@@ -172,6 +181,7 @@ Page({ ...@@ -172,6 +181,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,
......
...@@ -40,12 +40,17 @@ ...@@ -40,12 +40,17 @@
<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">{{item.number}}件</view>
</view>
</view>
</block> </block>
</view> </view>
<view class="cell"> <view class="cell">
......
...@@ -174,18 +174,32 @@ page { ...@@ -174,18 +174,32 @@ 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: 30rpx;
} }
.box .goods .item { .box .goods .item {
margin: 0 -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 .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;
} }
...@@ -193,11 +207,6 @@ page { ...@@ -193,11 +207,6 @@ page {
margin-left: 140rpx; margin-left: 140rpx;
} }
.box .goods .item .price {
color: #333333;
margin-left: auto;
}
.box .cell { .box .cell {
font-size: 28rpx; font-size: 28rpx;
color: #888888; color: #888888;
......
// 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({
...@@ -298,6 +299,14 @@ Page({ ...@@ -298,6 +299,14 @@ Page({
delete submitObj.customerCouponCode delete submitObj.customerCouponCode
delete submitObj.selectPayType delete submitObj.selectPayType
} }
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'
...@@ -563,7 +572,7 @@ Page({ ...@@ -563,7 +572,7 @@ Page({
}, },
getOrderBaseGoodsList(merchantId) { getOrderBaseGoodsList(merchantId) {
let { first, orderObj } = this.data let { first, orderObj, positionTypeList } = this.data
let { subOrderList } = orderObj let { subOrderList } = orderObj
const selectPayType = orderObj.selectPayType == 0 const selectPayType = orderObj.selectPayType == 0
api api
...@@ -581,7 +590,9 @@ Page({ ...@@ -581,7 +590,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
}, []) }, [])
...@@ -722,11 +733,21 @@ Page({ ...@@ -722,11 +733,21 @@ Page({
}) })
}, },
// 获取太阳膜类商品部位数据
getGoodsPosition() {
getPositionList().then(res => {
this.setData({
positionTypeList: res || []
})
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
this.getConfig() this.getConfig()
this.getGoodsPosition()
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
......
...@@ -105,25 +105,33 @@ ...@@ -105,25 +105,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">
<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 /> <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 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>总价</view>
<view class="total">¥{{total || 0}}</view> <view class="total">¥{{total || 0}}</view>
</view> </view>
</view> </view>
......
...@@ -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,11 +255,21 @@ page { ...@@ -227,11 +255,21 @@ 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;
} }
......
...@@ -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({
/** /**
...@@ -16,7 +17,8 @@ Page({ ...@@ -16,7 +17,8 @@ Page({
defaultCustomerService: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/kf.png', defaultCustomerService: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/kf.png',
failCustomerService: '../images/kfrefresh.png', failCustomerService: '../images/kfrefresh.png',
warrantyCardVisible: true, warrantyCardVisible: true,
signatureSwitch: false //不需要走签名逻辑 没有开启签名功能或则是战败订单 signatureSwitch: false, //不需要走签名逻辑 没有开启签名功能或则是战败订单
positionTypeList: []
}, },
jumpUserPortrait (){ jumpUserPortrait (){
wx.$router.go('tabDate.userPortrait', this.data.orderInfo) wx.$router.go('tabDate.userPortrait', this.data.orderInfo)
...@@ -85,25 +87,14 @@ Page({ ...@@ -85,25 +87,14 @@ Page({
}, },
onRoute(options) { onRoute(options) {
// console.log(options) // console.log(options)
if (options.orderCode) { this.getGoodsPosition(options)
this.setData({
orderCode: options.orderCode
})
this.getOrderDetail(options.orderCode)
// this.getGrass(options.orderCode)
}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
// console.log(options.orderCode) // console.log(options.orderCode)
if (options.orderCode) { this.getGoodsPosition(options)
this.getOrderDetail(options.orderCode)
this.setData({
orderCode: options.orderCode
})
}
let o = wx.$util.getStorageSync('dj_boutique_user_info') let o = wx.$util.getStorageSync('dj_boutique_user_info')
...@@ -116,6 +107,21 @@ Page({ ...@@ -116,6 +107,21 @@ Page({
}) })
}, },
// 获取太阳膜类商品部位数据
getGoodsPosition(options) {
getPositionList().then(res => {
this.setData({
positionTypeList: res || []
})
if (options.orderCode) {
this.getOrderDetail(options.orderCode)
this.setData({
orderCode: options.orderCode
})
}
})
},
checkPhoneShow(config) { checkPhoneShow(config) {
// 有就屏蔽手机号的显示 // 有就屏蔽手机号的显示
if (config) { if (config) {
...@@ -129,6 +135,7 @@ Page({ ...@@ -129,6 +135,7 @@ Page({
getOrderDetail(orderCode) { getOrderDetail(orderCode) {
// console.log(orderCode) // console.log(orderCode)
let _this = this let _this = this
let { positionTypeList } = _this.data
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
api api
...@@ -145,6 +152,7 @@ Page({ ...@@ -145,6 +152,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,
......
...@@ -31,12 +31,17 @@ ...@@ -31,12 +31,17 @@
<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">{{item.number}}件</view>
</view>
</view>
</block> </block>
</view> </view>
<view class="cell"> <view class="cell">
......
...@@ -66,28 +66,29 @@ page { ...@@ -66,28 +66,29 @@ page {
} }
.box .goods { .box .goods {
font-size: 24rpx; font-size: 28rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.box .goods .item { .box .goods .item {
margin: 0 -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 .subItem_box{
width: 256rpx; display: flex;
font-size: 28rpx; justify-content: space-between;
} width: 100%;
.box .goods .item .type {
margin-left: 140rpx;
} }
.box .goods .item .price { .box .goods .item .goods_name{
color: #333333; color: #333333;
margin-left: auto;
} }
.box .line { .box .line {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!