Commit 1def4b2d by 赵雅纹

Merge branch 'feature-zyw-sc' into 'dev_7.1.0'

Feature zyw sc

See merge request !54
parents 67b6faee c32e2001
...@@ -13,7 +13,7 @@ wxService.page({ ...@@ -13,7 +13,7 @@ wxService.page({
unfold:false, unfold:false,
startY:'', startY:'',
refreshClass:'', refreshClass:'',
delBtnWidth:114 delBtnWidth:''
}, },
/** /**
...@@ -45,60 +45,76 @@ wxService.page({ ...@@ -45,60 +45,76 @@ wxService.page({
selected: 3 selected: 3
}) })
} }
const query = wx.createSelectorQuery()
query.select('#plusImg').boundingClientRect()
query.selectViewport().scrollOffset()
var that = this;
query.exec(function (res) {
that.setData({
delBtnWidth: res[0].height
})
})
}, },
// // 开始滑动事件 // 开始滑动事件
// touchS: function (e) { touchS: function (e) {
// console.log('e', e) console.log('e', e)
// if (e.touches.length == 1) { if (e.touches.length == 1) {
// this.setData({ this.setData({
// //设置触摸起始点水平方向位置 //设置触摸起始点水平方向位置
// startY: e.touches[0].clientY startY: e.touches[0].clientY
// }); });
// } }
// }, },
// touchM: function (e) { touchM: function (e) {
// console.log('333', e) console.log('333', e)
// if (e.touches.length == 1) { if (e.touches.length == 1) {
// //手指移动时y方向位置 //手指移动时y方向位置
// var moveY = e.touches[0].clientY; var moveY = e.touches[0].clientY;
// //手指起始点位置与移动期间的差值 //手指起始点位置与移动期间的差值
// var disY = moveY - this.data.startY; var disY = moveY - this.data.startY;
// var delBtnWidth = this.data.delBtnWidth; var delBtnWidth = this.data.delBtnWidth;
// var moveDistance = delBtnWidth - disY; var moveDistance = delBtnWidth - disY;
// var txtStyle = ""; var txtStyle = "";
// console.log('------', disY) console.log('------', disY)
// if (disY == 0 || disY < 0) { //如果移动距离小于等于0,文本层位置不变 if (disY == 0 || disY < 0) { //如果移动距离小于等于0,文本层位置不变
// txtStyle = "margin-top:-114px"; txtStyle = "margin-top:-" + delBtnWidth;
// } else if (disY > 0) { //移动距离大于0,文本层left值等于手指移动距离 } else if (disY > 0) { //移动距离大于0,文本层left值等于手指移动距离
// txtStyle = "margin-top:-" + moveDistance + "px"; txtStyle = "margin-top:-" + moveDistance + "px";
// console.log('+++', txtStyle) console.log('+++', txtStyle)
// if (disY >= delBtnWidth) { if (disY >= delBtnWidth) {
// //控制手指移动距离最大值为删除按钮的宽度 //控制手指移动距离最大值为删除按钮的宽度
// txtStyle = "margin-top:0px" ; txtStyle = "margin-top:0px" ;
// } }
// } }
// this.setData({ this.setData({
// refreshClass: txtStyle refreshClass: txtStyle
// }) })
console.log(txtStyle)
}
},
// 滑动结束事件
touchE: function (e) {
if (e.changedTouches.length == 1) {
//手指移动结束后水平位置
var endY = e.changedTouches[0].clientY;
//触摸开始与结束,手指移动的距离
var disY = endY-this.data.startY;
var delBtnWidth = this.data.delBtnWidth;
//如果距离小于删除按钮的1/2,不显示删除按钮
var txtStyle = "";
console.log('.....', disY)
if (disY > 0){
txtStyle = disY > delBtnWidth ? "margin-top:-" + delBtnWidth : "margin-top:" + disY + "px";
this.setData({
refreshClass: txtStyle
})
}
// } console.log('////',txtStyle)
// }, } else {
// // 滑动中事件 }
// touchE: function (e) { },
// if (e.changedTouches.length == 1) {
// //手指移动结束后水平位置
// var endY = e.changedTouches[0].clientY;
// //触摸开始与结束,手指移动的距离
// var disY = this.data.startY - endY;
// var delBtnWidth = this.data.delBtnWidth;
// //如果距离小于删除按钮的1/2,不显示删除按钮
// var txtStyle = "";
// txtStyle = disY > delBtnWidth / 2 ? "margin-top:" + delBtnWidth + "px" : "margin-top:-114px";
// this.setData({
// refreshClass: txtStyle
// })
// } else {
// }
// },
}) })
\ No newline at end of file
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
<view class="user-header-wrap"> <view class="user-header-wrap">
<view class="header-content"> <view class="header-content">
<view class="avatar-wrap"> <view class="avatar-wrap">
<image class="avatar" src="/assets/imgs/sc-avatar.png"></image> <view class="avatar">
<open-data type="userAvatarUrl" ></open-data>
</view>
<image class="crown" src="/assets/imgs/crown.png"></image> <image class="crown" src="/assets/imgs/crown.png"></image>
</view> </view>
<view class="user-info"> <view class="user-info">
...@@ -61,7 +63,7 @@ ...@@ -61,7 +63,7 @@
</view> </view>
</view> </view>
<!-- 展开 --> <!-- 展开 -->
<view class="interest-unfold" wx:if="{{unfold}}"> <view class="interest-unfold" id="plusImg">
<image class="interest-unfold-bg" src="/assets/imgs/interest-unfold.png"></image> <image class="interest-unfold-bg" src="/assets/imgs/interest-unfold.png"></image>
<view class="interest-title-line"> <view class="interest-title-line">
<image src="/assets/imgs/interest-line.png"></image> <image src="/assets/imgs/interest-line.png"></image>
...@@ -107,7 +109,7 @@ ...@@ -107,7 +109,7 @@
</view> </view>
</view> </view>
<view class="main-content {{unfold ? '' : 'content'}}" > <view class="main-content" bindtouchstart="touchS" bindtouchmove="touchM" bindtouchend="touchE" style="{{refreshClass}}">
<view class="order-ul"> <view class="order-ul">
<view class="order-list"> <view class="order-list">
<view class="my-order"> <view class="my-order">
......
...@@ -10,10 +10,10 @@ page{ ...@@ -10,10 +10,10 @@ page{
padding: 60rpx 30rpx 0; padding: 60rpx 30rpx 0;
} }
.avatar{ .avatar{
width: 93rpx; width: 96rpx;
height: 93rpx; height: 96rpx;
border-radius: 50%; border-radius: 50%;
border: 1px solid #000000; overflow: hidden;
} }
.user-info{ .user-info{
display: inline-block; display: inline-block;
...@@ -181,16 +181,12 @@ page{ ...@@ -181,16 +181,12 @@ page{
text-align: center; text-align: center;
} }
.main-content{ .main-content{
/* position: relative; */ position: relative;
margin-top: -4rpx; /* margin-top: -4rpx; */
padding: 0 20rpx; padding: 0 20rpx;
background-color: #F9F9F9; background-color: #F9F9F9;
} margin-top: -228rpx;
.content{ z-index: 99;
margin-top: 28rpx;
/* margin-top: -228rpx;
z-index: 99; */
} }
.order-list{ .order-list{
width: 664rpx; width: 664rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment