Compare commits

...

4 Commits

Author SHA1 Message Date
赵毅
804579f19f 完成易购商品的立即购买功能 2025-11-17 08:35:49 +08:00
赵毅
70b747bcd0 优化聊天界面时间的显示 2025-11-14 17:49:30 +08:00
赵毅
97056bf5b5 优化物业端页面样式 2025-11-14 17:09:05 +08:00
赵毅
94c058c96f 完成加载历史聊天记录功能 2025-11-14 16:32:51 +08:00
7 changed files with 535 additions and 67 deletions

View File

@ -15,15 +15,15 @@
<view v-if="connectingStatus" class="connecting-status">{{ connectingStatus }}</view> <view v-if="connectingStatus" class="connecting-status">{{ connectingStatus }}</view>
<!-- 聊天消息区域 --> <!-- 聊天消息区域 -->
<scroll-view :scroll-into-view="scrollToView" class="chat-messages" lower-threshold="100" scroll-y="true" <scroll-view class="chat-messages" scroll-y="true"
upper-threshold="100" @scrolltolower="loadMoreHistory" @scrolltoupper="loadMoreHistory"> upper-threshold="50" @scrolltoupper="loadMoreHistory" @scroll="onScroll">
<!-- 加载历史消息提示 --> <!-- 加载历史消息提示 -->
<view v-if="isLoadingHistory" class="message-time">加载历史消息...</view> <view v-if="isLoadingHistory" class="message-time">加载历史消息...</view>
<!-- 消息列表 --> <!-- 消息列表 -->
<block v-for="(message, index) in messages" :key="index"> <block v-for="(message, index) in messages" :key="index">
<!-- 时间分割线 --> <!-- 时间分割线 -->
<view v-if="needShowTime(index)" class="message-time">{{ formatTime(message.time) }}</view> <view v-if="needShowTime(index)" class="message-time">{{ message.times }}</view>
<!-- 消息项 --> <!-- 消息项 -->
<view :id="'msg-' + index" :class="{ <view :id="'msg-' + index" :class="{
@ -56,8 +56,8 @@
<script> <script>
import { menuButtonInfo, picUrl, request } from '@/utils' import { menuButtonInfo, picUrl, request } from '@/utils'
import { apiArr } from '@/api/customerService'
import mqttTool from '@/utils/mqtt' import mqttTool from '@/utils/mqtt'
import { apiArr } from '../../../api/customerService'
export default { export default {
data() { data() {
@ -76,6 +76,7 @@ export default {
userAvatar: '', userAvatar: '',
// //
messages: [], messages: [],
// //
inputMessage: '', inputMessage: '',
// //
@ -105,9 +106,11 @@ export default {
} }
}, },
onLoad(options) { onLoad(options) {
console.log('客服聊天页面onLoad触发')
const meun = menuButtonInfo() const meun = menuButtonInfo()
this.top = meun.top this.top = meun.top
this.localHeight = meun.height this.localHeight = meun.height
console.log('导航栏信息top:', this.top, 'height:', this.localHeight)
// //
if (options.item) { if (options.item) {
const item = JSON.parse(options.item) const item = JSON.parse(options.item)
@ -119,7 +122,10 @@ export default {
this.chatTarget.title = this.chatTarget.employee_name this.chatTarget.title = this.chatTarget.employee_name
this.getMqttConfig().then(() => { this.getMqttConfig().then(() => {
// //
console.log('获取MQTT配置成功开始初始化聊天')
this.initChat() this.initChat()
}).catch(error => {
console.error('获取MQTT配置失败:', error)
}) })
} else { } else {
// //
@ -133,11 +139,15 @@ export default {
this.chatTarget.openId = this.chatTarget.client_id_one this.chatTarget.openId = this.chatTarget.client_id_one
} }
// MQTT // MQTT
console.log('开始初始化聊天')
this.initChat() this.initChat()
} }
} else {
console.log('没有接收到参数item')
} }
// //
this.userAvatar = picUrl + uni.getStorageSync('headPhoto') this.userAvatar = picUrl + uni.getStorageSync('headPhoto')
console.log('用户头像:', this.userAvatar)
}, },
onShow() { onShow() {
}, },
@ -222,7 +232,11 @@ export default {
// //
this.startKeepalive() this.startKeepalive()
// //
console.log('连接成功,开始加载历史消息')
await this.loadHistoryMessages() await this.loadHistoryMessages()
console.log('历史消息加载完成,消息数量:', this.messages.length)
} catch (error) { } catch (error) {
console.error('初始化聊天失败', error) console.error('初始化聊天失败', error)
this.connectingStatus = '连接失败,请检查网络' this.connectingStatus = '连接失败,请检查网络'
@ -291,16 +305,23 @@ export default {
// //
async loadHistoryMessages() { async loadHistoryMessages() {
console.log('loadHistoryMessages方法调用')
console.log('加载条件检查hasMoreHistory:', this.hasMoreHistory, 'isLoadingHistory:', this.isLoadingHistory)
if (!this.hasMoreHistory || this.isLoadingHistory) { if (!this.hasMoreHistory || this.isLoadingHistory) {
console.log('不满足加载条件hasMoreHistory:', this.hasMoreHistory, 'isLoadingHistory:', this.isLoadingHistory)
return return
} }
try { try {
this.isLoadingHistory = true this.isLoadingHistory = true
console.log('开始加载历史消息,当前页码:', this.pageNum)
// mqttConfig.bindId // mqttConfig.bindId
if (!this.chatTarget.bindId) { if (!this.chatTarget.bindId) {
console.log('没有bindId开始获取MQTT配置')
await this.getMqttConfig() await this.getMqttConfig()
console.log('获取MQTT配置成功bindId', this.chatTarget.bindId)
} }
const params = { const params = {
@ -314,11 +335,13 @@ export default {
const res = await request(apiArr.csGetMsgRecord, 'POST', params) const res = await request(apiArr.csGetMsgRecord, 'POST', params)
console.log('历史消息返回结果:', res) console.log('历史消息返回结果:', res)
if (res && res.code === 1 && res.data && res.data.msg_record) { if (res && res.msg_record) {
const historyMessages = res.data.msg_record const historyMessages = res.msg_record
console.log('原始历史消息数量:', historyMessages.length)
// //
if (historyMessages.length === 0) { if (historyMessages.length === 0) {
console.log('没有更多历史消息了')
this.hasMoreHistory = false this.hasMoreHistory = false
return return
} }
@ -327,30 +350,74 @@ export default {
const formattedMessages = historyMessages.map(msg => ({ const formattedMessages = historyMessages.map(msg => ({
content: msg.content, content: msg.content,
time: new Date(msg.create_time).getTime(), time: new Date(msg.create_time).getTime(),
times: msg.update_time,
isSelf: msg.send_client === this.selfClientId, // isSelf: msg.send_client === this.selfClientId, //
isLoading: false isLoading: false
})).reverse(); // })).reverse(); //
console.log('格式化后的历史消息:', formattedMessages)
// //
this.messages = [...formattedMessages, ...this.messages] const previousMessageCount = this.messages.length;
console.log('添加前消息数量:', previousMessageCount)
this.messages = [...formattedMessages, ...this.messages];
console.log('添加后消息数量:', this.messages.length)
// //
this.pageNum++ this.pageNum++;
console.log('下一页页码:', this.pageNum)
//
if (previousMessageCount === 0) {
setTimeout(() => {
console.log('首次加载,滚动到底部,消息数量:', this.messages.length)
// 使
uni.pageScrollTo({
scrollTop: 999999,
duration: 300
});
}, 100);
} else {
//
//
console.log('非首次加载,新增消息数量:', formattedMessages.length)
}
} else {
console.log('接口返回数据格式不正确或无消息记录')
// hasMoreHistoryfalse
if (this.pageNum > 1) {
this.hasMoreHistory = false
}
} }
} catch (error) { } catch (error) {
console.error('加载历史消息失败', error) console.error('加载历史消息失败', error)
} finally { } finally {
this.isLoadingHistory = false this.isLoadingHistory = false
console.log('加载历史消息结束')
} }
}, },
//
onScroll(e) {
console.log('滚动事件触发scrollTop', e.detail.scrollTop)
},
// //
loadMoreHistory(e) { loadMoreHistory() {
// console.log('滚动到顶部事件触发')
if (e && e.detail.direction === 'top') { //
if (!this.isLoadingHistory && this.hasMoreHistory) { console.log('当前条件isLoadingHistory:', this.isLoadingHistory, 'hasMoreHistory:', this.hasMoreHistory, 'pageNum:', this.pageNum)
this.loadHistoryMessages()
// hasMoreHistorytrue
if (!this.hasMoreHistory && this.pageNum === 1) {
console.log('重置hasMoreHistory为true')
this.hasMoreHistory = true
} }
if (!this.isLoadingHistory && this.hasMoreHistory) {
console.log('开始加载更多历史消息')
this.loadHistoryMessages()
} else {
console.log('不满足加载更多条件isLoadingHistory:', this.isLoadingHistory, 'hasMoreHistory:', this.hasMoreHistory)
} }
}, },
@ -433,7 +500,11 @@ export default {
// //
scrollToBottom() { scrollToBottom() {
setTimeout(() => { setTimeout(() => {
this.scrollToView = 'msg-' + (this.messages.length - 1) console.log('手动滚动到底部')
uni.pageScrollTo({
scrollTop: 999999,
duration: 300
});
}, 100) }, 100)
}, },
@ -515,3 +586,9 @@ export default {
<style> <style>
@import url("./index.css"); @import url("./index.css");
</style> </style>
<style scoped>
:root {
--header-height: 80px; /* 头部高度 */
--input-height: 80px; /* 输入区域高度 */
}
</style>

View File

@ -271,24 +271,6 @@ image {
height: 40rpx; height: 40rpx;
} }
.car_right {
width: 470rpx;
height: 70rpx;
background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%);
border-radius: 100rpx 100rpx 100rpx 100rpx;
font-size: 36rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
margin-top: 26rpx;
}
.car_right_disabled {
background: #CCCCCC;
color: #FFFFFF;
}
.cars { .cars {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -311,13 +293,6 @@ image {
top: -10rpx; top: -10rpx;
} }
.car_right .input {
font-size: 36rpx;
color: #FFFFFF;
font-weight: 700;
}
.shadow { .shadow {
background: rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.4);
position: fixed; position: fixed;
@ -569,7 +544,6 @@ image {
.popup-header { .popup-header {
display: flex; display: flex;
width: 90%;
padding-left: 80rpx; padding-left: 80rpx;
margin: 20rpx 0; margin: 20rpx 0;
} }
@ -623,8 +597,12 @@ image {
border-radius: 40rpx; border-radius: 40rpx;
padding: 10rpx 15rpx; padding: 10rpx 15rpx;
white-space: nowrap; white-space: nowrap;
margin: 20rpx 30rpx;
display: inline-block;
width: auto;
} }
.itemSize_active { .itemSize_active {
background: #FF370B; background: #FF370B;
color: #fff; color: #fff;
@ -640,6 +618,7 @@ image {
.itemSize_top { .itemSize_top {
display: flex; display: flex;
margin-left: 30rpx; margin-left: 30rpx;
position: relative;
} }
.itemSize_info { .itemSize_info {
@ -658,3 +637,200 @@ image {
margin-top: 10rpx; margin-top: 10rpx;
color: red; color: red;
} }
.car_right_box {
display: flex;
font-size: 30rpx;
}
.car_right {
width: 220rpx;
height: 70rpx;
/* background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%); */
background: #ff712c;
border-radius: 20rpx 0 0 20rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
margin-top: 26rpx;
}
.seckill {
width: 220rpx;
height: 70rpx;
background: #ff3b31;
border-radius: 0 20rpx 20rpx 0;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
margin-top: 26rpx;
}
.car_right2 {
width: 470rpx;
height: 70rpx;
background: #ffb1a5;
border-radius: 100rpx 100rpx 100rpx 100rpx;
font-size: 36rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
margin-top: 26rpx;
}
/* 立即购买弹窗样式 */
.address-section {
background-color: #fff;
}
.address-info {
padding: 20rpx 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1rpx solid #eee;
margin-bottom: 20rpx;
font-size: 26rpx;
font-weight: bold;
}
.address-main {
flex: 1;
}
.address-name-phone {
display: flex;
align-items: center;
margin-bottom: 10rpx;
}
.name {
margin-right: 20rpx;
}
.phone {
color: #666;
}
.address-detail {
color: #666;
line-height: 40rpx;
display: flex;
align-items: center;
}
.copy-icon {
width: 30rpx;
height: 30rpx;
background: url('https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_copy.png') no-repeat center;
background-size: contain;
margin-left: 10rpx;
}
.address-arrow {
color: #999;
}
.quantity-control {
display: flex;
align-items: center;
justify-content: flex-end;
position: absolute;
bottom: 10rpx;
right: 40rpx;
}
.decrease-btn {
width: 40rpx;
height: 40rpx;
background-color: #f5f5f5;
border: 1rpx solid #ccc;
border-radius: 50%;
line-height: 33rpx;
text-align: center;
font-size: 28rpx;
color: #333;
}
.increase-btn {
width: 40rpx;
height: 40rpx;
background-color: #ff502a;
border-radius: 50%;
line-height: 33rpx;
text-align: center;
font-size: 28rpx;
color: #ffffff;
}
.quantity {
font-size: 28rpx;
color: #333;
margin: 0 20rpx;
min-width: 40rpx;
text-align: center;
}
.payment-section {
background-color: #fff;
margin-bottom: 20rpx;
margin-top: 15rpx;
}
.payment-item {
padding: 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1rpx solid #eee;
}
.payment-icon {
width: 40rpx;
height: 40rpx;
margin-right: 20rpx;
}
.payment-icon image {
width: 100%;
height: 100%;
}
.payment-content {
flex: 1;
}
.payment-name {
font-size: 28rpx;
margin-bottom: 5rpx;
}
.payment-desc {
font-size: 26rpx;
color: #333;
}
.payment-select {
color: #FF7658;
}
.pay-button {
width: 50%;
height: 70rpx;
margin: 0 auto;
line-height: 70rpx;
text-align: center;
background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%);
color: #fff;
font-size: 34rpx;
font-weight: bold;
border-radius: 50rpx;
}
.car_right_buy {
width: 220rpx;
margin-left: 20rpx;
}

View File

@ -175,6 +175,7 @@
</view> </view>
</view> </view>
<view class="car_right_box">
<view class="car_right" v-if=" <view class="car_right" v-if="
info.commodity_goods_info_list[currentGGIndex].stock_quantity > 0 && info.commodity_goods_info_list[currentGGIndex].stock_quantity > 0 &&
(!info.commodity_goods_info_list[currentGGIndex].cart_count || (!info.commodity_goods_info_list[currentGGIndex].cart_count ||
@ -190,8 +191,13 @@
加入购物车 加入购物车
</view> </view>
<view class="car_right car_right_disabled" <view class="seckill" v-if="info.commodity_goods_info_list[currentGGIndex].stock_quantity != 0"
v-if="info.commodity_goods_info_list[currentGGIndex].stock_quantity < 1"> @click="showBuyPopup">
立即购买
</view>
</view>
<view class="car_right2" v-if="info.commodity_goods_info_list[currentGGIndex].stock_quantity < 1">
已售罄 已售罄
</view> </view>
</view> </view>
@ -298,7 +304,7 @@
<view class="itemSize_name" style="display: flex;"> <view class="itemSize_name" style="display: flex;">
<view v-if="currentGG.is_same_day" class="isDay">当日达</view>{{ changeName }} <view v-if="currentGG.is_same_day" class="isDay">当日达</view>{{ changeName }}
</view> </view>
<view class="itemSize_price">{{ changePrice }}/</view> <view class="itemSize_price">{{ changePrice }}/{{ goodsUnit }}</view>
</view> </view>
</view> </view>
<view class="itemSizeBox" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id" <view class="itemSizeBox" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id"
@ -307,6 +313,75 @@
{{ item.goods_spec }} / {{ item.goods_unit }}</text> {{ item.goods_spec }} / {{ item.goods_unit }}</text>
</view> </view>
</u-popup> </u-popup>
<!-- 立即购买 -->
<u-popup :show="showBuy" round="20rpx" mode="bottom" @close="closeBuy">
<view class="popup-header">
<h3 class="popup-header-h3">立即购买</h3>
<view class="popup-header-view" @click="closeBuy">取消</view>
</view>
<view class="address-section">
<view class="address-info" @click="editAddress()">
<view class="address-main" v-if="defAddress && Object.keys(defAddress).length > 0">
<view class="address-name-phone">
<text class="name">{{ defAddress.name }}</text>
<text class="phone">{{ defAddress.phone }}</text>
</view>
<view class="address-detail">
{{ defAddress.address }}{{ defAddress.house_number }}
<view class="copy-icon" @click.stop="copyAddress" />
</view>
</view>
<view class="address-main" v-else>
<view class="address-name-phone">
<text class="name">请选择收货地址</text>
</view>
</view>
<view class="address-arrow"><u-icon name="arrow-right" size="25"></u-icon></view>
</view>
</view>
<view class="itemSize_top">
<image :src="changeImg" class="itemSize-img"></image>
<view class="itemSize_info">
<view class="itemSize_name">{{ changeName }}</view>
<view class="itemSize_price">{{ changePrice }}/{{ goodsUnit }}</view>
</view>
<view class="quantity-control">
<view class="decrease-btn" @tap.stop="decreaseQuantity()">-</view>
<view class="quantity">{{ changeCount }}</view>
<view class="increase-btn" @tap.stop="increaseQuantity()">+</view>
</view>
</view>
<view class="itemSize" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id"
@click="changeGG(item, index)" :class="index == currentGGIndex ? 'itemSize_active' : ''">
{{ item.goods_name }} {{ item.goods_spec }} / {{ item.goods_unit }}
</view>
<view class="fenge"></view>
<!-- 支付方式 -->
<view class="payment-section">
<view class="payment-item" @click="selectPayment('wechat')">
<view class="payment-icon">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png"
mode="aspectFit"></image>
</view>
<view class="payment-content">
<view class="payment-name">微信支付</view>
</view>
<view class="payment-select" v-if="selectedPayment === 'wechat'">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check2.png"
mode="aspectFit" style="width: 30rpx; height: 30rpx;"></image>
</view>
<view class="payment-select" v-else>
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check1.png"
mode="aspectFit" style="width: 30rpx; height: 30rpx;"></image>
</view>
</view>
</view>
<view class="pay-button" @click="submitBuyOrder">立即支付</view>
</u-popup>
</view> </view>
</template> </template>
@ -345,10 +420,16 @@ export default {
comments: [], comments: [],
show: false, show: false,
showSize: false, showSize: false,
//
showBuy: false,
changeCount: 0,
defAddress: {},
selectedPayment: 'wechat', //
changeImg: "", changeImg: "",
changeName: "", changeName: "",
changePrice: "", changePrice: "",
goodsUnit: "",
selectedGoods: null, // selectedGoods: null, //
qrcodePath: null, // qrcodePath: null, //
}; };
@ -478,6 +559,7 @@ export default {
this.changeImg = picUrl + this.currentGG.commodity_pic[0] this.changeImg = picUrl + this.currentGG.commodity_pic[0]
this.changeName = this.currentGG.goods_alias this.changeName = this.currentGG.goods_alias
this.changePrice = this.currentGG.sales_price this.changePrice = this.currentGG.sales_price
this.goodsUnit = this.currentGG.goods_unit
}); });
}, },
@ -508,8 +590,73 @@ export default {
this.changeImg = picUrl + item.commodity_pic[0] this.changeImg = picUrl + item.commodity_pic[0]
this.changeName = item.goods_alias this.changeName = item.goods_alias
this.changePrice = item.sales_price this.changePrice = item.sales_price
this.goodsUnit = item.goods_unit
this.getComment(item.goods_id) this.getComment(item.goods_id)
}, },
//
showBuyPopup() {
this.changeCount = 1;
this.showBuy = true;
//
const selectedAddress = uni.getStorageSync('selectedAddress');
if (selectedAddress && Object.keys(selectedAddress).length > 0) {
this.defAddress = selectedAddress;
//
uni.removeStorageSync('selectedAddress');
} else {
//
this.getUserAddress();
}
},
closeBuy() {
this.showBuy = false;
uni.removeStorageSync('selectedAddress');
this.changeCount = 1;
},
editAddress() {
NavgateTo('/packages/shop/address/index');
},
//
decreaseQuantity() {
if (this.changeCount > 1) {
this.changeCount--;
}
},
increaseQuantity() {
const stock = this.info.commodity_goods_info_list[this.currentGGIndex].stock_quantity;
if (this.changeCount < stock) {
this.changeCount++;
} else {
uni.showToast({
title: '库存不足',
icon: 'none'
});
}
},
//
getUserAddress() {
request(apiArr.getUserDefAddress, "POST", {}).then(res => {
this.defAddress = res.default_address;
});
},
//
selectPayment(type) {
this.selectedPayment = type;
},
//
copyAddress() {
if (this.defAddress && Object.keys(this.defAddress).length > 0) {
uni.setClipboardData({
data: this.defAddress.address + this.defAddress.house_number,
success: () => {
uni.showToast({
title: '地址复制成功',
icon: 'success'
});
}
});
}
},
car() { car() {
NavgateTo("../shopCar/index"); NavgateTo("../shopCar/index");
}, },
@ -627,6 +774,69 @@ export default {
closeSize() { closeSize() {
this.showSize = false; this.showSize = false;
}, },
//
submitBuyOrder() {
//
if (!this.defAddress || !this.defAddress.address) {
uni.showToast({
title: '请选择收货地址',
icon: 'none'
});
return;
}
// trans_type
// : 71, App: 51
const systemInfo = uni.getSystemInfoSync();
let trans_type = 51; // App
//
if (systemInfo.platform === 'devtools' || systemInfo.platform === 'unknown') {
trans_type = 71; //
}
//
// #ifdef MP
trans_type = 71; //
// #endif
// #ifdef APP-PLUS
trans_type = 51; // App
// #endif
//
const params = {
user_id: uni.getStorageSync('userId'),
// 1
order_cate: 1,
goods_list: [{
supplier_id: this.info.supplier_id,
supplier_name: this.currentGG.supplier_name || '',
is_same_day: this.currentGG.is_same_day,
receiving_name: this.defAddress.name,
receiving_phone: this.defAddress.phone,
receiving_address: this.defAddress.address + this.defAddress.house_number,
merchant_id: this.defAddress.address_id,
goods_and_count: [{
goods_id: this.currentGG.id,
count: this.changeCount,
price: this.currentGG.sales_price
}]
}]
}
console.log("🚀 ~ params:", params)
request(apiArr.createOrder, "POST", params).then(resVal => {
const param = {
order_id: resVal.order_id,
user_id: uni.getStorageSync('userId'),
trans_type: trans_type
}
request(apiArr.mergePreorder, "POST", param).then(res => {
this.handleMergePreorderResponse(res, resVal.order_id);
})
})
},
// //
getComment(id) { getComment(id) {
let params = {} let params = {}

View File

@ -909,7 +909,6 @@ image {
} }
.itemSize { .itemSize {
width: 30%;
font-size: 26rpx; font-size: 26rpx;
color: #333; color: #333;
background: #F6F7FB; background: #F6F7FB;
@ -917,6 +916,8 @@ image {
padding: 10rpx 15rpx; padding: 10rpx 15rpx;
white-space: nowrap; white-space: nowrap;
margin: 20rpx 30rpx; margin: 20rpx 30rpx;
display: inline-block;
width: auto;
} }
.itemSize_active { .itemSize_active {

View File

@ -324,7 +324,7 @@
<image :src="changeImg" class="itemSize-img"></image> <image :src="changeImg" class="itemSize-img"></image>
<view class="itemSize_info"> <view class="itemSize_info">
<view class="itemSize_name">{{ changeName }}</view> <view class="itemSize_name">{{ changeName }}</view>
<view class="itemSize_price">{{ changePrice }}/</view> <view class="itemSize_price">{{ changePrice }}/{{ goodsUnit }}</view>
</view> </view>
</view> </view>
<view class="itemSize" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id" <view class="itemSize" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id"
@ -382,7 +382,7 @@
<image :src="changeImg" class="itemSize-img"></image> <image :src="changeImg" class="itemSize-img"></image>
<view class="itemSize_info"> <view class="itemSize_info">
<view class="itemSize_name">{{ changeName }}</view> <view class="itemSize_name">{{ changeName }}</view>
<view class="itemSize_price">{{ changePrice }}/</view> <view class="itemSize_price">{{ changePrice }}/{{ goodsUnit }}</view>
</view> </view>
<view class="quantity-control"> <view class="quantity-control">
<view class="decrease-btn" @tap.stop="decreaseQuantity()">-</view> <view class="decrease-btn" @tap.stop="decreaseQuantity()">-</view>
@ -557,6 +557,7 @@ export default {
changeImg: "", changeImg: "",
changeName: "", changeName: "",
changePrice: "", changePrice: "",
goodsUnit: "",
endTime: "", endTime: "",
endTheCountdownDay: '', endTheCountdownDay: '',
@ -1043,6 +1044,7 @@ export default {
this.changeImg = this.currentGG.commodity_pic[0]; this.changeImg = this.currentGG.commodity_pic[0];
this.changeName = this.currentGG.goods_alias; this.changeName = this.currentGG.goods_alias;
this.changePrice = this.currentGG.sales_price; this.changePrice = this.currentGG.sales_price;
this.goodsUnit = this.currentGG.goods_unit;
} else { } else {
// //
this.currentGG = null; this.currentGG = null;
@ -1050,6 +1052,7 @@ export default {
this.changeImg = ''; this.changeImg = '';
this.changeName = ''; this.changeName = '';
this.changePrice = ''; this.changePrice = '';
this.goodsUnit = '';
} }
}); });
}, },
@ -1079,6 +1082,7 @@ export default {
this.changeImg = item.commodity_pic[0] this.changeImg = item.commodity_pic[0]
this.changeName = item.goods_alias this.changeName = item.goods_alias
this.changePrice = item.sales_price this.changePrice = item.sales_price
this.goodsUnit = item.goods_unit;
}, },
car() { car() {
const item = { const item = {

View File

@ -20,8 +20,8 @@
} }
.top-image{ .top-image{
width: 50rpx; width: 60rpx;
height: 50rpx; height: 60rpx;
} }
.emptyCommunity { .emptyCommunity {
@ -87,8 +87,8 @@
} }
.work-order-icon { .work-order-icon {
width: 100rpx; width: 55rpx;
height: 100rpx; height: 55rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@ -3,7 +3,7 @@
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }"> <view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<view class="searchBox_add" @click="addCommunity"> <view class="searchBox_add" @click="addCommunity">
<image class="top-image" <image class="top-image"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/workOrder_community.png" mode="aspectFill"> src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/workOrder_community_2.svg">
</image> </image>
<view class="emptyCommunity"> <view class="emptyCommunity">
{{ communityVal }} {{ communityVal }}
@ -43,11 +43,11 @@
<view class="work-order-card" v-if="index == 1 && showWorkOrderSection" <view class="work-order-card" v-if="index == 1 && showWorkOrderSection"
@click="navigateToWorkOrderDashboard"> @click="navigateToWorkOrderDashboard">
<image class="work-order-icon" <image class="work-order-icon"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/workOrder.png" mode="aspectFill" /> src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/workOrder_2.svg" mode="aspectFill" />
<text class="work-order-text">工单台</text> <text class="work-order-text">工单台</text>
</view> </view>
<view class="work-order-card" v-if="index == 0" @click="navigateToRoutingInspection"> <view class="work-order-card" v-if="index == 0" @click="navigateToRoutingInspection">
<image class="work-order-icon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/polling.png" <image class="work-order-icon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/polling_2.svg"
mode="aspectFill" /> mode="aspectFill" />
<text class="work-order-text">巡更巡检</text> <text class="work-order-text">巡更巡检</text>
</view> </view>