Commit 9d469f99 by 李伟康

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

2 parents 5069b9a9 847e7c8b
...@@ -228,6 +228,14 @@ module.exports = { ...@@ -228,6 +228,14 @@ module.exports = {
getServiceBaseInfo(data) { getServiceBaseInfo(data) {
return http.post({ method: 'dj.api.smartcarlife.serviceMerchant.getServiceBaseInfo', projectName: 'boutique', ...data }) return http.post({ method: 'dj.api.smartcarlife.serviceMerchant.getServiceBaseInfo', projectName: 'boutique', ...data })
}, },
/** 获取转化员上一笔订单的销售顾问 */
getLastUserOrderInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.order.getLastUser',
projectName: 'boutique',
...data
})
},
/**根据订单号获取订单详情(含套餐) */ /**根据订单号获取订单详情(含套餐) */
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 })
......

2.56 MB | W: | H:

2.55 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -4,13 +4,28 @@ ...@@ -4,13 +4,28 @@
<view class="box"> <view class="box">
<scroll-view class="scroll-view" scroll-y="true"> <scroll-view class="scroll-view" scroll-y="true">
<view class="box-content"> <view class="box-content">
<GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @inputBlur="inputBlur" @handleCell="handleCell"> <GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @inputBlur="inputBlur"
<template slot="frontGear"> @handleCell="handleCell">
<Product v-if="orderObj.frontGear && orderObj.frontGear.length" :list="orderObj.frontGear" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product> <!-- 使用v-for循环渲染产品组件,减少重复代码 -->
<template v-for="(_, slotName) in productSlots" :slot="slotName" >
<Product
:key="slotName"
v-if="orderObj[slotName] && orderObj[slotName].length"
@changeTotalPrice="changeTotalPrice"
:list="orderObj[slotName]"
:positionTypeList="positionTypeList"
:baseConfigData="baseConfigData">
</Product>
</template> </template>
<template slot="package"> <template slot="package">
<Package></Package> <Package></Package>
</template> </template>
<template slot="skuGoods">
<view class="total" v-if="totalPrice > 0">
<view class="total-left">总价</view>
<view class="total-right">¥{{totalPrice}}</view>
</view>
</template>
<template slot="otherPay"> <template slot="otherPay">
<view v-if="showPayTips" class="pay-tips">其他收款:当客户已向嘀加付款但无法使用流水补录时,新建工单应选择收款方为「嘀加收款」且支付方为「其他收款」。</view> <view v-if="showPayTips" class="pay-tips">其他收款:当客户已向嘀加付款但无法使用流水补录时,新建工单应选择收款方为「嘀加收款」且支付方为「其他收款」。</view>
</template> </template>
...@@ -50,6 +65,9 @@ export default { ...@@ -50,6 +65,9 @@ export default {
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
console.log('接收到的交易数据:', newVal) console.log('接收到的交易数据:', newVal)
this.orderCreateType = 'supplementOrder'
this.orderObj.outTradeNo = newVal.selectedItems.map(item => item.outTradeNo).join(',')
this.orderObj.tradeNo = newVal.selectedItems.map(item => item.tradeNo).join(',')
} }
}, },
immediate: true immediate: true
...@@ -57,6 +75,7 @@ export default { ...@@ -57,6 +75,7 @@ export default {
}, },
data() { data() {
return { return {
orderCreateType: "createWithPay", // supplementOrder(补录订单) createWithPay(新增)
formList: utils.deepClone(FORM_LIST), formList: utils.deepClone(FORM_LIST),
userInfo: {}, userInfo: {},
baseConfigData: {}, baseConfigData: {},
...@@ -67,7 +86,11 @@ export default { ...@@ -67,7 +86,11 @@ export default {
experienceFlag: 'Y', experienceFlag: 'Y',
payeeType: 1, payeeType: 1,
salesType: '0', salesType: '0',
frontGear: null frontGear: null,
frontWindow: null,
rearWindow: null,
rearGear: null,
sunRoof: null,
}, // 弹窗传入的数据}, }, // 弹窗传入的数据},
popupType: 0, popupType: 0,
popupTypeEnum, popupTypeEnum,
...@@ -80,7 +103,16 @@ export default { ...@@ -80,7 +103,16 @@ export default {
payTypeList, payTypeList,
goodsList: [], goodsList: [],
positionTypeList: [], positionTypeList: [],
valueKey: '' valueKey: '',
totalPrice: 0,
// 产品槽位配置,用于循环渲染产品组件
productSlots: {
frontGear: true,
frontWindow: true,
rearGear: true,
rearWindow: true,
sunRoof: true
},
} }
}, },
computed: { computed: {
...@@ -93,7 +125,7 @@ export default { ...@@ -93,7 +125,7 @@ export default {
console.log(options, 'options') console.log(options, 'options')
}, },
mounted() { mounted() {
console.log('mounted') console.log('mounted', this.orderCreateType)
this.userInfo = uni.$storage.get('userInfo') || {} this.userInfo = uni.$storage.get('userInfo') || {}
this.baseConfigData = uni.$storage.get('mock_data') || {} this.baseConfigData = uni.$storage.get('mock_data') || {}
const { userInfo } = this const { userInfo } = this
...@@ -115,9 +147,10 @@ export default { ...@@ -115,9 +147,10 @@ export default {
this.getSubShopMerchantList(userInfo.shopMerchantId) this.getSubShopMerchantList(userInfo.shopMerchantId)
this.getSetting() this.getSetting()
this.getConfig() this.getConfig()
this.getEmployeeList() // this.getEmployeeList()
this.getSelectOrderGoodsList() this.getSelectOrderGoodsList()
this.getPositionList() this.getPositionList()
if (this.orderCreateType == 'createWithPay') this.getLastUserOrderInfo() // 补录订单不需要设置默认值
}, },
// 选择行事件 // 选择行事件
handleCell(val) { handleCell(val) {
...@@ -147,12 +180,15 @@ export default { ...@@ -147,12 +180,15 @@ export default {
this.changePayee() this.changePayee()
} }
}, },
// 弹窗确认回调
onConfirm(val) { onConfirm(val) {
console.log(val, 'onConfirm') console.log(val, 'onConfirm')
const { chooseContent } = val const { chooseContent } = val
// 根据popupTypeEnum优化处理 // 根据popupTypeEnum优化处理
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'];
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}`)
...@@ -169,10 +205,14 @@ export default { ...@@ -169,10 +205,14 @@ export default {
customerCouponCode: customerCouponCode customerCouponCode: customerCouponCode
}) })
this.$set(this.orderObj, 'couponInfo', couponName + customerCouponCode) this.$set(this.orderObj, 'couponInfo', couponName + customerCouponCode)
} else if (_typeValue.key == 'frontGear') { } else if (productFields.includes(_typeValue.key)) {
this.$set(this.orderObj, 'frontGear', val.chooseContent) // 商品类,需计算总价
this.$set(this.orderObj, _typeValue.key, val.chooseContent)
this.$nextTick(() => {
// 确保数据更新后再计算总价
this.changeTotalPrice()
})
} else if (_typeValue.key) { } else if (_typeValue.key) {
// this.formObj[_typeValue.key] = chooseContent;
this.orderObj[_typeValue.targetIdKey] = chooseContent[_typeValue.sourceIdKey] this.orderObj[_typeValue.targetIdKey] = chooseContent[_typeValue.sourceIdKey]
this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey]) this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey])
} }
...@@ -254,6 +294,7 @@ export default { ...@@ -254,6 +294,7 @@ export default {
async submit() { async submit() {
console.log(this.orderObj) console.log(this.orderObj)
if (!this.checkRequired()) return if (!this.checkRequired()) return
const {orderCreateType} = this
const obj = utils.deepClone(this.orderObj) const obj = utils.deepClone(this.orderObj)
const otherCustomer = ['standNo', 'plateNumber', 'customerSex', 'experienceFlag', 'salesType'] const otherCustomer = ['standNo', 'plateNumber', 'customerSex', 'experienceFlag', 'salesType']
obj.customer = { obj.customer = {
...@@ -266,8 +307,17 @@ export default { ...@@ -266,8 +307,17 @@ export default {
return acc return acc
}, {}) }, {})
} }
if (obj.frontGear) { // 将 frontGear、frontWindow、rearGear、rearWindow、sunRoof 字段合并到 goodsList 中
obj.subOrderList = obj.frontGear.map(item => { const labelFields = ['frontGear', 'frontWindow', 'rearGear', 'rearWindow', 'sunRoof']
let goodsList = []
labelFields.forEach(field => {
if (Array.isArray(obj[field]) && obj[field].length > 0) {
goodsList = goodsList.concat(obj[field]);
}
delete obj[field];
});
if (goodsList.length > 0) {
obj.subOrderList = goodsList.map(item => {
return { return {
totalPrice: item.goods.sellPrice, totalPrice: item.goods.sellPrice,
number: item.goods.number, number: item.goods.number,
...@@ -275,11 +325,10 @@ export default { ...@@ -275,11 +325,10 @@ export default {
} }
}) })
} }
delete obj.frontGear
delete obj.carBrand delete obj.carBrand
delete obj.couponInfo delete obj.couponInfo
console.log(obj, 'rucan') console.log(obj, 'rucan')
const res = await uni.$api.boutiqueApi.createWithPay(obj) const res = await uni.$api.boutiqueApi[orderCreateType](obj)
console.log(res, '===submit') console.log(res, '===submit')
if (res) { if (res) {
uni.showToast({ uni.showToast({
...@@ -289,6 +338,35 @@ export default { ...@@ -289,6 +338,35 @@ export default {
this.$emit('jump', 'ConfirmOrder', res.data) this.$emit('jump', 'ConfirmOrder', res.data)
} }
}, },
// 计算所有产品的总价
changeTotalPrice() {
let total = 0
// 遍历所有产品槽位
Object.keys(this.productSlots).forEach(slotName => {
const productList = this.orderObj[slotName]
if (Array.isArray(productList) && productList.length > 0) {
// 计算每个产品的价格 * 数量,并累加到总价
productList.forEach(item => {
if (item.goods && item.goods.sellPrice && item.goods.number) {
total += parseFloat(item.goods.sellPrice) * parseInt(item.goods.number)
}
})
}
})
console.log(total, 'total')
// 更新总价
this.totalPrice = total.toFixed(2)
},
// 获取上一个订单的销售顾问信息 并且不是再次下单
async getLastUserOrderInfo() {
const res = await uni.$api.boutiqueApi.getLastUserOrderInfo({
sellerUserId: this.userInfo.subLoginUser.uuid
})
this.$set(this.orderObj, 'employeeName', res.employeeName)
this.orderObj.userId = res.userId
console.log(res, '上一个订单的销售顾问信息')
},
async getShopMerchantPointConfig(merchantId) { async getShopMerchantPointConfig(merchantId) {
const res = await uni.$api.boutiqueApi.getShopMerchantPointConfig({ merchantId }) const res = await uni.$api.boutiqueApi.getShopMerchantPointConfig({ merchantId })
console.log(res) console.log(res)
...@@ -392,8 +470,8 @@ export default { ...@@ -392,8 +470,8 @@ export default {
}) })
if (data && data.length) { if (data && data.length) {
this.employeeList = data this.employeeList = data
this.$set(this.orderObj, 'employeeName', data[0].staffName) // this.$set(this.orderObj, 'employeeName', data[0].staffName)
this.orderObj.userId = data[0].uuid // this.orderObj.userId = data[0].uuid
} }
}, },
async getPositionList() { async getPositionList() {
...@@ -628,6 +706,25 @@ export default { ...@@ -628,6 +706,25 @@ export default {
} }
} }
.total {
display: flex;
justify-content: space-between;
align-items: center;
padding: toRpx(24) toRpx(32) toRpx(24) 0;
font-size: toRpx(28);
border-bottom: toRpx(2) solid #f7f7f6;
&-left {
color: #333;
font-weight: 500;
}
&-right {
color: #f45001;
font-weight: 500;
}
}
.pay-tips { .pay-tips {
padding: toRpx(24) toRpx(24) toRpx(24) 0; padding: toRpx(24) toRpx(24) toRpx(24) 0;
font-size: toRpx(24); font-size: toRpx(24);
......
<template>
<uni-popup ref="popup" type="center" border-radius="16px" :mask-click="false">
<view class="popup-content" :class="[`popup-${type}`]">
<view class="popup-icon">
<image
:src="require(`../../../../assets/images/common/${type}-notice.png`)"
mode="aspectFit"
class="icon-image"
/>
</view>
<view class="popup-title">{{ title }}</view>
<view class="popup-text">{{ text }}</view>
<view class="popup-buttons">
<view
v-for="(button, index) in buttons"
:key="index"
class="popup-button"
:class="[
`button-${button.type || 'default'}`,
{ 'single-button': buttons.length === 1 }
]"
@click="handleButtonClick(button)"
>
{{ button.text }}
</view>
</view>
</view>
</uni-popup>
</template>
<script>
export default {
props: {
// 弹窗类型:success, error, warning, info
type: {
type: String,
default: 'info'
},
// 弹窗标题
title: {
type: String,
default: '提示'
},
// 弹窗内容
text: {
type: String,
default: ''
},
// 按钮配置
buttons: {
type: Array,
default: () => [{
text: '确认',
type: 'primary',
callback: null
}]
}
},
data() {
return {
popupShow: false
}
},
computed: {
// 根据类型返回对应的图标
iconSrc() {
const iconMap = {
success: 'https://img01.glsx.com.cn/weapp/resource/app-tape/media/common/icon-success.png',
error: 'https://img01.glsx.com.cn/weapp/resource/app-tape/media/common/icon-error.png',
warning: '@/assets/images/common/warning-notice.png',
info: 'https://img01.glsx.com.cn/weapp/resource/app-tape/media/common/icon-info.png'
}
return iconMap[this.type] || iconMap.info
}
},
methods: {
open() {
this.$refs.popup.open("center");
},
close() {
this.$refs.popup.close()
},
// 处理按钮点击事件
handleButtonClick(button) {
if (typeof button.callback === 'function') {
button.callback()
} else {
this.close()
}
// 触发点击事件,传递按钮信息
this.$emit('buttonClick', button)
}
}
}
</script>
<style scoped lang="scss">
.popup-content {
background-color: #fff;
border-radius: toRpx(38);
width: toRpx(848);
height: toRpx(660);
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
overflow: hidden;
}
.popup-icon {
width: 100%;
margin-bottom: toRpx(48);
.icon-image {
width: 100%;
height: toRpx(248);
// border-radius: toRpx(38) toRpx(38) 0 0;
}
}
.popup-title {
font-size: toRpx(40);
font-weight: 500;
color: #333;
margin-bottom: toRpx(16);
text-align: center;
}
.popup-text {
font-size: 28rpx;
color: #666;
text-align: center;
margin-bottom: 32rpx;
line-height: 1.5;
}
.popup-buttons {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
gap: toRpx(32);
margin-top: auto;
height: toRpx(160);
}
.popup-button {
flex: 1;
height: toRpx(80);
line-height: toRpx(80);
text-align: center;
border-radius: toRpx(40);
font-size: toRpx(28);
max-width: toRpx(344);
&.single-button {
max-width: toRpx(688);
}
}
.button-primary {
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #fff;
}
.button-default {
background-color: #f5f5f5;
color: #333;
}
.button-danger {
background-color: #f45001;
color: #fff;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view> <view>
<view class="shop-list"> <view class="shop-list">
<view class="shop-item" v-for="(item, index) in list" :key="item.goods.goodsId"> <view class="shop-item" v-for="(item, index) in list" :key="item.goods.goodsId">
<view class="sprite-icon icon-blue-delete"></view> <view class="sprite-icon icon-blue-delete" @click="deleteGoods(index)"></view>
<view class="right"> <view class="right">
<view class="shop-name">商品名称:{{ item.goods.goodsAlias || item.goods.upgradeGoodsName || <view class="shop-name">商品名称:{{ item.goods.goodsAlias || item.goods.upgradeGoodsName ||
item.goods.goodsInfo.goodsName }}</view> item.goods.goodsInfo.goodsName }}</view>
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
<input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.goods.sellPrice" @blur="validatePrice($event, item, index)" /> <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> </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" @input="validateNumber($event, item)" />
...@@ -105,6 +104,7 @@ export default { ...@@ -105,6 +104,7 @@ export default {
// 更新值 // 更新值
// this.$set(item.goods, 'sellPrice', value) // this.$set(item.goods, 'sellPrice', value)
this.$set(this.list[index].goods, 'sellPrice', value) this.$set(this.list[index].goods, 'sellPrice', value)
this.$emit('changeTotalPrice')
}, },
// 验证数量输入 // 验证数量输入
validateNumber(event, item) { validateNumber(event, item) {
...@@ -117,6 +117,7 @@ export default { ...@@ -117,6 +117,7 @@ export default {
} }
// 更新值 // 更新值
this.$set(item.goods, 'number', value) this.$set(item.goods, 'number', value)
this.$emit('changeTotalPrice')
}, },
// 增加数量 // 增加数量
increaseNumber(item) { increaseNumber(item) {
...@@ -128,6 +129,7 @@ export default { ...@@ -128,6 +129,7 @@ export default {
const newValue = currentValue >= 999 ? 999 : currentValue + 1 const newValue = currentValue >= 999 ? 999 : currentValue + 1
this.$set(item.goods, 'number', newValue.toString()) this.$set(item.goods, 'number', newValue.toString())
} }
this.$emit('changeTotalPrice')
}, },
// 减少数量 // 减少数量
decreaseNumber(item) { decreaseNumber(item) {
...@@ -140,6 +142,12 @@ export default { ...@@ -140,6 +142,12 @@ export default {
// 确保减少后的值不小于1 // 确保减少后的值不小于1
const newValue = Math.max(1, currentValue - 1) const newValue = Math.max(1, currentValue - 1)
this.$set(item.goods, 'number', newValue.toString()) this.$set(item.goods, 'number', newValue.toString())
this.$emit('changeTotalPrice')
},
// 删除商品
deleteGoods(index) {
this.list.splice(index, 1)
this.$emit('changeTotalPrice')
} }
} }
} }
......
...@@ -179,17 +179,17 @@ const FORM_LIST = [ ...@@ -179,17 +179,17 @@ const FORM_LIST = [
}, },
{ {
label: '套餐', label: '套餐',
value: 'couponInfo', value: 'package',
type: 'select', type: 'select',
key: 'name', key: 'name',
// addHtml: 'package' addHtml: 'package'
}, },
{ {
label: '其他精品', label: '其他精品',
value: 'couponInfo', value: 'skuGoods',
type: 'select', type: 'select',
key: 'name', key: 'name',
// addHtml: '' addHtml: 'skuGoods'
}, },
{ {
label: '收款方式', label: '收款方式',
...@@ -320,7 +320,31 @@ const popupTypeEnum = { ...@@ -320,7 +320,31 @@ const popupTypeEnum = {
6: { 6: {
key: 'frontGear', key: 'frontGear',
list: '', list: '',
} },
7: {
key: 'frontWindow',
list: '',
},
8: {
key: 'rearGear',
list: '',
},
9: {
key: 'rearWindow',
list: '',
},
10: {
key: 'sunRoof',
list: '',
},
11: {
key: 'package',
list: '',
},
12: {
key: 'skuGoods',
list: '',
},
} }
export { export {
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<component :is="toolComponentName" @jump="jump" :transmission-of-data="transmissionOfData" /> <component :is="toolComponentName" @jump="jump" :transmission-of-data="transmissionOfData" />
</view> </view>
</view> </view>
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
</view> </view>
</template> </template>
...@@ -31,6 +32,7 @@ import DailyReport from './components/DailyReport.vue' ...@@ -31,6 +32,7 @@ import DailyReport from './components/DailyReport.vue'
import DefeatOrder from './components/DefeatOrder.vue' import DefeatOrder from './components/DefeatOrder.vue'
import OrderManagement from './components/OrderManagement.vue' import OrderManagement from './components/OrderManagement.vue'
import ConfirmOrder from './components/ConfirmOrder.vue' import ConfirmOrder from './components/ConfirmOrder.vue'
import NoticePopup from './components/NoticePopup.vue'
export default { export default {
components: { components: {
Entrance, Entrance,
...@@ -38,7 +40,8 @@ export default { ...@@ -38,7 +40,8 @@ export default {
DailyReport, DailyReport,
DefeatOrder, DefeatOrder,
OrderManagement, OrderManagement,
ConfirmOrder ConfirmOrder,
NoticePopup
}, },
data() { data() {
return { return {
...@@ -52,10 +55,38 @@ export default { ...@@ -52,10 +55,38 @@ export default {
methods: { methods: {
entranceClick(item) { entranceClick(item) {
console.log(item) console.log(item)
this.toolComponentName = item.name // 保存当前选择的组件信息,但不立即切换
if (item.name !== 'CreateOrder') { const selectedItem = item
// 如果当前组件是OrderManagement,直接切换组件,不显示弹窗
if (this.toolComponentName === 'OrderManagement') {
this.toolComponentName = selectedItem.name
this.transmissionOfData = null
return
}
// 配置弹窗按钮
this.$refs.notice.buttons = [{
text: '确认退出',
type: 'default',
callback: () => {
// 点击确认后才切换组件
this.toolComponentName = selectedItem.name
if (selectedItem.name !== 'CreateOrder') {
this.transmissionOfData = null this.transmissionOfData = null
} }
this.$refs.notice.close()
}
}, {
text: '继续编辑',
type: 'primary',
callback: () => {
this.$refs.notice.close()
}
}]
// 打开弹窗
this.$refs.notice.open()
}, },
backPage() { backPage() {
uni.navigateBack() uni.navigateBack()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!