123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351 |
- <template>
- <div class="custom">
- <!-- {{ isCustom }} -->
- <template v-if="isCustom.businessID === 'product_message'">
- <div class="evaluate">
- <div @click="product(isCustom)">
- <div class="left">
- <img
- :src="isCustom.pic"
- style="width: 80px; height: 80px; border-radius: 10px"
- />
- <div class="right">
- <div class="label">
- {{ isCustom.spuName }}
- </div>
- <div style="font-weight: 400; font-size: 28rpx">
- {{ isCustom.price }}元/{{ isCustom.unit }}
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-else-if="isCustom.businessID === 'modify_order_cost'">
- <div class="evaluate">
- <span style="font-size: 36rpx; line-height: 44rpx"
- >老板,请及时修改订单费用!</span
- >
- <div @click="productOrder(isCustom)" style="margin-top: 10px">
- <div class="left">
- <img
- :src="isCustom.pic"
- style="width: 80px; height: 80px; border-radius: 10px"
- />
- <div class="right">
- <div class="label">
- {{ isCustom.spuName }}
- </div>
- <div style="font-weight: 400; font-size: 28rpx">
- {{ isCustom.price }}元/{{ isCustom.unit }}
- </div>
- </div>
- </div>
- <div style="line-height: 32px; margin-top: 10px">
- <div>
- <span class="name">姓名 :</span>
- <span class="value">{{ isCustom.consigneeContactName }}</span>
- </div>
- <div>
- <span class="name">电话 :</span>
- <span class="value">{{ isCustom.consigneeContactMobile }}</span>
- </div>
- <div>
- <span class="name">地址 :</span>
- <span class="value">{{ isCustom.consigneeAddressDetail }}</span>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-else-if="isCustom.businessID === 'reminder_pay'">
- <div class="evaluate">
- <span style="font-size: 36rpx; line-height: 44rpx">亲,请及时付款!</span>
- <div @click="productOrder(isCustom)" style="margin-top: 10px">
- <div class="left">
- <img
- :src="isCustom.pic"
- style="width: 80px; height: 80px; border-radius: 10px"
- />
- <div class="right">
- <div class="label">
- {{ isCustom.spuName }}
- </div>
- <div style="font-weight: 400; font-size: 28rpx">
- {{ isCustom.price }}元/{{ isCustom.unit }}
- </div>
- </div>
- </div>
- <div style="line-height: 32px; margin-top: 10px">
- <div>
- <span class="name">姓名 :</span>
- <span class="value">{{ isCustom.consigneeContactName }}</span>
- </div>
- <div>
- <span class="name">电话 :</span>
- <span class="value">{{ isCustom.consigneeContactMobile }}</span>
- </div>
- <div>
- <span class="name">地址 :</span>
- <span class="value">{{ isCustom.consigneeAddressDetail }}</span>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-else-if="isCustom.businessID === 'order_deliver_goods'">
- <div class="evaluate">
- <span style="font-size: 36rpx; line-height: 44rpx">老板,请尽快发货!</span>
- <div @click="productOrder(isCustom)" style="margin-top: 10px">
- <div class="left">
- <img
- :src="isCustom.pic"
- style="width: 80px; height: 80px; border-radius: 10px"
- />
- <div class="right">
- <div class="label">
- {{ isCustom.spuName }}
- </div>
- <div style="font-weight: 400; font-size: 28rpx">
- {{ isCustom.price }}元/{{ isCustom.unit }}
- </div>
- </div>
- </div>
- <div style="line-height: 32px; margin-top: 10px">
- <div>
- <span class="name">姓名 :</span>
- <span class="value">{{ isCustom.consigneeContactName }}</span>
- </div>
- <div>
- <span class="name">电话 :</span>
- <span class="value">{{ isCustom.consigneeContactMobile }}</span>
- </div>
- <div>
- <span class="name">地址 :</span>
- <span class="value">{{ isCustom.consigneeAddressDetail }}</span>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-else-if="isCustom.businessID === 'order_pay'">
- <div class="evaluate">
- <span style="font-size: 36rpx; line-height: 44rpx"
- >订单价格已修改,请及时付款!</span
- >
- <div @click="productOrder(isCustom)" style="margin-top: 10px">
- <div class="left">
- <img
- :src="isCustom.pic"
- style="width: 80px; height: 80px; border-radius: 10px"
- />
- <div class="right">
- <div class="label">
- {{ isCustom.spuName }}
- </div>
- <div style="font-weight: 400; font-size: 28rpx">
- {{ isCustom.price }}元/{{ isCustom.unit }}
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-else>
- <span v-html="content.custom" />
- </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 * as mesApi from "@/api/message/index";
- 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 = JSONToObject(payload.data);
- if (payload.data === CHAT_MSG_CUSTOM_TYPE.SERVICE) {
- extension.value = JSONToObject(payload.extension);
- }
- });
- const openLink = (url: any) => {
- window.open(url);
- };
- // const productOrderPay = async (record) => {
- // let userid = uni.getStorageSync("userId");
- // if (userid == record.shopOwnerId) {
- // let res = await mesApi.default.orderDetail(record.orderId);
- // if (res.code == 200) {
- // let item = res.data;
- // webUni.webView.navigateTo({
- // url: `/subpages/my/product-orders/sell-order-details?id=${item.id}&item=${item.consigneeAddress.contact.contactMobile}&orderStatus=${item.orderStatus}&transportStatus=${item.transportStatus}&invoiceStatus=${item.invoiceStatus}¤tIndex=1`,
- // });
- // }
- // console.log(res);
- // } else {
- // webUni.webView.navigateTo({
- // url: `/subpages/my/product-orders/buy-order-details?id=` + record.orderId,
- // });
- // }
- // };
- const productOrder = async (record) => {
- let userid = uni.getStorageSync("userId");
- if (userid == record.shopOwnerId) {
- let res = await mesApi.default.orderDetail(record.orderId);
- if (res.code == 200) {
- let item = res.data;
- webUni.webView.navigateTo({
- url: `/subpages/my/product-orders/sell-order-details?id=${item.orderId}&item=${item.consigneeAddress.contact.contactMobile}&orderStatus=${item.orderStatus}&transportStatus=${item.transportStatus}&invoiceStatus=${item.invoiceStatus}¤tIndex=1`,
- });
- }
- console.log(res);
- } else {
- webUni.webView.navigateTo({
- url: `/subpages/my/product-orders/buy-order-details?id=` + record.orderId,
- });
- }
- };
- const product = (record) => {
- webUni.webView.navigateTo({
- url: `/subpages/home/carpoolGoods/product-details?id=` + record.id,
- });
- };
- </script>
- <style lang="scss" scoped>
- @import "../../../../assets/styles/common";
- .name {
- font-weight: bold;
- font-size: 16px;
- margin-right: 10px;
- }
- .value {
- font-size: 16px;
- margin-right: 10px;
- }
- a {
- color: #679ce1;
- }
- .custom {
- font-size: 14px;
- h1 {
- font-size: 14px;
- color: #000;
- }
- h1,
- a,
- p {
- font-size: 14px;
- }
- .evaluate {
- min-width: 240px;
- width: 240px;
- .left {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- background: #7a7a7d29;
- border-radius: 15px;
- padding: 15px;
- }
- .right {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- height: 75px;
- width: 70%;
- justify-content: center;
- line-height: 25px;
- margin-left: 10px;
- .label {
- font-weight: bold;
- font-size: 14px;
- width: 100px;
- height: auto;
- word-wrap: break-word;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- ul {
- display: flex;
- padding: 10px 0;
- }
- &-list {
- display: flex;
- flex-direction: row;
- &-item {
- padding: 0 2px;
- }
- }
- }
- .order {
- display: flex;
- main {
- padding-left: 5px;
- p {
- font-family: PingFangSC-Regular;
- width: 145px;
- line-height: 17px;
- font-size: 14px;
- color: #999;
- letter-spacing: 0;
- margin-bottom: 6px;
- word-break: break-word;
- }
- span {
- font-family: PingFangSC-Regular;
- line-height: 25px;
- color: #ff7201;
- }
- }
- img {
- width: 67px;
- height: 67px;
- }
- }
- }
- </style>
|