Commit caf0a97e by jscat

nyx: tiny fix

parent b93eb4aa
<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="14"></icon>
<icon class="weui-icon-search_in-box" type="search" size="16"></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="14"></icon>
<icon type="clear" size="16"></icon>
</view>
</view>
<label class="weui-search-bar__label" hidden="{{inputShowed}}" bindtap="showInput">
<icon class="weui-icon-search" type="search" size="14"></icon>
<icon class="weui-icon-search" type="search" size="16"></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 ">
......@@ -26,6 +29,7 @@
</scroll-view>
</view>
<!-- 文章列表 -->
<scroll-view class="list-block" scroll-y="true" style="height:{{noteHeight}}px">
<!-- 文章封面内容 -->
......
.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: 15px;
font-size: 16px;
color: #9d9d9d;
}
.navBar-box .cate-list.on {
......@@ -105,8 +98,6 @@
margin: auto;
}
/* 加载更多 */
.weui-loading {
margin: 0 5px;
......
var config = wx.getStorageSync("config");
var config = 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.cacheImageAll();
}
}
})
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论