Commit ce7a67bb by Lin

Merge branch 'saas+v5.8.3' of http://192.168.3.233:8090/glsx/gl_tape into saas+v5.8.3

2 parents 9297ce65 d39f90e3
...@@ -24,26 +24,36 @@ ...@@ -24,26 +24,36 @@
<view class="sub-title flex"> <view class="sub-title flex">
<view :class="['sprite-icon', subIcon]"></view> <view :class="['sprite-icon', subIcon]"></view>
{{ subTitle }} {{ subTitle }}
<template v-if="options.type == 'task'"> <template v-if="options.type == 'task' && taskList.length">
<view class="btn flex" @click="confirmAllTask">全部任务合并推送</view> <view class="btn flex" @click="confirmAllTask">全部任务合并推送</view>
</template> </template>
</view> </view>
<scroll-view class="content" scroll-y> <template v-if="loadComplete">
<template v-for="(item, index) in taskList"> <template v-if="taskList.length">
<task-item :key="index" :item="{ <scroll-view class="content" scroll-y>
...item, <template v-for="(item, index) in taskList">
qwGroupName: options.data.qwGroupName <task-item :key="index" :item="{
}" :num="index" :type="options.type" @confirmTask="confirmTask" /> ...item,
qwGroupName: options.data.qwGroupName
}" :num="index" :type="options.type" @confirmTask="confirmTask" />
</template>
<view class="p-b"></view>
</scroll-view>
</template> </template>
<view class="p-b"></view> <template v-else>
</scroll-view> <view class="nothing">
<nothing text="暂无数据" />
</view>
</template>
</template>
</view> </view>
</uni-popup> </uni-popup>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import TaskItem from './TaskItem.vue' import TaskItem from './TaskItem.vue'
import Nothing from './Nothing.vue'
export default { export default {
components: { TaskItem }, components: { TaskItem, Nothing },
name: 'CustomerPopup', name: 'CustomerPopup',
inject: ['userInfo'], inject: ['userInfo'],
data() { data() {
...@@ -59,7 +69,8 @@ export default { ...@@ -59,7 +69,8 @@ export default {
{ title: '订单状态', key: 'customerStatus', block: true }, { title: '订单状态', key: 'customerStatus', block: true },
{ title: '订单时间', key: 'orderHandleTime' }, { title: '订单时间', key: 'orderHandleTime' },
], ],
taskList: [] taskList: [],
loadComplete: false,
} }
}, },
watch: {}, watch: {},
...@@ -113,6 +124,8 @@ export default { ...@@ -113,6 +124,8 @@ export default {
return data[key] || '-' return data[key] || '-'
}, },
open(options) { open(options) {
this.loadComplete = false
this.taskList = []
this.options = options this.options = options
this.$refs.popup.open() this.$refs.popup.open()
this.getData(options) this.getData(options)
...@@ -133,9 +146,11 @@ export default { ...@@ -133,9 +146,11 @@ export default {
}[options.type], }[options.type],
{ customerInstanceId } = options.data, { customerInstanceId } = options.data,
data = await uni.$api.customerApi[targetApi]({ merchantId, customerInstanceId }) data = await uni.$api.customerApi[targetApi]({ merchantId, customerInstanceId })
this.loadComplete = true
uni.hideLoading() uni.hideLoading()
this.taskList = data this.taskList = data
} catch (error) { } catch (error) {
this.loadComplete = true
uni.hideLoading() uni.hideLoading()
} }
...@@ -166,18 +181,30 @@ export default { ...@@ -166,18 +181,30 @@ export default {
if (res.confirm) _this.confirmSopTask({ if (res.confirm) _this.confirmSopTask({
taskIds, taskIds,
confirmStatus: 1 confirmStatus: 1
}) }, true)
} }
}) })
}, },
async confirmSopTask(params) { async confirmSopTask(params, all) {
console.log(params) try {
return uni.showLoading({
const data = await uni.$api.customerApi.confirmSopTask(params) mask: true,
uni.showToast({ title: '提交中...'
title: data ? '提交成功' : '提交失败', })
icon: "none", const data = await uni.$api.customerApi.confirmSopTask(params)
}) uni.showToast({
title: data ? '提交成功' : '提交失败',
icon: "none",
})
if (data) {
this.loadComplete = false
this.taskList = []
this.getData(this.options)
}
} catch (error) {
uni.hideLoading()
}
} }
} }
} }
...@@ -292,4 +319,8 @@ export default { ...@@ -292,4 +319,8 @@ export default {
height: 28rpx; height: 28rpx;
} }
} }
.nothing {
height: calc(100% - #{toRpx(484)});
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</template> </template>
<template v-else> <template v-else>
<text> <text>
{{ item[i.key] }} {{ formatValue(item[i.key]) }}
</text> </text>
</template> </template>
</template> </template>
...@@ -76,29 +76,41 @@ export default { ...@@ -76,29 +76,41 @@ export default {
data() { data() {
return { return {
defaultPoster: 'https://img02.glsx.com.cn/weapp/resource/app-zyzs/equity/tire-tips-1.webp' defaultPoster: 'https://img02.glsx.com.cn/weapp/resource/app-zyzs/common/default-video.webp'
} }
}, },
watch: {}, watch: {},
computed: { computed: {
messageList() { messageList() {
let { type } = this let { type, item } = this,
return type == 'task' ? [ { messageType } = item,
{ label: '目标群', key: 'qwGroupName' }, taskList = [
{ label: '消息类型', key: 'messageType', format: (type) => this.messageType(type) }, { label: '目标群', key: 'qwGroupName' },
{ label: '消息内容', key: 'messageContent' }, { label: '消息类型', key: 'messageType', format: (type) => this.messageType(type) },
] : [ { label: '消息内容', key: 'messageContent' },
{ label: '消息内容', key: 'messageContent' }, ],
{ label: '推送时间', key: 'pushTime' }, taskRecordList = [
{ { label: '消息内容', key: 'messageContent' },
{ label: '推送时间', key: 'pushTime' },
{ label: '操作人', key: 'confirmBy' },
]
if (type == 'taskRecord') {
if (item.taskStatus == 1) taskRecordList.push({
label: '推送结果', key: 'pushResult', format: (status) => { label: '推送结果', key: 'pushResult', format: (status) => {
return { return {
2: '成功', 2: '成功',
3: '失败', 3: '失败',
}[status] }[status]
} }
}, })
] if (messageType == 4) taskRecordList.push({
label: '浏览人数', key: 'viewTimes'
})
}
return type == 'task' ? taskList : taskRecordList
} }
}, },
mounted() { }, mounted() { },
...@@ -137,6 +149,9 @@ export default { ...@@ -137,6 +149,9 @@ export default {
getImages(mediaIds) { getImages(mediaIds) {
return mediaIds.split(',') return mediaIds.split(',')
}, },
formatValue(value){
return value !== null && value !== '' && value !== undefined ? value : '-'
}
} }
} }
</script> </script>
...@@ -246,12 +261,14 @@ export default { ...@@ -246,12 +261,14 @@ export default {
} }
} }
.video, .image { .video,
.image {
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
border-radius: 16rpx; border-radius: 16rpx;
} }
.img-box { .img-box {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
......
...@@ -112,7 +112,7 @@ export default { ...@@ -112,7 +112,7 @@ export default {
this.tableData = [...tableData, ...list] this.tableData = [...tableData, ...list]
this.tableRef().loadComplete = true this.tableRef().loadComplete = true
this.total = total this.total = total
if (total) this.$set(this.tabs, 0, `待执行推送客户(${total})`) this.$set(this.tabs, 0, `待执行推送客户(${total})`)
} catch (error) { } catch (error) {
this.tableRef() && (this.tableRef().loadComplete = true) this.tableRef() && (this.tableRef().loadComplete = true)
} }
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
this.total = total this.total = total
uni.hideLoading() uni.hideLoading()
} }
if (total) this.$set(this.tabs, 1, `近7日已推送客户(${total})`) this.$set(this.tabs, 1, `近7日已推送客户(${total})`)
} catch (error) { } catch (error) {
this.tableRef() && (this.tableRef().loadComplete = true) this.tableRef() && (this.tableRef().loadComplete = true)
} }
......
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
<scroll-view scroll-y class="content-scroll-box" id="content-scroll" :style="{ height: contentHeight }" <scroll-view scroll-y class="content-scroll-box" id="content-scroll" :style="{ height: contentHeight }"
:scroll-top="flagObject.scrollTop"> :scroll-top="flagObject.scrollTop">
<template v-for="(i, index) in goodsList"> <template v-for="(i, index) in goodsList">
<view :class="['goods-item', goodsIndex == index ? 'active' : '', `status-${i.status}`]" :key="index" <view :class="['goods-item', goodsIndex == index ? 'active' : '', `status-${i.isMainPush}`]" :key="index"
@click="changeGoods(i, index)"> @click="changeGoods(i, index)">
<view :class="['goods-status flex']">{{ statusText(i.status) }}</view> <view :class="['goods-status flex']">{{ statusText(i.isMainPush) }}</view>
<image class="goods-image" :src="i.chooseCardPicurl"></image> <image class="goods-image" :src="i.thumbImageUrl"></image>
<view class="goods-title">{{ i.name }}</view> <view class="goods-title">{{ i.tabName }}</view>
<view class="goods-description"> <view class="goods-description">
<rich-text :nodes="i.descriptionText"></rich-text> <rich-text :nodes="i.tabDescription"></rich-text>
</view> </view>
<view class="goods-price"> <view class="goods-price">
¥ {{ i.updatedDate }} ¥ {{ i.discountPrice }}
<view class="old-price">¥ {{ i.merchantConfigId }}</view> <view class="old-price">¥ {{ i.currentPrice }}</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -27,14 +27,16 @@ ...@@ -27,14 +27,16 @@
export default { export default {
name: 'SkuBox', name: 'SkuBox',
props: { props: {
defaultTabId: Number,
currentCar: [Number, String], currentCar: [Number, String],
show: Boolean show: Boolean,
activityData: Array,
tabIndex: Number,
hasBeforeActivity: Boolean,
hasAfterActivity: Boolean,
}, },
data() { data() {
return { return {
tabId: '1',
blockIndex: 0, blockIndex: 0,
secondIndex: 0, secondIndex: 0,
thirdlyIndex: 0, thirdlyIndex: 0,
...@@ -52,12 +54,6 @@ export default { ...@@ -52,12 +54,6 @@ export default {
} }
}, },
watch: { watch: {
defaultTabId: {
immediate: true,
handler(newval) {
if (this.show) this.tabId = newval
}
},
/**切换车型 */ /**切换车型 */
currentCar: { currentCar: {
immediate: true, immediate: true,
...@@ -70,14 +66,13 @@ export default { ...@@ -70,14 +66,13 @@ export default {
handler(newval) { handler(newval) {
if (newval && !this.requested) { if (newval && !this.requested) {
this.requested = true this.requested = true
this.init(this.defaultTabId) this.init()
} }
} }
}, },
watchStatus: { watchStatus: {
immediate: true, immediate: true,
handler(newval) { handler(newval) {
this.tabId = '1'
} }
}, },
}, },
...@@ -85,38 +80,24 @@ export default { ...@@ -85,38 +80,24 @@ export default {
watchStatus() { watchStatus() {
return this.$store.state.user.historyStatus; return this.$store.state.user.historyStatus;
}, },
boutiqueMediaConfig() {
return this.$store.state.user.boutiqueMediaConfig
},
list() {
let item = this.boutiqueMediaConfig[this.currentCar]
return item?.retrofitting || []
}
}, },
mounted() { mounted() {
}, },
methods: { methods: {
changeCar(newval) { init() {
let [item] = this.boutiqueMediaConfig[newval].retrofitting // this.setGoodsList(this.activityData[this.tabIndex].productList)
this.changeTabId(item.tabId, 0, false) this.changeCar(this.currentCar)
},
init(tabId) {
let index = this.boutiqueMediaConfig[this.currentCar].retrofitting.findIndex(e => e.tabId == tabId)
this.changeTabId(tabId, index, false)
},
changeTabId(tabId, index, filter = true) {
if (filter && tabId == this.tabId && index == this.blockIndex) return
this.tabId = tabId
this.blockIndex = index
this.setSecondList()
}, },
async setSecondList() { changeCar(newval) {
let secondList = this.boutiqueMediaConfig[this.currentCar].retrofitting, this.goodsList = []
index = secondList.findIndex(e => e.tabId == this.tabId) let { activityData, tabIndex } = this,
if (index == -1) index = 0 { carSeriesList } = activityData[tabIndex],
let { list } = secondList[index] data = carSeriesList.find(e => e.carSeriesId == newval)
this.secondList = list if (data) {
this.secondClick(0, false) this.setGoodsList(data.productList)
this.$emit('noActivity', false)
} else this.$emit('noActivity', true)
}, },
setScrollHeight() { setScrollHeight() {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -127,49 +108,23 @@ export default { ...@@ -127,49 +108,23 @@ export default {
}).exec() }).exec()
}) })
}, },
secondClick(index, filter = true) {
if (filter && this.secondIndex == index) return
let { secondList } = this
this.secondIndex = index
this.secondName = secondList[index].category
if (this.tabId == 2 && this.secondName == '窗膜') {
let { infoList } = this.secondList[index],
arr = Array.from(new Set([...infoList.map((e) => e.brand)])),
brandList = []
arr.map(e => {
let obj = {
brandName: e,
list: []
}
infoList.map(i => {
if (i.brand == e) obj.list.push(i)
})
brandList.push(obj)
})
this.brandList = brandList
this.thirdlyClick(0, false)
} else this.getGoodsList()
},
thirdlyClick(index, filter = true) {
if (filter && this.thirdlyIndex == index) return
this.thirdlyIndex = index
this.getGoodsList()
},
changeGoods(item, index, filter = true) { changeGoods(item, index, filter = true) {
if (filter && this.goodsIndex == index) return if (filter && this.goodsIndex == index) return
this.goodsIndex = index this.goodsIndex = index
this.currentItem = item this.currentItem = item
this.changePreView() this.changePreView()
}, },
getGoodsList() { setGoodsList(data) {
this.goodsList = [] this.goodsList = []
this.flagObject.goodsFlag = false this.flagObject.goodsFlag = false
let { secondIndex, secondList, tabId, brandList, thirdlyIndex, secondName } = this data.map(e => {
let goodsList = this.setGoodsData(tabId == 2 && secondName == '窗膜' ? brandList[thirdlyIndex].list : secondList[secondIndex].infoList) console.log(e)
this.goodsList = goodsList if (e.tabDescription) e.tabDescription = e.tabDescription.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>')
})
this.goodsList = data
this.flagObject.goodsFlag = true this.flagObject.goodsFlag = true
this.flagObject.scrollTop = -100 this.flagObject.scrollTop = -100
this.changeGoods(goodsList[0], 0, false) this.changeGoods(data[0], 0, false)
setTimeout(() => { setTimeout(() => {
this.setScrollHeight() this.setScrollHeight()
}, 500) }, 500)
...@@ -177,15 +132,12 @@ export default { ...@@ -177,15 +132,12 @@ export default {
changePreView() { changePreView() {
this.$emit('changePreView', this.currentItem) this.$emit('changePreView', this.currentItem)
}, },
setGoodsData(data, key) { // setGoodsData(data, key) {
let goodsList = [] // let goodsList = []
data.map(e => {
if (e.description) e.descriptionText = e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>') // console.log(goodsList)
goodsList.push(e) // return goodsList
}) // },
console.log(goodsList)
return goodsList
},
statusText(status) { statusText(status) {
return status == 1 ? '主推' : '次推' return status == 1 ? '主推' : '次推'
}, },
...@@ -203,6 +155,7 @@ export default { ...@@ -203,6 +155,7 @@ export default {
position: relative; position: relative;
width: calc(100% - #{toRpx(64)}); width: calc(100% - #{toRpx(64)});
border: toRpx(3) solid #292D3333; border: toRpx(3) solid #292D3333;
min-height: toRpx(296);
border-radius: toRpx(16); border-radius: toRpx(16);
padding: toRpx(24) toRpx(32) toRpx(24) toRpx(232); padding: toRpx(24) toRpx(32) toRpx(24) toRpx(232);
margin-bottom: toRpx(24); margin-bottom: toRpx(24);
...@@ -267,7 +220,8 @@ export default { ...@@ -267,7 +220,8 @@ export default {
.goods-status { .goods-status {
background: linear-gradient(270deg, #FF6748 0%, #F24724 100%); background: linear-gradient(270deg, #FF6748 0%, #F24724 100%);
} }
&::after{
&::after {
position: absolute; position: absolute;
content: ''; content: '';
width: 296rpx; width: 296rpx;
......
...@@ -21,14 +21,20 @@ ...@@ -21,14 +21,20 @@
<view class="sprite-icon icon-info_shield"></view> <view class="sprite-icon icon-info_shield"></view>
</view> </view>
<view class="content-box flex" v-show="hasOptionals ? tabIndex != tabs.length - 1 : true"> <view class="content-box flex" v-show="hasOptionals ? tabIndex != tabs.length - 1 : true">
<template v-if="currentItem && currentItem.modelDisplayPicurl"> <template v-if="noActivity">
<view class="no-activity-box">
<image class="icon" :src="require('@/assets/images/common/noData.webp')" />
暂无数据
</view>
</template>
<template v-if="currentItem">
<view class="left-content flex" :key="updateViewKey" @click="showPicture(currentItem)"> <view class="left-content flex" :key="updateViewKey" @click="showPicture(currentItem)">
<template v-if="showActivity"> <template v-if="showActivity">
<image :src="currentItem.modelDisplayPicurl" class="img" /> <image :src="currentItem.mainImageUrl" class="img" />
<view class="img-bg-1"></view> <view class="img-bg-1"></view>
<view class="img-bg-2"></view> <view class="img-bg-2"></view>
<view class="img-mask"> <view class="img-mask">
<image :src="currentItem.modelDisplayPicurl" class="icon" /> <image :src="currentItem.mainImageUrl" class="icon" />
</view> </view>
</template> </template>
<template v-else> <template v-else>
...@@ -40,7 +46,9 @@ ...@@ -40,7 +46,9 @@
<view class="right-content"> <view class="right-content">
<template v-if="showActivity"> <template v-if="showActivity">
<view class="sku-box"> <view class="sku-box">
<goods-box :currentCar="currentCarId" :show="show" @changePreView="changePreView" ref="goodsBox" /> <goods-box :currentCar="currentCarId" :activityData="activityData" :show="show"
@changePreView="changePreView" ref="goodsBox" :tabIndex="tabIndex"
@noActivity="noActivity = $event" />
</view> </view>
</template> </template>
<template v-else> <template v-else>
...@@ -105,8 +113,8 @@ export default { ...@@ -105,8 +113,8 @@ export default {
tabIndex: 0, tabIndex: 0,
isSelect: false, isSelect: false,
currentCarId: '', currentCarId: '',
hasBeforeActivity: true, activityData: [],
hasAfterActivity: true, noActivity: false
} }
}, },
watch: { watch: {
...@@ -146,8 +154,18 @@ export default { ...@@ -146,8 +154,18 @@ export default {
}, },
show: { show: {
immediate: true, immediate: true,
handler(newval) { async handler(newval) {
if (newval) { if (newval) {
console.log(this.activityData)
if (!this.activityData.length) {
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo,
data = await uni.$api.activityApi.getActivityProductListAPI({
merchantId: shopMerchantId
})
this.activityData = data
this.currentItem = null
}
this.isSelect = false this.isSelect = false
let index = 0 let index = 0
if (this.hasBeforeActivity || this.hasAfterActivity) { if (this.hasBeforeActivity || this.hasAfterActivity) {
...@@ -167,7 +185,6 @@ export default { ...@@ -167,7 +185,6 @@ export default {
if (hasBeforeActivity || hasAfterActivity) skuIndex = 1 if (hasBeforeActivity || hasAfterActivity) skuIndex = 1
if (hasBeforeActivity && hasAfterActivity) skuIndex = 2 if (hasBeforeActivity && hasAfterActivity) skuIndex = 2
return tabIndex != skuIndex return tabIndex != skuIndex
}, },
watchStatus() { watchStatus() {
return this.$store.state.user.historyStatus; return this.$store.state.user.historyStatus;
...@@ -196,7 +213,9 @@ export default { ...@@ -196,7 +213,9 @@ export default {
/**是否有选装项目 */ /**是否有选装项目 */
hasOptionals() { hasOptionals() {
let flag = false let flag = false
if (this.show) flag = this.boutiqueMediaConfig[this.currentCarId].optionals && this.boutiqueMediaConfig[this.currentCarId].optionals.length if (this.show) {
flag = this.boutiqueMediaConfig[this.currentCarId].optionals && this.boutiqueMediaConfig[this.currentCarId].optionals.length
}
return flag return flag
}, },
carList() { carList() {
...@@ -210,10 +229,17 @@ export default { ...@@ -210,10 +229,17 @@ export default {
if (hasOptionals) tabs.push('选装') if (hasOptionals) tabs.push('选装')
return tabs return tabs
}, },
hasBeforeActivity() {
return this.activityData.some(e => e.marketingStage == 0)
},
hasAfterActivity() {
return this.activityData.some(e => e.marketingStage == 1)
}
}, },
methods: { methods: {
changeCar(item) { changeCar(item) {
console.log(item)
if (this.change_disabled || this.currentCarId == item.carModelId) return uni.hideLoading() if (this.change_disabled || this.currentCarId == item.carModelId) return uni.hideLoading()
this.currentCarString = item.carModelName this.currentCarString = item.carModelName
this.currentCarId = item.carModelId this.currentCarId = item.carModelId
...@@ -260,8 +286,10 @@ export default { ...@@ -260,8 +286,10 @@ export default {
uni.hideLoading() uni.hideLoading()
}, },
showPicture(off = true) { showPicture(off = true) {
let { detailPicurl } = this.currentItem let { currentItem } = this
this.currentImgUrl = off ? detailPicurl : '' let detailPicurl = currentItem.detailPicurl,
detailImageUrl = currentItem.detailImageUrl
this.currentImgUrl = off ? detailPicurl || detailImageUrl : ''
}, },
reception(e) { reception(e) {
this.clearCustomerReceivedTimer() this.clearCustomerReceivedTimer()
...@@ -299,7 +327,7 @@ export default { ...@@ -299,7 +327,7 @@ export default {
this.tabIndex = index this.tabIndex = index
this.currentItem = null this.currentItem = null
this.$nextTick(() => { this.$nextTick(() => {
if(skuIndex == 2 && index < 2) this.$refs.goodsBox.changeCar(this.currentCarId) if (skuIndex == 2 && index < 2) this.$refs.goodsBox.changeCar(this.currentCarId)
if (index == skuIndex) this.$refs.sku.changeCar(this.currentCarId) if (index == skuIndex) this.$refs.sku.changeCar(this.currentCarId)
this.clearCanvas() this.clearCanvas()
}) })
...@@ -599,4 +627,31 @@ export default { ...@@ -599,4 +627,31 @@ export default {
} }
} }
} }
.no-activity-box {
position: absolute;
left: 0;
top: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: toRpx(32);
color: #999999;
line-height: toRpx(44);
width: 100%;
height: 100%;
.icon {
width: 300rpx;
height: 236rpx;
margin-bottom: 8rpx;
}
.text {
font-size: 24rpx;
line-height: 28rpx;
color: #999;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!