Commit c38ab0aa by 李伟康

feat(TypeTabComponent): 优化标签页滚动效果并修复样式问题

- 使用 scroll-view 实现横向可滚动的标签栏,提升用户体验
- 调整 tab-item 样式,修复首项内边距问题
- 增加 scroll-into-view 功能,使当前选中项自动居中显示
- 更新相关 CSS 样式以支持新结构,并移除旧的 overflow-x 设置

fix(CreateOrder): 修正订单价格未正确转换为分的问题

- 在设置订单价格时,调用 divideByHundred 方法确保单位统一为分

feat(OrderCard): 新增跳转和支付事件触发功能

- 添加点击“去报价”时触发 jump 事件逻辑
- 补充点击“去支付”时触发 openPay 事件处理

feat(OrderManagement): 集成订单支付弹窗组件及联动逻辑

- 引入 OrderPay 组件作为支付弹窗使用
- 新增 openPay 方法用于打开支付窗口
- 增加 jumpSuccess 回调方法,在支付成功后跳转至详情页
1 parent bbf2f1f9
...@@ -25,25 +25,34 @@ ...@@ -25,25 +25,34 @@
<view class="mask-box"></view> <view class="mask-box"></view>
</template> </template>
<template v-else> <template v-else>
<view class="type-box-v2">
<view <scroll-view
:class="['tab-item',{active:tabIndex == index}]" scroll-x
v-for="(i, index) in typeList" enable-flex
:key="index" class="scroll-box"
@click="tabClick(index)" :scroll-into-view="`tab-id-${tabIndex}`"
> >
<template v-if="index == 0"> <view class="type-box-v2">
<view class="sprite-icon icon-first-right"></view> <view
</template> :class="['tab-item',{active:tabIndex == index}]"
<template v-else> v-for="(i, index) in typeList"
<view class="sprite-icon icon-second-left"></view> :key="index"
<view class="sprite-icon icon-second-right"></view> @click="tabClick(index)"
</template> :id="`tab-id-${index}`"
<view class="text"> >
{{ i[nameKey] }} <template v-if="index == 0">
<view class="sprite-icon icon-first-right"></view>
</template>
<template v-else>
<view class="sprite-icon icon-second-left"></view>
<view class="sprite-icon icon-second-right"></view>
</template>
<view class="text">
{{ i[nameKey] }}
</view>
</view> </view>
</view> </view>
</view> </scroll-view>
</template> </template>
</view> </view>
</template> </template>
...@@ -69,13 +78,14 @@ export default { ...@@ -69,13 +78,14 @@ export default {
data () { data () {
return { return {
firstClass: Object.freeze(['first-nav', 'second-nav']), firstClass: Object.freeze(['first-nav', 'second-nav']),
viewIndex: ''
} }
}, },
computed: { computed: {
blockLeft () { blockLeft () {
let { tabIndex } = this let { tabIndex } = this
return `${(tabIndex * 400) - (tabIndex == 0 ? 0 : 48)}rpx` return `${(tabIndex * 400) - (tabIndex == 0 ? 0 : 48)}rpx`
} },
}, },
mounted () { mounted () {
}, },
...@@ -90,7 +100,9 @@ export default { ...@@ -90,7 +100,9 @@ export default {
return className return className
}, },
tabClick (index) { tabClick (index) {
if(this.tabIndex == index) return if (this.tabIndex == index) return
// this.viewIndex = `tab-id-${index}`
// console.log(this.viewIndex)
this.$emit('update:tabIndex', index) this.$emit('update:tabIndex', index)
this.$emit('tabClick', index) this.$emit('tabClick', index)
} }
...@@ -156,6 +168,9 @@ export default { ...@@ -156,6 +168,9 @@ export default {
border-radius: toRpx(48); border-radius: toRpx(48);
overflow: hidden; overflow: hidden;
} }
.scroll-box {
width: 100%;
}
.type-box-v2 { .type-box-v2 {
position: relative; position: relative;
display: flex; display: flex;
...@@ -166,13 +181,12 @@ export default { ...@@ -166,13 +181,12 @@ export default {
border-radius: toRpx(48) toRpx(48) 0 0; border-radius: toRpx(48) toRpx(48) 0 0;
z-index: 0; z-index: 0;
flex-wrap: nowrap; flex-wrap: nowrap;
overflow-x: auto;
gap: 0 toRpx(80); gap: 0 toRpx(80);
.tab-item { .tab-item {
padding: 0 toRpx(40); padding: 0 toRpx(40);
flex-shrink: 0; flex-shrink: 0;
position: relative; position: relative;
&:first-of-type{ &:first-of-type {
padding-left: toRpx(80); padding-left: toRpx(80);
} }
.text { .text {
......
...@@ -932,7 +932,7 @@ export default { ...@@ -932,7 +932,7 @@ export default {
} }
orderObj.city = city orderObj.city = city
} }
if (customerInfo.carPrice) orderObj.price = customerInfo.carPrice if (customerInfo.carPrice) orderObj.price = this.divideByHundred(customerInfo.carPrice)
if (customerInfo.salesUuid) { if (customerInfo.salesUuid) {
orderObj.referrerId = customerInfo.salesUuid orderObj.referrerId = customerInfo.salesUuid
orderObj.referrer = customerInfo.salesName orderObj.referrer = customerInfo.salesName
......
...@@ -425,8 +425,10 @@ export default { ...@@ -425,8 +425,10 @@ export default {
break break
case 'price': case 'price':
// 处理去报价 // 处理去报价
this.$emit('jump', 'CreateOrder', { paramsData: this.orderCardDetail, type: 'CreateOrder' })
break break
case 'pay': case 'pay':
this.$emit('openPay',this.orderCardDetail)
// 处理去支付 // 处理去支付
break break
case 'defeat': case 'defeat':
......
...@@ -22,9 +22,14 @@ ...@@ -22,9 +22,14 @@
</view> </view>
<z-paging ref="paging" :fixed="false" paging-class="paging-class px-48" :loading-full-fixed="false" :auto-show-system-loading="true" :show-scrollbar="false" v-model="dataList" @query="queryList" :default-page-size="10"> <z-paging ref="paging" :fixed="false" paging-class="paging-class px-48" :loading-full-fixed="false" :auto-show-system-loading="true" :show-scrollbar="false" v-model="dataList" @query="queryList" :default-page-size="10">
<OrderCard v-for="(item, index) in dataList" :key="index" :orderCardDetail="item" @toggle-goods-list="handleToggleGoodsList" @jump="jump" @refresh="search()"></OrderCard> <OrderCard v-for="(item, index) in dataList" :key="index" :orderCardDetail="item" @toggle-goods-list="handleToggleGoodsList" @jump="jump" @refresh="search()" @openPay="openPay"></OrderCard>
</z-paging> </z-paging>
<OrderScreenContract ref="openFilter" @onConfirm="openFilterConfirm" /> <OrderScreenContract ref="openFilter" @onConfirm="openFilterConfirm" />
<!-- 支付弹框 -->
<OrderPay
ref="OrderPay"
@jumpSuccess="jumpSuccess"
/>
</view> </view>
</template> </template>
...@@ -37,13 +42,16 @@ import PublishPopup from '@/components/PublishPopup.vue' ...@@ -37,13 +42,16 @@ import PublishPopup from '@/components/PublishPopup.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import utils from '@/utils/utils' import utils from '@/utils/utils'
import OrderScreenContract from '@/components/OrderScreenContract/index.vue' import OrderScreenContract from '@/components/OrderScreenContract/index.vue'
import OrderPay from './OrderPay.vue'
export default { export default {
name: 'OrderManagement', name: 'OrderManagement',
mixins: [ZPMixin, interceptionMixin], mixins: [ZPMixin, interceptionMixin],
components: { components: {
OrderCard, OrderCard,
PublishPopup, PublishPopup,
OrderScreenContract OrderScreenContract,
OrderPay
}, },
computed: { computed: {
orderObj() { orderObj() {
...@@ -302,7 +310,13 @@ export default { ...@@ -302,7 +310,13 @@ export default {
jump(name, val) { jump(name, val) {
console.log(name, val, 'jump') console.log(name, val, 'jump')
this.$emit('jump', name, val) this.$emit('jump', name, val)
} },
openPay(item){
this.$refs.OrderPay.open(item.id)
},
jumpSuccess (params) {
this.$emit('jump', 'OrderDetail', params)
},
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!