Commit 068c7a67 by cen

Merge branch 'V4.56.0' of http://192.168.3.233:8090/glsx/gl_tape into V4.56.0

2 parents b8bda5ab 5f7c3ace
...@@ -58,22 +58,15 @@ ...@@ -58,22 +58,15 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import popupmixin from './popupmixin'
export default { export default {
mixins: [popupmixin],
name: 'CarModelList', name: 'CarModelList',
inject: ['userInfo'],
data () { data () {
return { return {
list: [],
currentId: '',
searchList: [],
letter: 'A', letter: 'A',
searchStatus: false,
} }
}, },
props: {
params: Object,
data: Object,
},
mounted () { mounted () {
}, },
methods: { methods: {
...@@ -93,7 +86,7 @@ export default { ...@@ -93,7 +86,7 @@ export default {
if (data && data.length) { if (data && data.length) {
this.initCarList(data) this.initCarList(data)
params.cacheData = data params.cacheData = data
this.$emit('update:params', params) this.updateParams(params)
} }
}, },
initCarList (carData) { initCarList (carData) {
......
...@@ -48,22 +48,15 @@ ...@@ -48,22 +48,15 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import popupmixin from './popupmixin'
export default { export default {
mixins: [popupmixin],
name: 'CouponList', name: 'CouponList',
inject: ['userInfo'],
data () { data () {
return { return {
list: [],
currentId: '',
searchList: [],
searchStatus: false,
customerCouponList: [] customerCouponList: []
} }
}, },
props: {
params: Object,
data: Object,
},
watch: { watch: {
'data.customer.customerPhone': { 'data.customer.customerPhone': {
handler (val) { handler (val) {
...@@ -94,7 +87,7 @@ export default { ...@@ -94,7 +87,7 @@ export default {
if (data && data.length) { if (data && data.length) {
this.initCouponList(data) this.initCouponList(data)
params.cacheData = data params.cacheData = data
this.$emit('update:params', params) this.updateParams(params)
} }
}, },
initCouponList (data) { initCouponList (data) {
......
...@@ -14,19 +14,14 @@ ...@@ -14,19 +14,14 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import popupmixin from './popupmixin'
export default { export default {
mixins: [popupmixin],
name: 'DiversionMerchant', name: 'DiversionMerchant',
inject: ['userInfo'],
data () { data () {
return { return {
list: [],
currentId: ''
} }
}, },
props: {
params: Object,
data: Object,
},
mounted () { mounted () {
}, },
methods: { methods: {
...@@ -46,7 +41,7 @@ export default { ...@@ -46,7 +41,7 @@ export default {
this.$emit('onComplete') this.$emit('onComplete')
this.list = data this.list = data
params.cacheData = data params.cacheData = data
this.$emit('update:params', params) this.updateParams(params)
} }
}, },
choose (i) { choose (i) {
......
...@@ -14,19 +14,15 @@ ...@@ -14,19 +14,15 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import popupmixin from './popupmixin'
export default { export default {
mixins: [popupmixin],
name: 'EmployeeList', name: 'EmployeeList',
inject: ['userInfo'], inject: ['userInfo'],
data () { data () {
return { return {
list: [],
currentId: ''
} }
}, },
props: {
params: Object,
data: Object
},
mounted () { mounted () {
}, },
methods: { methods: {
...@@ -49,7 +45,7 @@ export default { ...@@ -49,7 +45,7 @@ export default {
this.$emit('onComplete') this.$emit('onComplete')
this.list = data this.list = data
params.cacheData = data params.cacheData = data
this.$emit('update:params', params) this.updateParams(params)
} }
}, },
handleSearch (searchValue) { handleSearch (searchValue) {
......
...@@ -22,23 +22,14 @@ ...@@ -22,23 +22,14 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import popupmixin from './popupmixin'
export default { export default {
mixins: [popupmixin],
name: 'GoodsList', name: 'GoodsList',
inject: ['userInfo', 'baseConfigData'],
data () { data () {
return { return {
list: [],
currentIds: [],
chooseList: [],
searchStatus: false,
searchList: [],
} }
}, },
props: {
params: Object,
data: [Object, Array],
dataKey: String
},
mounted () { mounted () {
}, },
methods: { methods: {
...@@ -60,7 +51,7 @@ export default { ...@@ -60,7 +51,7 @@ export default {
if (response && response.length) { if (response && response.length) {
this.list = this.initGoodsList(response) this.list = this.initGoodsList(response)
params.cacheData = response params.cacheData = response
this.$emit('update:params', params) this.updateParams(params)
} }
}, },
handleSearch (searchValue) { handleSearch (searchValue) {
......
<template> <template>
<view class="goods-list"> <view class="goods-list">
<!-- <template v-if="list.length"> --> <template v-if="params.loadComplete">
<template v-for="(item, index) in (searchStatus ? searchList : list)"> <template v-if="listData.length">
<view <template v-for="(item, index) in listData">
:key="index" <view
@click="choose(item)" :key="index"
:class="['item',{active: checkActive(item)}]" @click="choose(item)"
> :class="['item',{active: checkActive(item)}]"
<view class="title flex"> >
<view class="icon"> <view class="title flex">
<uni-icons <view class="icon">
type="circle" <uni-icons
:size="16" type="circle"
color="#8C8C8C" :size="16"
class="uni-icons" color="#8C8C8C"
></uni-icons> class="uni-icons"
<view class="sprite-icon icon-notice-success"></view> ></uni-icons>
</view> <view class="sprite-icon icon-notice-success"></view>
{{item.packageGoods.packageAlias||item.packageGoods.packageName}} </view>
<text class="price">¥{{item.packageGoods.upgradePrice}}</text> {{item.packageGoods.packageAlias||item.packageGoods.packageName}}
</view> <text class="price">¥{{item.packageGoods.upgradePrice}}</text>
<view class="package-list"> </view>
<template v-for="(i,ind) in item.packageGoods.goodsList"> <view class="package-list">
<view <template v-for="(i,ind) in item.packageGoods.goodsList">
class="package-item flex" <view
:key="ind" class="package-item flex"
> :key="ind"
<view class="name">{{i.goodsAlias||i.upgradeGoodsAlias||i.upgradeGoodsName}}</view> >
<view class="price">¥{{i.sellPrice}}</view> <view class="name">{{i.goodsAlias||i.upgradeGoodsAlias||i.upgradeGoodsName}}</view>
<view class="price">¥{{i.sellPrice}}</view>
</view>
</template>
</view> </view>
</template> </view>
</view> </template>
</view> </template>
</template> </template>
<!-- </template> -->
</view> </view>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import NP from 'number-precision' import NP from 'number-precision'
import popupmixin from './popupmixin'
export default { export default {
mixins: [popupmixin],
name: 'PackageList', name: 'PackageList',
inject: ['userInfo', 'baseConfigData'],
data () { data () {
return { return {
list: [],
currentIds: [],
chooseList: [],
searchStatus: false,
searchList: [],
} }
}, },
props: {
params: Object,
data: [Object, Array],
dataKey: String
},
mounted () { mounted () {
}, },
methods: { methods: {
...@@ -77,7 +70,7 @@ export default { ...@@ -77,7 +70,7 @@ export default {
if (response && response.length) { if (response && response.length) {
this.list = this.initGoodsList(response) this.list = this.initGoodsList(response)
params.cacheData = response params.cacheData = response
this.$emit('update:params', params) this.updateParams(params)
} }
}, },
handleSearch (searchValue) { handleSearch (searchValue) {
......
<template> <template>
<view class="goods-list"> <view class="goods-list">
<template v-for="(i, index) in (searchStatus ? searchList : list)"> <template v-if="params.loadComplete">
<view <template v-if="listData.length">
:key="index" <template v-for="(i, index) in listData">
@click.stop="choose(i ,index)" <view
:class="['item',{active: checkActive(i) || i.active},{single:i.goodsFlag == 1}]" :key="index"
> @click.stop="choose(i ,index)"
<template v-if="i.goodsFlag == 1"> :class="['item',{active: checkActive(i) || i.active},{single:i.goodsFlag == 1}]"
<view class="flex"> >
<view class="icon"> <template v-if="i.goodsFlag == 1">
<uni-icons <view class="flex">
type="circle" <view class="icon">
:size="16" <uni-icons
color="#8C8C8C" type="circle"
class="uni-icons" :size="16"
></uni-icons> color="#8C8C8C"
<view class="sprite-icon icon-notice-success"></view> class="uni-icons"
</view> ></uni-icons>
<text class="goods-name text-hide"> <view class="sprite-icon icon-notice-success"></view>
{{replaceItemText(i.goods,'goodsAlias') ||replaceItemText(i.goods,'upgradeGoodsName') || replaceItemText(i.goodsInfo,'goodsName')}} </view>
</text> <text class="goods-name text-hide">
<template v-if="i.goods.merchantGoodsPosition && (i.goods.goodsInfo.goodsType == 1 || i.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)"> {{replaceItemText(i.goods,'goodsAlias') ||replaceItemText(i.goods,'upgradeGoodsName') || replaceItemText(i.goodsInfo,'goodsName')}}
<text>「{{ i.goods.positionStr}}」</text> </text>
<template v-if="i.goods.merchantGoodsPosition && (i.goods.goodsInfo.goodsType == 1 || i.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)">
<text>「{{ i.goods.positionStr}}」</text>
</template>
<text class="price">¥{{i.goods.price}}</text>
</view>
</template> </template>
<text class="price">¥{{i.goods.price}}</text> <template v-if="i.goodsFlag == 2">
</view> <view class="title flex">
</template> <view class="icon">
<template v-if="i.goodsFlag == 2"> <uni-icons
<view class="title flex"> type="circle"
<view class="icon"> :size="16"
<uni-icons color="#8C8C8C"
type="circle" class="uni-icons"
:size="16" ></uni-icons>
color="#8C8C8C" <view class="sprite-icon icon-notice-success"></view>
class="uni-icons" </view>
></uni-icons> {{i.multipleSpecificationsGoods.baseGoodsName}}
<view class="sprite-icon icon-notice-success"></view> <template v-if="i.multipleSpecificationsGoods.goods && i.multipleSpecificationsGoods.goods.sellPrice">
</view> <text class="price">¥{{i.multipleSpecificationsGoods.goods.sellPrice}}</text>
{{i.multipleSpecificationsGoods.baseGoodsName}} </template>
<template v-if="i.multipleSpecificationsGoods.goods && i.multipleSpecificationsGoods.goods.sellPrice"> </view>
<text class="price">¥{{i.multipleSpecificationsGoods.goods.sellPrice}}</text> <template v-if="i.multipleSpecificationsGoods.specificationList && i.multipleSpecificationsGoods.specificationList.length">
</template> <view
</view> class="package-list"
<template v-if="i.multipleSpecificationsGoods.specificationList && i.multipleSpecificationsGoods.specificationList.length"> :key="i.key"
<view >
class="package-list" <template v-for="(specific, specificIndex) in i.multipleSpecificationsGoods.specificationList">
:key="i.key"
>
<template v-for="(specific, specificIndex) in i.multipleSpecificationsGoods.specificationList">
<picker <picker
@click.stop @click.stop
@change="handlePickerChange($event, { @change="handlePickerChange($event, {
item:specific, item:specific,
list:specific.specificationSelectValueList, list:specific.specificationSelectValueList,
parent: i, parent: i,
index index
} )" } )"
:range="specific.specificationSelectValueList" :range="specific.specificationSelectValueList"
:key="`key_${index}_${specificIndex}`" :key="`key_${index}_${specificIndex}`"
> >
<view class="package-item flex"> <view class="package-item flex">
<view class="label"> <view class="label">
{{specific.specificationName}} {{specific.specificationName}}
</view> </view>
<view class="value"> <view class="value flex">
<template v-if="specific.value"> <template v-if="specific.value">
{{specific.value}} {{specific.value}}
</template> </template>
<text <text
class="placeholder" class="placeholder flex"
v-else v-else
>请选择</text> >
</view> 请选择
</view> </text>
</picker> <uni-icons
type="right"
size="14"
class="arrow"
/>
</view>
</view>
</picker>
</template>
</view>
</template> </template>
</view> </template>
</template> </view>
</template> </template>
</view> </template>
</template> </template>
</view> </view>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import popupmixin from './popupmixin'
export default { export default {
mixins: [popupmixin],
name: 'SkuGoodsList', name: 'SkuGoodsList',
inject: ['userInfo', 'baseConfigData'],
data () { data () {
return { return {
list: [],
currentIds: [],
chooseList: [],
searchStatus: false,
searchList: [],
} }
}, },
props: {
params: Object,
data: [Object, Array],
dataKey: String
},
mounted () { mounted () {
}, },
methods: { methods: {
...@@ -124,7 +126,7 @@ export default { ...@@ -124,7 +126,7 @@ export default {
if (response && response.length) { if (response && response.length) {
this.list = this.initGoodsList(response) this.list = this.initGoodsList(response)
params.cacheData = response params.cacheData = response
this.$emit('update:params', params) this.updateParams(params)
} }
}, },
handleSearch (searchValue) { handleSearch (searchValue) {
...@@ -135,7 +137,12 @@ export default { ...@@ -135,7 +137,12 @@ export default {
arr = [] arr = []
goodsList.map(c => { goodsList.map(c => {
let name = '' let name = ''
if (c.goodsFlag == 3 && c.packageGoods) name = c.packageGoods.packageName || c.packageGoods.packageAlias if (c.goodsFlag == 1 && c.goods) {
name = c.goods.goodsAlias || c.goods.upgradeGoodsName || c.goods.goodsName || ''
}
if (c.goodsFlag == 2 && c.multipleSpecificationsGoods) {
name = c.multipleSpecificationsGoods.baseGoodsName
}
if (name.indexOf(searchValue) != -1) { if (name.indexOf(searchValue) != -1) {
arr.push(c) arr.push(c)
} }
...@@ -462,6 +469,9 @@ export default { ...@@ -462,6 +469,9 @@ export default {
margin-left: auto; margin-left: auto;
max-width: 50%; max-width: 50%;
flex-shrink: 0; flex-shrink: 0;
.arrow {
margin-left: 4rpx;
}
} }
&:last-of-type { &:last-of-type {
border: none; border: none;
......
export default {
inject: ['userInfo', 'baseConfigData'],
data () {
return {
list: [],
searchStatus: false,
searchList: [],
chooseList: [],
currentId: '',
currentIds: [],
}
},
props: {
params: Object,
data: [Object, Array],
dataKey: String
},
computed: {
listData () {
return this.searchStatus ? this.searchList : this.list
},
noData () {
return !this.listData.length
}
},
watch: {
noData: {
handler (val) {
let { params } = this
params.noData = val
this.updateParams(params)
},
deep: true
}
},
methods: {
updateParams (params) {
this.$emit('update:params', params)
}
}
}
\ No newline at end of file \ No newline at end of file
...@@ -21,39 +21,61 @@ const componentConfig = { ...@@ -21,39 +21,61 @@ const componentConfig = {
name: 'EmployeeList', name: 'EmployeeList',
title: '销售顾问/录单员', title: '销售顾问/录单员',
placeholder: '请输入姓名', placeholder: '请输入姓名',
idKey: 'userId' idKey: 'userId',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}, },
1: { 1: {
name: 'EmployeeList', name: 'EmployeeList',
title: '交付专员', title: '交付专员',
placeholder: '请输入姓名', placeholder: '请输入姓名',
nullTips: '请选择交付专员', nullTips: '请选择交付专员',
idKey: 'deliveryUserId' idKey: 'deliveryUserId',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}, },
2: { 2: {
name: 'DiversionMerchant', name: 'DiversionMerchant',
title: '二级流量方', title: '二级流量方',
hideSearch: true, hideSearch: true,
idKey: 'subShopMerchantId' idKey: 'subShopMerchantId',
cacheData: [],
loadComplete: false
}, },
3: { 3: {
name: 'EmployeeList', name: 'EmployeeList',
title: '转化人员', title: '转化人员',
placeholder: '请输入姓名', placeholder: '请输入姓名',
idKey: 'sellerUserId', idKey: 'sellerUserId',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}, },
4: { 4: {
name: 'CarModelList', name: 'CarModelList',
title: '选择车型', title: '选择车型',
placeholder: '查找', placeholder: '查找',
idKey: 'carSeriesId' idKey: 'carSeriesId',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}, },
5: { 5: {
name: 'CouponList', name: 'CouponList',
title: '选择礼券', title: '选择礼券',
placeholder: '查找', placeholder: '查找',
idKey: 'customerCouponCode', idKey: 'customerCouponCode',
nullTips: '优惠券不能为空' nullTips: '优惠券不能为空',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}, },
6: { 6: {
name: 'GoodsList', name: 'GoodsList',
...@@ -61,7 +83,11 @@ const componentConfig = { ...@@ -61,7 +83,11 @@ const componentConfig = {
placeholder: '请输入名称', placeholder: '请输入名称',
idKey: 'goodsId', idKey: 'goodsId',
nullTips: '请勾选商品', nullTips: '请勾选商品',
goodsType: [1]//前档 goodsType: [1],//前档
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}, },
7: { 7: {
name: 'GoodsList', name: 'GoodsList',
...@@ -69,7 +95,11 @@ const componentConfig = { ...@@ -69,7 +95,11 @@ const componentConfig = {
placeholder: '请输入名称', placeholder: '请输入名称',
idKey: 'goodsId', idKey: 'goodsId',
nullTips: '请勾选商品', nullTips: '请勾选商品',
goodsType: [2] // 前侧窗玻璃 goodsType: [2], // 前侧窗玻璃
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}, },
8: { 8: {
name: 'GoodsList', name: 'GoodsList',
...@@ -77,7 +107,11 @@ const componentConfig = { ...@@ -77,7 +107,11 @@ const componentConfig = {
placeholder: '请输入名称', placeholder: '请输入名称',
idKey: 'goodsId', idKey: 'goodsId',
nullTips: '请勾选商品', nullTips: '请勾选商品',
goodsType: [3] // 后侧窗玻璃 goodsType: [3], // 后侧窗玻璃
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}, },
9: { 9: {
name: 'GoodsList', name: 'GoodsList',
...@@ -85,7 +119,11 @@ const componentConfig = { ...@@ -85,7 +119,11 @@ const componentConfig = {
placeholder: '请输入名称', placeholder: '请输入名称',
idKey: 'goodsId', idKey: 'goodsId',
nullTips: '请勾选商品', nullTips: '请勾选商品',
goodsType: [4] // 后档 goodsType: [4],// 后档
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}, },
10: { 10: {
name: 'GoodsList', name: 'GoodsList',
...@@ -93,26 +131,38 @@ const componentConfig = { ...@@ -93,26 +131,38 @@ const componentConfig = {
placeholder: '请输入名称', placeholder: '请输入名称',
idKey: 'goodsId', idKey: 'goodsId',
nullTips: '请勾选商品', nullTips: '请勾选商品',
goodsType: [5, 6, 7] // 天窗 goodsType: [5, 6, 7],// 天窗
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}, },
11: { 11: {
name: 'PackageList', name: 'PackageList',
title: '选择套餐', title: '选择套餐',
placeholder: '查找', placeholder: '查找',
nullTips: '请勾选套餐', nullTips: '请勾选套餐',
idKey: 'packageCode' idKey: 'packageCode',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}, },
12: { 12: {
name: 'SkuGoodsList', name: 'SkuGoodsList',
title: '选择商品', title: '选择商品',
nullTips: '请勾选商品', nullTips: '请勾选商品',
placeholder: '查找', placeholder: '查找',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}, },
13: { 13: {
name: 'DateTime', name: 'DateTime',
title: '选择时间', title: '选择时间',
hideSearch: true, hideSearch: true,
loadComplete: false
} }
} }
export default { componentConfig } export default { componentConfig }
\ No newline at end of file \ No newline at end of file
...@@ -19,14 +19,14 @@ ...@@ -19,14 +19,14 @@
></uni-icons> ></uni-icons>
</view> </view>
</view> </view>
<template v-if="!componentObject.hideSearch"> <template v-if="!componentObject[popupType].hideSearch">
<view class="popup-search"> <view class="popup-search">
<input <input
class="input" class="input"
type="text" type="text"
:placeholder="componentObject.placeholder || '请输入'" :placeholder="componentObject[popupType].placeholder || '请输入'"
placeholder-class="placeholder" placeholder-class="placeholder"
v-model="componentObject.searchValue" v-model="componentObject[popupType].searchValue"
confirm-type="search" confirm-type="search"
@confirm="handleSearch" @confirm="handleSearch"
> >
...@@ -37,29 +37,33 @@ ...@@ -37,29 +37,33 @@
<uni-icons <uni-icons
type="closeempty" type="closeempty"
size="16" size="16"
v-if="componentObject.searchValue" v-if="componentObject[popupType].searchValue"
></uni-icons> ></uni-icons>
</view> </view>
</view> </view>
</template> </template>
<view :class="['popup-body',{ 'hide-search' :componentObject.hideSearch}]"> <view :class="['popup-body',{ 'hide-search' :componentObject[popupType].hideSearch}]">
<scroll-view <scroll-view
scroll-y scroll-y
:class="['popup-scroll-view',{show:loadComplete}]" :class="['popup-scroll-view',{show:componentObject[popupType].loadComplete}]"
> >
<component <component
:is="componentObject.name" :is="componentObject[popupType].name"
:params.sync="componentObject" :params.sync="componentObject[popupType]"
:data="data" :data="data"
:dataKey="dataKey" :dataKey="dataKey"
ref="componentRef" ref="componentRef"
@choose="chooseContent = $event" @choose="chooseContent = $event"
@openSkuPopup="openSkuPopup" @openSkuPopup="openSkuPopup"
@onComplete="loadComplete = true" @onComplete="componentObject[popupType].loadComplete = true"
@updateCacheData="updateCacheData"
></component> ></component>
<template v-if="componentObject[popupType].noData">
<view class="nothing flex">暂无数据</view>
</template>
</scroll-view> </scroll-view>
<image <image
v-if="!loadComplete" v-if="!componentObject[popupType].loadComplete"
class="loading" class="loading"
src="../../assets/images/common/loadding.gif" src="../../assets/images/common/loadding.gif"
/> />
...@@ -127,14 +131,12 @@ export default { ...@@ -127,14 +131,12 @@ export default {
return { return {
position: 'bottom', position: 'bottom',
chooseContent: null, chooseContent: null,
componentObject: null, componentObject: config.componentConfig,
loadComplete: false
} }
}, },
watch: { watch: {
popupType: { popupType: {
handler (val) { handler (val) {
this.componentObject = config.componentConfig[this.popupType]
if (val == 11 || val == 12) this.position = 'right' if (val == 11 || val == 12) this.position = 'right'
else this.position = 'bottom' else this.position = 'bottom'
}, },
...@@ -143,9 +145,15 @@ export default { ...@@ -143,9 +145,15 @@ export default {
}, },
externalData: { externalData: {
handler (val) { handler (val) {
if (val && this.componentObject) this.componentObject.cacheData = val if (val) {
}
if (val && val.length && this.componentObject[this.popupType]) {
this.componentObject[this.popupType].cacheData = val
}
}, },
deep: true, deep: true,
immediate: true
} }
}, },
computed: { computed: {
...@@ -170,6 +178,7 @@ export default { ...@@ -170,6 +178,7 @@ export default {
this.initPopupData() this.initPopupData()
}, },
cancel () { cancel () {
console.log()
this.$refs.popup.close() this.$refs.popup.close()
this.$emit('cancel') this.$emit('cancel')
}, },
...@@ -180,7 +189,7 @@ export default { ...@@ -180,7 +189,7 @@ export default {
initPopupData () { initPopupData () {
let componentRef = this.componentRef() let componentRef = this.componentRef()
if (!componentRef) setTimeout(this.initPopupData, .1e3) if (!componentRef) setTimeout(this.initPopupData, .1e3)
else componentRef.getList && componentRef.getList(this.componentObject.searchValue) else componentRef.getList && componentRef.getList(this.componentObject[this.popupType].searchValue)
}, },
handleSearch () { handleSearch () {
let componentRef = this.componentRef() let componentRef = this.componentRef()
...@@ -188,7 +197,7 @@ export default { ...@@ -188,7 +197,7 @@ export default {
title: '请稍后再试', title: '请稍后再试',
icon: 'none' icon: 'none'
}) })
else componentRef.handleSearch(this.componentObject.searchValue) else componentRef.handleSearch(this.componentObject[this.popupType].searchValue)
}, },
confirm () { confirm () {
try { try {
...@@ -197,14 +206,14 @@ export default { ...@@ -197,14 +206,14 @@ export default {
chooseContent = this.componentRef().getResult() chooseContent = this.componentRef().getResult()
} }
if (chooseContent) { if (chooseContent) {
if(Array.isArray(chooseContent) && !chooseContent.length && componentObject.nullTips) throw componentObject.nullTips if (Array.isArray(chooseContent) && !chooseContent.length && componentObject[popupType].nullTips) throw componentObject.nullTips
this.$emit('onConfirm', { this.$emit('onConfirm', {
chooseContent, chooseContent,
popupType popupType
}) })
this.$refs.popup.close() this.$refs.popup.close()
} else { } else {
if (componentObject.nullTips) throw componentObject.nullTips if (componentObject[popupType].nullTips) throw componentObject[popupType].nullTips
} }
} catch (error) { } catch (error) {
uni.showToast({ uni.showToast({
...@@ -224,9 +233,9 @@ export default { ...@@ -224,9 +233,9 @@ export default {
}) })
}, },
clear () { clear () {
this.componentObject.searchValue = '' this.componentObject[this.popupType].searchValue = ''
this.handleSearch() this.handleSearch()
} },
} }
} }
</script> </script>
...@@ -335,6 +344,15 @@ export default { ...@@ -335,6 +344,15 @@ export default {
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%); background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
} }
} }
.nothing{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
justify-content: center;
}
} }
.right-box { .right-box {
width: 46vw; width: 46vw;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!