Merge branch 'dev' into test

This commit is contained in:
linxi
2025-06-26 09:33:44 +08:00
9 changed files with 150 additions and 24 deletions
+51 -7
View File
@@ -50,7 +50,9 @@ export const chatMixins = {
],
errorMsg: Object.freeze('您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!'),
audioAyy: [],
isPlayAudio: false
isPlayAudio: false,
audioContext: null,
audioPlayId: ''
}
},
computed: {
@@ -408,9 +410,38 @@ export const chatMixins = {
}
},
ttsHandle(item) {
this.audioAyy = []
if (this.audioContext) {
this.audioContext.stop()
// this.audioContext.destroy()
}
// 如果正在播放,点击当前播放的则认为是暂停
if (this.isPlayAudio && item.conversationId === this.audioPlayId) {
this.isPlayAudio = false
this.audioPlayId = ''
return
}
this.isPlayAudio = false
this.audioAyy = []
this.splitAndSynthesize(removeMarkdown(item.content).replace(/[\n\t\s]/g, ''))
this.audioPlayId = item.conversationId
const flag = 1
if (flag === 1) {
console.log(removeMarkdown(item.content).replace(/[\n\t\s]/g, ''))
uni.showLoading({
title: '合成中...'
})
this.splitAndSynthesize(removeMarkdown(item.content).replace(/[\n\t\s]/g, ''))
} else {
// 调试数据
this.audioAyy = [
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749075_2f71887cc48d9b3753c39d119862d4bb&filekey=871027724&source=miniapp_plugin',
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749077_0970508786c5e3edc3a68a5eb9de048c&filekey=871027724&source=miniapp_plugin',
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749079_e77cec52cc077ba981892887c3df4cdf&filekey=871027724&source=miniapp_plugin',
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749080_02db4235771f5561cdb73c06d8c67e53&filekey=871027724&source=miniapp_plugin',
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749082_534e455c5d6ac5e9a4192ecf9952851a&filekey=871027724&source=miniapp_plugin',
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749083_78c4a2fecad538561f81c48dc4ecd645&filekey=871027724&source=miniapp_plugin'
]
this.playNextChunk()
}
},
splitAndSynthesize(text) {
const _this = this
@@ -440,25 +471,38 @@ export const chatMixins = {
_this.playNextChunk()
}
}
uni.hideLoading()
},
fail: function(err) {
console.log("转换失败:", err)
uni.hideLoading()
}
})
} else {
if (!_this.isPlayAudio) {
_this.playNextChunk()
}
uni.hideLoading()
}
},
playNextChunk() {
if (this.audioAyy.length > 0) {
if (this.audioAyy.length > 0 && this.audioPlayId) {
const src = this.audioAyy.shift()
this.isPlayAudio = true
const audioContext = uni.createInnerAudioContext()
audioContext.src = this.audioAyy.shift()
audioContext.onEnded(() => this.playNextChunk())
const audioContext = uni.createInnerAudioContext({
// 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项
useWebAudioImplement: false
})
this.audioContext = audioContext
audioContext.src = src
audioContext.onEnded(() => {
audioContext.destroy()
this.playNextChunk()
})
audioContext.play()
console.log('------------src' + src)
} else {
console.log('------------end')
this.isPlayAudio = false
}
}
+9 -2
View File
@@ -32,6 +32,10 @@
}"
class="fix-tabbar-body"
>
<!-- <button @click="ttsHandle({
content: '是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项。临床试验统计分析结果生成系统是服务于医学研究的数据处理平台。系统聚焦临床试验数据,可对患者入组信息、疗效指标、安全性数据等进行标准化统计分析,自动生成包含描述性统计、假设检验、生存分析等内容的结果报告。支持可视化图表输出,如疗效对比柱状图、不良事件分布饼图等,直观呈现数据特征。具备灵活的参数配置功能,可适配不同试验设计与分析需求,助力研究者高效完成数据解读,为药物研发、临床研究结论输出提供精准的统计支持。',
conversationId: '123'
})">播放</button> -->
<block v-if="chatMessageListLength < 1">
<view class="home-focus-wrap">
<view class="focus-guide-wrap">
@@ -234,15 +238,18 @@
重新生成
</view>
<view
:class="{
'playing': audioPlayId === item.conversationId && isPlayAudio
}"
class="item"
@click="ttsHandle(item)"
>
<image
:src="webUrl + '/aiChat/icon-04.png'"
:src="webUrl + '/aiChat/' + ((audioPlayId === item.conversationId && isPlayAudio) ? 'audio-on' : 'audio-off') +'.png'"
class="icon"
mode="widthFix"
/>
播放
语音播放
</view>
<view class="item item2" @click="copyMoreInfoHandle(item)">拷贝</view>
</view>
+3
View File
@@ -518,6 +518,9 @@ page {
margin: 0;
color: transparent;
}
.playing {
color: #3D4CF1;
}
}
}
}
+8 -2
View File
@@ -73,6 +73,7 @@
:style="giftBg ? 'background: url(' + giftBg + ') no-repeat center/cover' : ''"
:class="giftBg ? '' : 'v12-primary'"
>
<text v-if="storeInfo.discount > 0" class="v12-font-24 v12-yellow-text ll-text">平台补贴限时{{ storeInfo.discount }}%</text>
<view class="v12-font-28 v12-align-center" style="height: 74rpx; opacity: 0;">
<image class="gift-img" :src="webUrl + '/orderIcon/gift.png'" mode="widthFix" ></image>
支持礼包赠送
@@ -1457,7 +1458,8 @@ export default {
path: "/pages/order/OrderSubmission/index",
query: {
id: res.data.cartId,
couponId: that.couponId // 优惠券ID
couponId: that.couponId, // 优惠券ID
discount: that.storeInfo.discount,
}
})
return
@@ -1465,7 +1467,7 @@ export default {
if(news === 2) {
const coupId = that.couponId ? that.couponId : (that.couponList.usable[0] && that.couponList.usable[0].id || '')
uni.navigateTo({
url: '/pkg_user/views/gift/gift?cartId=' + res.data.cartId + '&couponId=' + coupId
url: '/pkg_user/views/gift/gift?cartId=' + res.data.cartId + '&couponId=' + coupId + (that.storeInfo.discount ? '&discount=' + that.storeInfo.discount : '')
})
}
if(news === 0) {
@@ -2181,4 +2183,8 @@ export default {
left: 0;
width: 100%;
}
.ll-text{
margin-left: 280rpx;
word-break: keep-all;
}
</style>
+1 -1
View File
@@ -293,7 +293,7 @@
class="seeNum-txt"
>{{ item.zan }}</text>
</view>
<view class="flex">
<view class="flex" @click="infoClick(item)">
<!-- <image
:src="webUrl + '/20230803152147141807.png'"
class="icon"
+16 -6
View File
@@ -78,6 +78,10 @@
</view>
</view>
</view>
<view class="v12-px-2">资讯评论</view>
<view v-if="comments.length === 0" class="v12-text-center v12-py-2 v12-dark1-text v12-font-24">
暂无评论
</view>
<view class="comment-list">
<view class="v12-mt-2" v-for="(comment, index) in comments" :key="index" @click="selectComment(comment)">
<view class="user-info v12-align-center">
@@ -87,7 +91,7 @@
<view class="user-name v12-ml-3">
<view class="v12-font-bold v12-dark-text v12-font-32">
<text>{{ comment.userNickName }}</text>
<text v-if="comment.isHotelAdmin" class="v12-ml-1 v12-primary v12-white-text v12-font-24 v12-font-weight-400 v12-px-1 v12-radius-8">
<text v-if="comment.userIsAdmin" class="v12-ml-1 v12-primary v12-white-text v12-font-24 v12-font-weight-400 v12-px-1 v12-radius-8">
{{ '店主' }}
</text>
</view>
@@ -118,7 +122,7 @@
<view class="user-name v12-ml-3">
<view class="v12-font-bold v12-dark-text v12-font-32">
<text>{{ _comment.userNickName }}</text>
<text v-if="_comment.isHotelAdmin" class="v12-ml-1 v12-primary v12-white-text v12-font-24 v12-font-weight-400 v12-px-1 v12-radius-8">
<text v-if="_comment.userIsAdmin" class="v12-ml-1 v12-primary v12-white-text v12-font-24 v12-font-weight-400 v12-px-1 v12-radius-8">
{{ '店主' }}
</text>
</view>
@@ -348,21 +352,26 @@ export default {
<style lang="less">
@import "@/assets/css/store.less";
.comment-list{
padding-bottom: 100rpx;
}
.more-text{
color:#1B76F0;
font-weight: 400;
font-size: 28rpx;
}
.comment-input-wrap{
padding: 20rpx 0 ;
padding: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
position: sticky;
position: -webkit-sticky;
position: fixed;
width: 100%;
box-sizing: border-box;
bottom: 0;
background: #fff;
left: 0;
}
.comment-input{
height: 70rpx;
@@ -796,8 +805,9 @@ export default {
.info-item-bottom {
display: flex;
align-items: center;
padding: 20rpx;
border-top: 1px solid #f1f1f1;
padding: 0 20rpx 20rpx 20rpx;
margin-bottom: 20rpx;
border-bottom: 1px solid #f1f1f1;
font-size: 16px;
.time {
flex: 1;
+1 -1
View File
@@ -162,7 +162,7 @@ export default {
showSendBtn(item) {
this.showBtn = true // 显示发送按钮
this.currentComment = item
this.content = ' `' // 清空输入框
this.content = ' ' // 清空输入框
},
/**
* 回复消息
+9 -3
View File
@@ -1,8 +1,10 @@
<template>
<view class="common-roomLogs">
<view class="v12-align-center v12-pa-3" @click="toMessage">
<view class="call-message"></view>
<view class="v12-ml-2" style="width: 100%">
<view class="call-message">
<u-icon :name="webUrl + '/icon/message.png'" size="25"></u-icon>
</view>
<view class="v12-ml-2" style="width: 80%">
<view class="v12-font-bold v12-font-32">互动消息</view>
<view class="v12-secondary-dark-text v12-font-28 v12-mt-3 v12-justify-between">
<text>{{ unreadNum > 0 ? `收到${unreadNum}条回复` : '暂无通知'}}</text>
@@ -66,7 +68,8 @@ export default {
uid: null,
list: [],
options1: [{text: '删除', style: {color: '#fff', backgroundColor: '#C52733'} }],
unreadNum: 0
unreadNum: 0,
webUrl: this.$VUE_APP_RESOURCES_URL
}
},
computed: mapGetters(['userInfo']),
@@ -142,6 +145,9 @@ export default {
height: 120rpx;
background: #C52733;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
}
.common-roomLogs{
background: #fff;
+52 -2
View File
@@ -95,6 +95,40 @@
<u-switch v-model="canTransfer" ></u-switch>
</view>
</view>
<view class="price-wrap">
<view class="v12-font-28 v12-dark-text v12-font-bold">价格明细</view>
<view class="v12-justify-between v12-align-center v12-font-28 v12-mt-1">
<view>商品总价</view>
<view>
<text class="v12-dark-text v12-font-22"></text>
<text class="v12-dark-text v12-font-30">{{ computedResult.totalPrice }}</text>
</view>
</view>
<view class="v12-justify-between v12-align-center v12-font-28 v12-mt-1">
<view>平台折扣</view>
<view>
-
<text class="v12-dark-text v12-font-22"></text>
<text class="v12-dark-text v12-font-30">{{ computedResult.discountPrice }}</text>
</view>
</view>
<view class="v12-justify-between v12-align-center v12-font-28 v12-mt-1">
<view>优惠券</view>
<view>
-
<text class="v12-dark-text v12-font-22"></text>
<text class="v12-dark-text v12-font-30">{{ computedResult.couponPrice }}</text>
</view>
</view>
<u-divider></u-divider>
<view class="v12-justify-between v12-align-center v12-font-28 v12-mt-1">
<view class="v12-font-bold">合计</view>
<view class="">
<text class="v12-primary-text v12-font-bold v12-font-22"></text>
<text class="v12-primary-text v12-font-bold v12-font-28">{{ computedResult.payPrice }}</text>
</view>
</view>
</view>
<button v-if="isPayOk" open-type="share" class="share-btn" >
<view class="v12-font-28 v12-primary-text v12-align-center">
<u-icon :name="webUrl + '/icon/gift-primary.png'" size="18"></u-icon>
@@ -181,12 +215,15 @@ export default {
giftKey: '',
payPrice: 0,
orderId: '',
defaultIndex:0
defaultIndex:0,
discount: null,
computedResult: {},
}
},
onLoad(opts) {
this.cartId = opts.cartId
this.couponId = opts.couponId
this.discount = opts.discount
this.getGift()
},
computed: mapGetters(["userInfo"]),
@@ -248,10 +285,14 @@ export default {
const params = {
cartId: this.cartId,
couponId: this.couponId,
cartNum : num,
cartNum : num
}
if(this.discount) {
params.discount = this.discount
}
getGiftCardSendOrderAmount(this.orderKey, params).then(res => {
this.payPrice = res.data.result.payPrice
this.computedResult = res.data.result
this.$forceUpdate()
})
},
@@ -553,4 +594,13 @@ export default {
.share-btn::after {
border: none;
}
.price-wrap{
width: 100%;
height: 320rpx;
background: #fff;
border-radius: 20rpx;
margin-top: 30rpx;
padding: 20rpx;
box-sizing: border-box;
}
</style>