Commit fa21bf06 by cen

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

2 parents 0d04cd01 687c5dc9
...@@ -248,13 +248,36 @@ module.exports = { ...@@ -248,13 +248,36 @@ module.exports = {
getPackageGoodsDetail(data) { getPackageGoodsDetail(data) {
return http.post({ method: 'dj.api.smartcarlife.order.packageGoodsDetail', projectName: 'boutique', ...data }) return http.post({ method: 'dj.api.smartcarlife.order.packageGoodsDetail', projectName: 'boutique', ...data })
}, },
/** 根据订单号获取订单详情 */ /**
getOrderDetail(data) { * 查询日报门店主营品牌
return http.post({ method: 'dj.api.smartcarlife.order.detail', projectName: 'boutique', ...data }) */
getDailyReportCarBrand(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.car.brand',
projectName: 'boutique',
...data
})
}, },
/**改变支付订单状态 */ /**
createPayOrder(data) { * 查询员工日报是否填写列表
return http.post({ method: 'dj.api.smartcarlife.payOrder.create', projectName: 'boutique', ...data }) *
*/
getStaffDailyReportDetailWeeklyList(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.weekly.list',
projectName: 'boutique',
...data
})
},
/**
* 查询日报详情
*/
getStaffDailyReportDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.detail',
projectName: 'boutique',
...data
})
}, },
/** 修改订单备注 */ /** 修改订单备注 */
updateOrderRemark(data) { updateOrderRemark(data) {
......
...@@ -63,4 +63,23 @@ module.exports = { ...@@ -63,4 +63,23 @@ module.exports = {
...data ...data
}) })
}, },
/**获取订单列表筛选转化人员&销售顾问 */
getOrderScreenEmployeeList (data) {
return http.post({
method: 'dj.api.smartcarlife.employee.getByMerchantId',
projectName: 'boutique',
...data
})
},
/**
* 获取园区店配置
*/
getYqStoreConfig(data){
return http.get({
method: 'dj.api.smarcarlife.yqMerchantConfig.detail',
projectName: 'boutique',
...data
})
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -75,6 +75,10 @@ export default { ...@@ -75,6 +75,10 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: toRpx(30); font-size: toRpx(30);
.sprite-icon {
background-color: #fff;
border-radius: toRpx(14);
}
.entrance-name { .entrance-name {
margin-top: toRpx(22); margin-top: toRpx(22);
} }
......
...@@ -25,8 +25,7 @@ export default { ...@@ -25,8 +25,7 @@ export default {
}, },
props: { props: {
params: Object, params: Object,
data: Object, data: Object
cacheData: Array
}, },
mounted () { mounted () {
}, },
......
...@@ -37,7 +37,6 @@ export default { ...@@ -37,7 +37,6 @@ export default {
props: { props: {
params: Object, params: Object,
data: [Object, Array], data: [Object, Array],
cacheData: Array,
dataKey: String dataKey: String
}, },
mounted () { mounted () {
......
...@@ -54,7 +54,6 @@ export default { ...@@ -54,7 +54,6 @@ export default {
props: { props: {
params: Object, params: Object,
data: [Object, Array], data: [Object, Array],
cacheData: Array,
dataKey: String dataKey: String
}, },
mounted () { mounted () {
......
...@@ -101,7 +101,6 @@ export default { ...@@ -101,7 +101,6 @@ export default {
props: { props: {
params: Object, params: Object,
data: [Object, Array], data: [Object, Array],
cacheData: Array,
dataKey: String dataKey: String
}, },
mounted () { mounted () {
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import Popup from './Popup.vue' import Popup from '@/components/Popup.vue'
export default { export default {
components: { components: {
Popup, Popup,
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import Popup from './components/Popup.vue' import Popup from '@/components/Popup.vue'
import config from './config' import config from './config'
import EmployeeList from './components/EmployeeList.vue' import EmployeeList from './components/EmployeeList.vue'
import DiversionMerchant from './components/DiversionMerchant.vue' import DiversionMerchant from './components/DiversionMerchant.vue'
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
confirm () { confirm () {
try { try {
let { chooseContent, popupType, componentObject } = this let { chooseContent, popupType, componentObject } = this
if (popupType === 13) { if (popupType == 13) {
chooseContent = this.componentRef().getResult() chooseContent = this.componentRef().getResult()
} }
if (chooseContent) { if (chooseContent) {
......
<template>
<view class="employee-list">
<view
@click="currentIds = []"
:class="['item flex',{active:!currentIds.length}]"
>
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex',{active:checkActive(i)}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.staffName}}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'EmployeeList',
inject: ['userInfo'],
data () {
return {
list: [],
currentIds: []
}
},
props: {
params: Object,
data: [Array, Object],
},
watch: {
currentIds: {
handler (val) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value: val.length ? val : null
})
},
deep: true
}
},
mounted () {
this.getList()
},
methods: {
async getList () {
const { userInfo, params } = this,
{ cacheData } = params
if (cacheData && cacheData.length) {
this.initList(cacheData)
return
}
const { shopMerchantId, sceneType, merchantId } = userInfo,
data = await uni.$api.popupApi.getOrderScreenEmployeeList({
merchantId: params.idKey == 'sellerUserIdList' ? merchantId : shopMerchantId,
sceneList: params.idKey == 'sellerUserIdList' ? '' : [sceneType]
})
if (data && data.length) {
this.initList(data)
params.cacheData = data
this.$emit('update:params', params)
}
},
initList (list) {
let { data, params: {idKey} } = this
this.list = list
let paramsData = idKey ? data[idKey] : data
if (paramsData && paramsData.length) paramsData.map(e => {
this.currentIds.push(e)
})
this.$emit('onComplete')
},
choose (i) {
if (i) {
let { uuid } = i,
{ currentIds } = this,
index = currentIds.indexOf(uuid)
if (index == -1) this.currentIds.push(uuid)
else this.currentIds.splice(index, 1)
}
},
checkActive (i) {
let { currentIds } = this,
active = false
if (currentIds.length) active = currentIds.includes(i.uuid)
return active
// return this.currentIds.includes(i.uuid)
},
}
}
</script>
<style scoped lang='scss'>
.employee-list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 32rpx;
margin: 0 48rpx;
.item {
justify-content: center;
height: 72rpx;
border-radius: 8rpx;
border: 2rpx solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: 32rpx;
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="list">
<view
@click="currentId = ''"
:class="['item flex',{active:!currentId}]"
>
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view
:key="index"
@click="currentId = i.id"
:class="['item flex',{active:currentId == i.id}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.name}}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'OrderStatusList',
inject: ['userInfo'],
data () {
return {
list: Object.freeze([
{
name: '待跟进',
value: [1],
id: 1
},
{
name: '已支付',
value: [4],
id: 2
},
{
name: '待支付',
value: [3],
id: 3
},
{
name: '已撤销',
value: [9],
id: 4
},
{
name: '战败',
value: [2],
id: 5
},
{
name: '已评价',
value: [6],
id: 6
},
{
name: '已关闭',
value: [10],
id: 7
},
{
name: '已失效',
value: [11],
id: 8
},
{
name: '未施工',
value: ['N'],
id: 9
},
{
name: '已施工',
value: ['Y'],
id: 10
},
{
name: '已退款',
value: [5, 12],
id: 11
}
]),
currentId: '',
}
},
props: {
params: Object,
data: [Array, Object],
},
watch: {
currentId: {
handler (val) {
let { params: { idKey } } = this,
{ list } = this,
item = list.find(item => item.id == val)
this.$emit('choose', {
key: idKey,
value: item ? item.value : null
})
},
deep: true
}
},
mounted () {
this.initList()
},
methods: {
initList () {
let { data, params: { idKey } } = this
this.currentId = data[idKey]
this.$emit('onComplete')
}
}
}
</script>
<style scoped lang='scss'>
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 32rpx;
margin: 0 48rpx;
.item {
justify-content: center;
height: 72rpx;
border-radius: 8rpx;
border: 2rpx solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: 32rpx;
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: 32rpx;
margin: 0 8rpx;
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="list">
<view
@click="currentId = ''"
:class="['item flex',{active:!currentId}]"
>
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view
:key="index"
@click="currentId = i.value"
:class="['item flex',{active:currentId == i.value}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.name}}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
const payTypeList = [{
name: '门店收款',
value: 2
},
{
name: '微信支付',
value: 1
},
{
name: 'POS机支付',
value: 3
},
{
name: '支付宝支付',
value: 4
},
{
name: '嘀加收款',
value: 5
}
]
export default {
name: 'PayList',
inject: ['userInfo'],
data () {
return {
list: [],
currentId: '',
}
},
props: {
params: Object,
data: [Object, Array],
},
watch: {
currentId: {
handler (value) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value
})
},
deep: true
}
},
mounted () {
this.getList()
},
methods: {
async getList () {
const { userInfo, params } = this,
{ cacheData } = params
if (cacheData && cacheData.length) {
this.initList(cacheData)
return
}
const { merchantId } = userInfo,
data = await uni.$api.popupApi.getYqStoreConfig({
yqMerchantId: merchantId
})
if (data) {
let obj = data || {}
let m = obj.supportPayTypes || []
let n = JSON.parse(JSON.stringify(payTypeList))
let payList = n.filter(k => {
let idx = m.find(j => j == k.value)
return idx >= 0
})
payList = [
...payList,
{
name: '对公转账',
value: '6'
},
{
name: '其它收款',
value: '7'
}
]
this.initList(payList)
params.cacheData = payList
this.$emit('update:params', params)
}
},
initList (list) {
this.list = list
let { data, params: { idKey } } = this
this.currentId = data[idKey]
this.$emit('onComplete')
},
}
}
</script>
<style scoped lang='scss'>
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 32rpx;
margin: 0 48rpx;
.item {
justify-content: center;
height: 72rpx;
border-radius: 8rpx;
border: 2rpx solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: 32rpx;
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: 32rpx;
margin: 0 8rpx;
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="list">
<view
@click="currentId = ''"
:class="['item flex',{active:!currentId}]"
>
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i.id)"
:class="['item flex',{active:currentId == i.id}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.name}}
</view>
</template>
<template v-if="currentId == 3 && customDate.startDate && customDate.endDate">
<view
class="calendar flex"
@click="$refs.calendar.open()"
>
<view class="item flex active">
{{customDate.startDate}}
</view>
<view class="splice">-</view>
<view class="item flex active">
{{customDate.endDate}}
</view>
</view>
</template>
<template v-else>
<view
@click="$refs.calendar.open()"
:class="['item flex']"
>
自定义
</view>
</template>
<uni-calendar
ref="calendar"
:insert="false"
range
:clearDate="false"
startDate="2020-10-01"
:endDate="endDate"
@confirm="confirmCalendar"
:rangeValue="rangeValue"
/>
</view>
</template>
<script type='text/ecmascript-6'>
import dayjs from 'dayjs'
export default {
name: 'TimeList',
inject: ['userInfo'],
data () {
return {
list: Object.freeze([
{
name: '今日',
startDate: dayjs().format('YYYY-MM-DD'),
endDate: dayjs().format('YYYY-MM-DD'),
id: 1
}, {
name: '本月',
startDate: dayjs().startOf('month').format('YYYY-MM-DD'),
endDate: dayjs().format('YYYY-MM-DD'),
id: 2
}
]),
currentId: '',
endDate: dayjs().format('YYYY-MM-DD'),
customDate: {
startDate: '',
endDate: ''
},
rangeValue: {}
}
},
props: {
params: Object,
data: [Array, Object],
},
watch: {
currentId: {
handler (val) {
let { params: { idKey, currentIdKey } } = this
let { list } = this,
value = {}
if (val) {
let [startDateName, endDateName] = idKey
if (val == 3) {
value = {
[startDateName]: this.customDate.startDate,
[endDateName]: this.customDate.endDate
}
} else {
let item = list.find(e => e.id == val)
value = {
[startDateName]: item.startDate,
[endDateName]: item.endDate
}
}
}
this.$emit('choose', {
currentIdKey,
currentId: val,
keys: idKey,
value
})
},
deep: true
}
},
mounted () {
this.initList()
},
methods: {
async initList () {
let { data, params: { idKey, currentIdKey } } = this
if (data[currentIdKey] == 3) {
this.customDate = {
startDate: data[idKey[0]],
endDate: data[idKey[1]]
}
this.rangeValue = {
before: data[idKey[0]],
after: data[idKey[1]]
}
}
this.currentId = data[currentIdKey]
this.$emit('onComplete')
},
choose (i) {
this.currentId = i
},
confirmCalendar ({range}) {
let { data } = range
this.customDate = {
startDate: data[0] || dayjs().format('YYYY-MM-DD'),
endDate: data[data.length - 1] || dayjs().format('YYYY-MM-DD')
}
this.rangeValue = range
if (this.currentId == 3) {
let { params: { idKey } } = this,
[startDateName, endDateName] = idKey
this.$emit('choose', {
currentId: 3,
keys: idKey,
value: {
[startDateName]: this.customDate.startDate,
[endDateName]: this.customDate.endDate
}
})
} else this.currentId = 3
}
}
}
</script>
<style scoped lang='scss'>
.list {
display: flex;
gap: 32rpx;
margin: 0 48rpx;
.item {
justify-content: center;
width: 348rpx;
height: 72rpx;
border-radius: 8rpx;
border: 2rpx solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: 32rpx;
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: 32rpx;
margin: 0 8rpx;
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
const screenList = [
{
title: '转化人员',
suffix: 'merchantName',
componentName: 'EmployeeList',
params: {
cacheData: [],
idKey: 'sellerUserIdList'
},
hasToggle: true,
toggle: false
},
{
title: '销售顾问',
suffix: 'shopMerchantName',
componentName: 'EmployeeList',
params: {
cacheData: [],
idKey: 'userIdList'
},
hasToggle: true,
toggle: false
},
{
title: '订单时间',
componentName: 'TimeList',
params: {
idKey: ['orderStartDate', 'orderEndDate'],
currentIdKey: 'orderTimeId',
},
},
{
title: '支付时间',
componentName: 'TimeList',
params: {
idKey: ['payStartDate', 'payEndDate'],
currentIdKey: 'payTimeId',
},
},
{
title: '订单状态',
componentName: 'OrderStatusList',
params: {
idKey: 'statusList'
}
},
{
title: '支付方式',
componentName: 'PayList',
params: {
idKey: 'payType'
}
},
]
export default { screenList }
\ No newline at end of file \ No newline at end of file
<template>
<popup
ref="popup"
@onConfirm="confirm"
@onCancel="clear"
cancelText="清除"
>
<view class="popup-title flex">
工单筛选
<view
class="popup-close flex"
@click="close"
>
<uni-icons
type="closeempty"
size="16"
></uni-icons>
</view>
</view>
<view class="popup-body" :key="viewKey">
<scroll-view
scroll-y
:class="['popup-scroll-view',{show:loadComplete}]"
>
<template v-for="(i, index) in screenList">
<view
class="item-box"
:key="index"
>
<view class="title flex">
{{i.title}}
<template v-if="i.suffix">
({{userInfo[i.suffix]}})
</template>
<template v-if="i.hasToggle">
<view class="toggle-btn" @click="i.toggle = !i.toggle">{{i.toggle ? '收起' : '展开'}}</view>
</template>
</view>
<view :class="['box',{'fold':i.hasToggle},{'show':i.toggle}]">
<component
:ref="`${i.componentName}_${index}`"
:is="i.componentName"
:params.sync="i.params"
@choose="choose"
:data="chooseContent"
/>
</view>
</view>
</template>
</scroll-view>
<image
v-if="!loadComplete"
class="loading"
src="../../assets/images/common/loadding.gif"
/>
</view>
</popup>
</template>
<script type='text/ecmascript-6'>
import Popup from '@/components/Popup.vue'
import config from './config'
import EmployeeList from './components/EmployeeList.vue'
import TimeList from './components/TimeList.vue'
import OrderStatusList from './components/OrderStatusList.vue'
import PayList from './components/PayList.vue'
export default {
components: {
Popup,
EmployeeList,
TimeList,
OrderStatusList,
PayList
},
name: 'OrderScreen',
props: {
},
data () {
return {
screenList: config.screenList,
loadComplete: true,
chooseContent: {},
viewKey:Date.now(),
}
},
provide () {
return {
userInfo: this.userInfo,
}
},
computed: {
userInfo () {
return uni.$storage.get("userInfo")
},
},
mounted () {
},
methods: {
open (data) {
this.$refs.popup.open()
},
clear () {
this.chooseContent = {}
this.viewKey = Date.now()
},
close () {
this.$refs.popup.close()
},
choose (i) {
let { key, value, keys, currentIdKey, currentId } = i,
{ chooseContent } = this
if (keys) {
if (currentIdKey) chooseContent[currentIdKey] = currentId || ''
keys.map(e => {
if (value[e]) chooseContent[e] = value[e]
else delete chooseContent[e]
})
} else {
if (value) chooseContent[key] = value
else delete chooseContent[key]
}
},
confirm () {
let chooseContent = JSON.parse(JSON.stringify(this.chooseContent))
delete chooseContent.payTimeId
delete chooseContent.orderTimeId
Object.keys(chooseContent).map(e => {
if (e == 'orderStartDate' || e == 'payStartDate') chooseContent[e] = `${chooseContent[e]} 00:00:00`
if (e == 'orderEndDate' || e == 'payEndDate') chooseContent[e] = `${chooseContent[e]} 23:59:59`
})
this.$emit('onConfirm', chooseContent)
this.close()
},
}
}
</script>
<style scoped lang='scss'>
.popup-box {
border-radius: 32rpx 32rpx 0 0;
background: #ffffff;
height: 70vh;
.popup-title {
height: 104rpx;
justify-content: center;
position: relative;
color: #333333;
font-size: 36rpx;
font-weight: 500;
.popup-close {
position: absolute;
height: 100%;
top: 0;
right: 0;
padding: 0 48rpx;
font-weight: 400;
color: #1a1a1a;
}
}
.popup-tips {
color: #999ea8;
font-size: 28rpx;
padding-left: 48rpx;
}
.popup-body {
height: calc(100% - 312rpx);
position: relative;
.popup-scroll-view {
height: 100%;
padding-top: 8rpx;
.item-box {
margin-bottom: 32rpx;
.title {
color: #888888;
font-size: 28rpx;
height: 40rpx;
background: #f5f7fa;
padding-left: 48rpx;
margin-bottom: 16rpx;
line-height: 40rpx;
.toggle-btn {
margin-left: auto;
padding: 0 48rpx;
color: #4673ff;
font-size: 24rpx;
}
}
.box{
overflow: hidden;
}
.fold{
height: 72rpx;
}
.show{
height: auto !important;
}
}
}
.loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: toRpx(64);
height: toRpx(64);
}
.show {
opacity: 1;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
<view <view
class="popup-btn popup-cancel" class="popup-btn popup-cancel"
@click="cancel" @click="cancel"
>取消</view> >{{cancelText}}</view>
<view <view
class="popup-btn popup-confirm" class="popup-btn popup-confirm"
@click="confirm" @click="confirm"
>确定</view> >{{confirmText}}</view>
</view> </view>
</view> </view>
...@@ -38,7 +38,16 @@ export default { ...@@ -38,7 +38,16 @@ export default {
position:{ position:{
type: String, type: String,
default: 'bottom' default: 'bottom'
},
cancelText: {
type: String,
default: '取消'
},
confirmText:{
type: String,
default: '确定'
} }
}, },
data () { data () {
...@@ -54,7 +63,6 @@ export default { ...@@ -54,7 +63,6 @@ export default {
this.$refs.popup.open() this.$refs.popup.open()
}, },
cancel () { cancel () {
this.$refs.popup.close()
this.$emit('onCancel') this.$emit('onCancel')
}, },
close () { close () {
......
...@@ -18,9 +18,10 @@ ...@@ -18,9 +18,10 @@
</Product> </Product>
</template> </template>
<template slot="package"> <template slot="package">
<Package></Package> <Package v-if="orderObj.package" :list="orderObj.package" :positionTypeList="positionTypeList"></Package>
</template> </template>
<template slot="skuGoods"> <template slot="skuGoods">
<SkuGoods v-if="orderObj.skuGoods" :list="orderObj.skuGoods" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></SkuGoods>
<view class="total" v-if="totalPrice > 0"> <view class="total" v-if="totalPrice > 0">
<view class="total-left">总价</view> <view class="total-left">总价</view>
<view class="total-right">¥{{totalPrice}}</view> <view class="total-right">¥{{totalPrice}}</view>
...@@ -45,6 +46,7 @@ import OrderPopup from '@/components/OrderPopup/index.vue' ...@@ -45,6 +46,7 @@ import OrderPopup from '@/components/OrderPopup/index.vue'
import GlCell from '../../../../components/Form/GlCell.vue' import GlCell from '../../../../components/Form/GlCell.vue'
import Product from './Product.vue' import Product from './Product.vue'
import Package from './Package.vue' import Package from './Package.vue'
import SkuGoods from './SkuGoods.vue'
import { FORM_LIST, popupTypeEnum, payTypeList } from '../contant' import { FORM_LIST, popupTypeEnum, payTypeList } from '../contant'
export default { export default {
name: 'CreateOrder', name: 'CreateOrder',
...@@ -52,7 +54,8 @@ export default { ...@@ -52,7 +54,8 @@ export default {
GlCell, GlCell,
OrderPopup, OrderPopup,
Product, Product,
Package Package,
SkuGoods
}, },
props: { props: {
selectedTradeData: { selectedTradeData: {
...@@ -91,6 +94,8 @@ export default { ...@@ -91,6 +94,8 @@ export default {
rearWindow: null, rearWindow: null,
rearGear: null, rearGear: null,
sunRoof: null, sunRoof: null,
package: null,
skuGoods: null
}, // 弹窗传入的数据}, }, // 弹窗传入的数据},
popupType: 0, popupType: 0,
popupTypeEnum, popupTypeEnum,
...@@ -165,7 +170,7 @@ export default { ...@@ -165,7 +170,7 @@ export default {
this.externalData = [] this.externalData = []
} }
// 定义产品相关字段数组 // 定义产品相关字段数组
const productFields = ['frontGear', 'frontWindow', 'rearGear', 'rearWindow', 'sunRoof'] const productFields = ['frontGear', 'frontWindow', 'rearGear', 'rearWindow', 'sunRoof', 'package', 'skuGoods']
if (productFields.includes(val.value)) { if (productFields.includes(val.value)) {
this.valueKey = val.value this.valueKey = val.value
} }
...@@ -188,7 +193,7 @@ export default { ...@@ -188,7 +193,7 @@ export default {
const _typeValue = this.popupTypeEnum[this.popupType] const _typeValue = this.popupTypeEnum[this.popupType]
console.log(_typeValue) console.log(_typeValue)
// 定义产品相关字段数组 // 定义产品相关字段数组
const productFields = ['frontGear', 'frontWindow', 'rearGear', 'rearWindow', 'sunRoof']; const productFields = ['frontGear', 'frontWindow', 'rearGear', 'rearWindow', 'sunRoof', 'package', 'skuGoods'];
if (_typeValue.key == 'carBrand') { if (_typeValue.key == 'carBrand') {
// 车型 // 车型
this.$set(this.orderObj, _typeValue.key, `${chooseContent.carBrand}-${chooseContent.carChildsBrandName}-${chooseContent.carSeriesName}`) this.$set(this.orderObj, _typeValue.key, `${chooseContent.carBrand}-${chooseContent.carChildsBrandName}-${chooseContent.carSeriesName}`)
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
<view class="popup-text">{{ text }}</view> <view class="popup-text">{{ text }}</view>
<view class="popup-buttons"> <view class="popup-buttons">
<view <view
v-for="(button, index) in buttons" v-for="(button, index) in buttonsList"
:key="index" :key="index"
class="popup-button" class="popup-button"
:class="[ :class="[
`button-${button.type || 'default'}`, `button-${button.type || 'default'}`,
{ 'single-button': buttons.length === 1 } { 'single-button': buttonsList.length === 1 }
]" ]"
@click="handleButtonClick(button)" @click="handleButtonClick(button)"
> >
...@@ -57,7 +57,8 @@ export default { ...@@ -57,7 +57,8 @@ export default {
}, },
data() { data() {
return { return {
popupShow: false popupShow: false,
buttonsList: []
} }
}, },
computed: { computed: {
...@@ -89,6 +90,23 @@ export default { ...@@ -89,6 +90,23 @@ export default {
// 触发点击事件,传递按钮信息 // 触发点击事件,传递按钮信息
this.$emit('buttonClick', button) this.$emit('buttonClick', button)
} }
},
// 监听props变化,更新本地数据
watch: {
buttons: {
immediate: true,
handler(newVal) {
if (newVal) {
this.buttonsList = JSON.parse(JSON.stringify(newVal))
}
}
}
},
created() {
// 初始化时将buttons赋值给buttonsList
this.buttonsList = JSON.parse(JSON.stringify(this.buttons))
} }
} }
</script> </script>
......
<template> <template>
<view> <view>
<view class="package-list"> <view class="package-list">
<view class="package-item"> <view class="package-item" v-for="(item, index) in list" :key="index">
<view class="header"> <view class="header">
<view class="header-left"> <view class="header-left">
<view class="sprite-icon icon-blue-delete"></view> <view class="sprite-icon icon-blue-delete"></view>
<view class="name">平步青云套餐</view> <view class="name">{{item.packageGoods.packageAlias||item.packageGoods.packageName}}</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="control">
<view class="minus">-</view> <view class="minus" @click="decreaseNumber(item)">-</view>
<input class="uni-input control-input" type="number" /> <input class="uni-input control-input" type="number" maxlength="3" v-model="item.packageGoods.number" @blur="validateNumber($event, item)" />
<view class="add">+</view> <view class="add" @click="increaseNumber(item)">+</view>
</view> </view>
</view> </view>
<view class="price">¥{{item.packageGoods.upgradePrice}}</view>
</view> </view>
<view class="goods-item"> <view class="goods-item" v-for="(goods, ind) in item.packageGoods.goodsList" :key="ind">
<view class="goods-name">AITO汽车专享 M5中控屏钢化保护膜</view> <view class="goods-name">{{goods.goodsAlias || goods.upgradeGoodsName}}</view>
<view class="alias-name">商品别名:阿尔法 T5极狐非三电整车延保(新车2年6万公里)</view> <!-- <view class="alias-name">商品别名:阿尔法 T5极狐非三电整车延保(新车2年6万公里)</view> -->
<view class="front-gear-box"> <view class="front-gear-box">
<view class="front-gear-input-box"> <view class="front-gear-input-box">
<view class="front-gear-label">前档玻璃</view> <view class="front-gear-label" v-if="goods.merchantGoodsPosition || goods.goodsInfo.goodsTypeName">{{goods.goodsInfo.goodsType===1?formatPosition(goods.merchantGoodsPosition, positionTypeList):goods.goodsInfo.goodsTypeName}}</view>
<view class="front-gear-input"> <view class="front-gear-input">
<view class="unit">¥</view> <view class="unit">¥</view>
<input class="uni-input" type="digit" placeholder="请输入价格" placeholder-style="font-size: 14px" /> <input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="goods.sellPrice" @blur="validatePrice($event, goods, ind, index)" />
</view> </view>
</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> </view>
...@@ -50,8 +32,110 @@ ...@@ -50,8 +32,110 @@
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name: 'Package' name: 'Package',
props: {
list: {
type: Array,
default: () => []
},
positionTypeList: {
type: Array,
default: []
},
},
created() {
// 初始化商品数量
this.list.forEach(item => {
if (!item.packageGoods.number) {
this.$set(item.packageGoods, 'number', '1')
}
})
},
methods: {
// 格式化位置信息
formatPosition(item, positionTypeList) {
const filterData = positionTypeList.filter(v => v.positionValue == item)
return (filterData.length && filterData[0] && filterData[0].positionName) || ''
},
// 验证数量输入
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.packageGoods, 'number', value)
this.$emit('changeTotalPrice')
},
// 增加数量
increaseNumber(item) {
if (!item.packageGoods.number) {
this.$set(item.packageGoods, 'number', '1')
} else {
const currentValue = parseInt(item.packageGoods.number)
// 限制最大数量为999
const newValue = currentValue >= 999 ? 999 : currentValue + 1
this.$set(item.packageGoods, 'number', newValue.toString())
}
this.$emit('changeTotalPrice')
},
// 减少数量
decreaseNumber(item) {
// 如果商品数量不存在或小于等于1,设置为1
if (!item.packageGoods.number || parseInt(item.packageGoods.number) <= 1) {
this.$set(item.packageGoods, 'number', '1')
return
}
const currentValue = parseInt(item.packageGoods.number)
// 确保减少后的值不小于1
const newValue = Math.max(1, currentValue - 1)
this.$set(item.packageGoods, 'number', newValue.toString())
this.$emit('changeTotalPrice')
},
validatePrice(event, goods, ind, index) {
let value = event.detail.value
console.log('value', value)
// 如果为空则设置为0
if (!value || value.trim() === '') {
value = '0'
}
// 限制只能输入数字和小数点
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'
}
// 如果validMinSellPrice为Y,则强制修改值为最小值
if (goods.validMinSellPrice === 'Y' && goods.minSellPrice && parseFloat(value) < parseFloat(goods.minSellPrice)) {
console.log('最小值', goods.minSellPrice)
value = goods.minSellPrice.toString()
}
// 更新值
this.$set(this.list[index].packageGoods.goodsList[ind], 'sellPrice', value)
this.$emit('changeTotalPrice')
},
}
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
...@@ -94,8 +178,17 @@ export default { ...@@ -94,8 +178,17 @@ export default {
} }
} }
} }
}
.package-list {
padding: toRpx(12) toRpx(32) toRpx(12) 0;
.package-item {
background-color: #f5f7fa;
border-radius: toRpx(16);
margin-bottom: toRpx(16);
.control { .control {
margin-left: toRpx(32);
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -129,15 +222,6 @@ export default { ...@@ -129,15 +222,6 @@ export default {
border-right: toRpx(2) solid #eff0f2; 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 { .header {
display: flex; display: flex;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</view> </view>
<view class="control"> <view class="control">
<view class="minus" @click="decreaseNumber(item)">-</view> <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)" /> <input class="uni-input control-input" type="number" maxlength="3" v-model="item.goods.number" @blur="validateNumber($event, item)" />
<view class="add" @click="increaseNumber(item)">+</view> <view class="add" @click="increaseNumber(item)">+</view>
</view> </view>
</view> </view>
...@@ -49,13 +49,27 @@ export default { ...@@ -49,13 +49,27 @@ export default {
}, },
created() { created() {
// 初始化商品数量 // 初始化商品数量
this.initProductNumbers()
},
mounted() {
// 确保每次使用组件时都检查并设置number属性
this.initProductNumbers()
},
updated() {
// 当组件数据更新时也检查number属性
this.initProductNumbers()
},
methods: {
// 初始化商品数量方法
initProductNumbers() {
if (this.list && this.list.length > 0) {
this.list.forEach(item => { this.list.forEach(item => {
if (!item.goods.number) { if (!item.goods.number) {
this.$set(item.goods, 'number', '1') this.$set(item.goods, 'number', '1')
} }
}) })
}
}, },
methods: {
circulation(data, str) { circulation(data, str) {
let arr = str.split('.'), let arr = str.split('.'),
result; result;
...@@ -75,6 +89,10 @@ export default { ...@@ -75,6 +89,10 @@ export default {
validatePrice(event, item, index) { validatePrice(event, item, index) {
let value = event.detail.value let value = event.detail.value
console.log('value', value) console.log('value', value)
// 如果为空则设置为0
if (!value || value.trim() === '') {
value = '0'
}
// 限制只能输入数字和小数点 // 限制只能输入数字和小数点
value = value.replace(/[^\d.]/g, '') value = value.replace(/[^\d.]/g, '')
// 限制只能有一个小数点 // 限制只能有一个小数点
...@@ -99,6 +117,10 @@ export default { ...@@ -99,6 +117,10 @@ export default {
} }
if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) { if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) {
console.log('最小值', item.goods.minSellPrice) console.log('最小值', item.goods.minSellPrice)
uni.showToast({
title: '单价不可低于商品最低价',
icon: 'none'
})
value = item.goods.minSellPrice.toString() value = item.goods.minSellPrice.toString()
} }
// 更新值 // 更新值
......
...@@ -14,11 +14,13 @@ ...@@ -14,11 +14,13 @@
<template v-if="toolComponentName !== 'DailyReport'"> <template v-if="toolComponentName !== 'DailyReport'">
<Entrance @entranceClick="entranceClick"></Entrance> <Entrance @entranceClick="entranceClick"></Entrance>
</template> </template>
<template v-else></template> <template v-else>
<uni-calendar ref="calendar" :clearDate="false" :endDate="endDate" :showMonth="false" @monthSwitch="currentMonth = `${$event.year}-${$event.month}`" @change="currentDate = $event.fulldate" backgroundColor="transparent" :selected="selectedDays" />
</template>
</view> </view>
</view> </view>
<view class="detail-right"> <view class="detail-right">
<component :is="toolComponentName" @jump="jump" :transmission-of-data="transmissionOfData" /> <component :is="toolComponentName" @jump="jump" :transmission-of-data="transmissionOfData" :currentDate="currentDate" :currentMonth="currentMonth" @setCalendarSelected="selectedDays = $event" />
</view> </view>
</view> </view>
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup> <NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
...@@ -35,6 +37,7 @@ import ConfirmOrder from './components/ConfirmOrder.vue' ...@@ -35,6 +37,7 @@ import ConfirmOrder from './components/ConfirmOrder.vue'
import OrderDetail from './components/OrderDetail.vue' import OrderDetail from './components/OrderDetail.vue'
import UploadProofOfPayment from './components/UploadProofOfPayment.vue' import UploadProofOfPayment from './components/UploadProofOfPayment.vue'
import NoticePopup from './components/NoticePopup.vue' import NoticePopup from './components/NoticePopup.vue'
import dayjs from 'dayjs'
export default { export default {
components: { components: {
Entrance, Entrance,
...@@ -50,7 +53,11 @@ export default { ...@@ -50,7 +53,11 @@ export default {
data() { data() {
return { return {
toolComponentName: '', toolComponentName: '',
transmissionOfData: null transmissionOfData: null,
endDate: dayjs().format('YYYY-MM-DD'),
currentDate: dayjs().format('YYYY-MM-DD'),
currentMonth: dayjs().format('YYYY-MM'),
selectedDays: []
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -61,7 +68,7 @@ export default { ...@@ -61,7 +68,7 @@ export default {
console.log(item) console.log(item)
// 保存当前选择的组件信息,但不立即切换 // 保存当前选择的组件信息,但不立即切换
const selectedItem = item const selectedItem = item
if (this.toolComponentName == selectedItem.name) return
// 如果当前组件是OrderManagement,直接切换组件,不显示弹窗 // 如果当前组件是OrderManagement,直接切换组件,不显示弹窗
if (this.toolComponentName === 'OrderManagement') { if (this.toolComponentName === 'OrderManagement') {
this.toolComponentName = selectedItem.name this.toolComponentName = selectedItem.name
...@@ -70,7 +77,7 @@ export default { ...@@ -70,7 +77,7 @@ export default {
} }
// 配置弹窗按钮 // 配置弹窗按钮
this.$refs.notice.buttons = [ this.$refs.notice.buttonsList = [
{ {
text: '确认退出', text: '确认退出',
type: 'default', type: 'default',
...@@ -80,14 +87,6 @@ export default { ...@@ -80,14 +87,6 @@ export default {
if (selectedItem.name !== 'CreateOrder') { if (selectedItem.name !== 'CreateOrder') {
this.transmissionOfData = null this.transmissionOfData = null
} }
this.$refs.notice.close()
}
},
{
text: '继续编辑',
type: 'primary',
callback: () => {
this.$refs.notice.close()
} }
} }
] ]
......
<template> <template>
<view class="uni-calendar-item__weeks-box" :class="{ <view
class="uni-calendar-item__weeks-box"
:class="{
'uni-calendar-item--disable':weeks.disable, 'uni-calendar-item--disable':weeks.disable,
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay, 'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
'uni-calendar-item--checked':(calendar.fullDate === weeks.fullDate && !weeks.isDay) , 'uni-calendar-item--checked':(calendar.fullDate === weeks.fullDate && !weeks.isDay) ,
...@@ -7,10 +9,16 @@ ...@@ -7,10 +9,16 @@
'uni-calendar-item--multiple': weeks.multiple, 'uni-calendar-item--multiple': weeks.multiple,
'uni-calendar-item--after-checked':weeks.afterMultiple, 'uni-calendar-item--after-checked':weeks.afterMultiple,
}" }"
@click="choiceDate(weeks)"> @click="choiceDate(weeks)"
>
<view class="uni-calendar-item__weeks-box-item"> <view class="uni-calendar-item__weeks-box-item">
<text v-if="selected&&weeks.extraInfo" class="uni-calendar-item__weeks-box-circle"></text> <text
<text class="uni-calendar-item__weeks-box-text" :class="{ v-if="selected&&weeks.extraInfo"
class="uni-calendar-item__weeks-box-circle"
></text>
<text
class="uni-calendar-item__weeks-box-text"
:class="{
'uni-calendar-item--isDay-text': weeks.isDay, 'uni-calendar-item--isDay-text': weeks.isDay,
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay, 'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay, 'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
...@@ -18,16 +26,24 @@ ...@@ -18,16 +26,24 @@
'uni-calendar-item--multiple': weeks.multiple, 'uni-calendar-item--multiple': weeks.multiple,
'uni-calendar-item--after-checked':weeks.afterMultiple, 'uni-calendar-item--after-checked':weeks.afterMultiple,
'uni-calendar-item--disable':weeks.disable, 'uni-calendar-item--disable':weeks.disable,
}">{{weeks.date}}</text> }"
<text v-if="!lunar&&!weeks.extraInfo && weeks.isDay" class="uni-calendar-item__weeks-lunar-text" :class="{ >{{weeks.date}}</text>
<text
v-if="!lunar&&!weeks.extraInfo && weeks.isDay"
class="uni-calendar-item__weeks-lunar-text"
:class="{
'uni-calendar-item--isDay-text':weeks.isDay, 'uni-calendar-item--isDay-text':weeks.isDay,
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay, 'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay, 'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
'uni-calendar-item--before-checked':weeks.beforeMultiple, 'uni-calendar-item--before-checked':weeks.beforeMultiple,
'uni-calendar-item--multiple': weeks.multiple, 'uni-calendar-item--multiple': weeks.multiple,
'uni-calendar-item--after-checked':weeks.afterMultiple, 'uni-calendar-item--after-checked':weeks.afterMultiple,
}">{{todayText}}</text> }"
<text v-if="lunar&&!weeks.extraInfo" class="uni-calendar-item__weeks-lunar-text" :class="{ >{{todayText}}</text>
<text
v-if="lunar&&!weeks.extraInfo"
class="uni-calendar-item__weeks-lunar-text"
:class="{
'uni-calendar-item--isDay-text':weeks.isDay, 'uni-calendar-item--isDay-text':weeks.isDay,
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay, 'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay, 'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
...@@ -35,8 +51,12 @@ ...@@ -35,8 +51,12 @@
'uni-calendar-item--multiple': weeks.multiple, 'uni-calendar-item--multiple': weeks.multiple,
'uni-calendar-item--after-checked':weeks.afterMultiple, 'uni-calendar-item--after-checked':weeks.afterMultiple,
'uni-calendar-item--disable':weeks.disable, 'uni-calendar-item--disable':weeks.disable,
}">{{weeks.isDay ? todayText : (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}</text> }"
<text v-if="weeks.extraInfo&&weeks.extraInfo.info" class="uni-calendar-item__weeks-lunar-text" :class="{ >{{weeks.isDay ? todayText : (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}</text>
<text
v-if="weeks.extraInfo&&weeks.extraInfo.info"
class="uni-calendar-item__weeks-lunar-text"
:class="{
'uni-calendar-item--extra':weeks.extraInfo.info, 'uni-calendar-item--extra':weeks.extraInfo.info,
'uni-calendar-item--isDay-text':weeks.isDay, 'uni-calendar-item--isDay-text':weeks.isDay,
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay, 'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
...@@ -45,18 +65,19 @@ ...@@ -45,18 +65,19 @@
'uni-calendar-item--multiple': weeks.multiple, 'uni-calendar-item--multiple': weeks.multiple,
'uni-calendar-item--after-checked':weeks.afterMultiple, 'uni-calendar-item--after-checked':weeks.afterMultiple,
'uni-calendar-item--disable':weeks.disable, 'uni-calendar-item--disable':weeks.disable,
}">{{weeks.extraInfo.info}}</text> }"
>{{weeks.extraInfo.info}}</text>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { initVueI18n } from '@dcloudio/uni-i18n' import { initVueI18n } from '@dcloudio/uni-i18n'
import i18nMessages from './i18n/index.js' import i18nMessages from './i18n/index.js'
const { t } = initVueI18n(i18nMessages) const { t } = initVueI18n(i18nMessages)
export default { export default {
emits:['change'], emits: ['change'],
props: { props: {
weeks: { weeks: {
type: Object, type: Object,
...@@ -82,27 +103,27 @@ ...@@ -82,27 +103,27 @@
} }
}, },
computed: { computed: {
todayText() { todayText () {
return t("uni-calender.today") return t("uni-calender.today")
}, },
}, },
methods: { methods: {
choiceDate(weeks) { choiceDate (weeks) {
this.$emit('change', weeks) this.$emit('change', weeks)
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$uni-font-size-base:14px; $uni-font-size-base: 14px;
$uni-text-color:#333; $uni-text-color: #37393D;
$uni-font-size-sm:12px; $uni-font-size-sm: 12px;
$uni-color-error: #e43d33; $uni-color-error: #e43d33;
$uni-opacity-disabled: 0.3; $uni-opacity-disabled: 0.3;
$uni-text-color-disable:#c0c0c0; $uni-text-color-disable: #c0c0c0;
$uni-primary: #2979ff !default; $uni-primary: #4673ff !default;
.uni-calendar-item__weeks-box { .uni-calendar-item__weeks-box {
flex: 1; flex: 1;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
...@@ -110,19 +131,19 @@ ...@@ -110,19 +131,19 @@
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.uni-calendar-item__weeks-box-text { .uni-calendar-item__weeks-box-text {
font-size: $uni-font-size-base; font-size: $uni-font-size-base;
color: $uni-text-color; color: $uni-text-color;
} }
.uni-calendar-item__weeks-lunar-text { .uni-calendar-item__weeks-lunar-text {
font-size: $uni-font-size-sm; font-size: $uni-font-size-sm;
color: $uni-text-color; color: $uni-text-color;
} }
.uni-calendar-item__weeks-box-item { .uni-calendar-item__weeks-box-item {
position: relative; position: relative;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
...@@ -132,56 +153,57 @@ ...@@ -132,56 +153,57 @@
align-items: center; align-items: center;
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
} }
.uni-calendar-item__weeks-box-circle { .uni-calendar-item__weeks-box-circle {
position: absolute; position: absolute;
top: 5px; bottom: 10rpx;
right: 5px; left: 50%;
width: 8px; transform: translate(-50%, -50%);
height: 8px; width: 12rpx;
height: 12rpx;
border-radius: 8px; border-radius: 8px;
background-color: $uni-color-error; background-color: $uni-color-error;
}
} .uni-calendar-item--disable {
// background-color: rgba(249, 249, 249, $uni-opacity-disabled);
.uni-calendar-item--disable {
background-color: rgba(249, 249, 249, $uni-opacity-disabled);
color: $uni-text-color-disable; color: $uni-text-color-disable;
} }
.uni-calendar-item--isDay-text { .uni-calendar-item--isDay-text {
color: $uni-primary; color: $uni-primary;
} }
.uni-calendar-item--isDay { .uni-calendar-item--isDay {
background-color: $uni-primary; background-color: $uni-primary;
opacity: 0.8; // opacity: 0.8;
color: #fff; color: #fff;
} border-radius: 16rpx;
}
.uni-calendar-item--extra { .uni-calendar-item--extra {
color: $uni-color-error; color: $uni-color-error;
opacity: 0.8; opacity: 0.8;
} }
.uni-calendar-item--checked { .uni-calendar-item--checked {
background-color: $uni-primary; background-color: $uni-primary;
color: #fff; color: #fff;
opacity: 0.8; opacity: 0.8;
} }
.uni-calendar-item--multiple { .uni-calendar-item--multiple {
background-color: $uni-primary; background-color: $uni-primary;
color: #fff; color: #fff;
opacity: 0.8; opacity: 0.8;
} }
.uni-calendar-item--before-checked { .uni-calendar-item--before-checked {
background-color: #ff5a5f; background-color: #ff5a5f;
color: #fff; color: #fff;
} }
.uni-calendar-item--after-checked { .uni-calendar-item--after-checked {
background-color: #ff5a5f; background-color: #ff5a5f;
color: #fff; color: #fff;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!