im ok
This commit is contained in:
49
components/GoEasyCustomMessage/customMessage.js
Normal file
49
components/GoEasyCustomMessage/customMessage.js
Normal file
@@ -0,0 +1,49 @@
|
||||
/* customMessage.js */
|
||||
Component({
|
||||
data: {
|
||||
to: null,//接收方
|
||||
type: "", //私聊还是群聊
|
||||
show: false,//是否展示自定义消息组件
|
||||
|
||||
goods : '',
|
||||
price : '',
|
||||
number : ''
|
||||
},
|
||||
methods:{
|
||||
setNumber(e){
|
||||
this.setData({
|
||||
number: e.detail.value
|
||||
});
|
||||
},
|
||||
setGoods(e){
|
||||
this.setData({goods: e.detail.value});
|
||||
},
|
||||
setPrice(e){
|
||||
this.setData({
|
||||
price: e.detail.value
|
||||
});
|
||||
},
|
||||
createCustomMessage () {
|
||||
let customMessage = wx.im.createCustomMessage({
|
||||
type : 'order',
|
||||
payload : {
|
||||
number : this.data.number,
|
||||
goods : this.data.goods,
|
||||
price : this.data.price
|
||||
},
|
||||
to: {
|
||||
id : this.data.to.uuid,
|
||||
type : this.data.type,
|
||||
data : {name : this.data.to.name, avatar: this.data.to.avatar}
|
||||
}
|
||||
});
|
||||
this.triggerEvent("sendCustomMessage",customMessage);
|
||||
this.close();
|
||||
},
|
||||
close () {
|
||||
this.setData({
|
||||
show: false
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
5
components/GoEasyCustomMessage/customMessage.json
Normal file
5
components/GoEasyCustomMessage/customMessage.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents":{},
|
||||
"navigationBarTitleText": "自定义消息"
|
||||
}
|
||||
29
components/GoEasyCustomMessage/customMessage.wxml
Normal file
29
components/GoEasyCustomMessage/customMessage.wxml
Normal file
@@ -0,0 +1,29 @@
|
||||
<view>
|
||||
<view wx:if="{{show}}" class="goeasy-custom-message">
|
||||
<view class="custom-message-box">
|
||||
<view class="goeasy-custom-message-title">发送订单</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<view class="order-item">编号:</view>
|
||||
<view class="order-item">商品:</view>
|
||||
<view class="order-item">金额:</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="order-input">
|
||||
<input class="input" type="text" bindinput="setNumber" maxlength="20"/>
|
||||
</view>
|
||||
<view class="order-input">
|
||||
<input class="input" type="text" bindinput="setGoods" maxlength="20"/>
|
||||
</view>
|
||||
<view class="order-input">
|
||||
<input class="input" type="text" bindinput="setPrice" maxlength="10" />
|
||||
</view>
|
||||
<view class="action-btn">
|
||||
<view class="cancel-btn" bindtap="close">取消</view>
|
||||
<view class="send-btn" bindtap="createCustomMessage">发送</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
78
components/GoEasyCustomMessage/customMessage.wxss
Normal file
78
components/GoEasyCustomMessage/customMessage.wxss
Normal file
@@ -0,0 +1,78 @@
|
||||
/* customMessage.wxss */
|
||||
.goeasy-custom-message {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 10000;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.custom-message-box {
|
||||
padding: 0 40rpx;
|
||||
}
|
||||
|
||||
.goeasy-custom-message-title {
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
font-size: 40rpx;
|
||||
line-height: 200rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.order-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 80rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.order-input {
|
||||
height: 80rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.input {
|
||||
width: 500rpx;
|
||||
height: 80rpx;
|
||||
padding: 10rpx;
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
background: #EFEFEF;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
|
||||
.send-btn {
|
||||
width: 240rpx;
|
||||
height: 80rpx;
|
||||
background: #618DFF;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
border-radius: 10rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
width: 240rpx;
|
||||
height: 80rpx;
|
||||
background: #FFFFFF;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
border-radius: 10rpx;
|
||||
color: #666666;
|
||||
font-size: 32rpx;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1)
|
||||
}
|
||||
Reference in New Issue
Block a user