上传代码

This commit is contained in:
2025-08-18 14:20:34 +08:00
commit 527fd07910
2408 changed files with 427370 additions and 0 deletions

View File

@ -0,0 +1,78 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
data() {
return {
scrollTop: 0,
userId: "",
chatMsg: "",
msgList: [
{
botContent: "商家正在积极出餐吗,请问有什么问题嘛?",
recordId: 0,
titleId: 0,
userContent: "",
userId: 0
},
{
botContent: "",
recordId: 0,
titleId: 0,
userContent: "不要香菜",
userId: 0
}
]
};
},
computed: {
windowHeight() {
return this.rpxTopx(common_vendor.index.getSystemInfoSync().windowHeight);
}
},
methods: {
rpxTopx(px) {
let deviceWidth = common_vendor.index.getSystemInfoSync().windowWidth;
let rpx = 750 / deviceWidth * Number(px);
return Math.floor(rpx);
},
handleSend() {
if (!this.chatMsg || !/^\s+$/.test(this.chatMsg)) {
let obj = {
botContent: "",
recordId: 0,
titleId: 0,
userContent: this.chatMsg,
userId: 0
};
this.msgList.push(obj);
this.chatMsg = "";
} else {
this.$modal.showToast("不能发送空白消息");
}
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.f($data.msgList, (item, index, i0) => {
return common_vendor.e({
a: item.userContent != ""
}, item.userContent != "" ? {
b: common_vendor.t(item.userContent)
} : {}, {
c: item.botContent != ""
}, item.botContent != "" ? {
d: common_vendor.t(item.botContent)
} : {}, {
e: index
});
}),
b: `${$options.windowHeight}rpx`,
c: $data.scrollTop,
d: $data.chatMsg,
e: common_vendor.o(($event) => $data.chatMsg = $event.detail.value),
f: common_vendor.o((...args) => $options.handleSend && $options.handleSend(...args))
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-c08180ec"]]);
wx.createPage(MiniProgramPage);

View File

@ -0,0 +1,5 @@
{
"navigationBarTitleText": "商家",
"enablePullDownRefresh": false,
"usingComponents": {}
}

View File

@ -0,0 +1 @@
<view class="chat data-v-c08180ec"><scroll-view style="{{'height:' + b}}" id="scrollview" scroll-y="true" scroll-top="{{c}}" scroll-with-animation="{{true}}" class="scroll-view data-v-c08180ec"><view id="msglistview" class="chat-body data-v-c08180ec"><view wx:for="{{a}}" wx:for-item="item" wx:key="e" class="data-v-c08180ec"><view wx:if="{{item.a}}" class="item self data-v-c08180ec"><view class="content right data-v-c08180ec">{{item.b}}</view><view class="avatar data-v-c08180ec"></view></view><view wx:if="{{item.c}}" class="item Ai data-v-c08180ec"><view class="avatar data-v-c08180ec"></view><view class="content left data-v-c08180ec">{{item.d}}</view></view></view></view></scroll-view><view class="chat-bottom data-v-c08180ec"><view class="send-msg data-v-c08180ec"><view class="uni-textarea data-v-c08180ec"><block wx:if="{{r0}}"><textarea class="data-v-c08180ec" maxlength="300" show-confirm-bar="{{false}}" auto-height value="{{d}}" bindinput="{{e}}"></textarea></block></view><button bindtap="{{f}}" class="send-btn data-v-c08180ec">发送</button></view></view></view>

View File

@ -0,0 +1,158 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
view.data-v-c08180ec,
button.data-v-c08180ec,
text.data-v-c08180ec,
input.data-v-c08180ec,
textarea.data-v-c08180ec {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.chat .scroll-view.data-v-c08180ec {
background-color: #F6F6F6;
}
.chat .scroll-view.data-v-c08180ec ::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
color: transparent;
}
.chat .scroll-view .chat-body.data-v-c08180ec {
display: flex;
flex-direction: column;
padding-top: 23rpx;
}
.chat .scroll-view .chat-body .self.data-v-c08180ec {
justify-content: flex-end;
}
.chat .scroll-view .chat-body .item.data-v-c08180ec {
display: flex;
padding: 23rpx 30rpx;
}
.chat .scroll-view .chat-body .item .right.data-v-c08180ec {
background-color: #4095e5;
}
.chat .scroll-view .chat-body .item .left.data-v-c08180ec {
background-color: #FFFFFF;
}
.chat .scroll-view .chat-body .item .right.data-v-c08180ec::after {
position: absolute;
display: inline-block;
content: "";
width: 0;
height: 0;
left: 100%;
top: 10px;
border: 12rpx solid transparent;
border-left: 12rpx solid #4095e5;
}
.chat .scroll-view .chat-body .item .left.data-v-c08180ec::after {
position: absolute;
display: inline-block;
content: "";
width: 0;
height: 0;
top: 10px;
right: 100%;
border: 12rpx solid transparent;
border-right: 12rpx solid #FFFFFF;
}
.chat .scroll-view .chat-body .item .content.data-v-c08180ec {
position: relative;
max-width: 486rpx;
border-radius: 8rpx;
word-wrap: break-word;
padding: 24rpx 24rpx;
margin: 0 24rpx;
border-radius: 5px;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333;
line-height: 42rpx;
}
.chat .scroll-view .chat-body .item .avatar.data-v-c08180ec {
display: flex;
justify-content: center;
width: 78rpx;
height: 78rpx;
background-image: url("https://pic2.zhimg.com/v2-45e3ca228438d1e4c3e98e38c8f8e4a4_r.jpg?source=1940ef5c");
background-size: contain;
border-radius: 8rpx;
overflow: hidden;
}
.chat .scroll-view .chat-body .item .avatar image.data-v-c08180ec {
align-self: center;
}
.chat .chat-bottom.data-v-c08180ec {
width: 100%;
height: 177rpx;
background: #F4F5F7;
}
.chat .chat-bottom .send-msg.data-v-c08180ec {
display: flex;
align-items: flex-end;
padding: 16rpx 30rpx;
width: 100%;
min-height: 177rpx;
position: fixed;
bottom: 0;
background: #EDEDED;
}
.chat .chat-bottom .uni-textarea.data-v-c08180ec {
padding-bottom: 70rpx;
}
.chat .chat-bottom .uni-textarea textarea.data-v-c08180ec {
width: 537rpx;
min-height: 75rpx;
max-height: 500rpx;
background: #FFFFFF;
border-radius: 8rpx;
font-size: 32rpx;
font-family: PingFang SC;
color: #333333;
line-height: 43rpx;
padding: 5rpx 8rpx;
}
.chat .chat-bottom .send-btn.data-v-c08180ec {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 70rpx;
margin-left: 25rpx;
width: 128rpx;
height: 75rpx;
background: #4095e5;
border-radius: 8rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
line-height: 28rpx;
}