Commit 021c1dfa by 李伟康

commit 提交

1 parent f7c84de1
......@@ -13,9 +13,11 @@
.icon-clone { width: 24rpx; height: 24rpx; background-position: -781rpx -509rpx;}
.icon-customer-1 { width: 400rpx; height: 400rpx; background-position: 0rpx 0rpx;}
.icon-customer-2 { width: 400rpx; height: 400rpx; background-position: -415rpx 0rpx;}
.icon-customer-add { width: 80rpx; height: 80rpx; background-position: -1216rpx -382rpx;}
.icon-customer-detail { width: 40rpx; height: 40rpx; background-position: -830rpx -668rpx;}
.icon-customer-file-active { width: 112rpx; height: 112rpx; background-position: -638rpx -558rpx;}
.icon-customer-file { width: 112rpx; height: 112rpx; background-position: 0rpx -726rpx;}
.icon-detail-start { width: 80rpx; height: 80rpx; background-position: 0rpx -964rpx;}
.icon-face-error-active { width: 96rpx; height: 96rpx; background-position: -746rpx -726rpx;}
.icon-face-error { width: 96rpx; height: 96rpx; background-position: -857rpx -726rpx;}
.icon-face-success-active { width: 96rpx; height: 96rpx; background-position: -968rpx -726rpx;}
......@@ -37,9 +39,13 @@
.icon-kf-2 { width: 32rpx; height: 32rpx; background-position: -688rpx -853rpx;}
.icon-kf-3 { width: 32rpx; height: 32rpx; background-position: -735rpx -853rpx;}
.icon-logo { width: 160rpx; height: 160rpx; background-position: -1041rpx -382rpx;}
.icon-mask-del { width: 80rpx; height: 80rpx; background-position: -95rpx -964rpx;}
.icon-mask-edit { width: 80rpx; height: 80rpx; background-position: -190rpx -964rpx;}
.icon-no-insurance-data { width: 488rpx; height: 296rpx; background-position: 0rpx -415rpx;}
.icon-pause { width: 40rpx; height: 40rpx; background-position: -940rpx -668rpx;}
.icon-pen-active { width: 120rpx; height: 120rpx; background-position: -646rpx -415rpx;}
.icon-pen { width: 120rpx; height: 120rpx; background-position: -503rpx -558rpx;}
.icon-play { width: 40rpx; height: 40rpx; background-position: -995rpx -668rpx;}
.icon-qr-success { width: 96rpx; height: 96rpx; background-position: -1190rpx -726rpx;}
.icon-qw { width: 48rpx; height: 48rpx; background-position: -765rpx -558rpx;}
.icon-record-active { width: 112rpx; height: 112rpx; background-position: -381rpx -726rpx;}
......@@ -47,19 +53,13 @@
.icon-scan { width: 32rpx; height: 32rpx; background-position: -782rpx -853rpx;}
.icon-scene-0 { width: 96rpx; height: 96rpx; background-position: 0rpx -853rpx;}
.icon-scene-1 { width: 96rpx; height: 96rpx; background-position: -111rpx -853rpx;}
.icon-search { width: 40rpx; height: 40rpx; background-position: -940rpx -668rpx;}
.icon-search { width: 40rpx; height: 40rpx; background-position: -1050rpx -668rpx;}
.icon-second-nav { width: 480rpx; height: 176rpx; background-position: -830rpx 0rpx;}
.icon-setting { width: 64rpx; height: 64rpx; background-position: -372rpx -964rpx;}
.icon-store { width: 96rpx; height: 96rpx; background-position: -222rpx -853rpx;}
.icon-tag-checked { width: 60rpx; height: 32rpx; background-position: -1240rpx -557rpx;}
.icon-tool-file { width: 60rpx; height: 60rpx; background-position: -451rpx -964rpx;}
.icon-tool-finish { width: 60rpx; height: 60rpx; background-position: -526rpx -964rpx;}
.icon-tool-pay { width: 60rpx; height: 60rpx; background-position: -601rpx -964rpx;}
.icon-total { width: 32rpx; height: 32rpx; background-position: -829rpx -853rpx;}
.icon-visible { width: 40rpx; height: 40rpx; background-position: -995rpx -668rpx;}
.icon-customer-add { width: 80rpx; height: 80rpx; background-position: -1216rpx -382rpx;}
.icon-detail-start { width: 80rpx; height: 80rpx; background-position: 0rpx -964rpx;}
.icon-mask-del { width: 80rpx; height: 80rpx; background-position: -95rpx -964rpx;}
.icon-mask-edit { width: 80rpx; height: 80rpx; background-position: -190rpx -964rpx;}
.icon-pause { width: 40rpx; height: 40rpx; background-position: -1050rpx -668rpx;}
.icon-play { width: 40rpx; height: 40rpx; background-position: -1105rpx -668rpx;}
.icon-tag-checked { width: 60rpx; height: 32rpx; background-position: -1240rpx -557rpx;}
\ No newline at end of file
.icon-visible { width: 40rpx; height: 40rpx; background-position: -1105rpx -668rpx;}
\ No newline at end of file

1.2 MB | W: | H:

