This commit is contained in:
haomingming
2023-03-06 17:57:39 +08:00
parent 3794faceae
commit 1066e37c96
4230 changed files with 193453 additions and 0 deletions
@@ -0,0 +1,67 @@
const commonWordsList = [
'什么时候发货',
'发什么物流',
'为什么物流一直没更新',
'最新优惠',
'包邮吗',
'修改地址信息',
'修改收件人信息',
'物流一直显示正在揽收',
'问题A',
'问题B',
];
// eslint-disable-next-line no-undef
Component({
/**
* 组件的属性列表
*/
properties: {
display: {
type: Boolean,
value: '',
observer(newVal) {
this.setData({
displayTag: newVal,
});
},
},
},
/**
* 组件的初始数据
*/
data: {
displayTag: true,
words: '',
commonWordsMatch: commonWordsList,
},
/**
* 组件的方法列表
*/
methods: {
handleClose() {
this.triggerEvent('close', {
key: '0',
});
},
wordsInput(e) {
this.data.commonWordsMatch = [],
commonWordsList.forEach((item) => {
if (item.indexOf(e.detail.value) > -1) {
this.data.commonWordsMatch.push(item);
}
});
this.setData({
words: e.detail.value,
commonWordsMatch: this.data.commonWordsMatch,
});
},
sendMessage(e) {
this.triggerEvent('sendMessage', {
message: e.currentTarget.dataset.words,
});
},
},
});
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
@@ -0,0 +1,15 @@
<view wx:if="{{displayTag}}" class="tui-common-words-container">
<view class="tui-common-words-box">
<view class="tui-common-words-title">
<view>请选择你要发送的常用语</view>
<view style="color: #006EFF; font-family: PingFangSC-Regular;" class="tui-common-words-close" bindtap="handleClose">关闭</view>
</view>
<view class="tui-search-bar">
<image class="tui-searchcion" src="../../../../static/assets/serach-icon.svg" />
<input class="tui-search-bar-input" value="{{words}}" placeholder="请输入您想要提出的问题" bindinput='wordsInput'/>
</view>
<scroll-view class="tui-common-words-list" scroll-y="true" enable-flex="true">
<view class="tui-common-words-item" wx:key="index" bindtap="sendMessage" data-words="{{item}}" wx:for="{{commonWordsMatch}}">{{item}}</view>
</scroll-view>
</view>
</view>
@@ -0,0 +1,82 @@
.tui-common-words-container {
position: fixed;
width: 100vw;
height: 100vh;
z-index: 100;
top: 0;
background: rgba(0,0,0,0.5);
}
.tui-common-words-box {
position: absolute;
width: 100%;
height: 60%;
bottom: 0;
background: rgba(255,255,255,1);
padding-bottom: 68rpx;
z-index: 200;
}
.tui-common-words-title {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
padding-left: 40rpx;
padding-right: 40rpx;
padding-top: 48rpx;
font-family: PingFangSC-Medium;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
line-height: 50rpx;
}
.tui-search-bar {
display: flex;
flex-wrap: nowrap;
align-items: center;
margin: 32rpx 40rpx;
width: 670rpx;
height: 80rpx;
background: #FFFFFF;
border-radius: 40rpx;
border-radius: 40rpx;
background-color: #F8F8F8;
}
.tui-searchcion {
display: inline-block;
margin-left: 24rpx;
width: 48rpx;
height: 48rpx;
}
.tui-search-bar-input {
margin-left: 16rpx;
line-height: 40rpx;
font-size: 28rpx;
width: 100%;
display: inline-block;
}
.tui-common-words-list {
position: absolute;
top: 242rpx;
bottom: 68rpx;
width: 750rpx;
}
.tui-common-words-item {
width: 750rpx;
height: 112rpx;
border-bottom: 2rpx solid #EEF0F3;
background-color: #FFFFFF;
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
line-height: 44rpx;
padding: 0 40rpx;
display: flex;
align-items: center;
}
@@ -0,0 +1,105 @@
import constant from '../../../../../utils/constant';
const orderList = [
{
orderNum: 1,
time: '2021-7-20 20:45',
title: '即时通信 IM 首购活动',
description: '单用户限购1件',
imageUrl: 'https://sdk-web-1252463788.cos.ap-hongkong.myqcloud.com/component/TUIKit/assets/im.jpg',
link: 'https://cloud.tencent.com/act/pro/imnew?from=16262',
imageWidth: 135,
imageHeight: 135,
price: '0.9折起',
},
{
orderNum: 2,
time: '2021-7-20 22:45',
title: '即时通信 IM 老客户热销专区',
description: '购买时长越长越优惠',
imageUrl: 'https://sdk-web-1252463788.cos.ap-hongkong.myqcloud.com/component/TUIKit/assets/im.jpg',
link: 'https://cloud.tencent.com/act/pro/imnew?from=16262',
imageWidth: 135,
imageHeight: 135,
price: '7.2折起',
},
];
// eslint-disable-next-line no-undef
Component({
/**
* 组件的属性列表
*/
properties: {
display: {
type: Boolean,
value: '',
observer(newVal) {
this.setData({
displayTag: newVal,
});
},
},
conversation: {
type: Object,
value: {},
observer(newVal) {
this.setData({
conversation: newVal,
});
},
},
},
/**
* 组件的初始数据
*/
data: {
displayTag: true,
words: '',
orderMatch: orderList,
},
/**
* 组件的方法列表
*/
methods: {
handleClose() {
this.triggerEvent('close', {
key: '1',
});
},
wordsInput(e) {
this.data.orderMatch = [],
orderList.forEach((item) => {
if (item.title.indexOf(e.detail.value) > -1 || item.orderNum === ~~e.detail.value) {
this.data.orderMatch.push(item);
}
});
this.setData({
words: e.detail.value,
orderMatch: this.data.orderMatch,
});
},
sendMessage(e) {
const { BUSINESS_ID_TEXT, FEAT_NATIVE_CODE } = constant;
const { order } = e.currentTarget.dataset;
this.triggerEvent('sendCustomMessage', { // 传递给父组件,在父组件处调用SDK的接口,来进行自定消息的发送
payload: {
data: JSON.stringify({
businessID: BUSINESS_ID_TEXT.ORDER,
version: FEAT_NATIVE_CODE.NATIVE_VERSION,
title: order.title,
imageUrl: order.imageUrl,
imageWidth: order.imageWidth,
imageHeight: order.imageHeight,
link: order.link,
price: order.price,
description: order.description,
}), // data字段用于标识该消息类型
description: order.title, // 获取自定义消息的具体描述
extension: order.title, // 自定义消息的具体内容
},
});
},
},
});
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
@@ -0,0 +1,32 @@
<view wx:if="{{displayTag}}" class="tui-cards-container">
<view class="tui-cards-box">
<view class="tui-cards-title">
<view>请选择你要发送的订单</view>
<view style="color: #006EFF; font-family: PingFangSC-Regular;" class="tui-cards-close" bindtap="handleClose">关闭</view>
</view>
<view class="tui-search-bar">
<image class="tui-searchcion" src="../../../../static/assets/serach-icon.svg" />
<input class="tui-search-bar-input" value="{{words}}" placeholder="搜索" bindinput='wordsInput'/>
</view>
<scroll-view class="tui-order-list" scroll-y="true" enable-flex="true">
<view class="tui-order-item" wx:key="index" wx:for="{{orderMatch}}" >
<view class="order-title">
<view class="order-number">订单编号: {{item.orderNum}}</view>
<view class="order-time">{{item.time}}</view>
</view>
<view class="order-info">
<image class="order-image" src="{{item.imageUrl}}" />
<view class="order-content">
<view class="order-content-title">{{item.title}}</view>
<view class="order-content-description">{{item.description}}</view>
<view style="display: flex; flex-wrap: no-wrap; justify-content: space-between;">
<view class="order-content-price">{{item.price}}</view>
<view class="btn-send-order" data-order="{{item}}" catch:tap="sendMessage">
<text class="btn-send-text">发送此订单</text></view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
@@ -0,0 +1,173 @@
.tui-cards-container {
position: fixed;
width: 100vw;
height: 100vh;
z-index: 100;
top: 0;
background: rgba(0,0,0,0.5);
}
.tui-cards-box {
position: absolute;
width: 100%;
height: 60%;
bottom: 0;
background: #F4F5F9;
padding-bottom: 68rpx;
z-index: 200;
}
.tui-cards-title {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
padding-left: 40rpx;
padding-right: 40rpx;
padding-top: 48rpx;
font-family: PingFangSC-Medium;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
line-height: 50rpx;
}
.tui-search-bar {
display: flex;
flex-wrap: nowrap;
align-items: center;
margin: 32rpx 40rpx;
width: 670rpx;
height: 80rpx;
background: #FFFFFF;
border-radius: 40rpx;
border-radius: 40rpx;
background-color: #F8F8F8;
}
.tui-searchcion {
display: inline-block;
margin-left: 24rpx;
width: 48rpx;
height: 48rpx;
}
.tui-search-bar-input {
margin-left: 16rpx;
line-height: 40rpx;
font-size: 28rpx;
width: 100%;
display: inline-block;
}
.tui-order-list {
position: absolute;
top: 242rpx;
bottom: 68rpx;
width: 750rpx;
}
.tui-order-item {
width: 670rpx;
margin: 32rpx 40rpx;
height: 388rpx;
background-color: #FFFFFF;
border-radius: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
}
.order-title {
width: 670rpx;
height: 102rpx;
padding: 32rpx 40rpx;
padding-bottom: 0;
border-bottom: 2rpx solid #EEF0F3;
}
.order-title > .order-number {
font-family: PingFangSC-Medium;
font-size: 32rpx;
line-height: 44rpx;
color: #000000;
letter-spacing: 0;
margin-bottom: 8rpx;
}
.order-title > .order-time {
font-family: PingFangSC-Regular;
font-size: 24rpx;
line-height: 34rpx;
color: #999999;
letter-spacing: 0;
}
.order-info {
display: flex;
flex-wrap: nowrap;
width: 670rpx;
height: 236rpx;
padding: 32rpx 40rpx;
}
.order-content {
width: 450rpx;
margin-left: 32rpx;
}
.order-content-title {
font-family: PingFangSC-Medium;
width: 378rpx;
line-height: 34rpx;
font-size: 24rpx;
color: #000000;
letter-spacing: 0;
margin-bottom: 12rpx;
}
.order-content-description {
display: flex;
flex-wrap: nowrap;
font-family: PingFangSC-Regular;
max-width: 410rpx;
line-height: 34rpx;
font-size: 24rpx;
color: #999999;
letter-spacing: 0;
margin-bottom: 12rpx;
}
.order-content-price {
font-family: PingFangSC-Medium;
font-size: 36rpx;
line-height: 50rpx;
color: #FF7201;
letter-spacing: 0;
}
.order-image {
width: 156rpx;
height: 156rpx;
}
.btn-send-order {
width: 176rpx;
height: 58rpx;
background-color: #006EFF;
border-radius: 14.5px;
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #FFFFFF;
line-height: 28px;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
margin-right: 40rpx;
}
.btn-send-text{
font-family: PingFangSC-Regular;
font-size: 12px;
color: #FFFFFF;
line-height: 14px;
}
@@ -0,0 +1,77 @@
import constant from '../../../../../utils/constant';
// eslint-disable-next-line no-undef
Component({
/**
* 组件的属性列表
*/
properties: {
display: {
type: Boolean,
value: '',
observer(newVal) {
this.setData({
displayTag: newVal,
});
},
},
},
/**
* 组件的初始数据
*/
data: {
displayTag: false,
scoreList: [1, 2, 3, 4, 5],
score: 0,
comment: '',
},
/**
* 组件的方法列表
*/
methods: {
handleClose() {
this.triggerEvent('close', {
key: '2',
});
},
handleScore(e) {
let { score } = e.currentTarget.dataset;
if (score === this.data.score) {
score = 0;
}
this.setData({
score,
});
},
bindTextAreaInput(e) {
this.setData({
comment: e.detail.value,
});
},
sendMessage() {
const { BUSINESS_ID_TEXT, STRING_TEXT, FEAT_NATIVE_CODE } = constant;
this.triggerEvent('sendCustomMessage', {
payload: {
// data 字段作为表示,可以自定义
data: JSON.stringify({
businessID: BUSINESS_ID_TEXT.EVALUATION,
version: FEAT_NATIVE_CODE.NATIVE_VERSION,
score: this.data.score,
comment: this.data.comment,
}),
description: STRING_TEXT.TYPETEXT, // 获取骰子点数
extension: STRING_TEXT.TYPETEXT,
},
});
this.setData({
score: 0,
comment: '',
});
this.handleClose();
},
},
});
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
@@ -0,0 +1,18 @@
<view class="tui-cards-container" catch:tap="handleClose" wx:if="{{displayTag}}">
<view class="service-evaluation" catch:tap="()=>{}">
<view class="header">
<label>请对本次服务进行评价</label>
<button class="btn" bind:tap="handleClose">关闭</button>
</view>
<view class="main">
<view class="main-evaluation-score">
<image class="score-star" wx:for="{{scoreList}}" wx:key="*this" data-score="{{item}}" src="{{'../../../../../static/images/star' + (item > score ? '-grey': '') + '.png'}}" bind:tap="handleScore" />
</view>
<textarea cols="30" rows="10" bindinput="bindTextAreaInput" placeholder="请输入评语" placeholder-style="textarea-placeholder"
confirm-type="done"show-confirm-bar="{{false}}"></textarea>
</view>
<view class="footer">
<button class="btn" bind:tap="sendMessage" disabled="{{score===0 && !comment}}">提交评价</button>
</view>
</view>
</view>
@@ -0,0 +1,73 @@
.tui-cards-container {
position: fixed;
width: 100vw;
height: 100vh;
z-index: 100;
top: 0;
background: rgba(0,0,0,0.5);
display: flex;
align-items: flex-end;
}
.service-evaluation {
flex: 1;
background: #FFFFFF;
padding: 48rpx 40rpx;
}
.header {
display: flex;
justify-content: space-between;
font-family: PingFangSC-Regular;
}
.btn {
width: auto !important;
padding: 0;
margin: 0 !important;
background: none;
}
.header label {
font-size: 18px;
color: #000000;
letter-spacing: 0;
line-height: 25px;
}
.header .btn {
font-size: 16px;
color: #006EFF;
letter-spacing: 0;
line-height: 24px;
}
.main {
display: flex;
flex-direction: column;
padding: 48rpx 0;
}
.main-evaluation-score {
padding: 0 60rpx 48rpx;
display: flex;
justify-content: space-between;
align-items: flex-end;
}
.main-evaluation-score .score-star {
width: 72rpx;
height: 72rpx;
}
.main textarea {
background: #F8F8F8;
border: 0 solid #D9D9D9;
border-radius: 4px;
font-size: 14px;
padding: 16rpx 32rpx;
}
.textarea-placeholder {
color: #B0B0B0;
}
.footer .btn {
width: 100%;
padding: 26rpx 0;
background: #006EFF;
border-radius: 24px;
border-radius: 24px;
font-size: 16px;
color: #FFFFFF;
}