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