|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<view class="chat-container">
|
|
|
<!-- 连接状态指示器 -->
|
|
|
- <view class="connection-status" v-if="!isConnected">
|
|
|
+ <view class="connection-status" v-if="!isConnected && !isManualDisconnect">
|
|
|
<text class="status-text">{{ '连接中...' }}</text>
|
|
|
</view>
|
|
|
|
|
|
@@ -66,6 +66,14 @@
|
|
|
<view v-else>
|
|
|
<text v-if="message.goodsInfo.goodsPriceType == 0">报价窗口期已过,无法报价</text>
|
|
|
</view>
|
|
|
+ <!-- 报价类型显示重新报价 -->
|
|
|
+ <view v-if="message.goodsInfo.goodsPriceType == 2 && isExpired(message.timestamp)" class="action-buttons">
|
|
|
+ <form @submit.prevent="createQrotedPrice(message)">
|
|
|
+ <text class="goods-price" v-if="message.goodsInfo.lastPrice || message.goodsInfo.goodsPrice">¥{{message.goodsInfo.lastPrice || message.goodsInfo.goodsPrice}}</text>
|
|
|
+ <input class="price-input" type="number" v-model="message.quotedPrice" placeholder="输入价格" />
|
|
|
+ <button class="action-btn buy-btn" form-type="submit">重新报价</button>
|
|
|
+ </form>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="message-time align-right">{{ message.time }}</view>
|
|
|
</view>
|
|
|
@@ -109,9 +117,9 @@
|
|
|
</view>
|
|
|
<view class="action-buttons">
|
|
|
<button class="action-btn spec-btn" @click="toGoodsDetail(message.goodsInfo)">查看商品</button>
|
|
|
- <button v-if="message.goodsInfo.goodsPriceType == 1" class="action-btn buy-btn" click="toBuy">去购买</button>
|
|
|
+ <!-- <button v-if="message.goodsInfo.goodsPriceType == 1" class="action-btn buy-btn" @click="toBuy">去购买</button> -->
|
|
|
<!-- 报价类型显示去购买 -->
|
|
|
- <button v-if="message.goodsInfo.goodsPriceType == 2" class="action-btn buy-btn" click="toBuy">去购买</button>
|
|
|
+ <!-- <button v-if="message.goodsInfo.goodsPriceType == 2" class="action-btn buy-btn" @click="toBuy">去购买</button> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="message-time align-right">{{ message.time }}</view>
|
|
|
@@ -1008,16 +1016,20 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- createQrotedPrice(goodsInfo) {
|
|
|
- console.log("createPrice", goodsInfo)
|
|
|
+ createQrotedPrice(message) {
|
|
|
+ console.log("createPrice", message)
|
|
|
createQuotedPrice({
|
|
|
- key: goodsInfo.goodsInfo.key,
|
|
|
- price: goodsInfo.quotedPrice,
|
|
|
+ key: message.goodsInfo.key,
|
|
|
+ price: message.quotedPrice,
|
|
|
}).then(res => {
|
|
|
console.log("createQuotedPrice", res)
|
|
|
if (res.code == 1) {
|
|
|
this.$msg("报价成功")
|
|
|
- this.sendMessageOfGoodsPrice(goodsInfo.goodsInfo)
|
|
|
+ message.goodsInfo.goodsPriceType = 2;
|
|
|
+ message.goodsInfo.goodsPrice = message.quotedPrice;
|
|
|
+ message.goodsInfo.lastPrice = message.quotedPrice;
|
|
|
+ message.quotedPrice = '';
|
|
|
+ this.sendMessageOfGoodsPrice(message.goodsInfo)
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
console.log("createQuotedPrice error", err)
|
|
|
@@ -1030,6 +1042,32 @@ export default {
|
|
|
const now = Math.floor(Date.now()/1000);
|
|
|
const timeDiff = now - timestamp;
|
|
|
return timeDiff < this.expireTime;
|
|
|
+ },
|
|
|
+ // 查看商品
|
|
|
+ toGoodsDetail(goodsInfo) {
|
|
|
+ // console.log("---------- goodsInfo: ", goodsInfo);
|
|
|
+ const goodsId = parseInt(goodsInfo.goodsId);
|
|
|
+ const categoryId = parseInt(goodsInfo.categoryId);
|
|
|
+ const hdId = parseInt(goodsInfo.hdId);
|
|
|
+ const account = parseInt(goodsInfo.account);
|
|
|
+ if (isNaN(goodsId) || isNaN(categoryId) || isNaN(hdId) || isNaN(account)) {
|
|
|
+ this.$msg("商品数据异常");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$util.pageTo({
|
|
|
+ url: "/admin/goods/detail",
|
|
|
+ query: { // id=2020&categoryId=1402&hdId=229&account=36548&shopId=36548&name=花仙子&avatar=https://img.theflorist.cn/hhb_small.png
|
|
|
+ id: goodsId,
|
|
|
+ account: goodsInfo.account,
|
|
|
+ hdId: goodsInfo.hdId,
|
|
|
+ categoryId: categoryId,
|
|
|
+ shopId: goodsInfo.shopId,
|
|
|
+ name: goodsInfo.name,
|
|
|
+ avatar: goodsInfo.avatar,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.disconnectWebSocket();
|
|
|
}
|
|
|
},
|
|
|
};
|
|
|
@@ -1260,7 +1298,7 @@ export default {
|
|
|
.price-input {
|
|
|
display: inline-block;
|
|
|
vertical-align: middle;
|
|
|
- width: 180rpx;
|
|
|
+ width: 160rpx;
|
|
|
height: 60rpx;
|
|
|
border: 1px solid #666666;
|
|
|
border-radius: 8rpx;
|
|
|
@@ -1289,6 +1327,12 @@ export default {
|
|
|
background-color: #ff9800;
|
|
|
color: white;
|
|
|
}
|
|
|
+ .goods-price {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #ff5050;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-right: 10rpx;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|