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
caf0a97e
Commit
caf0a97e
authored
Apr 07, 2020
by
jscat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nyx: tiny fix
parent
b93eb4aa
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
46 行增加
和
42 行删除
+46
-42
增值产品-小程序及app/nyx-master/pages/discover/discover.wxml
+13
-9
增值产品-小程序及app/nyx-master/pages/discover/discover.wxss
+11
-20
增值产品-小程序及app/nyx-master/pages/map/map.js
+22
-13
没有找到文件。
增值产品-小程序及app/nyx-master/pages/discover/discover.wxml
查看文件 @
caf0a97e
<view
class="page">
<view
class="page">
<view class="page">
<!-- 搜索框 -->
<block style="position: fixed">
<view class="weui-search-bar">
<view class="weui-search-bar__form">
<view class="weui-search-bar__box">
<icon class="weui-icon-search_in-box" type="search" size="1
4
"></icon>
<icon class="weui-icon-search_in-box" type="search" size="1
6
"></icon>
<input type="text" class="weui-search-bar__input" placeholder="搜索" value="{{inputVal}}" focus="{{inputShowed}}" bindinput="inputTyping" />
<view class="weui-icon-clear" wx:if="{{inputVal.length > 0}}" bindtap="clearInput">
<icon type="clear" size="1
4
"></icon>
<icon type="clear" size="1
6
"></icon>
</view>
</view>
<label class="weui-search-bar__label" hidden="{{inputShowed}}" bindtap="showInput">
<icon class="weui-icon-search" type="search" size="1
4
"></icon>
<icon class="weui-icon-search" type="search" size="1
6
"></icon>
<view class="weui-search-bar__text">搜索</view>
</label>
</view>
<view class="weui-search-bar__cancel-btn" hidden="{{!inputShowed}}" bindtap="hideInput">取消
</view>
</view>
</block>
<!-- 导航栏 -->
<view class="navBar">
<scroll-view class="navBar-box" scroll-x="true" style="white-space: nowrap; display:flex ">
<view class="cate-list {{curIndex==index?'on':''}}" wx:for="{{category}}"
wx:key="{{item.id}}" data-id="{{item.id}}" data-index="{{index}}"
bindtap="switchCategory">{{item.name}}</view>
</scroll-view>
<scroll-view class="navBar-box" scroll-x="true" style="white-space: nowrap; display:flex ">
<view class="cate-list {{curIndex==index?'on':''}}" wx:for="{{category}}"
wx:key="{{item.id}}" data-id="{{item.id}}" data-index="{{index}}"
bindtap="switchCategory">{{item.name}}</view>
</scroll-view>
</view>
<!-- 文章列表 -->
<scroll-view class="list-block" scroll-y="true" style="height:{{noteHeight}}px">
<!-- 文章封面内容 -->
...
...
增值产品-小程序及app/nyx-master/pages/discover/discover.wxss
查看文件 @
caf0a97e
.page{
/*
/*
height: 100vh; 相对于视口(Layout Viewport)的高度; 视口被均分为100单位的vh
border-radius: 30px; 设置元素的外边框圆角
position: relative; 相对位置
em: 默认文字大小是16px, font-size: 16px; em是一个相对的大小; 1em=1*16=16px
结构: position -> margin -> ( border -> padding -> input )
position: 定位原则:子绝父相; absolute,绝对;relative,相对;fixed,固定,比如搜索框
*/
.page{
height:100vh; /* 相对于视口(Layout Viewport)的高度; 视口被均分为100单位的vh */
background-color:#f5f8fa;
}
.search{
background: #fff;
height: 40rpx;
}
.searchBar{
height: 40rpx;
margin: 20rpx;
border-radius: 30px;
border:1px solid #f5f5f5;
background: #f5f5f5;
}
.weui-icon-search{
margin-left: 15rpx;
float: left;
}
.navBar{
height: 60rpx;
background: #fff;
...
...
@@ -32,7 +25,7 @@
display: inline;
margin: 15rpx 22rpx;
text-align: center;
font-size: 1
5
px;
font-size: 1
6
px;
color: #9d9d9d;
}
.navBar-box .cate-list.on {
...
...
@@ -105,8 +98,6 @@
margin: auto;
}
/* 加载更多 */
.weui-loading {
margin: 0 5px;
...
...
增值产品-小程序及app/nyx-master/pages/map/map.js
查看文件 @
caf0a97e
var
c
onfig
=
wx
.
getStorageSync
(
"config"
);
var
c
onfig
=
wx
.
getStorageSync
(
"config"
);
...
...
@@ -64,15 +64,6 @@ Page({
// provinceIndex: 0,
cityIndex
:
0
,
districtIndex
:
0
,
cityInfoIndex
:
0
,
cityInfo
:
[
{
district
:
""
,
url
:
""
,
number
:
""
,
}
],
//end - address selector
//start - long press event
...
...
@@ -353,7 +344,7 @@ Page({
//基于图片尺寸,计算member的pos
_this
.
getMemberPos
(
""
,
areaName
)
//是否缓存图片
_this
.
cacheImage
();
_this
.
cacheImage
All
();
}
}
})
...
...
@@ -590,7 +581,7 @@ Page({
url
:
imgUrl
,
success
:
function
(
res
)
{
if
(
res
.
statusCode
===
200
)
{
console
.
log
(
'图片下载成功
'
+
res
.
tempFilePath
)
console
.
log
(
'图片下载成功
_'
+
img_cache_key
+
"_"
+
res
.
tempFilePath
)
// 第二步: 使用小程序的文件系统,通过小程序的api获取到全局唯一的文件管理器
const
fs
=
wx
.
getFileSystemManager
()
// fs为全局唯一的文件管理器。那么文件管理器的作用是什么,我们可以用来做什么呢?
...
...
@@ -625,7 +616,7 @@ Page({
url
:
imgUrl
,
success
:
function
(
res
)
{
if
(
res
.
statusCode
===
200
)
{
console
.
log
(
'图片下载成功
'
+
res
.
tempFilePath
)
console
.
log
(
'图片下载成功
_'
+
img_cache_key
+
"_"
+
res
.
tempFilePath
)
// 第二步: 使用小程序的文件系统,通过小程序的api获取到全局唯一的文件管理器
// 此时图片本地缓存已经完成,res.savedFilePath为本地存储的路径。
//小程序的本地文件路径标准: {{协议名}}://文件路径
...
...
@@ -656,6 +647,24 @@ Page({
},
cacheImageAll
:
function
()
{
var
_this
=
this
;
var
cityIndex
=
_this
.
data
.
cityIndex
var
img_cache_key
=
""
var
imgUrl
=
""
for
(
let
index
=
0
;
index
<
_this
.
data
.
district
.
length
;
index
++
)
{
img_cache_key
=
_this
.
data
.
city
[
cityIndex
]
+
"_"
+
_this
.
data
.
district
[
index
]
+
"_imgcache"
imgUrl
=
_this
.
__data__
.
url
[
index
]
if
(
wx
.
getStorageSync
(
img_cache_key
)
==
""
)
{
_this
.
cacheImageFunc
(
img_cache_key
,
imgUrl
)
}
}
},
})
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论