客服:完善商品消息发送
parent
d9efd4e2e6
commit
b630d26d4b
|
|
@ -91,16 +91,16 @@
|
||||||
></su-image>
|
></su-image>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- <template v-if="item.contentType === KeFuMessageContentTypeEnum.PRODUCT">-->
|
<template v-if="item.contentType === KeFuMessageContentTypeEnum.PRODUCT">
|
||||||
<!-- <GoodsItem-->
|
<GoodsItem
|
||||||
<!-- :goodsData="item.content.item"-->
|
:goodsData="JSON.parse(item.content)"
|
||||||
<!-- @tap="-->
|
@tap="
|
||||||
<!-- sheep.$router.go('/pages/goods/index', {-->
|
sheep.$router.go('/pages/goods/index', {
|
||||||
<!-- id: item.content.item.id,-->
|
id: JSON.parse(item.content).id,
|
||||||
<!-- })-->
|
})
|
||||||
<!-- "-->
|
"
|
||||||
<!-- />-->
|
/>
|
||||||
<!-- </template>-->
|
</template>
|
||||||
<!-- <template v-if="item.contentType === KeFuMessageContentTypeEnum.ORDER">-->
|
<!-- <template v-if="item.contentType === KeFuMessageContentTypeEnum.ORDER">-->
|
||||||
<!-- <OrderItem-->
|
<!-- <OrderItem-->
|
||||||
<!-- from="msg"-->
|
<!-- from="msg"-->
|
||||||
|
|
@ -133,8 +133,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { nextTick, onMounted,onBeforeUnmount, reactive, ref, unref } from 'vue';
|
import { nextTick, onBeforeUnmount, onMounted, reactive, ref, unref } from 'vue';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
|
import GoodsItem from './goods.vue';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import KeFuApi from '@/sheep/api/promotion/kefu';
|
import KeFuApi from '@/sheep/api/promotion/kefu';
|
||||||
import { isEmpty } from '@/sheep/helper/utils';
|
import { isEmpty } from '@/sheep/helper/utils';
|
||||||
|
|
@ -175,22 +176,6 @@
|
||||||
};
|
};
|
||||||
defineExpose({ getMessageList });
|
defineExpose({ getMessageList });
|
||||||
|
|
||||||
const poller = ref(null) // TODO puhui999: 轮训定时器,暂时模拟 websocket
|
|
||||||
onMounted(() => {
|
|
||||||
// TODO puhui999: 轮训相关,功能完善后移除
|
|
||||||
if (!poller.value) {
|
|
||||||
poller.value = setInterval(() => {
|
|
||||||
getMessageList(1)
|
|
||||||
}, 1000)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// TODO puhui999: 轮训相关,功能完善后移除
|
|
||||||
onBeforeUnmount(() => {
|
|
||||||
if (!poller.value) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
clearInterval(poller.value)
|
|
||||||
})
|
|
||||||
const scrollTop = ref(0); // 当前滚动区域距离顶部的距离
|
const scrollTop = ref(0); // 当前滚动区域距离顶部的距离
|
||||||
const currentTop = ref(0);
|
const currentTop = ref(0);
|
||||||
const showGoBottom = ref(false);
|
const showGoBottom = ref(false);
|
||||||
|
|
@ -232,6 +217,7 @@
|
||||||
|
|
||||||
// 虚拟列表展示可视区域的数据
|
// 虚拟列表展示可视区域的数据
|
||||||
const includePage = index => {
|
const includePage = index => {
|
||||||
|
console.log(visiblePagesList.value, index);
|
||||||
return visiblePagesList.value.indexOf(index) > -1;
|
return visiblePagesList.value.indexOf(index) > -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="goods ss-flex">
|
<view class="goods ss-flex">
|
||||||
<image class="image" :src="sheep.$url.cdn(goodsData.image)" mode="aspectFill"> </image>
|
<image class="image" :src="sheep.$url.cdn(goodsData.picUrl)" mode="aspectFill"> </image>
|
||||||
<view class="ss-flex-1">
|
<view class="ss-flex-1">
|
||||||
<view class="title ss-line-2">
|
<view class="title ss-line-2">
|
||||||
{{ goodsData.title }}
|
{{ goodsData.spuName }}
|
||||||
</view>
|
</view>
|
||||||
<view v-if="goodsData.subtitle" class="subtitle ss-line-1">
|
<view v-if="goodsData.introduction" class="subtitle ss-line-1">
|
||||||
{{ goodsData.subtitle }}
|
{{ goodsData.introduction }}
|
||||||
</view>
|
</view>
|
||||||
<view class="price ss-m-t-8">
|
<view class="price ss-m-t-8">
|
||||||
¥{{ isArray(goodsData.price) ? goodsData.price[0] : goodsData.price }}
|
¥{{ goodsData.price }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { isArray } from 'lodash';
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
goodsData: {
|
goodsData: {
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
<view
|
<view
|
||||||
class="item"
|
class="item"
|
||||||
v-for="item in state.pagination.data"
|
v-for="item in state.pagination.data"
|
||||||
:key="item"
|
:key="item.id"
|
||||||
@tap="emits('select', { type: mode, data: item })"
|
@tap="emits('select', { type: mode, data: item })"
|
||||||
>
|
>
|
||||||
<template v-if="mode == 'goods'">
|
<template v-if="mode == 'goods'">
|
||||||
<GoodsItem :goodsData="item.goods" />
|
<GoodsItem :goodsData="item" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="mode == 'order'">
|
<template v-if="mode == 'order'">
|
||||||
<OrderItem :orderData="item" />
|
<OrderItem :orderData="item" />
|
||||||
|
|
@ -32,7 +32,6 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, watch } from 'vue';
|
import { reactive, watch } from 'vue';
|
||||||
import sheep from '@/sheep';
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import GoodsItem from './goods.vue';
|
import GoodsItem from './goods.vue';
|
||||||
import OrderItem from './order.vue';
|
import OrderItem from './order.vue';
|
||||||
|
|
@ -83,7 +82,7 @@
|
||||||
page,
|
page,
|
||||||
list_rows,
|
list_rows,
|
||||||
});
|
});
|
||||||
let orderList = _.concat(state.pagination.data, res.data.data);
|
let orderList = _.concat(state.pagination.data, res.data.list);
|
||||||
state.pagination = {
|
state.pagination = {
|
||||||
...res.data,
|
...res.data,
|
||||||
data: orderList,
|
data: orderList,
|
||||||
|
|
|
||||||
|
|
@ -118,19 +118,17 @@
|
||||||
content: res.data,
|
content: res.data,
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
// TODO puhui999: 还需要重构
|
|
||||||
case 'goods':
|
case 'goods':
|
||||||
msg = {
|
msg = {
|
||||||
contentType: KeFuMessageContentTypeEnum.PRODUCT,
|
contentType: KeFuMessageContentTypeEnum.PRODUCT,
|
||||||
content: {
|
content: JSON.stringify({
|
||||||
item: {
|
id: data.id,
|
||||||
id: data.goods.id,
|
spuName: data.spuName,
|
||||||
title: data.goods.title,
|
picUrl: data.picUrl,
|
||||||
image: data.goods.image,
|
price: data.price,
|
||||||
price: data.goods.price,
|
introduction: data.introduction,
|
||||||
stock: data.goods.stock,
|
stock: data.stock,
|
||||||
},
|
})
|
||||||
},
|
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'order':
|
case 'order':
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue