Commit 1eda0ae7 by 李伟康

feat(boutique): 新增商户套餐推荐配置列表查询功能

新增 `getBoutiquePackageList` 方法用于查询商户套餐推荐配置列表,支持通过商户 ID 获取套餐信息,并对返回数据进行格式化处理,包括价格千分位分隔、换行符统一为 `<br>` 标签等。

fix(swiper): 优化轮播组件兼容性与自定义能力

1. 支持双图展示模式(moduleList.length == 2)时的轮播逻辑处理。
2. 增加 noDataObject 属性,支持自定义空状态图标和文案。
3. 添加 custom 插槽支持 swiper 内容自定义。
4. 增加 swiperType 属性用于控制不同展示样式。
5. 修复单张图片时不执行轮播动画的问题。
6. 优化 autoplay 判断逻辑,防止未启用自动播放时仍执行动画。
7. 修复 moduleList 为空时未重置 imagelist 和 datalist 的问题。

feat(home-frame): 支持首页框架中自定义轮播内容

在 HomeFrame 组件中增加 swiperCustom 属性,允许通过插槽传入自定义轮播组件。同时调整埋点逻辑,在 sceneType 不为 0 时不触发产品介绍点击事件。

chore(api): 更新本地开发环境 IP 地址

将 http.js 中的本地开发服务器地址从 `http://192.168.1.169:8292` 更改为 `http://192.168.1.67:8392`。

feat(boutique): 实现套餐详情弹窗组件及展示逻辑

1. 新增 PackageDetailPopup 弹窗组件,用于展示套餐详情内容。
2. 在 boutique 页面中集成套餐详情弹窗,展示富文本格式的套餐内容和介绍。
3. 新增套餐列表获取方法 `getBoutiquePackageList`,并替换原有 moduleList 使用 packageList。
4. 调整轮播组件使用方式,使用自定义插槽实现套餐信息展示。
5. 引入套餐默认图片资源 package-1.webp 和 package-2.webp。

feat(invitation): 增加流量有效性字段展示

在邀请记录列表中新增“流量有效性”字段,并根据值显示“有效客户”或“无效客户”,默认显示“-”。

style(component): 优化样式命名与结构

统一组件中的 class 命名规范,调整部分样式缩进,优化 SwiperComponent 中 type-2 类型的样式布局,提升视觉效果。
1 parent 6e85274c
......@@ -345,5 +345,15 @@ module.exports = {
projectName: 'boutique',
...data
})
},
/**
* 查询商户套餐推荐配置列表
*/
getBoutiquePackageList(data){
return http.post({
method: 'dj.api.smartcarlife.receptionMaterialRecommendPackageConfig.getByMerchantId',
projectName: 'boutique',
...data
})
}
}
......@@ -11,7 +11,7 @@ const HOST = {
scrm: domain,
dj: djDomain,
merchant: merchantDomain,
ip: "http://192.168.1.169:8292",
ip: "http://192.168.1.67:8392",
};
class Request {
get (params, returnAll = false, hostType) {
......
No preview for this file type
No preview for this file type
......@@ -31,13 +31,19 @@
<view class="module-box box-class">
<view class="common-title">产品介绍</view>
<view class="content-box">
<swiper-component
:moduleList="moduleList"
@click="swiperClick"
:stopAutoPlay="previewOff"
:imgKey="bannerKey"
:loadComplete="loadComplete"
></swiper-component>
<template v-if="swiperCustom">
<slot name="swiperCustom" />
</template>
<template v-else>
<swiper-component
:moduleList="moduleList"
@click="swiperClick"
:stopAutoPlay="previewOff"
:imgKey="bannerKey"
:loadComplete="loadComplete"
>
</swiper-component>
</template>
</view>
</view>
<view class="tool-box box-class">
......@@ -209,6 +215,7 @@ export default {
},
bannerKey: String,
loadComplete: Boolean,
swiperCustom: Boolean,
},
data () {
return {
......@@ -380,9 +387,9 @@ export default {
}
},
swiperClick (e) {
uni.$track.add({
if (this.sceneType == 0) uni.$track.add({
eventCode: 'app_product_Introduction'
})
}) //轻改场景不埋点
this.previewOff = true
this.$emit('swiperClick', e)
},
......
<template>
<view class="swiper-box">
<view :class="['swiper-box',{'type-2':swiperType == 2}]">
<template v-if="loadComplete">
<template v-if="moduleList.length">
<movable-area
class="swiper-carousel"
......@@ -15,19 +14,28 @@
@click.stop="changeBlock(item)"
direction="horizontal"
@change="change"
:disabled="item.class != 'block-center'"
:disabled="item.class != 'block-center' || moduleList.length == 1"
:x="item.class != 'block-center' ? 0 : viewX"
:data-index="item.isIndex"
v-if="item.imgUrl"
>
<image
class="image-block"
:src="item.imgUrl"
@load="item.hide = true"
/>
<view
class="bg"
v-if="item.hide"
></view>
<template v-if="custom">
<slot
:content="item"
name="swiper"
></slot>
</template>
<template v-else>
<image
class="image-block"
:src="item.imgUrl"
@load="item.hide = true"
/>
<view
class="bg"
v-if="item.hide"
></view>
</template>
<!-- <view :class="['error-block',{hide:item.hide}]">
<uni-icons
:type="icon"
......@@ -53,7 +61,14 @@
</template>
<template v-else>
<view class="nothing flex">
该场景尚未配置素材,请联系总部人员
<template v-if="noDataObject.icon">
<image
:src="noDataObject.icon"
class="icon"
:style="noDataObject.style"
/>
</template>
{{noDataObject.text || '该场景尚未配置素材,请联系总部人员'}}
</view>
</template>
</template>
......@@ -75,7 +90,6 @@
</template>
<script>
import utils from "@/utils/utils.js";
export default {
name: 'SwiperComponent',
props: {
......@@ -107,11 +121,21 @@ export default {
type: Boolean,
default: false
},
loadComplete: Boolean
loadComplete: Boolean,
noDataObject: {
type: Object,
default: () => ({})
},
custom: Boolean,
swiperType: [Number, String]
},
watch: {
moduleList: {
handler (val) {
if (!val.length) {
this.datalist = []
this.imagelist = []
}
if (val.length && !this.imagelist.length) this.getDatalist()
},
deep: true
......@@ -125,7 +149,7 @@ export default {
},
computed: {
moduleTitle () {
return this.moduleList[this.currentIndex]?.detailTitle
return this.moduleList[this.currentIndex]?.detailTitle || ''
}
},
created () {
......@@ -159,6 +183,7 @@ export default {
methods: {
getDatalist () {
if (this.moduleList) {
this.currentIndex = 0
this.datalist = JSON.parse(JSON.stringify(this.moduleList))
let num = 3
let diff = num - this.moduleList.length
......@@ -173,18 +198,20 @@ export default {
}
},
getImagelist () {
let { datalist, autoplay } = this
this.imagelist = JSON.parse(JSON.stringify(this.style_object))
let { datalist, autoplay, style_object } = this
this.imagelist = JSON.parse(JSON.stringify(style_object))
this.imagelist.forEach((item, index) => {
const dataIndex = index - 1 < 0 ? datalist.length - 1 : index - 1
item.isIndex = dataIndex
item.isToor = index
item.imgUrl = datalist[dataIndex]?.[this.imgKey] || ''
item.originalData = datalist[dataIndex]
item.x = 0
})
if (autoplay) this.autoPlayFunction()
},
autoPlayFunction () {
if (!this.autoplay) return
if (this.stopAutoPlay || !this.playStatus) {
if (this.autoPlayTimer) {
clearTimeout(this.autoPlayTimer);
......@@ -200,42 +227,56 @@ export default {
this.autoPlayTimer = null;
return;
}
// 执行轮播动画并递归调用自身
this.updateCarouselPositions();
this.autoPlayFunction();
}, this.interval);
},
updateCarouselPositions (direction = 'left') {
let { imagelist, datalist } = this,
let { imagelist, datalist, moduleList } = this,
len = datalist.length - 1,
list = JSON.parse(JSON.stringify(this.style_object))
this.imagelist.forEach(item => {
let toor = direction == 'left' ?
(item.isToor - 1) < 0 ? imagelist.length - 1 : item.isToor - 1
: (item.isToor + 1) > imagelist.length - 1 ? 0 : item.isToor + 1
item.isToor = toor
item.imgUrl = ''
item.class = list[toor].class
item.x = 0
let isIndex = item.isIndex
if (direction == 'left' && item.class == 'block-right') {
if (isIndex == len) isIndex = 2
else if (isIndex == len - 1) isIndex = 1
else isIndex += 3
if (isIndex > len) isIndex = 0
}
if (direction == 'right' && item.class == 'block-left') {
if (isIndex == 1) isIndex = len - 1
else if (isIndex == 0) isIndex = len - 2
else isIndex -= 3
if (isIndex < 0) isIndex = len
}
item.isIndex = isIndex
item.imgUrl = datalist[isIndex][this.imgKey] || ''
item.index = list[toor].index
})
if (moduleList.length == 2) {
this.imagelist.forEach((item, index) => {
if (index != 0) {
let toor = item.isToor == 1 ? 2 : 1
item.isToor = toor
item.imgUrl = ''
item.class = list[toor].class
item.x = 0
let isIndex = item.isIndex
item.isIndex = isIndex
item.imgUrl = datalist[isIndex][this.imgKey] || ''
item.index = list[toor].index
}
})
} else {
this.imagelist.forEach(item => {
let toor = direction == 'left' ?
(item.isToor - 1) < 0 ? imagelist.length - 1 : item.isToor - 1
: (item.isToor + 1) > imagelist.length - 1 ? 0 : item.isToor + 1
item.isToor = toor
item.imgUrl = ''
item.class = list[toor].class
item.x = 0
let isIndex = item.isIndex
if (direction == 'left' && item.class == 'block-right') {
if (isIndex == len) isIndex = 2
else if (isIndex == len - 1) isIndex = 1
else isIndex += 3
if (isIndex > len) isIndex = 0
}
if (direction == 'right' && item.class == 'block-left') {
if (isIndex == 1) isIndex = len - 1
else if (isIndex == 0) isIndex = len - 2
else isIndex -= 3
if (isIndex < 0) isIndex = len
}
item.isIndex = isIndex
item.imgUrl = datalist[isIndex][this.imgKey] || ''
item.index = list[toor].index
})
}
let currentIndex = this.imagelist.findIndex(item => item.index == 1)
this.currentIndex = this.imagelist[currentIndex].isIndex
},
......@@ -255,10 +296,12 @@ export default {
}
},
ends (e) {
let { moduleList } = this
if (moduleList.length == 1) return
let { blockX, ismove } = this
let pageX = e.changedTouches[0].pageX
let nums = ismove - pageX
if(nums == 0) return
if (nums == 0) return
if (!(nums > 50 || blockX < -30) || !(nums < -50 || blockX > 30)) {
this.viewX = -10
setTimeout(() => {
......@@ -267,8 +310,6 @@ export default {
}
if (nums > 50 || blockX < -30) this.updateCarouselPositions()
if (nums < -50 || blockX > 30) this.updateCarouselPositions('right')
this.endTimer = setTimeout(() => {
if (!this.playStatus) {
this.playStatus = true
......@@ -290,7 +331,7 @@ export default {
width: 100%;
height: 100%;
justify-content: center;
.gif{
.gif {
width: toRpx(64);
height: toRpx(64);
}
......@@ -351,7 +392,6 @@ export default {
justify-content: center;
z-index: 1;
}
.hide {
opacity: 0;
}
......@@ -361,7 +401,6 @@ export default {
top: toRpx(68);
height: toRpx(306);
width: toRpx(468);
transition: all 0.1s;
}
.block-left {
......@@ -410,5 +449,36 @@ export default {
justify-content: center;
color: #999;
font-size: toRpx(20);
flex-direction: column;
.icon {
width: toRpx(344);
height: toRpx(236);
}
}
.type-2 {
.swiper-carousel {
height: toRpx(460);
.block-left,
.block-right {
top: toRpx(68);
height: toRpx(306);
width: toRpx(604);
transition: all 0.1s;
}
.block-left {
left: toRpx(88);
z-index: 10;
}
.block-right {
left: toRpx(508);
z-index: 15;
}
.block-center {
left: toRpx(180);
top: toRpx(10);
width: toRpx(848);
height: toRpx(428);
}
}
}
</style>
</style>
\ No newline at end of file
<template>
<uni-popup
ref="packageDetailPopupRef"
type="center"
:is-mask-click="false"
animation
class="center-popup"
>
<view class="box">
<view class="title flex">
<view class="text">套餐详情</view>
<view
class="icon-close-box flex"
@click="close"
>
<uni-icons
class="icon-close"
type="closeempty"
:size="20"
color="#1A1A1A"
></uni-icons>
</view>
</view>
<view class="content">
<slot />
</view>
</view>
</uni-popup>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'PackageDetailPopup',
props: {
},
data () {
return {
}
},
mounted () {
},
methods: {
open () {
this.$refs.packageDetailPopupRef.open();
},
close () {
this.$refs.packageDetailPopupRef.close();
this.$emit('cancel')
},
}
}
</script>
<style scoped lang='scss'>
.center-popup {
z-index: 99 !important;
}
.box {
width: toRpx(1400);
max-height: 80vh;
min-height: 32vh;
background: #ffffff;
border-radius: toRpx(48);
overflow: auto;
.title {
width: 100%;
height: toRpx(160);
background-color: #fff;
background-image: url('@/assets/images/boutique/customer-type-bg.webp');
background-repeat: no-repeat;
background-size: 100% 100%;
position: sticky;
top: 0;
z-index: 2;
.text {
font-weight: 500;
font-size: toRpx(40);
color: #1a1a1a;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.icon-close-box {
height: 100%;
margin-left: auto;
padding: 0 toRpx(48);
font-weight: 700;
}
}
.content {
width: 100%;
// height: toRpx(768);
}
}
</style>
\ No newline at end of file
......@@ -72,6 +72,7 @@
>
<view class="label">{{ k.label }}</view>
<view class="value">{{
k.formatter ? k.formatter(item[k.key]):
k.format
? formatTime(item[k.key], k.key)
: item[k.key] || "-"
......@@ -140,6 +141,14 @@ export default {
{ label: '礼券名称', key: 'couponName' },
{ label: '领券时间', key: 'receiveCouponDate', format: true },
{ label: '销售顾问', key: 'employeeName' },
{
label: '流量有效性', key: 'trafficEffectiveness', formatter: (val) => {
return {
1: '有效客户',
2: '无效客户'
}[val] || '-'
}
},
],
chooseItem: {}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!