Commit 61c12612 by 李伟康

commit 客户案例广场

1 parent 526dcf0f
......@@ -47,6 +47,21 @@
<script type='text/ecmascript-6'>
export default {
name: 'CarBrands',
props: {
carBrandKey: {//品牌key
type: String,
default: 'carBrand'
},
carModelKey: {//车型key
type: String,
default: 'carModel'
},
echoData: {
type: Object,
default: () => ({})
},
customBoolean: Boolean
},
data () {
return {
carlist: [],
......@@ -68,13 +83,13 @@ export default {
return this.$store.state.user.historyStatus
},
carModel () {
return this.$store.state.user.customerInfo.carModel
return this.customBoolean ? this.echoData[this.carModelKey] : this.$store.state.user.customerInfo.carModel
},
carBrandList () {
return this.$store.state.user.carBrands || []
},
carBrand () {
return this.$store.state.user.customerInfo.carBrand
return this.customBoolean ? this.echoData[this.carBrandKey] : this.$store.state.user.customerInfo.carBrand
},
boutiqueDefaultCarBrandId () {
return this.$store.state.user.boutiqueDefaultCarBrandId
......@@ -127,7 +142,7 @@ export default {
},
selectCar (e, auto = false, index, autoHideLoading = true) {
let { clickFlga } = this
if (clickFlga) return
if (clickFlga) return
this.clickFlga = true
this.selectItem = {
carBrand: e.brandName,
......@@ -192,19 +207,19 @@ export default {
.select-box {
margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
.select-item {
text-align: center;
height: 68rpx;
line-height: 68rpx;
line-height: 44rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
font-size: 28rpx;
color: #333;
font-size: 32rpx;
border-radius: 8rpx;
&.checked {
border: 2rpx solid #292d33;
......
......@@ -3,8 +3,8 @@
ref="customerTagstVisible"
position="bottom"
:isFooter="false"
title="请选择客户标签"
:maxHeight="1000"
:title="title"
:maxHeight="1040"
@close="$emit('close')"
>
<view class="select-views">
......@@ -33,10 +33,10 @@
<view class="footer-btns">
<view
class="btn cancel"
@click="close"
>取消</view>
@click="clearSwitch ? clear() : close()"
>{{cancelText}}</view>
<view
:class="['btn',{disabled:component_chooseList.length == 0}]"
:class="['btn',{disabled: disabled}]"
@click="choose"
>确定</view>
</view>
......@@ -47,7 +47,27 @@
export default {
name: 'CustomerTags',
props: {
chooseList: Array
chooseList: Array,
title: {
type: String,
default: '请选择客户标签'
},
disabledSwitch: {
type: Boolean,
default: true
},
cancelText: {
type: String,
default: '取消'
},
clearSwitch: {
type: Boolean,
default: false
},
sceneNumber: {
type: [Number, String],
default: -1
}
},
data () {
return {
......@@ -73,6 +93,9 @@ export default {
watchStatus () {
return this.$store.state.user.historyStatus
},
disabled () {
return this.disabledSwitch && this.component_chooseList.length == 0
}
},
mounted () {
},
......@@ -80,10 +103,11 @@ export default {
open () {
this.$refs.customerTagstVisible.open()
const userInfo = uni.$storage.get("userInfo"),
{ sceneType } = userInfo;
{ sceneType } = userInfo,
{ sceneNumber } = this
uni.$api.customerApi
.findCustomerTags({
scene: sceneType,
scene: sceneNumber > -1 ? sceneNumber : sceneType,
})
.then((res) => {
this.list = res || []
......@@ -105,9 +129,14 @@ export default {
return component_chooseList.findIndex(e => e.labelId == item.labelId) != -1
},
choose () {
if (this.component_chooseList.length == 0) return
if (this.disabled) return
this.$emit('select', this.component_chooseList)
this.close();
},
clear () {
console.log(123)
this.component_chooseList = []
this.$forceUpdate()
}
}
}
......@@ -116,7 +145,7 @@ export default {
<style scoped lang='scss'>
.select-views {
overflow-y: scroll;
max-height: 50vh;
max-height: 60vh;
position: relative;
padding-bottom: 128rpx;
.select-group {
......@@ -129,20 +158,21 @@ export default {
.select-box {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
.select-item {
text-align: center;
justify-content: center;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
font-size: 28rpx;
color: #333;
font-size: 32rpx;
border-radius: 8rpx;
position: relative;
box-sizing: border-box;
padding:13rpx 40rpx;
padding: 13rpx 40rpx;
word-break: break-all;
line-height: 44rpx;
.sprite-icon {
display: none;
position: absolute;
......
......@@ -85,19 +85,19 @@ export default {
.select-box {
margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
.select-item {
text-align: center;
height: 68rpx;
line-height: 68rpx;
line-height: 44rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
font-size: 28rpx;
color: #333;
font-size: 32rpx;
border-radius: 8rpx;
&.checked {
border: 2rpx solid #292d33;
......
<template>
<view
class="case-item"
@click="jumpDetail(item)"
>
<image
class="img"
:src="item.cover"
:style="imgStyle"
mode="aspectFill"
></image>
<view class="case-info">
<view class="case-name text-hide">{{ item.title }}</view>
<template v-for="(j, ind) in caseInfo">
<view
class="case-text flex"
:key="ind"
>
<view class="case-label">{{ j.label }}:</view>
<view :class="['case-value', j.class]">
<template v-if="j.format">
{{ j.format(item) }}
</template>
<template v-else>
{{ item[j.key] || '--' }}
</template>
</view>
</view>
</template>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'CaseItem',
props: {
item: Object,
source: {
type: Number,
default: 1
},
visitsId: [Number, String],
imgStyle: String
},
data () {
return {
caseInfo: [
{
label: '业务场景',
class: 'text-hide',
format: (val) => {
// 业务场景:0-会员权益/升级;1-精品升级;2-次新车转化;3-售后众筹;4-积分商城
return val ? {
0: '会员权益/升级',
1: '精品升级',
2: '次新车转化',
3: '售后众筹',
4: '积分商城'
}[val.scene] : '--'
}
},
{
label: '客户标签',
key: 'tags',
class: 'text-hide'
},
{
label: '适用套餐',
key: 'goods',
class: 'text-two-line'
},
],
}
},
mounted () {
},
methods: {
jumpDetail (item) {
const { source, visitsId } = this
let params = `id=${item.id}&source=${source}`
if (visitsId) params += `&visitsId=${visitsId}`
// 类型:0-图片;1-视频;2-pdf;3-富文本
let url = `/pages/common/caseDetail?${params}`
if (item.type != 3) {
let fileUrl = item?.detailInfos[0]?.image
if (item.type == 2) url = `/pages/common/webview?fileUrl=${fileUrl}&title=${item.title}&${params}`
if (item.type == 1 || item.type == 0) url = `/pages/boutique/preview?tabName=${item.title}&sourceType=${item.type == 1 ? 2 : 1}&detailUrl=${fileUrl}&${params}`
}
uni.navigateTo({
url: `${url}`
})
},
}
}
</script>
<style scoped lang='scss'>
.case-item {
width: 100%;
height: 100%;
background: #ffffff;
box-shadow: 0 8rpx 24rpx 0 #2c66f71a;
border-radius: 16rpx;
display: flex;
flex-direction: column;
overflow: hidden;
.img {
width: 100%;
height: 324rpx;
}
.case-name {
font-weight: 500;
font-size: 28rpx;
color: #333333;
line-height: 48rpx;
padding: 16rpx 32rpx 8rpx;
}
.case-text {
align-items: flex-start;
font-size: 24rpx;
color: #666666;
line-height: 40rpx;
padding: 0 32rpx;
margin-bottom: 2rpx;
}
.case-label {
width: 120rpx;
flex-shrink: 0;
}
}
</style>
\ No newline at end of file
......@@ -89,6 +89,10 @@
<car-brands
ref="carBrandVisible"
@select="handleSelect($event,'carBrandVisible')"
:echoData="customerInfo"
carBrandKey="carBrand"
carModelKey="brandModel"
customBoolean
/>
<customer-tags
ref="customerTagstVisible"
......@@ -268,6 +272,7 @@ export default {
if (popkey == 'carBrandVisible') {
this.$refs.carBrandVisible.close()
this.customerInfo.brandModel = item.name
this.customerInfo.carBrand = item.carChildsBrandName
} else if (popkey == 'customerTagstVisible') {
let names = [],
ids = []
......
......@@ -25,12 +25,12 @@
export default {
name: 'ReceptionSence',
props: {
customerInfo:Object
customerInfo: Object
},
data () {
return {
list:[],
id:''
list: [],
id: ''
}
},
watch: {
......@@ -52,7 +52,7 @@ export default {
watchStatus () {
return this.$store.state.user.historyStatus
},
watchCustomerInfo() {
watchCustomerInfo () {
return this.customerInfo
},
},
......@@ -70,7 +70,7 @@ export default {
})
.then((res) => {
this.list = res || []
}).catch(err =>{
}).catch(err => {
this.list = []
})
},
......@@ -90,15 +90,15 @@ export default {
.select-box {
margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
.select-item {
text-align: center;
height: 68rpx;
line-height: 68rpx;
line-height: 44rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
......
const target = ["ip", "dev", "uat", "prod", "beta"];
const index = 2;
const index = 1;
/**
*
0本地
......
export default {
data() {
data () {
return {
goodsId: '',
visitsId: ''
visitsId: '',
source: 1
}
},
onLoad(options) {
this.visitsId = options.visitsId
onLoad (options) {
this.visitsId = options.visitsId || ''
this.goodsId = options.id
if (options.source) this.source = options.source
this.addRecord()
},
methods: {
addRecord() {
addRecord () {
const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo')
const params = {
goodsId: this.goodsId,
goodsType: 0,
merchantId,
merchantName,
visitsId: this.visitsId
searchSource: this.source
}
if (this.visitsId) params.visitsId = this.visitsId
uni.$api.commonApi.addRecord(params).then(res => {
this.addId = res
})
}
},
onUnload() {
onUnload () {
const params = {
id: this.addId,
visitsId: this.visitsId
id: this.addId
}
if (this.visitsId) params.visitsId = this.visitsId
uni.$api.commonApi.leaveRecord(params).then(res => {
console.log(res, 888)
})
......
......@@ -85,7 +85,7 @@
<template v-if="customerType == 1">
<template v-if="pageParams.received">
<view class="ok">
<view class="ok-status"></view>
<view class="ok-status"></view>
<!-- <image
class="ok-status"
src="@/assets/images/boutique/ok-status.webp"
......@@ -94,11 +94,15 @@
</view>
</template>
<template v-else>
<image v-if="pageParams.QRURL"
<image
v-if="pageParams.QRURL"
class="qr-code-img"
:src="pageParams.QRURL"
/>
<view v-else class="no-data">
<view
v-else
class="no-data"
>
<view class="no-data-img"></view>
<!-- <image
src="@/assets/images/boutique/no-data.webp"
......@@ -231,7 +235,7 @@ export default {
watch: {
watchCustomerInfo: {
immediate: true,
handler(newval) {
handler (newval) {
this.customerInfo = Object.assign(this.customerInfo, newval)
try {
// 监听完成接待修改数据,同步修改生成优惠券按钮状态
......@@ -246,7 +250,7 @@ export default {
},
watchStatus: {
immediate: true,
handler(newval) {
handler (newval) {
this.close()
this.closeAllPopup()
this.pageParams.QRURL = ''
......@@ -260,7 +264,7 @@ export default {
}
}
},
show() {
show () {
this.closeAllPopup()
}
},
......@@ -293,7 +297,7 @@ export default {
}
},
mounted () {
},
methods: {
init () {
......@@ -332,7 +336,7 @@ export default {
const { customerName, phoneNumber, staffName } = this.customerInfo
this.isCheck = customerName && phoneNumber && staffName
},
chooseCoupon(item) {
chooseCoupon (item) {
this.pageParams.couponId = item.id
this.customerInfo.couponTypeName = item.couponTypeName
this.$store.dispatch('setCustomerInfo', this.customerInfo)
......@@ -349,12 +353,12 @@ export default {
this.$refs[e].open();
this.$emit('hideTool')
},
open(customerType, customerCouponId) {
open (customerType, customerCouponId) {
this.$refs.couponPopup.open()
this.customerType = customerType
if (customerCouponId) {
this.pageParams.customerCouponId = customerCouponId
this.pageParams.customerQr = qrcode.createQrCodeImg(`couponId=${customerCouponId}`, {size: 200})
this.pageParams.customerQr = qrcode.createQrCodeImg(`couponId=${customerCouponId}`, { size: 200 })
}
this.init()
try {
......@@ -367,7 +371,7 @@ export default {
close () {
this.$refs.couponPopup?.close()
},
handleSelect(item, popkey) {
handleSelect (item, popkey) {
console.log(item, popkey)
this.$refs[popkey].close();
if (popkey == "employeeBoxVisible") {
......@@ -404,7 +408,7 @@ export default {
}
return flag
},
async createCoupon() {
async createCoupon () {
if (this.pageParams.received) return
if (!this.isCheck) return // 按钮置灰的情况
try {
......@@ -620,8 +624,8 @@ export default {
.select-box {
margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
......
......@@ -268,6 +268,7 @@ export default {
e.optionals?.map(item => {
item.checked = false
item.warranty = item.warranty?.replace(/<\/?br\s*\/?>|\n/g, '<br>')
})
boutiqueMediaConfig[e.carModelName].optionals = e.optionals
})
......
......@@ -94,11 +94,11 @@ export default {
mounted () {
},
methods: {
search () {
search () {
this.edit = false
console.log(this.searchValue)
},
openInput () {
openInput () {
this.edit = true
this.inputFocus = true
},
......@@ -141,7 +141,7 @@ export default {
width: 100%;
height: 80rpx;
background: #ffffff;
border: 3rpx solid #A8C1FF;;
border: 3rpx solid #a8c1ff;
border-radius: 16rpx;
box-sizing: border-box;
color: #333;
......@@ -179,8 +179,8 @@ export default {
.select-box {
margin: 32rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
......
......@@ -61,31 +61,11 @@
<view
class="case-item"
:key="item.id"
@click="jumpDetail(item)"
>
<image
class="img"
:src="item.cover"
></image>
<view class="case-info">
<view class="case-name text-hide">{{ item.title }}</view>
<template v-for="(j, ind) in caseInfo">
<view
class="case-text flex"
:key="ind"
>
<view class="case-label">{{ j.label }}:</view>
<view :class="['case-value', j.class]">
<template v-if="j.format">
{{ j.format(item) }}
</template>
<template v-else>
{{ item[j.key] || '--' }}
</template>
</view>
</view>
</template>
</view>
<case-item
:item="item"
:visitsId="visitsId"
/>
</view>
</template>
</template>
......@@ -115,9 +95,11 @@
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
import PackagePopup from './components/PackagePopup.vue'
import CaseItem from '@/components/HomeFrame/components/CaseItem.vue'
export default {
components: {
PackagePopup
PackagePopup,
CaseItem
},
data () {
return {
......@@ -277,28 +259,6 @@ export default {
animationDuration: 100
})
},
jumpDetail (item) {
// 类型:0-图片;1-视频;2-pdf;3-富文本
let url = `/pages/common/caseDetail?id=${item.id}&visitsId=${this.visitsId}`
if (item.type != 3) {
let fileUrl = item?.detailInfos[0]?.image
if (item.type == 2) {
// uni.downloadFile({
// url: fileUrl,
// success (res) {
// var filePath = res.tempFilePath;
// }
// })
// return
url = `/pages/common/webview?fileUrl=${fileUrl}&title=${item.title}&id=${item.id}&visitsId=${this.visitsId}`
}
if (item.type == 1 || item.type == 0) url = `/pages/boutique/preview?tabName=${item.title}&sourceType=${item.type == 1 ? 2 : 1}&detailUrl=${fileUrl}&id=${item.id}&visitsId=${this.visitsId}`
}
uni.navigateTo({
url: `${url}`
})
},
pageonReachBottom () {
let { currentPage, total, nothing, pageSize } = this
if (!nothing) nothing = 'nothing'
......@@ -463,35 +423,6 @@ export default {
.case-item {
width: 496rpx;
height: 588rpx;
background: #ffffff;
box-shadow: 0 8rpx 24rpx 0 #2c66f71a;
border-radius: 16rpx;
display: flex;
flex-direction: column;
overflow: hidden;
.img {
width: 100%;
height: 324rpx;
}
.case-name {
font-weight: 500;
font-size: 28rpx;
color: #333333;
line-height: 48rpx;
padding: 16rpx 32rpx 8rpx;
}
.case-text {
align-items: flex-start;
font-size: 24rpx;
color: #666666;
line-height: 40rpx;
padding: 0 32rpx;
margin-bottom: 2rpx;
}
.case-label {
width: 120rpx;
flex-shrink: 0;
}
}
}
}
......
......@@ -79,4 +79,11 @@
width: fit-content !important;
padding: 20rpx 46rpx !important;
}
}
\ No newline at end of file
}
.select-box{
.select-item{
display: flex;
justify-content: center;
align-items: center;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!