Commit 9cedb0a8 by cen

Merge branch 'V4.56.0' of http://192.168.3.233:8090/glsx/gl_tape into V4.56.0

2 parents c04652a9 9b228cd8
......@@ -180,7 +180,39 @@ module.exports = {
...data
})
},
// 根据商户号获取可选商品列表
getSelectOrderGoodsList(data){
return http.post({
method: 'dj.api.smartcarlife.selectOrderGoods.list',
projectName: 'boutique',
...data
})
},
/** 选择支付方式下单 */
createWithPay(data) {
console.log(data)
return http.post({
method: 'dj.api.smartcarlife.order.createWithPay',
projectName: 'boutique',
...data
})
},
/** 订单补录 */
supplementOrder(data) {
return http.post({
method: 'dj.api.smartcarlife.order.supplementOrder',
projectName: 'boutique',
...data
})
},
// 获取精品升级场景 太阳膜类商品部位数据
getPositionList(data) {
return http.post({
method: 'dj.api.smartcarlife.goodsPosition.list',
projectName: 'boutique',
...data
})
},
/** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid(data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
......
......@@ -2,64 +2,69 @@
<view>
<view v-for="(items, boxIdx) in formList" :key="boxIdx">
<view class="cell-box">
<view v-for="(item, idx) in items" :key="idx" class="cell-row">
<view class="cell" @click="onCellClick(item)" :class="[
item.noBorder ? '' : 'border',
item.onlyLabel ? 'small-height' : '',
item.class
]">
<template v-if="!item.hidden">
<view :class="['cell-label', { 'only-label': item.onlyLabel }]">
<view v-if="item.labellIcon" :class="['sprite-icon', `icon-${item.labellIcon}`]"></view>
{{ item.label }}
<view v-if="item.required" class="required">*</view>
</view>
<view class="cell-value">
<!-- 输入框 -->
<template v-if="item.type === 'input'">
<view class="input-box">
<input class="input-value" v-model="formData[item.value]" :type="item.inputType || 'text'" @blur="handleBlur($event, item)" :placeholder="item.placeholder || '请输入'"
:maxlength="item.maxlength || 500" />
<view v-if="item.valueIcon" :class="['sprite-icon', `icon-${item.valueIcon}`]"
@click="onValueClick(item)"></view>
</view>
</template>
<!-- 下拉选择 -->
<template v-else-if="item.type === 'select'">
<view class="value">
<template v-if="formData[item.value] && formData[item.value]">
<template v-if="item.showText && userInfo && userInfo[item.showText]">
{{ userInfo[item.showText] }}<text>|</text>
<template v-for="(item, idx) in items">
<view v-if="!item.hidden">
<view class="cell-row" :key="idx">
<view class="cell" @click="onCellClick(item)" :class="[
item.noBorder ? '' : 'border',
item.onlyLabel ? 'small-height' : '',
item.class
]">
<view :class="['cell-label', { 'only-label': item.onlyLabel }]">
<view v-if="item.labellIcon" :class="['sprite-icon', `icon-${item.labellIcon}`]"></view>
{{ item.label }}
<view v-if="item.required" class="required">*</view>
</view>
<view class="cell-value">
<!-- 输入框 -->
<template v-if="item.type === 'input'">
<view class="input-box">
<input class="input-value" v-model="formData[item.value]" :type="item.inputType || 'text'"
@blur="handleBlur($event, item)" :placeholder="item.placeholder || '请输入'"
:maxlength="item.inputType === 'number' ? false : (item.maxlength || -1)"
@input="item.inputType === 'number' && item.maxlength ? (formData[item.value] = String($event.target.value).slice(0, item.maxlength)) : null" />
<view v-if="item.valueIcon" :class="['sprite-icon', `icon-${item.valueIcon}`]"
@click="onValueClick(item)"></view>
</view>
</template>
<!-- 下拉选择 -->
<template v-else-if="item.type === 'select'">
<view class="value">
<template v-if="!item.addHtml && formData[item.value] && formData[item.value]">
<template v-if="item.showText && userInfo && userInfo[item.showText]">
{{ userInfo[item.showText] }}<text>|</text>
</template>
{{ formData[item.value] }}
</template>
<template v-else>
<span class="placeholder">请选择</span>
</template>
{{ formData[item.value] }}
</template>
<template v-else>
<span class="placeholder">请选择</span>
</template>
<view class="sprite-icon icon-icon-select"></view>
</view>
</template>
<!-- 单选框 -->
<template v-else-if="item.type === 'radio'">
<radio-group class="radio-group value" @change="onRadioChange($event, item)">
<label class="uni-list-cell uni-list-cell-pd" v-for="radio in item.radioList"
:key="radio.value + item.value">
<radio style="transform:scale(0.7)" :value="radio.value" :checked="radio.value == item.current" />
<view class="radio-name">{{ radio.name }}</view>
</label>
</radio-group>
</template>
<!-- 多行文本 -->
<template v-else-if="item.type === 'textarea'">
<textarea class="textarea" v-model="formData[item.value]" :placeholder="item.placeholder || '请输入'"
placeholder-class="textarea-placeholder" confirm-type="done" auto-height
:maxlength="item.maxlength"></textarea>
</template>
<view class="sprite-icon icon-icon-select"></view>
</view>
</template>
<!-- 单选框 -->
<template v-else-if="item.type === 'radio'">
<radio-group class="radio-group value" @change="onRadioChange($event, item)">
<label class="uni-list-cell uni-list-cell-pd" v-for="radio in item.radioList"
:key="radio.value + item.value">
<radio style="transform:scale(0.7)" :value="radio.value" :disabled="radio.disabled"
:checked="radio.value == item.current" />
<view class="radio-name">{{ radio.name }}</view>
</label>
</radio-group>
</template>
<!-- 多行文本 -->
<template v-else-if="item.type === 'textarea'">
<textarea class="textarea" v-model="formData[item.value]" :placeholder="item.placeholder || '请输入'"
placeholder-class="textarea-placeholder" confirm-type="done" auto-height
:maxlength="item.maxlength"></textarea>
</template>
</view>
</view>
</template>
<slot v-if="item.addHtml" :name="item.addHtml"></slot>
</view>
</view>
<slot v-if="item.addHtml" :name="item.addHtml"></slot>
</view>
</template>
</view>
</view>
</view>
......@@ -124,9 +129,11 @@ export default {
overflow: hidden;
margin-bottom: toRpx(18);
}
.cell-row {
padding-left: toRpx(32);
}
.cell {
display: flex;
align-items: center;
......
......@@ -37,7 +37,8 @@ export default {
props: {
params: Object,
data: [Object, Array],
cacheData: Array
cacheData: Array,
dataKey: String
},
mounted () {
},
......@@ -82,7 +83,7 @@ export default {
},
initGoodsList (goodsData) {
let { goodsType } = this.params,
{ data } = this,
{ data ,dataKey } = this,
arr = []
goodsData.map(val => {
if (val.goodsFlag == 1) {
......@@ -94,7 +95,8 @@ export default {
if (goodsType.includes(subVal.merchantGoodsPosition)) arr.push(val)
}
})
if (data.length) data.map(e => {
let paramsData = dataKey ? data[dataKey] : data
if (paramsData.length) paramsData.map(e => {
this.currentIds.push(e.goods.goodsId)
this.chooseList.push(e)
})
......
......@@ -54,7 +54,8 @@ export default {
props: {
params: Object,
data: [Object, Array],
cacheData: Array
cacheData: Array,
dataKey: String
},
mounted () {
},
......@@ -98,7 +99,7 @@ export default {
}
},
initGoodsList (goodsData) {
let { data } = this,
let { data, dataKey } = this,
arr = []
goodsData.map(val => {
if (val.goodsFlag == 3) {
......@@ -109,7 +110,8 @@ export default {
arr.push(val)
}
})
if (data.length) data.map(e => {
let paramsData = dataKey ? data[dataKey] : data
if (paramsData.length) paramsData.map(e => {
this.currentIds.push(e.packageGoods.packageCode)
this.chooseList.push(e)
})
......
......@@ -93,27 +93,12 @@ const componentConfig = {
title: '选择套餐',
placeholder:'查找',
idKey: 'packageCode'
},
12:{
name:'SkuGoodsList',
title: '选择商品',
placeholder:'查找',
}
}
import EmployeeList from './components/EmployeeList.vue'
import DiversionMerchant from './components/DiversionMerchant.vue'
import CarModelList from './components/CarModelList.vue'
import CouponList from './components/CouponList.vue'
import GoodsList from './components/GoodsList.vue'
import PackageList from './components/PackageList.vue'
export default {
data () {
return {
componentConfig
}
},
components: {
EmployeeList,
DiversionMerchant,
CarModelList,
CouponList,
GoodsList,
PackageList
},
}
\ No newline at end of file
export default { componentConfig}
\ No newline at end of file
......@@ -50,6 +50,7 @@
:is="componentObject.name"
:params.sync="componentObject"
:data="data"
:dataKey="dataKey"
ref="componentRef"
@choose="chooseContent = $event"
></component>
......@@ -73,8 +74,23 @@
<script type='text/ecmascript-6'>
import config from './config'
import EmployeeList from './components/EmployeeList.vue'
import DiversionMerchant from './components/DiversionMerchant.vue'
import CarModelList from './components/CarModelList.vue'
import CouponList from './components/CouponList.vue'
import GoodsList from './components/GoodsList.vue'
import PackageList from './components/PackageList.vue'
import SkuGoodsList from './components/SkuGoodsList.vue'
export default {
mixins: [config],
components: {
EmployeeList,
DiversionMerchant,
CarModelList,
CouponList,
GoodsList,
PackageList,
SkuGoodsList
},
name: '',
props: {
animation: {
......@@ -91,8 +107,10 @@ export default {
default: 0
},
data: [Object, Array],
externalData: null
externalData: null,
dataKey: String
},
provide () {
return {
userInfo: this.userInfo,
......@@ -109,7 +127,7 @@ export default {
watch: {
popupType: {
handler (val) {
this.componentObject = this.componentConfig[this.popupType]
this.componentObject = config.componentConfig[this.popupType]
if (val == 11 || val == 12) this.position = 'right'
},
deep: true,
......@@ -124,7 +142,7 @@ export default {
},
computed: {
title () {
return this.componentConfig[this.popupType].title
return config.componentConfig[this.popupType].title
},
userInfo () {
return uni.$storage.get("userInfo")
......
<template>
<view>
<view class="package-list">
<view class="package-item">
<view class="header">
<view class="header-left">
<view class="sprite-icon icon-blue-delete"></view>
<view class="name">平步青云套餐</view>
</view>
<view class="price">¥6660.00</view>
</view>
<view class="goods-item">
<view class="goods-name">AITO汽车专享 M5中控屏钢化保护膜</view>
<view class="alias-name">商品别名:阿尔法 T5极狐非三电整车延保(新车2年6万公里)</view>
<view class="front-gear-box">
<view class="front-gear-input-box">
<view class="front-gear-label">前档玻璃</view>
<view class="front-gear-input">
<view class="unit">¥</view>
<input class="uni-input" type="digit" placeholder="请输入价格" placeholder-style="font-size: 14px" />
</view>
</view>
<view class="control">
<view class="minus">-</view>
<input class="uni-input control-input" type="number" />
<view class="add">+</view>
</view>
</view>
</view>
<view class="goods-item">
<view class="goods-name">AITO汽车专享 M5中控屏钢化保护膜</view>
<view class="alias-name">商品别名:阿尔法 T5极狐非三电整车延保(新车2年6万公里)</view>
<view class="front-gear-box">
<view class="front-gear-input-box">
<view class="front-gear-label">前档玻璃</view>
<view class="front-gear-input">
<view class="unit">¥</view>
<input class="uni-input" type="digit" placeholder="请输入价格" placeholder-style="font-size: 14px" />
</view>
</view>
<view class="control">
<view class="minus">-</view>
<input class="uni-input control-input" type="number" />
<view class="add">+</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'Package'
}
</script>
<style scoped lang="scss">
.front-gear-box {
display: flex;
justify-content: space-between;
margin-top: toRpx(24);
.front-gear-input-box {
display: flex;
align-items: center;
.front-gear-label {
font-size: toRpx(24);
margin-right: toRpx(24);
color: #999999;
}
.front-gear-input {
position: relative;
display: flex;
border: toRpx(2) solid #eff0f2;
background-color: #fff;
font-size: toRpx(28);
height: toRpx(70);
width: toRpx(250);
line-height: toRpx(70);
text-align: right;
.uni-input {
padding: 0 toRpx(32);
height: 100%;
}
.unit {
position: absolute;
top: 50%;
left: toRpx(32);
transform: translateY(-50%);
}
}
}
.control {
display: flex;
align-items: center;
.control-input {
width: toRpx(94);
height: toRpx(74);
background-color: #fff;
border: toRpx(2) solid #eff0f2;
padding: 0 toRpx(10);
text-align: center;
}
.minus,
.add {
width: toRpx(80);
height: toRpx(74);
line-height: toRpx(70);
text-align: center;
background-color: #fff;
border-top: toRpx(2) solid #eff0f2;
border-bottom: toRpx(2) solid #eff0f2;
}
.minus {
border-radius: toRpx(12) 0 0 toRpx(12);
border-left: toRpx(2) solid #eff0f2;
}
.add {
border-radius: 0 toRpx(12) toRpx(12) 0;
border-right: toRpx(2) solid #eff0f2;
}
}
}
.package-list {
padding: toRpx(12) toRpx(32) toRpx(12) 0;
.package-item {
background-color: #f5f7fa;
border-radius: toRpx(16);
margin-bottom: toRpx(16);
.header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: toRpx(1.6) solid #dce1e6;
padding: toRpx(24);
&-left {
display: flex;
align-items: center;
font-size: toRpx(28);
.name {
margin-left: toRpx(26);
color: #999;
}
.price {
color: #666;
}
}
}
.goods-item {
padding: toRpx(24);
border-bottom: toRpx(1.6) solid #dce1e6;
&:last-child {
border-bottom: none;
}
.goods-name {
color: #ff781f;
font-size: toRpx(28);
}
.alias-name {
margin-top: toRpx(12);
font-size: toRpx(24);
color: #666;
}
}
}
}
</style>
\ No newline at end of file
<template>
<view>
<view class="shop-list">
<view class="shop-item" v-for="(item, index) in list" :key="item.goods.goodsId">
<view class="sprite-icon icon-blue-delete"></view>
<view class="right">
<view class="shop-name">商品名称:{{ item.goods.goodsAlias || item.goods.upgradeGoodsName ||
item.goods.goodsInfo.goodsName }}</view>
<!-- <view class="alias">商品别名:{{ item.goods.goodsAlias }}</view> -->
<view class="front-gear-box">
<view class="front-gear-input-box">
<view class="front-gear-label"
v-if="(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition) && (item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1 || item.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.goods.upgradeGoodsType == baseConfigData.selfBuildFilmType)">
{{ formatPosition((item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition),
positionTypeList)}}</view>
<view class="front-gear-input">
<view class="unit">¥</view>
<input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.goods.sellPrice" @blur="validatePrice($event, item, index)" />
</view>
</view>
<view class="control">
<view class="minus" @click="decreaseNumber(item)">-</view>
<input class="uni-input control-input" type="number" maxlength="3" v-model="item.goods.number" @input="validateNumber($event, item)" />
<view class="add" @click="increaseNumber(item)">+</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'Product',
props: {
list: {
type: Array,
default: []
},
positionTypeList: {
type: Array,
default: []
},
baseConfigData: {
type: Object,
default: {}
}
},
created() {
// 初始化商品数量
this.list.forEach(item => {
if (!item.goods.number) {
this.$set(item.goods, 'number', '1')
}
})
},
methods: {
circulation(data, str) {
let arr = str.split('.'),
result;
if (arr.length) {
result = arr.reduce((pre, key) => {
return pre[key]
}, data)
}
return result;
},
// 格式化位置信息
formatPosition(item, positionTypeList) {
const filterData = positionTypeList.filter(v => v.positionValue == item)
return (filterData.length && filterData[0] && filterData[0].positionName) || ''
},
// 验证价格输入
validatePrice(event, item, index) {
let value = event.detail.value
console.log('value', value)
// 限制只能输入数字和小数点
value = value.replace(/[^\d.]/g, '')
// 限制只能有一个小数点
if (value.split('.').length > 2) {
value = value.slice(0, value.lastIndexOf('.')) + value.slice(value.lastIndexOf('.') + 1)
}
// 限制最多两位小数
if (value.includes('.')) {
const parts = value.split('.')
if (parts[1].length > 2) {
parts[1] = parts[1].substring(0, 2)
value = parts.join('.')
}
}
// 限制最 大值为100000
if (parseFloat(value) > 100000) {
value = '100000'
}
// 限制最小值为0
if (parseFloat(value) < 0 || parseFloat(value) == 0) {
value = '0'
}
if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) {
console.log('最小值', item.goods.minSellPrice)
value = item.goods.minSellPrice.toString()
}
// 更新值
// this.$set(item.goods, 'sellPrice', value)
this.$set(this.list[index].goods, 'sellPrice', value)
},
// 验证数量输入
validateNumber(event, item) {
let value = event.detail.value
// 限制只能输入整数
value = value.replace(/[^\d]/g, '')
// 如果为空或0,设置为1
if (!value || value.trim() === '' || parseInt(value) === 0) {
value = '1'
}
// 更新值
this.$set(item.goods, 'number', value)
},
// 增加数量
increaseNumber(item) {
if (!item.goods.number) {
this.$set(item.goods, 'number', '1')
} else {
const currentValue = parseInt(item.goods.number)
// 限制最大数量为999
const newValue = currentValue >= 999 ? 999 : currentValue + 1
this.$set(item.goods, 'number', newValue.toString())
}
},
// 减少数量
decreaseNumber(item) {
// 如果商品数量不存在或小于等于1,设置为1
if (!item.goods.number || parseInt(item.goods.number) <= 1) {
this.$set(item.goods, 'number', '1')
return
}
const currentValue = parseInt(item.goods.number)
// 确保减少后的值不小于1
const newValue = Math.max(1, currentValue - 1)
this.$set(item.goods, 'number', newValue.toString())
}
}
}
</script>
<style scoped lang="scss">
.shop-list {
padding: toRpx(12) toRpx(32) toRpx(12) 0;
.shop-item {
display: flex;
align-items: center;
background-color: #f5f7fa;
border-radius: toRpx(16);
margin-bottom: toRpx(16);
padding: toRpx(24);
.right {
flex: 1;
font-size: toRpx(28);
margin-left: toRpx(24);
.shop-name {
color: #ff781f;
}
.alias {
margin-top: toRpx(12);
font-size: toRpx(24);
color: #666;
}
}
}
}
.front-gear-box {
display: flex;
justify-content: space-between;
margin-top: toRpx(24);
.front-gear-input-box {
display: flex;
align-items: center;
.front-gear-label {
font-size: toRpx(24);
margin-right: toRpx(24);
color: #999999;
}
.front-gear-input {
position: relative;
display: flex;
border: toRpx(2) solid #eff0f2;
background-color: #fff;
font-size: toRpx(28);
height: toRpx(70);
width: toRpx(250);
line-height: toRpx(70);
text-align: right;
.uni-input {
padding: 0 toRpx(32);
height: 100%;
}
.unit {
position: absolute;
top: 50%;
left: toRpx(32);
transform: translateY(-50%);
}
}
}
.control {
display: flex;
align-items: center;
.control-input {
width: toRpx(94);
height: toRpx(74);
background-color: #fff;
border: toRpx(2) solid #eff0f2;
padding: 0 toRpx(10);
text-align: center;
}
.minus,
.add {
width: toRpx(80);
height: toRpx(74);
line-height: toRpx(70);
text-align: center;
background-color: #fff;
border-top: toRpx(2) solid #eff0f2;
border-bottom: toRpx(2) solid #eff0f2;
}
.minus {
border-radius: toRpx(12) 0 0 toRpx(12);
border-left: toRpx(2) solid #eff0f2;
}
.add {
border-radius: 0 toRpx(12) toRpx(12) 0;
border-right: toRpx(2) solid #eff0f2;
}
}
}
</style>
\ No newline at end of file
......@@ -90,7 +90,7 @@ const FORM_LIST = [
key: 'carInfo',
},
{
label: '车架号',
label: '车架号(VIN)',
value: 'standNo',
maxlength: '17',
type: 'input'
......@@ -133,75 +133,80 @@ const FORM_LIST = [
noBorder: true
},
{
label: '前档',
value: 'user',
label: '前挡',
value: 'frontGear',
type: 'select',
key: 'name',
labellIcon: 'front-gear',
addHtml: 'product'
addHtml: 'frontGear',
hidden: true
},
{
label: '前侧窗玻璃',
value: 'user',
value: 'frontWindow',
type: 'select',
key: 'name',
labellIcon: 'front-window',
addHtml: 'product'
addHtml: 'frontWindow',
hidden: true
},
{
label: '后侧窗玻璃',
value: 'user',
value: 'rearGear',
type: 'select',
key: 'name',
labellIcon: 'rear-gear',
addHtml: 'product'
addHtml: 'rearGear',
hidden: true
},
{
label: '后档',
value: 'user',
value: 'rearWindow',
type: 'select',
key: 'name',
labellIcon: 'rear-window',
addHtml: 'product'
addHtml: 'rearWindow',
hidden: true
},
{
label: '天窗',
value: 'user',
value: 'sunRoof',
type: 'select',
key: 'name',
labellIcon: 'sun-roof',
addHtml: 'product'
addHtml: 'sunRoof',
hidden: true
},
{
label: '套餐',
value: 'couponInfo',
type: 'select',
key: 'name',
required: true,
addHtml: 'package'
// addHtml: 'package'
},
{
label: '其他精品',
value: 'couponInfo',
type: 'select',
key: 'name',
required: true,
addHtml: 'product'
// addHtml: ''
},
{
label: '收款方式',
value: 'payeeType',
type: 'radio',
key: 'name',
current: '0',
current: '1',
radioList: [
{
value: '0',
name: '嘀加收款'
name: '嘀加收款',
disabled: false
},
{
value: '1',
name: '4s店收款'
name: '4s店收款',
disabled: false
}
],
},
......@@ -212,18 +217,18 @@ const FORM_LIST = [
key: 'name',
current: '0',
radioList: [
{
value: '3',
name: 'POS机'
},
{
value: '6',
name: '对公转账'
},
{
value: '7',
name: '其他收款'
}
// {
// value: '3',
// name: 'POS机'
// },
// {
// value: '6',
// name: '对公转账'
// },
// {
// value: '7',
// name: '其他收款'
// }
],
addHtml: 'otherPay'
},
......@@ -240,14 +245,14 @@ const FORM_LIST = [
]
]
const payType = [
const payTypeList = [
{
value: '1',
name: '微信支付'
},
{
value: '2',
name: '线下收款'
name: '门店收款'
},
{
value: '3',
......@@ -311,11 +316,15 @@ const popupTypeEnum = {
5: {
key: 'couponInfo',
list: '',
},
6: {
key: 'frontGear',
list: '',
}
}
export {
FORM_LIST,
popupTypeEnum,
payType
payTypeList
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!