123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <template>
- <div class="custom" style="font-size: 14px">
- <!-- 发送产品自定义消息 -->
- <template v-if="isCustom.businessID === 'hm_goods_message'">
- <view>
- <view class="qzy-center item-main" @click="toDetail(isCustom)">
- <image class="item-l" :src="isCustom.coverImg" mode="scaleToFill" />
- <view class="item-r">
- <view class="text-14 text-bold item-title ellipsis-nowrap">
- {{ isCustom.title }}
- </view>
- <view class="qzy-center text-500">
- <text class="text-12">¥</text>
- <text class="text-18">{{ isCustom.price }}</text>
- <i class="text-12">/{{ isCustom.unit }}</i>
- </view>
- </view>
- </view>
- </view>
- </template>
- </div>
- </template>
- <script lang="ts" setup>
- import { watchEffect, ref } from "../../../../adapter-vue";
- import {
- TUITranslateService,
- IMessageModel,
- } from "@tencentcloud/chat-uikit-engine";
- import { isUrl, JSONToObject } from "../../../../utils/index";
- import { CHAT_MSG_CUSTOM_TYPE } from "../../../../constant";
- import { ICustomMessagePayload } from "../../../../interface";
- import Icon from "../../../common/Icon.vue";
- import star from "../../../../assets/icon/star-light.png";
- import api from "@/api/home.js";
- const ownId = uni.getStorageSync("userId");
- interface IEmits {
- (key: "scrollToLatestMessage"): void;
- }
- const emits = defineEmits<IEmits>();
- interface Props {
- messageItem: IMessageModel;
- content: any;
- }
- const props = withDefaults(defineProps<Props>(), {
- messageItem: undefined,
- content: undefined,
- });
- const custom = ref();
- const message = ref<IMessageModel>();
- const extension = ref();
- const isCustom = ref<ICustomMessagePayload>({
- businessID: "",
- });
- watchEffect(() => {
- custom.value = props.content;
- message.value = props.messageItem;
- const { payload } = props.messageItem;
- isCustom.value = payload.data || "";
- isCustom.value = JSON.parse(payload.data);
- if (payload.data === CHAT_MSG_CUSTOM_TYPE.SERVICE) {
- extension.value = JSONToObject(payload.extension);
- }
- });
- const toDetail = (item) => {
- let shopId = uni.getStorageSync("userId");
- if (!shopId.includes("E")) {
- webUni.webView.navigateTo({
- url:
- "/packageHomeMaking/home/list/detail?id=" +
- item.goodsId +
- "&type=" +
- item.type +
- "&title=" +
- item.title,
- });
- }
- };
- </script>
- <style lang="scss" scoped>
- @import "../../../../assets/styles/common";
- .phone {
- min-width: 180px;
- height: 65px;
- border-radius: 10px;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- padding: 2px;
- }
- .xian {
- width: 408rpx;
- height: 1rpx;
- background: #000000;
- opacity: 0.1;
- }
- .phone_footer {
- display: flex;
- flex-direction: row;
- justify-content: space-around;
- position: relative;
- top: 8px;
- height: 25px;
- align-items: center;
- }
- a {
- color: #405eff;
- }
- .custom {
- font-size: 14px;
- h1 {
- font-size: 14px;
- color: #000;
- }
- h1,
- a,
- p {
- font-size: 14px;
- }
- .evaluate {
- ul {
- display: flex;
- padding: 10px 0;
- }
- &-list {
- display: flex;
- flex-direction: row;
- &-item {
- padding: 0 2px;
- }
- }
- }
- .order {
- display: flex;
- min-height: 250px;
- min-width: 215px;
- flex-direction: column;
- padding: 5px;
- .header {
- width: 100%;
- height: 55px;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- .contont {
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- align-items: flex-start;
- height: 190px;
- .title {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 26rpx;
- color: #a1a1a1;
- line-height: 44rpx;
- }
- .value {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 30rpx;
- color: #666666;
- line-height: 44rpx;
- }
- }
- .main {
- padding-left: 5px;
- width: 90%;
- line-height: 25px;
- }
- img {
- width: 45px;
- height: 45px;
- }
- }
- .data-time {
- background: #f4f4f4;
- padding: 10upx 24upx;
- }
- .item-l {
- width: 60px;
- height: 60px;
- border-radius: 6upx;
- margin-right: 22upx;
- }
- .item-r {
- width: calc(100% - 70px);
- padding: 10upx 0;
- }
- .item-row {
- text {
- display: block;
- }
- }
- i {
- font-style: normal;
- }
- .invite-box {
- .item-row {
- padding: 10upx 0;
- }
- }
- }
- .operate-box {
- margin-top: 10px;
- padding-top: 10px;
- text-align: center;
- font-weight: bold;
- font-size: 32upx;
- }
- .in {
- .operate-box {
- color: #405eff;
- border-top: 1px solid #f4f4f4;
- }
- .item-main {
- background: #f4f4f4;
- padding: 14upx;
- border-radius: 16rpx;
- }
- }
- .out {
- .operate-box {
- border-top: 1px solid rgba(255, 255, 255, 0.5);
- color: #fff;
- }
- .item-main {
- background: #405eff;
- padding: 14upx;
- border-radius: 16rpx;
- }
- }
- </style>
|