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 @@
<view class="mask-box"></view>
</template>
<template v-else>
<view class="type-box-v2">
<view
:class="['tab-item',{active:tabIndex == index}]"
v-for="(i, index) in typeList"
:key="index"
@click="tabClick(index)"
>
<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] }}
<scroll-view
scroll-x
enable-flex
class="scroll-box"
:scroll-into-view="`tab-id-${tabIndex}`"
>
<view class="type-box-v2">
<view
:class="['tab-item',{active:tabIndex == index}]"
v-for="(i, index) in typeList"
:key="index"
@click="tabClick(index)"
:id="`tab-id-${index}`"
>
<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>
</scroll-view>
</template>
</view>
</template>
......@@ -69,13 +78,14 @@ export default {
data () {
return {
firstClass: Object.freeze(['first-nav', 'second-nav']),
viewIndex: ''
}
},
computed: {
blockLeft () {
let { tabIndex } = this
return `${(tabIndex * 400) - (tabIndex == 0 ? 0 : 48)}rpx`
}
},
},
mounted () {
},
......@@ -90,7 +100,9 @@ export default {
return className
},
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('tabClick', index)
}
......@@ -156,6 +168,9 @@ export default {
border-radius: toRpx(48);
overflow: hidden;
}
.scroll-box {
width: 100%;
}
.type-box-v2 {
position: relative;
display: flex;
......@@ -166,13 +181,12 @@ export default {
border-radius: toRpx(48) toRpx(48) 0 0;
z-index: 0;
flex-wrap: nowrap;
overflow-x: auto;
gap: 0 toRpx(80);
.tab-item {
padding: 0 toRpx(40);
flex-shrink: 0;
position: relative;
&:first-of-type{
&:first-of-type {
padding-left: toRpx(80);
}
.text {
......
......@@ -932,7 +932,7 @@ export default {
}
orderObj.city = city
}
if (customerInfo.carPrice) orderObj.price = customerInfo.carPrice
if (customerInfo.carPrice) orderObj.price = this.divideByHundred(customerInfo.carPrice)
if (customerInfo.salesUuid) {
orderObj.referrerId = customerInfo.salesUuid
orderObj.referrer = customerInfo.salesName
......
......@@ -425,8 +425,10 @@ export default {
break
case 'price':
// 处理去报价
this.$emit('jump', 'CreateOrder', { paramsData: this.orderCardDetail, type: 'CreateOrder' })
break
case 'pay':
this.$emit('openPay',this.orderCardDetail)
// 处理去支付
break
case 'defeat':
......
......@@ -22,9 +22,14 @@
</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">
<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>
<OrderScreenContract ref="openFilter" @onConfirm="openFilterConfirm" />
<!-- 支付弹框 -->
<OrderPay
ref="OrderPay"
@jumpSuccess="jumpSuccess"
/>
</view>
</template>
......@@ -37,13 +42,16 @@ import PublishPopup from '@/components/PublishPopup.vue'
import dayjs from 'dayjs'
import utils from '@/utils/utils'
import OrderScreenContract from '@/components/OrderScreenContract/index.vue'
import OrderPay from './OrderPay.vue'
export default {
name: 'OrderManagement',
mixins: [ZPMixin, interceptionMixin],
components: {
OrderCard,
PublishPopup,
OrderScreenContract
OrderScreenContract,
OrderPay
},
computed: {
orderObj() {
......@@ -302,7 +310,13 @@ export default {
jump(name, val) {
console.log(name, val, 'jump')
this.$emit('jump', name, val)
}
},
openPay(item){
this.$refs.OrderPay.open(item.id)
},
jumpSuccess (params) {
this.$emit('jump', 'OrderDetail', params)
},
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!