1.2 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
<template>
<view class="bg">
<view class="top">
<view
class="top-one"
:style="randomize"
></view>
</view>
<view class="bottom">
<view
class="bottom-one"
:style="randomize"
></view>
<view
class="bottom-two"
:style="randomize"
></view>
<view
class="bottom-three"
:style="randomize"
></view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
dateKey: null,
}
},
computed:{
randomize () {
let { dateKey } = this;
const maxX = uni.getSystemInfoSync().windowWidth - 300,
maxY = uni.getSystemInfoSync().windowHeight - 100,
x = Math.floor(Math.random() * maxX),
y = Math.floor(Math.random() * maxY);
return `transform:translate(${x}px,${y}px);${dateKey};`;
},
},
mounted () {
setInterval(() => {
this.dateKey = Date.now();
}, 5e3);
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.bg {
position: absolute;
z-index: -2;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
background-image: linear-gradient(180deg, #f2f6ff 0%, #f7f9ff 100%);
overflow: hidden;
.top {
position: absolute;
top: 0;
left: 0;
width: 100%;
&-one {
position: absolute;
top: -1600rpx;
right: 128rpx;
width: 2012rpx;
height: 2012rpx;
opacity: 0.3;
background: #fff;
box-shadow: inset 2rpx 2rpx 0 2rpx #ffffff80;
border-radius: 50% / 25%;
transition: all 2s;
z-index: 2;
&::before {
position: absolute;
width: 856.56rpx;
height: 153.54rpx;
right: 150rpx;
top: 0;
opacity: 0.6;
background: #ebfdff;
filter: blur(36rpx);
content: '';
}
}
&::before {
position: absolute;
content: '';
right: 0;
top: 0;
width: 890.36rpx;
height: 174.84rpx;
opacity: 0.2;
background: #3582ee;
filter: blur(100rpx);
}
&::after {
width: 274.32rpx;
height: 410.02rpx;
opacity: 0.16;
background-image: linear-gradient(125deg, #65b8f7 36%, #3582ee 79%);
filter: blur(74rpx);
position: absolute;
content: '';
right: 0;
top: 24rpx;
}
}
.bottom {
position: absolute;
width: 1291.3rpx;
height: 316rpx;
left: 0;
bottom: 0;
z-index: 2;
&::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
opacity: 0.11;
background: #3582ee;
filter: blur(100rpx);
}
&::after {
width: 1484.32rpx;
height: 160.02rpx;
opacity: 0.12;
background-image: linear-gradient(125deg, #65b8f8 36%, #3582ee 79%);
filter: blur(74rpx);
position: absolute;
left: 480rpx;
bottom: 0;
content: '';
}
&-one {
position: absolute;
left: 0;
bottom: 44rpx;
width: 643.02rpx;
height: 258.78rpx;
opacity: 0.4;
background: #ebfffd;
filter: blur(36rpx);
transition: all 2s;
}
&-two {
position: absolute;
width: 450rpx;
height: 450rpx;
opacity: 0.24;
background: #ffffff;
box-shadow: inset 2rpx 2rpx 0 2rpx #ffffff80;
border: 100%;
left: -225rpx;
bottom: -225rpx;
border-radius: 100%;
transition: all 2s;
}
&-three {
width: 762.7rpx;
height: 210.92rpx;
opacity: 0.16;
box-shadow: inset 2rpx 2rpx 0 2rpx #ffffff80;
background-color: fff;
position: fixed;
left: 0;
top: 0;
border-radius: 50%;
transition: all 2s;
z-index: 2;
}
}
}
</style>
\ No newline at end of file
<template>
<view
class="container"
@click="handleTouchStart"
>
<view :class="['home', { show: !id }]">
<home-animation></home-animation>
<left-side
:userInfo="userInfo"
:tabIndex.sync="tabIndex"
......@@ -109,12 +105,11 @@
import RecordList from "./components/RecordList.vue";
import myClick from "@/mixin/click";
import uploader from "@/mixin/uploader.js";
import HomeAnimation from './components/HomeAnimation.vue';
import CustomerFile from './components/CustomerFile.vue';
import LeftSide from './components/LeftSide.vue';
export default {
mixins: [myClick, uploader],
components: { RecordList, HomeAnimation, CustomerFile, LeftSide },
components: { RecordList, CustomerFile, LeftSide },
props: {
id: [String, Number],
finishDoneText: String,
......@@ -153,6 +148,16 @@ export default {
<style scoped lang="scss">
.container {
position: relative;
&::after {
content: '';
position: absolute;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/home-bg.webp');
background-size: 100% 100%;
}
.home,
.detail {
position: fixed;
......
<template>
<view class="tool-box">
<view class="tool-box" :style="toolStyle">
<view
:class="['btn', {hideIcon:!show}]"
@click="show = false"
......@@ -64,7 +64,8 @@ export default {
idKey: {
type: String,
default: 'id'
}
},
toolStyle:String
},
data () {
return {
......
......@@ -11,14 +11,15 @@
@blur="input($event)"
@focus="focus"
/>
<view class="input-tips" v-if="!isSearch"
>搜索图片/视频名称<uni-icons
<view
class="input-tips"
v-if="!isSearch"
>搜索图片/视频名称<uni-icons
type="search"
class="icon"
color="#999"
size="20"
></uni-icons
></view>
></uni-icons></view>
<uni-icons
v-if="isSearch"
type="closeempty"
......@@ -29,13 +30,25 @@
></uni-icons>
</view>
<scroll-view class="record-box" scroll-y>
<scroll-view
class="record-box"
scroll-y
>
<view class="list">
<template v-if="list.length">
<template v-for="item in list">
<view class="item" :key="item.id">
<view class="item-autio" @click="playVideo(item)">
<image :src="item.coverUrl" class="cover-box"></image>
<view
class="item"
:key="item.id"
>
<view
class="item-autio"
@click="playVideo(item)"
>
<image
:src="item.coverUrl"
class="cover-box"
></image>
<image
v-if="item.sourceType == 2"
src="../../assets/images/boutique/play.png"
......@@ -48,37 +61,61 @@
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../assets/images/home/nothing.webp" />
<image
class="icon"
src="../../assets/images/home/nothing.webp"
/>
暂无数据
</view>
</template>
</view>
</scroll-view>
</view>
<view class="popup-box" v-if="popupShow">
<view
class="popup-box"
v-if="popupShow"
>
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="24" color="#fff"></uni-icons>
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="24"
color="#fff"
></uni-icons>
</view>
<view class="title">{{ title }}</view>
</view>
<view class="popup-body">
<video ref="videoPlayer" :src="videoSrc" controls></video>
<video
ref="videoPlayer"
:src="videoSrc"
controls
></video>
</view>
</view>
<preview
ref="preview"
isComponents
:show="showPreview"
/>
</view>
</template>
<script type="text/ecmascript-6">
import utils from "@/utils/utils";
import preview from './preview.vue'
export default {
name: '',
components: { preview },
name: 'case',
data () {
return {
name:'',
name: '',
list: [],
popupShow:false,
isSearch:false,
popupShow: false,
isSearch: false,
videoSrc: '',
showPreview: false
}
},
props: {
......@@ -93,41 +130,44 @@ export default {
},
},
watch: {
watchStatus:{
handler() {
watchStatus: {
handler () {
this.name = '';
this.isSearch = false
this.list = this.views
this.showPreview = false
},
immediate:true
immediate: true
}
},
methods: {
playVideo(item) {
const {tabName,sourceType,detailUrl} = item
uni.navigateTo({
url: `/pages/boutique/preview?tabName=${tabName}&sourceType=${sourceType}&detailUrl=${detailUrl}`
})
playVideo (item) {
const { tabName, sourceType, detailUrl } = item
console.log(this.$refs.preview)
// this.showPreview = true
// uni.navigateTo({
// url: `/pages/boutique/preview?tabName=${tabName}&sourceType=${sourceType}&detailUrl=${detailUrl}`
// })
},
focus() {
focus () {
this.isSearch = true
},
init() {
init () {
this.name = '';
setTimeout(() => {
this.isSearch = false
this.list = this.views
}, 300);
},
handleClear() {
handleClear () {
this.init()
},
input(e) {
this.name = e.detail.value
if(this.name == '')
input (e) {
this.name = e.detail.value
if (this.name == '')
this.isSearch = false
this.list = this.views.filter(i=>i.tabName.includes(this.name))
this.list = this.views.filter(i => i.tabName.includes(this.name))
},
},
}
......@@ -146,7 +186,7 @@ export default {
height: 800rpx;
position: absolute;
left: 0;
background-image: url("../../assets/images/boutique/record-bg.png");
background-image: url('../../assets/images/boutique/record-bg.png');
background-size: 100% 100%;
top: 0;
}
......
<template>
<view class="layout">
<view class="title">
<view class="sprite-icon icon-aito"></view>
<view class="text">{{tabId}}-{{currentCar}}</view>
</view>
<view
class="form-box"
:key="refreshKey"
>
<template v-if="customerType == 1">
<view class="form">
<template v-for="(i, index) in formObject">
<view
:class="['form-item' ,{active:focusIndex == index}]"
:key="index"
>
<view class="form-item-box">
<template v-if="i.type == 'input'">
<input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="customerInfo[i.key]"
class="input"
@input="inputCustomer"
:placeholder="i.placeholder"
@focus="focusIndex = index"
@blur="resetFocusIndex"
/>
<customer-autocomplete
:showType="i.inputType"
:searchValue="customerInfo[i.key]"
:show="focusIndex == index"
@choose="chooseCustomer"
/>
</template>
<template v-else>
<view
:class="['select flex',{placeholderStyle:!customerInfo[i.key]}]"
@click="showPopup(i.popKey,index)"
>
<view class="value text-hide">{{customerInfo[i.key] ||i.placeholder}}</view>
<uni-icons
class="arrow"
type="right"
:size="16"
></uni-icons>
</view>
</template>
</view>
</view>
</template>
<view :class="['form-item' ,{active:focusIndex == 4}]">
<view class="form-item-box">
<view
:class="['select flex',{placeholderStyle:!couponTypeName}]"
@click="showPopup('couponBoxVisible', 4)"
>
<view class="value text-hide">{{couponTypeName|| '请选择礼券类型'}}</view>
<uni-icons
class="arrow"
type="right"
:size="16"
></uni-icons>
</view>
</view>
</view>
<view
class="form-btn flex"
@click="createCoupon"
>为客户发券</view>
</view>
</template>
<template v-if="customerType == 0 && customerInfo.phoneNumber">
<view class="customer-info-box">
<view
class="customer-info flex"
@click="pageParams.showDetail = !pageParams.showDetail"
>
<view class="text text-hide flex">
<view class="text-hide">{{customerInfo.customerName}}</view>
<view class="line">|</view>
<view class="text-hide">{{customerInfo.carModel || '-'}}</view>
</view>
<view class="sprite-icon icon-customer-detail"></view>
</view>
<view
class="customer-detail flex"
v-show="pageParams.showDetail"
>
<template v-for="(i,index) in customerDetailObject">
<view
class="customer-item flex"
:key="index"
>
<view class="label">{{i.label}}</view>
<view class="value text-hide">
<template v-if="i.format">
{{i.format(customerInfo)}}
</template>
<template v-else>
{{customerInfo[i.key] || '-'}}
</template>
</view>
</view>
</template>
</view>
</view>
</template>
</view>
<view class="content">
<template v-for="(i, index) in views">
<image
:key="index"
:src="i.detailUrl"
:class="['item',`item-${index}`]"
@click="jumpPage(i)"
/>
</template>
</view>
<car-brands
ref="carBrandListVisible"
@select="handleSelect($event,'carBrandListVisible')"
@close="resetFocusIndex"
/>
<employee
ref="employeeBoxVisible"
@select="handleSelect($event,'employeeBoxVisible')"
title="交付人员"
@close="resetFocusIndex"
/>
<MessageBox
ref="couponBoxVisible"
position="bottom"
:isFooter="false"
title="请选择礼券类型"
:maxHeight="1000"
@close="resetFocusIndex"
>
<view class="select-box">
<view class="tab-box flex" v-if="customerType == 1 || isPreview">
<template v-for="(item, index) in carList">
<view
class="select-item"
:class="{ checked: pageParams.couponId == item.id }"
@click="chooseCoupon(item)"
v-for="(item, index) in couponList"
:key="index"
:class="['tab',`${currentIndex == index ? 'active' : ''}`]"
@click="currentCarString = item"
>
{{ item.couponTypeName }}
{{item}}
</view>
</template>
</view>
<view class="content-box flex">
<view class="left-content"></view>
<view class="right-content">
<view :class="['sku-box',isPreview ? 'preview' : '']">
<sku-box
:currentCar="currentCarString"
:defaultTabId="tabId"
:show="show"
/>
</view>
<view
class="coupon-btn flex"
v-if="!isPreview"
>{{couponText}}</view>
</view>
</MessageBox>
<MessageBox
ref="couponTips"
:content="couponErrorTips"
:showCancelBtn="false"
confirmBtnText="知道了"
></MessageBox>
<qr-box
:url="pageParams.QRURL"
ref="qrbox"
:received="pageParams.received"
@close="closeQr"
/>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import Employee from '@/components/Employee.vue'
import CarBrands from '@/components/CarBrands.vue'
import QrBox from './QrBox.vue'
import dayjs from 'dayjs'
import CustomerAutocomplete from '@/components/CustomerAutocomplete.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
import SkuBox from './SkuBox.vue'
export default {
name: 'Reception',
components: { Employee, CarBrands, QrBox, CustomerAutocomplete },
components: { SkuBox },
props: {
views: Array,
customerType: Number,
show: Boolean,
madiaId: Number,
tabId: Number,
currentCar: String
currentCar: String,
type: String
},
data () {
return {
formObject: [
{
placeholder: '车主姓名',
key: 'customerName',
type: 'input',
inputType: 'text',
maxlength: 50
},
{
placeholder: '车主电话',
key: 'phoneNumber',
type: 'input',
inputType: 'tel',
maxlength: 11
},
{
placeholder: '车型',
key: 'carModel',
type: 'select',
popKey: 'carBrandListVisible'
},
{
placeholder: '交付专员',
key: 'staffName',
type: 'select',
popKey: 'employeeBoxVisible'
}
],
customerDetailObject: [
{
label: '车主姓名',
key: 'customerName',
},
{
label: '交付专员',
key: 'staffName',
},
{
label: '车型',
key: 'carModel',
},
{
label: '领券时间',
format (cell) {
return dayjs(cell.receiveCouponDate).format("YYYY年MM月DD日")
}
},
{
label: '车主电话',
key: 'phoneNumber',
},
{
label: '接待时间',
format () {
return dayjs().format("YYYY年MM月DD日")
}
}
],
carList: ['M5', 'M7', 'M9'],
currentCarString: '',
customerInfo: {},
couponList: [],
couponTypeName: '',
focusIndex: -1,
pageParams: {
qrTimer: null,
received: false,
couponId: '',
carInfo: {},
QRURL: '',
showDetail: false,
clickFlag: false
},
couponErrorTips: '',
refreshKey: Date.now()
}
},
watch: {
......@@ -266,19 +54,17 @@ export default {
immediate: true,
handler (newval) {
this.customerInfo = newval
this.pageParams.showDetail = false
}
},
show (n) {
if (n && this.customerType == 1) this.init()
},
watchStatus: {
immediate: true,
handler (newval) {
this.pageParams = this.$options.data.call(this).pageParams
this.couponTypeName = ''
this.closeAllPopup()
this.refreshKey = Date.now()
}
},
currentCar: {
immediate: true,
handler (newval) {
this.currentCarString = newval
}
}
},
......@@ -289,409 +75,106 @@ export default {
watchStatus () {
return this.$store.state.user.historyStatus
},
},
methods: {
init () {
this.findCouponList()
},
async findCouponList () {
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo,
{ list } = await uni.$api.boutiqueApi.findCouponList({
merchantIdList: [shopMerchantId]
}),
arr = []
if (list && list.length) {
let couponTypeList = Array.from(new Set([...list.map((e) => e.couponType)]))
couponTypeList.map((i) => {
let item = []
list.map((e) => {
if (i == e.couponType) item.push(e)
})
if (item.length) arr.push(item.sort(function (a, b) {
return b.createdDate - a.createdDate
})[0])
})
console.log(arr)
let item = arr.find(e => e.couponType == 1),
item2 = arr.find(e => e.couponType == 18)
if (!this.pageParams.couponId) {
if (item) this.chooseCoupon(item) //默认填入类型为「太阳膜」类型
else if (item2) this.chooseCoupon(item2) //次选填入「精品」类型
else this.chooseCoupon(arr[0]) // 无此两种类型情况默认带入任意类型礼券
}
}
this.couponList = arr
},
inputCustomer () {
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
handleSelect (item, popkey) {
this.$refs[popkey].close()
if (popkey == 'employeeBoxVisible') {
this.customerInfo.salesUuid = item.uuid
this.customerInfo.staffName = item.staffName
} else {
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
this.pageParams.carInfo = item
}
this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
showPopup (e, index) {
this.focusIndex = index
this.$refs[e].open()
},
closeAllPopup () {
this.$refs.carBrandListVisible?.close()
this.$refs.employeeBoxVisible?.close()
this.$refs.couponBoxVisible?.close()
this.$refs.qrbox?.close()
this.resetFocusIndex()
this.closeQr()
},
chooseCoupon (item) {
this.pageParams.couponId = item.id
this.couponTypeName = item.couponTypeName
this.$refs.couponBoxVisible.close()
},
jumpPage (e) {
this.$emit('jumpPage', {
id: e.uniCode,
historyId: this.madiaId
})
},
async createCoupon () {
try {
const { pageParams: { clickFlag, couponId, carInfo }, customerInfo } = this, {
shopMerchantId } = uni.$storage.get("userInfo"),
validateStatus = await this.validate(),
checkCouponAmount = await this.checkCouponAmount(couponId, [shopMerchantId])
if (!validateStatus) return
if (clickFlag) return
if (!checkCouponAmount.length) throw '该门店礼券已使用完,请联系管理员配置。'
this.pageParams.clickFlag = true
uni.showLoading({
mask: true
})
let { staffName, salesUuid } = customerInfo,
scene = `id=${couponId}&userId=${salesUuid}&employName=${staffName}&merchantId=${shopMerchantId}&customerName=${customerInfo.customerName}&customerPhone=${customerInfo.phoneNumber}`,
params = {
path: '/packageShopmall/packageMine/pages/boutique/gift/gift',
appId: 'wxe10067a63c1856ac',
}
if (carInfo.name) {
scene += `&carChildsBrandId=${carInfo.carChildsBrandId}&carChildsBrandName=${carInfo.carChildsBrandName}&carBrandId=${carInfo.carBrandId}&carBrand=${carInfo.carBrand}&carSeriesId=${carInfo.id}&carSeriesName=${carInfo.name}`
}
params.scene = scene
let {
code,
data,
message
} = await uni.$api.commonApi.createQrcode(params)
if (code == 0) {
if (data) {
this.pageParams.QRURL = data
this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss"))
this.$refs.qrbox.open()
uni.hideLoading()
this.pageParams.clickFlag = false
}
else throw '生成小程序码失败,请重试!'
} else throw message
} catch (error) {
uni.hideLoading()
if (error) {
this.pageParams.clickFlag = false
this.couponErrorTips = error
this.$refs.couponTips.open()
}
}
},
async validate () {
let flag = true
try {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo,
{ couponId } = this.pageParams
// 检查车主姓名
if (!customerName || !phoneNumber || !carModel || !staffName) throw '请输入客户信息'
if (phoneNumber && !phoneRex.test(phoneNumber)) throw '请输入正确的手机号'
if (!couponId) throw '请选择礼券类型'
} catch (error) {
this.pageParams.clickFlag = false
uni.hideLoading()
uni.showToast({
title: error,
icon: 'none',
})
flag = false
}
return flag
},
checkCustomerReceivedStatus (receiveCouponStartTime) {
if (this.pageParams.qrTimer) return
try {
this.pageParams.received = false
this.pageParams.qrTimer = setInterval(async () => {
const { pageParams: { couponId }, customerInfo } = this,
res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({
merchantCouponId: couponId,
customerPhone: customerInfo.phoneNumber,
receiveCouponStartTime
})
if (res && res.total) {
this.pageParams.received = true
this.closeQr()
this.$emit('reception', {
item: {
customerName: customerInfo.customerName,
carSeriesName: customerInfo.carModel,
customerPhone: customerInfo.phoneNumber,
userId: customerInfo.salesUuid,
employeeName: customerInfo.staffName,
receiveCouponDate: Date.now()
}
})
setTimeout(() => {
this.$refs.qrbox.close()
}, 3e3)
}
}, 2e3)
} catch (error) {
if (error) uni.showToast({
title: error,
icon: "none",
});
}
},
closeQr () {
if (this.pageParams.qrTimer) clearInterval(this.pageParams.qrTimer)
this.pageParams.qrTimer = null
},
resetFocusIndex () {
this.focusIndex = -1
currentIndex () {
return this.carList.findIndex(e => e == this.currentCarString)
},
async checkCouponAmount (merchantCouponId, merchantIdList) {
const { list } = await uni.$api.boutiqueApi.findCouponList({
merchantCouponId,
merchantIdList
})
return list || []
isPreview () {
return this.type == 'preview'
},
chooseCustomer (e) {
this.customerInfo = {
...this.customerInfo,
phoneNumber: e.ownerPhone,
customerName: e.ownerName,
carModel: e.brandModel
}
this.inputCustomer()
couponText(){
return this.customerType == 0 ? '查看客户券码' : '为客户发券'
}
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.layout {
position: relative;
&::after {
position: absolute;
width: 100vw;
height: 100vh;
background-color: #fff;
position: absolute;
top: 0;
left: 0;
.tab-box {
padding-top: 66rpx;
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/boutique/reception-bg.webp');
background-size: 100% 100%;
content: '';
z-index: -1;
}
.title {
padding: 160rpx 0 24rpx 64rpx;
.sprite-icon {
margin-bottom: 24rpx;
width: 100%;
justify-content: center;
.tab {
padding: 0 32rpx;
font-weight: 500;
font-size: 36rpx;
color: #333333b3;
line-height: 44rpx;
width: 130rpx;
text-align: center;
position: relative;
}
.text {
line-height: 112rpx;
.active {
font-weight: 700;
font-size: 80rpx;
color: #333333;
transition: all 1s;
&::after {
content: '';
position: absolute;
left: 50%;
width: 8rpx;
height: 8rpx;
background: #333333;
border-radius: 100%;
transform: translateX(-50%);
animation: show-dot 0.15s forwards;
}
@keyframes show-dot {
0% {
bottom: 16rpx;
}
100% {
bottom: -16rpx;
}
}
}
}
.form-box {
height: 80rpx;
margin-bottom: 48rpx;
padding: 0 64rpx;
.form {
display: flex;
gap: 0 28rpx;
.content-box {
height: calc(100vh - 144rpx);
margin-top: 144rpx;
padding: 0 0 64rpx 64rpx;
.left-content {
width: 1328rpx;
height: 100%;
&-item {
width: 336rpx;
height: 100%;
position: relative;
&-box {
position: relative;
width: 100%;
height: 100%;
background: #ffffff;
border: 3rpx solid #a8c1ff;
border-radius: 16rpx;
box-sizing: border-box;
padding: 0 24rpx;
z-index: 2;
}
.input,
.select {
width: 100%;
height: 100%;
border: none !important;
outline: none;
font-size: 28rpx;
color: #333333;
border-radius: 16rpx;
box-sizing: border-box;
line-height: 80rpx;
padding: 0 !important;
&::placeholder {
color: #999999;
}
}
.placeholderStyle {
color: #999999;
}
.arrow {
color: #999 !important;
margin-left: auto;
flex-shrink: 0;
}
background: #069;
}
.right-content {
width: calc(100% - 1362rpx);
height: 100%;
display: flex;
flex-direction: column;
margin-left: auto;
.sku-box {
height: calc(100% - 116rpx);
}
.active {
&::after {
position: absolute;
left: -2rpx;
top: -2rpx;
width: calc(100% + 4rpx);
height: calc(100% + 4rpx);
content: '';
background-image: linear-gradient(#2f6af7, #75bcff);
box-shadow: 0 0 0 8rpx #2c66f71a;
border-radius: 16rpx;
}
.preview {
height: 100%;
}
&-btn {
width: 286rpx;
height: 80rpx;
.coupon-btn {
margin-top: auto;
width: calc(100% - 64rpx);
height: 96rpx;
background-image: linear-gradient(180deg, #61c0ff 0%, #2c66f7 100%);
box-shadow: inset 0 0 16rpx 0 #ffffff;
box-shadow: inset 0 0 32rpx 0 #ffffff;
border-radius: 16rpx;
font-weight: 500;
font-size: 28rpx;
font-size: 36rpx;
color: #ffffff;
justify-content: center;
}
}
.customer-info-box {
position: relative;
width: 480rpx;
height: 100%;
.customer-info {
width: 100%;
height: 100%;
background: #ffffff;
border-radius: 16rpx;
box-sizing: border-box;
padding: 0 24rpx;
.text {
flex: 1;
.text-hide {
max-width: calc(50% - 10rpx);
}
}
.line {
margin: 0 6rpx;
flex-shrink: 0;
}
.sprite-icon {
flex-shrink: 0;
margin-left: auto;
}
}
.customer-detail {
position: absolute;
bottom: 0;
left: 496rpx;
min-width: 860rpx;
height: 204rpx;
z-index: 2;
background: #ffffff;
border-radius: 16rpx;
flex-wrap: wrap;
box-sizing: border-box;
padding: 32rpx 48rpx;
gap: 16rpx 0;
.customer-item {
width: 50%;
color: #333333;
line-height: 36rpx;
font-size: 28rpx;
.label {
width: 120rpx;
color: #666666;
flex-shrink: 0;
margin-right: 24rpx;
text-align: right;
}
}
}
}
}
.content {
width: 100%;
height: calc(100vh - 484rpx);
padding: 0 64rpx;
.item {
float: left;
}
.item-0 {
width: 1084rpx;
height: 992rpx;
margin-right: 50rpx;
}
.item-1 {
margin-bottom: 48rpx;
}
.item-1,
.item-2 {
width: 1084rpx;
height: 472rpx;
}
}
}
.select-box {
margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
.select-item {
text-align: center;
height: 68rpx;
line-height: 68rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
font-size: 28rpx;
border-radius: 8rpx;
&.checked {
border: 2rpx solid #292d33;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="sku-content">
<view class="first-type-box flex">
<view :class="['block',blockClass]"></view>
<template v-for="(i,index) in boutiqueMediaConfig[currentCar]">
<view
class="first-type-item flex"
:key="index"
@click="changeTabId(i.tabId,index)"
>
<view :class="['sprite-icon',`icon-${i.icon}`]"></view>
{{i.tabName}}
</view>
</template>
</view>
<scroll-view
class="second-type-scroll"
scroll-x
enable-flex
>
<view class="second-type-box flex">
<template v-for="(i,index) in 20">
<view
:class="['second-type-item flex',secondIndex == index ? 'active' : '']"
:key="index"
@click="secondIndex = index"
>{{i}}一二三四五一二三四</view>
</template>
<view class="padding-right"></view>
</view>
</scroll-view>
<template v-if="tabId == 2 && secondIndex == 0">
<view class="sub-title">品牌</view>
<scroll-view
class="thirdly-type-scroll"
scroll-x
enable-flex
>
<view class="thirdly-type-box flex">
<template v-for="(i,index) in 20">
<view
:class="['thirdly-type-item flex',thirdlyIndex == index ? 'active' : '']"
:key="index"
@click="thirdlyIndex = index"
>{{i}}一二三四五一二三四</view>
</template>
<view class="padding-right"></view>
</view>
</scroll-view>
<view class="sub-title">部位</view>
</template>
<scroll-view
scroll-y
class="content-scroll-box"
id="content-scroll"
:style="{height:contentHeight}"
>
<template v-for="(i,index) in 20">
<view
:class="['goods-item',goodsId == index ? 'active' : '']"
:key="index"
@click="goodsId = index"
>
<view class="goods-title">一二三四五一二三四五一二三四五一二三四五一二三四五一二三四五一二三四五一二三四五一二三四五一二三四五</view>
<view class="goods-description">
<rich-text :nodes="test"></rich-text>
</view>
</view>
</template>
</scroll-view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'SkuBox',
props: {
defaultTabId: Number,
currentCar: String,
show: Boolean
},
data () {
return {
tabId: 1,
blockIndex: 0,
secondIndex: 0,
thirdlyIndex: 0,
goodsId: '',
contentHeight: '0',
requested: false,
test: '段落内容\n段落内容\n段落内容\n段\n#段落内容\n#段落内容\n#\n#段落内容\n#段落内容\n#段落内容\n#'
}
},
watch: {
defaultTabId: {
immediate: true,
handler (newval) {
if (this.show) this.tabId = newval
}
},
/**切换车型 */
currentCar: {
immediate: true,
handler (newval) {
if (this.show && this.requested) {
let [item] = this.boutiqueMediaConfig[newval]
this.changeTabId(item.tabId, 0)
}
}
},
show: {
immediate: true,
handler (newval) {
if (newval && !this.requested) {
this.changeTabId(this.tabId, this.boutiqueMediaConfig[this.currentCar].findIndex(e => e.tabId == this.tabId))
this.requested = true
}
}
},
watchStatus: {
immediate: true,
handler (newval) {
this.requested = false
}
},
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus;
},
blockClass () {
return ['block-0', 'block-1', 'block-2'][this.blockIndex]
},
boutiqueMediaConfig () {
return this.$store.state.user.boutiqueMediaConfig
}
},
mounted () {
},
methods: {
changeTabId (tabId, index) {
this.tabId = tabId
this.blockIndex = index
this.getSkuConfig()
this.setScrollHeight()
},
async getSkuConfig () {
this.test = this.test.replace(/<\/?br\s*\/?>|\n/g, '<br>')
// this.$forceUpdate()
},
setScrollHeight () {
this.$nextTick(() => {
let query = uni.createSelectorQuery()
query.select(`#content-scroll`).boundingClientRect(data => {
this.contentHeight = `calc(100% - ${data.top - 72}px)`
}).exec()
})
}
}
}
</script>
<style scoped lang='scss'>
.sku-content {
width: 100%;
height: 100%;
.padding-right {
height: 80rpx;
width: 40rpx;
flex-shrink: 0;
}
.first-type-box {
width: calc(100% - 64rpx);
height: 176rpx;
background: #f2f2f2;
border-radius: 24rpx;
box-sizing: border-box;
border: 8rpx solid #f2f2f2;
position: relative;
.first-type-item {
width: 280rpx;
height: 160rpx;
border-radius: 24rpx;
flex-direction: column;
justify-content: center;
font-weight: 500;
font-size: 36rpx;
color: #333333;
line-height: 44rpx;
position: relative;
z-index: 2;
.sprite-icon {
margin-bottom: 12rpx;
transform: scale(1.45);
}
}
.block {
width: 280rpx;
height: 160rpx;
border-radius: 24rpx;
background: #ffffff;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
transition: all 0.15s;
}
.block-0 {
left: 0;
}
.block-1 {
left: 280rpx;
}
.block-2 {
left: 560rpx;
}
}
.second-type-scroll {
width: 100%;
.second-type-box {
width: 100%;
gap: 24rpx;
flex-wrap: nowrap;
padding: 32rpx 0 24rpx;
.second-type-item {
width: fit-content;
flex-shrink: 0;
height: 80rpx;
background: #f2f2f2;
border-radius: 16rpx;
font-size: 28rpx;
color: #666666;
line-height: 44rpx;
padding: 0 32rpx;
justify-content: center;
transition: all 0.15s;
}
.active {
background: #2d66f71a;
font-weight: 500;
color: #2d66f7;
}
}
}
.thirdly-type-scroll {
width: 100%;
.thirdly-type-box {
width: 100%;
gap: 24rpx;
flex-wrap: nowrap;
padding-bottom: 24rpx;
.thirdly-type-item {
flex-shrink: 0;
height: 80rpx;
border: 2rpx solid #33333333;
border-radius: 16rpx;
font-size: 28rpx;
color: #666666;
line-height: 36rpx;
padding: 0 32rpx;
justify-content: center;
transition: all 0.15s;
}
.active {
font-weight: 500;
color: #333333;
border-color: #333333;
}
}
}
.sub-title {
font-size: 24rpx;
color: #999999;
line-height: 36rpx;
padding-bottom: 16rpx;
}
.content-scroll-box {
.goods-item {
width: calc(100% - 64rpx);
min-height: 244rpx;
border: 2rpx solid #33333333;
border-radius: 16rpx;
padding: 24rpx 32rpx;
margin-bottom: 24rpx;
transition: all 0.15s;
.goods-title {
font-weight: 500;
font-size: 28rpx;
color: #333333;
line-height: 44rpx;
margin-bottom: 8rpx;
}
.goods-description {
font-size: 24rpx;
color: #666666;
line-height: 36rpx;
max-height: 144rpx;
overflow: hidden;
}
}
.active {
border-color: #333;
.goods-description {
max-height: none;
overflow: auto;
}
}
}
}
</style>
\ No newline at end of file
<template>
<view class="layout">
<view class="title">
<view class="sprite-icon icon-aito"></view>
<view class="text">{{tabId}}-{{currentCar}}</view>
</view>
<view
class="form-box"
:key="refreshKey"
>
<template v-if="customerType == 1">
<view class="form">
<template v-for="(i, index) in formObject">
<view
:class="['form-item' ,{active:focusIndex == index}]"
:key="index"
>
<view class="form-item-box">
<template v-if="i.type == 'input'">
<input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="customerInfo[i.key]"
class="input"
@input="inputCustomer"
:placeholder="i.placeholder"
@focus="focusIndex = index"
@blur="resetFocusIndex"
/>
<customer-autocomplete
:showType="i.inputType"
:searchValue="customerInfo[i.key]"
:show="focusIndex == index"
@choose="chooseCustomer"
/>
</template>
<template v-else>
<view
:class="['select flex',{placeholderStyle:!customerInfo[i.key]}]"
@click="showPopup(i.popKey,index)"
>
<view class="value text-hide">{{customerInfo[i.key] ||i.placeholder}}</view>
<uni-icons
class="arrow"
type="right"
:size="16"
></uni-icons>
</view>
</template>
</view>
</view>
</template>
<view :class="['form-item' ,{active:focusIndex == 4}]">
<view class="form-item-box">
<view
:class="['select flex',{placeholderStyle:!couponTypeName}]"
@click="showPopup('couponBoxVisible', 4)"
>
<view class="value text-hide">{{couponTypeName|| '请选择礼券类型'}}</view>
<uni-icons
class="arrow"
type="right"
:size="16"
></uni-icons>
</view>
</view>
</view>
<view
class="form-btn flex"
@click="createCoupon"
>为客户发券</view>
</view>
</template>
<template v-if="customerType == 0 && customerInfo.phoneNumber">
<view class="customer-info-box">
<view
class="customer-info flex"
@click="pageParams.showDetail = !pageParams.showDetail"
>
<view class="text text-hide flex">
<view class="text-hide">{{customerInfo.customerName}}</view>
<view class="line">|</view>
<view class="text-hide">{{customerInfo.carModel || '-'}}</view>
</view>
<view class="sprite-icon icon-customer-detail"></view>
</view>
<view
class="customer-detail flex"
v-show="pageParams.showDetail"
>
<template v-for="(i,index) in customerDetailObject">
<view
class="customer-item flex"
:key="index"
>
<view class="label">{{i.label}}</view>
<view class="value text-hide">
<template v-if="i.format">
{{i.format(customerInfo)}}
</template>
<template v-else>
{{customerInfo[i.key] || '-'}}
</template>
</view>
</view>
</template>
</view>
</view>
</template>
</view>
<view class="content">
<template v-for="(i, index) in views">
<image
:key="index"
:src="i.detailUrl"
:class="['item',`item-${index}`]"
@click="jumpPage(i)"
/>
</template>
</view>
<car-brands
ref="carBrandListVisible"
@select="handleSelect($event,'carBrandListVisible')"
@close="resetFocusIndex"
/>
<employee
ref="employeeBoxVisible"
@select="handleSelect($event,'employeeBoxVisible')"
title="交付人员"
@close="resetFocusIndex"
/>
<MessageBox
ref="couponBoxVisible"
position="bottom"
:isFooter="false"
title="请选择礼券类型"
:maxHeight="1000"
@close="resetFocusIndex"
>
<view class="select-box">
<view
class="select-item"
:class="{ checked: pageParams.couponId == item.id }"
@click="chooseCoupon(item)"
v-for="(item, index) in couponList"
:key="index"
>
{{ item.couponTypeName }}
</view>
</view>
</MessageBox>
<MessageBox
ref="couponTips"
:content="couponErrorTips"
:showCancelBtn="false"
confirmBtnText="知道了"
></MessageBox>
<qr-box
:url="pageParams.QRURL"
ref="qrbox"
:received="pageParams.received"
@close="closeQr"
/>
</view>
</template>
<script type='text/ecmascript-6'>
import Employee from '@/components/Employee.vue'
import CarBrands from '@/components/CarBrands.vue'
import QrBox from './QrBox.vue'
import dayjs from 'dayjs'
import CustomerAutocomplete from '@/components/CustomerAutocomplete.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
export default {
name: 'Reception',
components: { Employee, CarBrands, QrBox, CustomerAutocomplete },
props: {
views: Array,
customerType: Number,
show: Boolean,
madiaId: Number,
tabId: Number,
currentCar: String
},
data () {
return {
formObject: [
{
placeholder: '车主姓名',
key: 'customerName',
type: 'input',
inputType: 'text',
maxlength: 50
},
{
placeholder: '车主电话',
key: 'phoneNumber',
type: 'input',
inputType: 'tel',
maxlength: 11
},
{
placeholder: '车型',
key: 'carModel',
type: 'select',
popKey: 'carBrandListVisible'
},
{
placeholder: '交付专员',
key: 'staffName',
type: 'select',
popKey: 'employeeBoxVisible'
}
],
customerDetailObject: [
{
label: '车主姓名',
key: 'customerName',
},
{
label: '交付专员',
key: 'staffName',
},
{
label: '车型',
key: 'carModel',
},
{
label: '领券时间',
format (cell) {
return dayjs(cell.receiveCouponDate).format("YYYY年MM月DD日")
}
},
{
label: '车主电话',
key: 'phoneNumber',
},
{
label: '接待时间',
format () {
return dayjs().format("YYYY年MM月DD日")
}
}
],
customerInfo: {},
couponList: [],
couponTypeName: '',
focusIndex: -1,
pageParams: {
qrTimer: null,
received: false,
couponId: '',
carInfo: {},
QRURL: '',
showDetail: false,
clickFlag: false
},
couponErrorTips: '',
refreshKey: Date.now()
}
},
watch: {
watchCustomerInfo: {
immediate: true,
handler (newval) {
this.customerInfo = newval
this.pageParams.showDetail = false
}
},
show (n) {
if (n && this.customerType == 1) this.init()
},
watchStatus: {
immediate: true,
handler (newval) {
this.pageParams = this.$options.data.call(this).pageParams
this.couponTypeName = ''
this.closeAllPopup()
this.refreshKey = Date.now()
}
}
},
computed: {
watchCustomerInfo () {
return this.$store.state.user.customerInfo
},
watchStatus () {
return this.$store.state.user.historyStatus
},
},
methods: {
init () {
this.findCouponList()
},
async findCouponList () {
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo,
{ list } = await uni.$api.boutiqueApi.findCouponList({
merchantIdList: [shopMerchantId]
}),
arr = []
if (list && list.length) {
let couponTypeList = Array.from(new Set([...list.map((e) => e.couponType)]))
couponTypeList.map((i) => {
let item = []
list.map((e) => {
if (i == e.couponType) item.push(e)
})
if (item.length) arr.push(item.sort(function (a, b) {
return b.createdDate - a.createdDate
})[0])
})
console.log(arr)
let item = arr.find(e => e.couponType == 1),
item2 = arr.find(e => e.couponType == 18)
if (!this.pageParams.couponId) {
if (item) this.chooseCoupon(item) //默认填入类型为「太阳膜」类型
else if (item2) this.chooseCoupon(item2) //次选填入「精品」类型
else this.chooseCoupon(arr[0]) // 无此两种类型情况默认带入任意类型礼券
}
}
this.couponList = arr
},
inputCustomer () {
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
handleSelect (item, popkey) {
this.$refs[popkey].close()
if (popkey == 'employeeBoxVisible') {
this.customerInfo.salesUuid = item.uuid
this.customerInfo.staffName = item.staffName
} else {
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
this.pageParams.carInfo = item
}
this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
showPopup (e, index) {
this.focusIndex = index
this.$refs[e].open()
},
closeAllPopup () {
this.$refs.carBrandListVisible?.close()
this.$refs.employeeBoxVisible?.close()
this.$refs.couponBoxVisible?.close()
this.$refs.qrbox?.close()
this.resetFocusIndex()
this.closeQr()
},
chooseCoupon (item) {
this.pageParams.couponId = item.id
this.couponTypeName = item.couponTypeName
this.$refs.couponBoxVisible.close()
},
jumpPage (e) {
this.$emit('jumpPage', {
id: e.uniCode,
historyId: this.madiaId
})
},
async createCoupon () {
try {
const { pageParams: { clickFlag, couponId, carInfo }, customerInfo } = this, {
shopMerchantId } = uni.$storage.get("userInfo"),
validateStatus = await this.validate(),
checkCouponAmount = await this.checkCouponAmount(couponId, [shopMerchantId])
if (!validateStatus) return
if (clickFlag) return
if (!checkCouponAmount.length) throw '该门店礼券已使用完,请联系管理员配置。'
this.pageParams.clickFlag = true
uni.showLoading({
mask: true
})
let { staffName, salesUuid } = customerInfo,
scene = `id=${couponId}&userId=${salesUuid}&employName=${staffName}&merchantId=${shopMerchantId}&customerName=${customerInfo.customerName}&customerPhone=${customerInfo.phoneNumber}`,
params = {
path: '/packageShopmall/packageMine/pages/boutique/gift/gift',
appId: 'wxe10067a63c1856ac',
}
if (carInfo.name) {
scene += `&carChildsBrandId=${carInfo.carChildsBrandId}&carChildsBrandName=${carInfo.carChildsBrandName}&carBrandId=${carInfo.carBrandId}&carBrand=${carInfo.carBrand}&carSeriesId=${carInfo.id}&carSeriesName=${carInfo.name}`
}
params.scene = scene
let {
code,
data,
message
} = await uni.$api.commonApi.createQrcode(params)
if (code == 0) {
if (data) {
this.pageParams.QRURL = data
this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss"))
this.$refs.qrbox.open()
uni.hideLoading()
this.pageParams.clickFlag = false
}
else throw '生成小程序码失败,请重试!'
} else throw message
} catch (error) {
uni.hideLoading()
if (error) {
this.pageParams.clickFlag = false
this.couponErrorTips = error
this.$refs.couponTips.open()
}
}
},
async validate () {
let flag = true
try {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo,
{ couponId } = this.pageParams
// 检查车主姓名
if (!customerName || !phoneNumber || !carModel || !staffName) throw '请输入客户信息'
if (phoneNumber && !phoneRex.test(phoneNumber)) throw '请输入正确的手机号'
if (!couponId) throw '请选择礼券类型'
} catch (error) {
this.pageParams.clickFlag = false
uni.hideLoading()
uni.showToast({
title: error,
icon: 'none',
})
flag = false
}
return flag
},
checkCustomerReceivedStatus (receiveCouponStartTime) {
if (this.pageParams.qrTimer) return
try {
this.pageParams.received = false
this.pageParams.qrTimer = setInterval(async () => {
const { pageParams: { couponId }, customerInfo } = this,
res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({
merchantCouponId: couponId,
customerPhone: customerInfo.phoneNumber,
receiveCouponStartTime
})
if (res && res.total) {
this.pageParams.received = true
this.closeQr()
this.$emit('reception', {
item: {
customerName: customerInfo.customerName,
carSeriesName: customerInfo.carModel,
customerPhone: customerInfo.phoneNumber,
userId: customerInfo.salesUuid,
employeeName: customerInfo.staffName,
receiveCouponDate: Date.now()
}
})
setTimeout(() => {
this.$refs.qrbox.close()
}, 3e3)
}
}, 2e3)
} catch (error) {
if (error) uni.showToast({
title: error,
icon: "none",
});
}
},
closeQr () {
if (this.pageParams.qrTimer) clearInterval(this.pageParams.qrTimer)
this.pageParams.qrTimer = null
},
resetFocusIndex () {
this.focusIndex = -1
},
async checkCouponAmount (merchantCouponId, merchantIdList) {
const { list } = await uni.$api.boutiqueApi.findCouponList({
merchantCouponId,
merchantIdList
})
return list || []
},
chooseCustomer (e) {
this.customerInfo = {
...this.customerInfo,
phoneNumber: e.ownerPhone,
customerName: e.ownerName,
carModel: e.brandModel
}
this.inputCustomer()
}
}
}
</script>
<style scoped lang='scss'>
.layout {
position: relative;
&::after {
position: absolute;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/boutique/reception-bg.webp');
background-size: 100% 100%;
content: '';
z-index: -1;
}
.title {
padding: 160rpx 0 24rpx 64rpx;
.sprite-icon {
margin-bottom: 24rpx;
}
.text {
line-height: 112rpx;
font-weight: 700;
font-size: 80rpx;
color: #333333;
}
}
.form-box {
height: 80rpx;
margin-bottom: 48rpx;
padding: 0 64rpx;
.form {
display: flex;
gap: 0 28rpx;
height: 100%;
&-item {
width: 336rpx;
height: 100%;
position: relative;
&-box {
position: relative;
width: 100%;
height: 100%;
background: #ffffff;
border: 3rpx solid #a8c1ff;
border-radius: 16rpx;
box-sizing: border-box;
padding: 0 24rpx;
z-index: 2;
}
.input,
.select {
width: 100%;
height: 100%;
border: none !important;
outline: none;
font-size: 28rpx;
color: #333333;
border-radius: 16rpx;
box-sizing: border-box;
line-height: 80rpx;
padding: 0 !important;
&::placeholder {
color: #999999;
}
}
.placeholderStyle {
color: #999999;
}
.arrow {
color: #999 !important;
margin-left: auto;
flex-shrink: 0;
}
}
.active {
&::after {
position: absolute;
left: -2rpx;
top: -2rpx;
width: calc(100% + 4rpx);
height: calc(100% + 4rpx);
content: '';
background-image: linear-gradient(#2f6af7, #75bcff);
box-shadow: 0 0 0 8rpx #2c66f71a;
border-radius: 16rpx;
}
}
&-btn {
width: 286rpx;
height: 80rpx;
background-image: linear-gradient(180deg, #61c0ff 0%, #2c66f7 100%);
box-shadow: inset 0 0 16rpx 0 #ffffff;
border-radius: 16rpx;
font-weight: 500;
font-size: 28rpx;
color: #ffffff;
justify-content: center;
}
}
.customer-info-box {
position: relative;
width: 480rpx;
height: 100%;
.customer-info {
width: 100%;
height: 100%;
background: #ffffff;
border-radius: 16rpx;
box-sizing: border-box;
padding: 0 24rpx;
.text {
flex: 1;
.text-hide {
max-width: calc(50% - 10rpx);
}
}
.line {
margin: 0 6rpx;
flex-shrink: 0;
}
.sprite-icon {
flex-shrink: 0;
margin-left: auto;
}
}
.customer-detail {
position: absolute;
bottom: 0;
left: 496rpx;
min-width: 860rpx;
height: 204rpx;
z-index: 2;
background: #ffffff;
border-radius: 16rpx;
flex-wrap: wrap;
box-sizing: border-box;
padding: 32rpx 48rpx;
gap: 16rpx 0;
.customer-item {
width: 50%;
color: #333333;
line-height: 36rpx;
font-size: 28rpx;
.label {
width: 120rpx;
color: #666666;
flex-shrink: 0;
margin-right: 24rpx;
text-align: right;
}
}
}
}
}
.content {
width: 100%;
height: calc(100vh - 484rpx);
padding: 0 64rpx;
.item {
float: left;
}
.item-0 {
width: 1084rpx;
height: 992rpx;
margin-right: 50rpx;
}
.item-1 {
margin-bottom: 48rpx;
}
.item-1,
.item-2 {
width: 1084rpx;
height: 472rpx;
}
}
}
.select-box {
margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
.select-item {
text-align: center;
height: 68rpx;
line-height: 68rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
font-size: 28rpx;
border-radius: 8rpx;
&.checked {
border: 2rpx solid #292d33;
}
}
}
</style>
\ No newline at end of file
......@@ -37,6 +37,7 @@
@reception="reception"
:tabId="tabId"
:currentCar="currentCar"
:type="type"
/>
</view>
</template>
......@@ -48,6 +49,7 @@
@choose="choose"
@finish="open"
:id="id"
toolStyle="top:48rpx;"
/>
</template>
<finish-step
......@@ -178,12 +180,14 @@ export default {
left: 0;
top: 48rpx;
z-index: 9;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
position: absolute;
......
......@@ -55,7 +55,7 @@
<swiper-item
:key="index"
:class="['swiper-item flex',carClass(index)]"
@click.prevent="toDetail({id:1,tabId:1})"
@click.prevent="toDetail({id:1,tabId:item.configList[0].tabId})"
>
<image
:src="item.url"
......@@ -63,7 +63,7 @@
/>
<template v-if="currentIndex == index">
<view class="config-box">
<template v-for="(i,ind) in carConfigList">
<template v-for="(i,ind) in item.configList">
<view
:class="['config-item',i.class]"
:key="ind"
......@@ -119,6 +119,29 @@ import { mapMutations } from "vuex";
const m5 = require("@/assets/images/boutique/index/m5.webp")
const m7 = require("@/assets/images/boutique/index/m7.webp")
const m9 = require("@/assets/images/boutique/index/m9.webp")
const defaultConfig = [
{
name: '套餐火爆热卖',
tabName: '套餐包',
icon: 'boutique-config-0',
class: 'config-0',
tabId: 1
},
{
name: '膜类专区',
tabName: '膜类专区',
icon: 'boutique-config-1',
class: 'config-1',
tabId: 2
},
{
name: '精品系列',
tabName: '精品专区',
icon: 'boutique-config-2',
class: 'config-2',
tabId: 3
}
]
export default {
components: { HomeFrame, detail, CustomerType },
name: 'boutique',
......@@ -134,37 +157,21 @@ export default {
recording: false,
carBannerList: [{
title: 'M5',
url: m5
url: m5,
configList: []
}, {
title: 'M7',
url: m7
url: m7,
configList: []
}, {
title: 'M9',
url: m9
url: m9,
configList: []
}],
currentCar: 'M7',
currentIndex: 0,
bannerAutoplay: true,
carConfigList: [
{
name: '套餐火爆热卖',
icon: 'boutique-config-0',
class: 'config-0',
tabId: 1
},
{
name: '膜类专区',
icon: 'boutique-config-1',
class: 'config-1',
tabId: 2
},
{
name: '精品系列',
icon: 'boutique-config-2',
class: 'config-2',
tabId: 3
}
]
mediaConfigList: []
}
},
onBackPress (options) {
......@@ -226,13 +233,22 @@ export default {
.then((res) => {
this.$store.dispatch("setEmployeeList", res);
});
/**获取车型素材配置 */
let boutiqueMediaConfig = {
M5: [defaultConfig[0], defaultConfig[1], defaultConfig[2]],
M7: [defaultConfig[0], defaultConfig[1]],
M9: [defaultConfig[1], defaultConfig[2]]
}
this.carBannerList.map(e => {
e.configList = boutiqueMediaConfig[e.title]
})
this.$store.state.user.boutiqueMediaConfig = boutiqueMediaConfig
},
// 查询素材
async getSoure () {
let { moduleList, toolList } = await uni.$api.systemApi.getBoutiqueMockData(true)
this.moduleList = moduleList
this.toolList = toolList
console.log(moduleList)
},
toDetail (item) {
this.chooseItem = item
......@@ -249,7 +265,6 @@ export default {
this.id = id;
this.tabId = tabId
this.currentCar = this.carBannerList[this.currentIndex].title
this.cancel()
},
back () {
if (!this.id) return uni.navigateBack();
......@@ -331,7 +346,6 @@ export default {
this.jumpPage()
},
swiperChange (e) {
console.log(e)
this.currentIndex = e.detail.current
},
carClass (index) {
......
<template>
<view class="popup-box">
<view
class="popup-box"
v-if="popupShow"
>
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#fff"></uni-icons>
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#fff"
></uni-icons>
</view>
<view class="title">{{ title }}</view>
</view>
<view class="popup-body">
<video ref="videoPlayer" :src="detailUrl" controls v-if="sourceType == 2"></video>
<view class="img-detail" v-else><image @click="back" :src="detailUrl" :style="{ width: width + 'px' }" /></view>
<video
ref="videoPlayer"
:src="detailUrl"
controls
v-if="sourceType == 2"
></video>
<view
class="img-detail"
v-else
>
<image
@click="back"
:src="detailUrl"
:style="{ width: width + 'px' }"
/>
</view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import report from "@/mixin/report.js";
export default {
props: {
isComponents: Boolean,
show: Boolean
},
data () {
return {
width:0,
title: '11',
width: 0,
title: '',
sourceType: '',
detailUrl: ''
}
},
mixins:[report],
computed: {
popupShow () {
let status = true
if (this.isComponents) status = this.show
return status
}
},
mixins: [report],
onLoad (options) {
const {tabName,sourceType,detailUrl} = options
this.title = tabName
this.sourceType = sourceType
this.detailUrl = detailUrl
const _this = this
uni.getImageInfo({
src: detailUrl, // 替换为你的图片路径
success (img) {
uni.createSelectorQuery().select('.img-detail').boundingClientRect(function(rect) {
_this.width = rect.height*img.height/img.width
}).exec();
},
fail: function (error) {
console.error('获取图片信息失败:', error);
}
});
this.init(options)
},
methods: {
back() {
uni.navigateBack()
init (options) {
const { tabName, sourceType, detailUrl } = options
this.title = tabName
this.sourceType = sourceType
this.detailUrl = detailUrl
const _this = this
uni.getImageInfo({
src: detailUrl, // 替换为你的图片路径
success (img) {
uni.createSelectorQuery().select('.img-detail').boundingClientRect(function (rect) {
_this.width = rect.height * img.height / img.width
}).exec();
},
fail: function (error) {
console.error('获取图片信息失败:', error);
}
});
},
back () {
if (this.isComponents) this.$emit('update:show', false)
else uni.navigateBack()
}
}
}
......
......@@ -24,6 +24,11 @@ export default {
employeeList: [],
paymentType: [],
haveCustomerAccess: false,
boutiqueMediaConfig: {
M5:[],
M7:[],
M9:[]
}
};
},
mutations: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!