Commit 6ec6d5cd by jscat

nyx改版。

parent 57e8e6b0
{
{
{
"pages": [
"pages/discover/discover",
"pages/key/key",
"pages/discover/note-info/note-info",
"pages/my/my",
"pages/discover/discover",
"pages/discover/note-writer/note-writer",
"pages/discover/searchbar/searchbar",
"pages/map/map",
......@@ -29,34 +29,16 @@
"color": "#a0a0a0",
"selectedColor": "#333333",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/map/map",
"text": "地图",
"iconPath": "./icon/map1.png",
"selectedIconPath": "./icon/map1.png"
},
"list": [
{
"pagePath": "pages/discover/discover",
"text": "发现",
"iconPath": "./icon/discover2.png",
"selectedIconPath": "./icon/discover2.png"
},
{
"pagePath": "pages/post/post",
"text": "添加",
"iconPath": "./icon/add.png",
"selectedIconPath": "./icon/add.png"
},
{
"pagePath": "pages/key/key",
"text": "知识",
"iconPath": "./icon/key.png",
"selectedIconPath": "./icon/key.png"
"text": "活动",
"iconPath": "./icon/index.png",
"selectedIconPath": "./icon/index.png"
},
{
"pagePath": "pages/my/my",
"text": "我的",
"text": "个人",
"iconPath": "./icon/my.png",
"selectedIconPath": "./icon/my.png"
}
......

693 Bytes | W: | H:

3.94 KB | W: | H:

增值产品-小程序及app/nyx-master/icon/down.png
增值产品-小程序及app/nyx-master/icon/down.png
增值产品-小程序及app/nyx-master/icon/down.png
增值产品-小程序及app/nyx-master/icon/down.png
  • 2-up
  • Swipe
  • Onion skin
// pages/address/address.js
// pages/address/address.js
var app = getApp()
Page({
data: {
searchLetter: [],
showLetter: "",
winHeight: 0,
cityList: [],
isShowLetter: false,
scrollTop: 0,//置顶高度
scrollTopId: '',//置顶id
city: "",
cityList_search:[],
address_show:false,
search_city:[],
is_data:true,
empty:'',
},
onLoad: function (options) {
console.log(options.currentcity)
// 生命周期函数--监听页面加载
let that = this;
that.setData({
city: options.currentcity
})
var searchLetter = ["A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "W", "X", "Y", "Z"];
new Promise(function (resolve) {
that.getCity(function (data) {
console.log(data)
let cityObj = data.cityList;
var tempObj = [];
for (var i = 0; i < searchLetter.length; i++) {
var initial = searchLetter[i];
var cityInfo = [];
var tempArr = {};
tempArr.initial = initial;
for (var j = 0; j < cityObj.length; j++) {
if (initial == cityObj[j].initial) {
cityInfo.push(cityObj[j]);
}
}
tempArr.cityInfo = cityInfo;
tempObj.push(tempArr);
}
console.log(tempObj)
that.setData({
cityList: tempObj
})
resolve(tempObj);
})
}).then(function(res){
console.log(res)
let cityObj = [];
var sysInfo = wx.getSystemInfoSync();
var winHeight = sysInfo.windowHeight;
var itemH = winHeight / searchLetter.length;
var tempObj = [];
for (var i = 0; i < searchLetter.length; i++) {
var temp = {};
temp.name = searchLetter[i];
temp.tHeight = i * itemH;
temp.bHeight = (i + 1) * itemH;
tempObj.push(temp)
}
that.setData({
winHeight: winHeight,
itemH: itemH,
searchLetter: tempObj,
})
})
},
getCity: function (callBack){
let that = this;
app.commonRequest('wxapp/public/getCityList', 'POST', {}, function (data) {
console.log(data);
if (data.status == '200') {
that.setData({
cityList: data.datainfo.list,
// city: data.datainfo.getcode,
})
callBack({
cityList: data.datainfo.list
})
} else {
callBack({
cityList: data.datainfo.list
})
}
})
},
set_current_city:function(set_city,callBack){
let that = this;
app.commonRequest('wxapp/public/getCityList', 'POST', {
area_name: set_city,
cityCheckType:1,
}, function (data) {
console.log(data)
if (data.status == "200") {
callBack({
data: data
})
}else {
callBack({
data: data
})
}
})
},
search_city:function(e){
let that =this;
that.setData({
address_show:true
})
},
cancel_city:function(e){
let that = this;
that.setData({
search_city:[],
address_show: false,
empty:'',
})
},
seacrch_city:function(e){
let that =this;
let search_val = e.detail.value;
console.log(search_val);
app.commonRequest('wxapp/public/getCityList', 'POST', {
area_name: search_val
}, function (data) {
console.log(data)
if(data.status == "200"){
if (data.datainfo.list.length >0){
that.setData({
search_city: data.datainfo.list,
is_data: true
})
}
else{
that.setData({
search_city: data.datainfo.list,
is_data:false
})
}
}
})
},
clickLetter: function (e) {
console.log(e.currentTarget.dataset.letter)
var showLetter = e.currentTarget.dataset.letter;
this.setData({
showLetter: showLetter,
isShowLetter: true,
scrollTopId: showLetter,
})
var that = this;
setTimeout(function () {
that.setData({
isShowLetter: false
})
}, 1000)
},
//选择城市
bindCity: function (e) {
let that = this;
console.log("bindCity");
that.set_current_city(e.currentTarget.dataset.city,function(data){
console.log(data)
});
wx.setStorageSync('currentcity', e.currentTarget.dataset.city)
// that.onLoad();
this.setData({
city: e.currentTarget.dataset.city,
// scrollTop: 0,
})
  // 回到首页
wx.switchTab({
url: '/pages/index/index'
})
},
})
\ No newline at end of file
{
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/address/address.wxml-->
<!--pages/address/address.wxml-->
<view class="searchLetter touchClass">
<view class="thishotText" bindtap="hotCity">
<view style="margin-top:0;">当前</view>
<!-- <view style="margin-top:0;">热门</view> -->
</view>
<view wx:for="{{searchLetter}}" style="color:#53985F;font-size:20rpx;" wx:key="index" data-letter="{{item.name}}" catchtouchend="clickLetter" >{{item.name}}</view>
</view>
<block wx:if="{{isShowLetter}}">
<view class="showSlectedLetter">
{{showLetter}}
</view>
</block>
<scroll-view scroll-y="true" style="height:{{winHeight}}px"
scroll-into-view="{{scrollTopId}}" scroll-top="{{scrollTop}}">
<view class='searchbox'>
<view class='input_box'>
<image class='search' src='/images/search.png'></image>
<input placeholder='城市' onchange="seacrch_city" oninput="seacrch_city" onblur="seacrch_city" value='{{empty}}' bindtap='search_city'></input>
<view class='close' bindtap='cancel_city'>×</view>
</view>
<view class='cancel' bindtap='cancel_city'>取消</view>
</view>
<view id='address' hidden='{{address_show}}'>
<view class='current_city li_style'>当前:{{city}}</view>
<view class='all_city'>
<view class='li_style'>所有城市</view>
</view>
<view class="selection" wx:for="{{cityList}}" wx:key="{{item.initial}}">
<view class="item_letter" id="{{item.initial}}">{{item.initial}}</view>
<view class="item_city" wx:for="{{item.cityInfo}}" wx:for-item="ct" wx:key="{{ct.id}}" data-cityCode="{{ct.area_code}}" data-city="{{ct.area_name}}" bindtap="bindCity">
{{ct.area_name}}
</view>
</view>
</view>
<view id='address_search' hidden='{{!address_show}}'>
<view>
<view class="item_city" wx:for="{{search_city}}" wx:for-item="ct" wx:key="{{ct.id}}" data-cityCode="{{ct.area_code}}" data-city="{{ct.area_name}}" bindtap="bindCity">
{{ct.area_name}}
</view>
<view class='noData' hidden='{{is_data}}'>暂无数据</view>
</view>
</view>
</scroll-view>
\ No newline at end of file
/* pages/address/address.wxss */
/* pages/address/address.wxss */
.searchbox{
overflow: hidden;
margin: 0 20rpx;
}
.search{
width: 20px;
height: 20px;
float: left;
margin:7rpx 10rpx;
}
.input_box{
width: 630rpx;
height: 50rpx;
background: #efefef;
border-radius: 30rpx;
float: left;
}
.input_box input{
font-size: 25rpx;
width: 450rpx;
float: left;
}
.input_box .close{
width:30rpx;
height:30rpx;
background:#aaa;
color:#fff;
border-radius:50%;
float:right;
margin-right:20rpx;
margin-top:10rpx;
line-height:27rpx;
font-size:30rpx;
text-align:center;
}
.searchbox .cancel{
font-size: 25rpx;
color: #53985F;
width: 80rpx;
text-align: right;
float: right;
line-height: 50rpx;
}
.current_city{
border-bottom: 1rpx solid #eee;
}
.li_style{
height: 50rpx;
padding: 20rpx 0;
width: 710rpx;
line-height: 50rpx;
font-size: 29rpx;
margin:0 20rpx;
}
.searchLetter {
position: fixed;
right: 0;
width: 50rpx;
text-align: center;
justify-content: center;
display: flex;
flex-direction: column;
color: #666;
z-index: 1;
}
.searchLetter view {
margin-top: 20rpx;
}
.touchClass {
background-color: #fff;
color: #fff;
top: 100rpx;
}
.showSlectedLetter {
background-color: rgba(0, 0, 0, 0.5);
color: #fff;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
top: 50%;
left: 50%;
margin: -100rpx;
width: 200rpx;
height: 200rpx;
border-radius: 20rpx;
font-size: 52rpx;
z-index: 1;
}
.selection {
display: flex;
width: 100%;
flex-direction: column;
margin-top: 10rpx;
}
.item_letter {
display: flex;
background-color: #f5f5f5;
height: 50rpx;
padding-left: 34rpx;
align-items: center;
font-size: 24rpx;
color: #666;
}
.item_city {
display: flex;
background-color: #fff;
height: 100rpx;
padding-left: 34rpx;
align-items: center;
border-bottom: 1rpx solid #ededed;
font-size: 24rpx;
color: #666;
}
.hotcity-common {
font-size: 24rpx;
color: #666;
padding: 0 0 0 30rpx;
}
.thisCity {
padding-top: 30rpx;
}
.thisCityName {
display: inline-block;
border: 1rpx solid #2ab4ff;
border-radius: 8rpx;
padding: 10rpx 0;
font-size: 24rpx;
color: #2ab4ff;
text-align: center;
min-width: 149.5rpx;
margin: 20rpx 0 20rpx 30rpx;
}
.thishotText {
color: #53985F;
font-size: 20rpx;
margin: 0 !important;
}
.slectCity {
border-color: #2ab4ff !important;
}
.slectCity view {
color: #2ab4ff !important;
}
.weui-grid {
position: relative;
float: left;
padding: 10rpx 0;
width: 149.5rpx;
box-sizing: border-box;
border: 1rpx solid #ececec;
border-radius: 8rpx;
margin: 10rpx 12rpx;
}
.weui-grid__label {
display: block;
text-align: center;
color: #333;
font-size: 24rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.noData{
text-align: center;
font-size: 30rpx;
color: #aaa;
line-height: 60rpx;
}
\ No newline at end of file
// pages/kinds/kinds.js
// pages/kinds/kinds.js
......@@ -9,21 +9,14 @@ Page({
*/
data: {
category: [ // 导航栏内容数据
{ name: '推荐', id: 'top' },
{ name: '问答', id: 'wenda' },
{ name: '复工', id: 'fugong' },
{ name: '心情', id: 'xinqing' },
{ name: '酒单', id: 'jiudan' },
{ name: '音乐', id: 'yinyue' },
{ name: '饮事', id: 'yinshi' },
],
curIndex: 0, // 给选中的tab加粗
notes: [
// {
// note_image: [ "https://img.xiaohongshu.com/items/c1a0056ba9ba17b30446a0e040dc9e30@800w_90Q_1x_2o.jpg",
// "https://img.xiaohongshu.com/items/c1a0056ba9ba17b30446a0e040dc9e30@800w_90Q_1x_2o.jpg",
// ],
// title: "便携香水加香一天",
// note_image: [ "https://1.jpg", "https://2.jpg"],
// title: "一天",
// like: 10,
// writer_name: "无敌花木兰",
// writer_image: "../../icon/icon_avatar3.png"
......@@ -88,7 +81,7 @@ Page({
})
wx.setNavigationBarTitle({
title: '发现',
title: '酒肆活动',
})
//初始载入四个推荐notes
......
<view class="page">
<view class="page">
<view class="page">
<!-- 搜索框 -->
<!--refer https://blog.csdn.net/weixin_44022446/article/details/86438015 -->
<!-- 2020/07/17 jscat 微信小程序城市选择及搜索功能的方法-->
<!-- refer https://www.jb51.net/article/158292.htm -->
<!-- refer https://github.com/cinoliu/-selectCity -->
<view class="weui-search-bar">
<text>上海</text>
<image src='../../icon/down.png' style='width: 32rpx;height: 32rpx;' class='selecrtImg'></image>
<view class="weui-search-bar__form">
<view class="weui-search-bar__box">
<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}}" bindconfirm="startSearch" />
<input type="text" class="weui-search-bar__input" placeholder="发现感兴趣的活动" value="{{inputVal}}" focus="{{inputShowed}}" bindconfirm="startSearch" />
<view class="weui-icon-clear" wx:if="{{inputVal.length > 0}}" bindtap="clearInput">
<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="16"></icon>
<view class="weui-search-bar__text">搜索</view>
<view class="weui-search-bar__text">发现感兴趣的活动</view>
</label>
</view>
<view class="weui-search-bar__cancel-btn" hidden="{{!inputShowed}}" bindtap="hideInput">取消
</view>
</view>
<view class="workbench">
<view class="list">
<view class="items">
<navigator url="matchStudyDetail/matchStudyDetail?studyType=wset1">
<image src="../../icon/discover/scan.png"></image>
</navigator>
<text>扫一扫</text>
</view>
<view class="items">
<navigator url="matchStudyDetail/matchStudyDetail?studyType=wset2">
<image src="../../icon/discover/points.png"></image>
</navigator>
<text>积分</text>
</view>
<view class="items">
<navigator url="matchStudyDetail/matchStudyDetail?studyType=wset3">
<image src="../../icon/discover/top.png"></image>
</navigator>
<text>热销</text>
</view>
</view>
</view>
<!-- 导航栏 -->
<view class="navBar" >
<scroll-view class="navBar-box" scroll-x="true" style="white-space: nowrap; display:flex ">
......@@ -34,19 +62,18 @@
<!-- 文章封面内容 -->
<view class="notes-block" wx:for="{{notes}}" wx:for-item="item" wx:key="{{index}}">
<view class="note-info">
<navigator url="../discover/note-info/note-info?title={{item.title}}&content={{item.content}}&like={{item.like}}&note_image={{item.note_image}}&writer_name={{item.writer_name}}&writer_image={{item.writer_image}}" >
<navigator url="../discover/note-info/note-info?title={{item.title}}&content={{item.content}}&like={{item.like}}&note_image={{item.note_image}}&writer_name={{item.writer_name}}&writer_image={{item.writer_image}}" >
<view class="note-img">
<image src="{{item.note_image[0]}}"/>
</view>
<span>{{item.title}}</span>
</navigator>
<text>{{item.title}}</text>
</view>
<!-- 作者信息 -->
<view class="note-handle">
<navigator class="writer" url="../discover/note-writer/note-writer">
<image class="photo-img" src="{{item.writer_image}}"/>
<span class="name">{{item.writer_name}}</span>
</navigator>
<span class="name">{{item.writer_name}}</span>
<view class="like" bindtap="onSubmitLike" data-post-id="{{item.post_id}}">
<image class="like-icon" src="../../icon/discover/like.png" style="width:30rpx;height:30rpx"/>
<span>{{item.like}}</span>
......
/*
/*
......@@ -53,18 +53,23 @@
border-radius: 5px;
position: relative;
float: left;
display: block;
/* display: block; */
}
/*item title*/
.note-info span{
.note-info{
font-size: 17px;
}
/*item title*/
.note-info text{
width: 100%;
overflow : hidden;
white-space: nowrap;
text-overflow: ellipsis;
/* display: -webkit-box; */
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
margin: 5px;
display: inline-block;
word-break: break-all;
/* margin: 5px; */
}
.note-img image{
width: 100%;
......@@ -197,3 +202,70 @@
display: inline-block;
vertical-align: middle;
}
/*城市选择器 */
/* start of citypicker */
.selecrtImg{
float:right;
margin-top: 10rpx;
margin-right: 10rpx;
margin-left: 10rpx;
}
/* end of citypicker */
/* start of workbench*/
.workbench{
font-size: 30rpx;
background: #fff;
padding-bottom: 10rpx;
margin-bottom:10rpx;
padding-top: 5rpx;
margin-top:5rpx;
color: #333;
}
.workbench .title{
font-size: 35rpx;
padding: 20rpx 20rpx;
margin-bottom: 40rpx;
display: block;
}
.workbench .items{
width: 100rpx;
flex:1;
text-align: center;
}
.workbench .items image{
width: 100rpx;
height: 100rpx;
}
.workbench .items image.service-icon{
width: 50rpx;
height: 50rpx;
}
.workbench .items text{
display: block;
text-align: center;
margin-top: 0rpx;
margin-bottom: 0rpx;
}
.workbench .items text.top{
display: block;
text-align: center;
margin-bottom: 0rpx;
}
.workbench .items text.bottom{
display: block;
text-align: center;
margin-top: 0rpx;
}
.workbench .list{
display: flex;
flex-direction: row;
flex:1;
}
/* end of workbench*/
// pages/index/note-info/note-info.js
// pages/index/note-info/note-info.js
......@@ -40,7 +40,7 @@ Page({
}
wx.setNavigationBarTitle({
title: '发现',
title: '活动详情',
})
_this.setData(
......@@ -128,4 +128,5 @@ Page({
// console.log("curIndex: ", curIndex)
// console.log("newScrollLeft: ", newScrollLeft)
},
})
\ No newline at end of file
<view class="page">
<view class="page">
<view class="page">
<!-- 作者信息 -->
<view class="note-handle">
<image class="writer-image" src="{{notes.writer_image}}"/>
......
// pages/my/my.js
// pages/my/my.js
......@@ -37,7 +37,7 @@ Page({
}
wx.setNavigationBarTitle({
title: '我的',
title: '酒肆活动',
});
log.info("my_onLoad_nyxCode", _this.data.nyxCode)
log.info("my_onLoad_authStatus", _this.data.authStatus)
......
<view class="page">
<view class="page">
......@@ -25,23 +25,16 @@
<view class="weui-cells">
<navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/my/rank/rank">
<view class="weui-cell__hd">
<image src="/icon/rank1.png" />
<image src="/icon/discover/points.png" />
</view>
<view class="weui-cell__bd">我的排名</view>
<view class="weui-cell__bd">我的积分</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
<!-- <navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/my/record/record">
<view class="weui-cell__hd">
<image src="/icon/match.png"/>
</view>
<view class="weui-cell__bd">我的挑战</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator> -->
<navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/my/myposts/myposts">
<view class="weui-cell__hd">
<image src="/icon/comment.png"/>
<image src="/icon/my/fav.png"/>
</view>
<view class="weui-cell__bd">我的评论</view>
<view class="weui-cell__bd">我的收藏</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
</view>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论