Commit 68abf93f by zhangxw

需求开发

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