Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
nyx
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
发现
nyx
Commits
8482e202
Commit
8482e202
authored
Oct 13, 2020
by
jscat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nyx weapp: bug fix
1. 分享按钮里, note_image字段写错 2. 调整scroll-view的格式
parent
00c8e83c
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
54 行增加
和
16 行删除
+54
-16
增值产品-小程序及app/nyx-dev/pages/activity/activity-info/activity-info.js
+45
-5
增值产品-小程序及app/nyx-dev/pages/activity/activity-info/activity-info.wxml
+3
-3
增值产品-小程序及app/nyx-dev/pages/activity/activity-info/activity-info.wxss
+6
-8
没有找到文件。
增值产品-小程序及app/nyx-dev/pages/activity/activity-info/activity-info.js
查看文件 @
8482e202
// pa
ges/activity/activity-info/activity-info.js
// pa
ges/activity/activity-info/activity-info.js
...
...
@@ -34,6 +34,9 @@ Page({
likeStatus
:
0
,
// 判断like图标的状态
likeUrl
:
"../../../icon/activity/like.png"
,
// like图标的url
//swiper的高度
swiperViewHeight
:
0
},
/**
...
...
@@ -217,7 +220,7 @@ Page({
var
_this
=
this
;
var
url_activity
=
"/pages/activity/activity-info/activity-info?"
+
"activity_id="
+
_this
.
data
.
activityInfo
[
"activity_id"
]
+
"¬e_image="
+
_this
.
data
.
activityInfo
[
'note
I
mage'
].
join
(
"::"
)
+
"¬e_image="
+
_this
.
data
.
activityInfo
[
'note
_i
mage'
].
join
(
"::"
)
+
"&title="
+
_this
.
data
.
activityInfo
[
"title"
]
+
"&content="
+
_this
.
data
.
activityInfo
[
"content"
]
+
"&num_like="
+
_this
.
data
.
activityInfo
[
'num_like'
]
...
...
@@ -294,12 +297,17 @@ Page({
},
//滑动获取选中商品
//滑动获取选中商品
jscat 20201012, obsolete; 不在需要去选中商品
getSelectItem
:
function
(
e
)
{
var
that
=
this
;
var
preCurImage
=
that
.
data
.
curImage
;
var
itemWidth
=
e
.
detail
.
scrollWidth
/
that
.
data
.
activityInfo
.
note_image
.
length
;
//每个商品的宽度
var
scrollLeft
=
e
.
detail
.
scrollLeft
;
//滚动宽度
if
(
scrollLeft
<=
0
)
{
scrollLeft
=
0
;
}
console
.
log
(
"===scrollLeft_"
,
scrollLeft
)
var
curImage
=
Math
.
round
(
scrollLeft
/
itemWidth
);
//通过Math.round方法对滚动大于一半的位置进行进位
var
newScrollLeft
=
0
// 目标: 始终让图片居中显示
...
...
@@ -308,11 +316,12 @@ Page({
)
{
newScrollLeft
=
that
.
data
.
windowWidth
*
curImage
scrollLeft
=
newScrollLeft
}
that
.
setData
({
scrollLeft
:
newS
crollLeft
,
scrollLeft
:
s
crollLeft
,
curImage
:
curImage
,
//图片轮循的时候, 不同步更新价格 jscat 20200921
});
}
},
//跳转到结算页 order.wxml
...
...
@@ -440,5 +449,35 @@ Page({
},
//动态设置swiper的高度; jscat 20201012, obsolete
setSwiperHeight
:
function
()
{
let
that
=
this
wx
.
getSystemInfo
({
success
:
function
(
res
)
{
that
.
setData
({
windowHeight
:
res
.
windowHeight
,
});
}
});
// 根据文档中的介绍,先创建一个SelectorQuery对象实例
let
query
=
wx
.
createSelectorQuery
().
in
(
this
);
query
.
select
(
'.image_view'
).
boundingClientRect
();
// 执行上面所指定的请求,结果会按照顺序存放于一个数组中,在callback的第一个参数中返回
query
.
exec
((
res
)
=>
{
//取出表头高度
let
headerHeight
=
res
[
0
].
height
;
// 计算出去除表头剩余的高度
let
swiperViewHeight
=
headerHeight
;
this
.
setData
({
swiperViewHeight
:
swiperViewHeight
});
});
},
})
\ No newline at end of file
增值产品-小程序及app/nyx-dev/pages/activity/activity-info/activity-info.wxml
查看文件 @
8482e202
<wxs
module="tutil" src="./../../../utils/date.wxs"></wxs>
<wxs
module="tutil" src="./../../../utils/date.wxs"></wxs>
...
...
@@ -3,9 +3,9 @@
<view class="page">
<!-- 图片 -->
<scroll-view class="scroll-view_H" scroll-x scroll-with-animation style="width: 100%;height:
90%;" bindscroll="getSelectItem" scroll-left="{{scrollLeft}}
">
<scroll-view class="scroll-view_H" scroll-x scroll-with-animation style="width: 100%;height:
100%;
">
<block wx:for="{{activityInfo.note_image}}" wx:key="unique" wx:for-index="id" wx:for-item="item">
<view class="scroll_item
{{item.selected ? 'selected' : ''}}" data-index='{{item.index}}' bindtap='selectProItem'
>
<view class="scroll_item
"
>
<image src="{{item}}" mode="widthFix"/>
</view>
</block>
...
...
增值产品-小程序及app/nyx-dev/pages/activity/activity-info/activity-info.wxss
查看文件 @
8482e202
.scro
ll-view_H{
.scro
ll-view_H{
...
...
@@ -2,13 +2,13 @@
position: relative;
width: 100%;
text-align: center;
transform: scale(
0.9
);
transform: scale(
1
);
white-space: nowrap;
}
.scroll_item {
position: relative;
width: 100%;
height:
9
0%;
height:
10
0%;
margin: 0;
transform-origin: 50% 0;
left: 0%;
...
...
@@ -22,23 +22,21 @@
background-color: #fff;
}
.scroll_item:first-child{
margin
-left
: 0%;
margin: 0%;
left: 0;
}
.scroll_item:last-child{
margin
-right: 10%
;
margin
: 0
;
left: 0;
}
.scroll_item.selected{
/* transform: scale(0.9); */
border: solid
1
px #ffcd54;
border: solid
0
px #ffcd54;
}
.scroll_item image {
width: 100%;
float: left;
margin-top: 0;
/* border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx; */
}
.note{
width: 100%;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论