优化页面
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
emits: ["input-click"],
|
||||
setup(props, { emit }) {
|
||||
const listItemClick = (branch) => {
|
||||
emit("input-click", branch);
|
||||
};
|
||||
return {
|
||||
props,
|
||||
listItemClick
|
||||
};
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: $setup.props.title
|
||||
}, $setup.props.title ? {
|
||||
b: common_vendor.t($setup.props.title)
|
||||
} : {}, {
|
||||
c: common_vendor.f($setup.props.list, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.content),
|
||||
b: index,
|
||||
c: common_vendor.o$1(($event) => $setup.listItemClick(item), index)
|
||||
};
|
||||
})
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-form/form-branch.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="form-branch-container"><view wx:if="{{a}}" class="card-title">{{b}}</view><view wx:for="{{c}}" wx:for-item="item" wx:key="b" class="form-branch-item" bindtap="{{item.c}}">{{item.a}}</view></view>
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.form-branch-container .card-title {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.form-branch-container .form-branch-item {
|
||||
font-weight: 400;
|
||||
color: #368dff;
|
||||
padding-top: 5px;
|
||||
cursor: pointer;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../../adapter-vue.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const { ref } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
|
||||
const _sfc_main = {
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
emits: ["input-submit"],
|
||||
setup(props, { emit }) {
|
||||
const disabled = ref(false);
|
||||
const text = ref("");
|
||||
const listItemClick = () => {
|
||||
disabled.value = true;
|
||||
emit("input-submit", text.value);
|
||||
};
|
||||
return {
|
||||
disabled,
|
||||
text,
|
||||
listItemClick,
|
||||
props
|
||||
};
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.t($setup.props.title),
|
||||
b: $setup.text,
|
||||
c: common_vendor.o$1(($event) => $setup.text = $event.detail.value),
|
||||
d: $setup.disabled,
|
||||
e: common_vendor.o$1((...args) => $setup.listItemClick && $setup.listItemClick(...args))
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-form/form-input.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="form-input-container"><view class="card-title">{{a}}</view><view class="form-input-box"><input class="form-input" value="{{b}}" bindinput="{{c}}"></input><button class="form-button" disabled="{{d}}" bindtap="{{e}}"/></view></view>
|
||||
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.form-input-container .card-title {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.form-input-container .form-input-box {
|
||||
display: flex;
|
||||
}
|
||||
.form-input-container .form-input-box button:disabled {
|
||||
background: #d8d8d8;
|
||||
}
|
||||
.form-input-container .form-input {
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
border-radius: 8px 0 0 8px;
|
||||
border: 1px #dddddd solid;
|
||||
}
|
||||
.form-input-container .form-button {
|
||||
position: relative;
|
||||
height: 40px;
|
||||
width: 42px;
|
||||
font-size: 16px;
|
||||
border-radius: 0 8px 8px 0;
|
||||
border: 0 #dddddd solid;
|
||||
background: #006eff;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
.form-input-container .form-button::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
top: 50%;
|
||||
right: 40%;
|
||||
border-left: 2px solid #fff;
|
||||
border-bottom: 2px solid #fff;
|
||||
transform: translate(0, -50%) rotate(-135deg);
|
||||
}
|
||||
64
unpackage/dist/dev/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-form/index.js
vendored
Normal file
64
unpackage/dist/dev/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-form/index.js
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../../adapter-vue.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const FormBranch = () => "./form-branch.js";
|
||||
const FormInput = () => "./form-input.js";
|
||||
const { computed } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
|
||||
const _sfc_main = {
|
||||
components: {
|
||||
FormBranch,
|
||||
FormInput
|
||||
},
|
||||
props: {
|
||||
payload: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
emits: ["sendMessage"],
|
||||
setup(props, { emit }) {
|
||||
const content = computed(() => {
|
||||
var _a;
|
||||
return ((_a = props.payload) == null ? void 0 : _a.content) || {
|
||||
type: 0,
|
||||
header: "",
|
||||
items: []
|
||||
};
|
||||
});
|
||||
const handleContentListItemClick = (branch) => {
|
||||
emit("sendMessage", { text: branch.content });
|
||||
};
|
||||
const handleFormSaveInputSubmit = (text) => {
|
||||
emit("sendMessage", { text });
|
||||
};
|
||||
return {
|
||||
content,
|
||||
handleContentListItemClick,
|
||||
handleFormSaveInputSubmit
|
||||
};
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _component_FormBranch = common_vendor.resolveComponent("FormBranch");
|
||||
const _component_FormInput = common_vendor.resolveComponent("FormInput");
|
||||
(_component_FormBranch + _component_FormInput)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: $setup.content.type === 1
|
||||
}, $setup.content.type === 1 ? {
|
||||
b: common_vendor.o$1($setup.handleContentListItemClick),
|
||||
c: common_vendor.p({
|
||||
title: $setup.content.header,
|
||||
list: $setup.content.items
|
||||
})
|
||||
} : {
|
||||
d: common_vendor.o$1($setup.handleFormSaveInputSubmit),
|
||||
e: common_vendor.p({
|
||||
title: $setup.content.header
|
||||
})
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-form/index.js.map
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"form-branch": "./form-branch",
|
||||
"form-input": "./form-input"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view wx:if="{{a}}" class="message-form"><form-branch wx:if="{{c}}" bindinputClick="{{b}}" u-i="6e5fe136-0" bind:__l="__l" u-p="{{c}}"/></view><view wx:else class="message-form"><form-input wx:if="{{e}}" bindinputSubmit="{{d}}" u-i="6e5fe136-1" bind:__l="__l" u-p="{{e}}"/></view>
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.message-form {
|
||||
max-width: 300px;
|
||||
}
|
||||
Reference in New Issue
Block a user