提交 3950b916 编写于 作者: 恪愚's avatar 恪愚

新增coupon组件

上级 921d70a5
// components/coupon/coupon.js
Component({
options:{
multipleSlots:true
},
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="card">
<view class="left">
<view class="left_img">
<slot name="l_img"></slot>
</view>
<view class="left_text">
<slot name="l_text"></slot>
</view>
</view>
<view class="right">
<view class="right_text">
<slot name="r_text"></slot>
</view>
</view>
</view>
\ No newline at end of file
.card{
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
align-items: center;
box-sizing: border-box;
padding: 6% 4%;
font-size: 34rpx;
background-color: white;
}
.card .left{
width: 26%;
height: 100%;
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
border-right: 1rpx solid rgba(0,0,0,.15);
}
.left .left_img{
width: 45%;
height: 0;
padding-bottom: 50%;
overflow: hidden;
}
.left .left_text{
width: 43%;
height: 0;
padding-bottom: 50%;
overflow: hidden;
white-space: pre-wrap;
word-wrap: normal;
}
.card .right{
flex: 1;
height: 100%;
overflow: hidden;
}
.right .right_text{
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 1rpx 15rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
overflow: hidden;
}
\ No newline at end of file
// pages/coupon/coupon.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {
"y-coupon":"/components/coupon/coupon"
}
}
\ No newline at end of file
<y-coupon>
<image slot="l_img" src="/img/localSDK.png" mode="aspectFill"></image>
<text slot="l_text">今日头条</text>
<text slot="r_text">uagiuagfiuagf以按广东省覅蒛以爱的功夫撒个</text>
</y-coupon>
\ No newline at end of file
/* pages/coupon/coupon.wxss */
\ No newline at end of file
// pages/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
gonotice(){
wx.navigateTo({
url: '../notices/notices',
})
},
gocoupon(){
wx.navigateTo({
url: '../coupon/coupon',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="mxc0" bindtap="gonotice">
<text>去康康“日期组件扩展组件”——高自定义程度、可精确到分、秒</text>
</view>
<view class="mxc1" bindtap="gocoupon">
<text>去康康“优惠券组件”——左右布局,支持slot,可自定义文字</text>
</view>
\ No newline at end of file
Page{
width: 100%;
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
}
view{
width: 100%;
height: 96rpx;
background-color: rgba(0,0,0,.2);
overflow: hidden;
}
\ No newline at end of file
<form bindsubmit="register">
<!-- 这里是三行和通知有关的,也用list整体布局吧 -->
<view class="n_top">
<view class="list" wx:if="{{swItch!=0}}">
<view class="left">通知时间</view>
......@@ -10,6 +8,4 @@
</view>
</view>
</view>
</form>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册