Commit 3b48ed94 by jscat

nyx weapp: 功能更新

1. 添加园区和园区活动query功能
parent a80d7bba
//app.js
//app.js
......@@ -77,6 +77,7 @@ App({
defaultCity: '上海',
defaultCounty: '静安区',
citySwitched: 0,
},
......
{
{
......@@ -43,7 +43,7 @@
},
{
"pagePath": "pages/fair/fair",
"text": "市",
"text": "市",
"iconPath": "./icon/fair/fair.png",
"selectedIconPath": "./icon/fair/fair.png"
},
......
//config.js API全局域名配置
//config.js API全局域名配置
......@@ -51,6 +51,7 @@ var config={
notes_query_url: host_key + "/api/nyx/post/query",
activity_query_url: host_key + "/api/nyx/activity/query",
activity_period_query_url: host_key + "/api/nyx/activity/query/period",
activity_stat_query_url: host_key + "/api/nyx/activity/stat/query",
order_detail_query_url: host_key + "/api/nyx/order/detail/query",
order_add_url: host_key + "/api/nyx/add/order",
match_query_url: host_key + "/api/nyx/match/query",
......
// pages/activity/activity.js
// pages/activity/activity.js
......@@ -51,24 +51,34 @@ Page({
//搜索模块
inputShowed: false, //初始文本框不显示内容
strSearch : "", //搜索的字串
strSearch : "", //搜索的title字串
strAddress : "思南公馆", //搜索的address字串
inputVal : "", //输入字符串,主要用于页面显示
//二维码信息
qRCodeMsg: "",
//园区
communities: [
'思南公馆',
'永平里',
],
curCommunity: 0,
},
switchCategory(e) {
var _this = this;
var curIndex = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
var strCity = _this.__data__.city
var curCommunity = _this.__data__.curCommunity
var strAddress = _this.__data__.communities[curCommunity]
var strCategory = _this.__data__.category[curIndex].order
var strSearch = _this.__data__.strSearch
this.setData({
curIndex: curIndex,
})
_this.getActivities(0, 1, 4, strCity, strCategory, strSearch);
_this.getActivities(0, 1, 4, strAddress, strCategory, strSearch);
},
// 搜索点击事件
entrySearch(e) {
......@@ -180,13 +190,13 @@ Page({
}
)
// step5 初始载入四个推荐的活动 - local page
if(_this.__data__.activities.length == 0)
{
var switchId = app.globalData.switchId
var curIndex = switchId != ""? switchId : _this.__data__.curIndex
var strCity = _this.__data__.city
var curCommunity = _this.__data__.curCommunity
var strAddress = _this.__data__.communities[curCommunity]
var strCategory = _this.__data__.category[curIndex].order
var strSearch = _this.__data__.strSearch
this.setData({
......@@ -194,7 +204,7 @@ Page({
});
app.globalData.switchId = ""
_this.getActivities(0, 1, 4, strCity, strCategory, strSearch);
_this.getActivities(0, 1, 4, strAddress, strCategory, strSearch);
}
......@@ -288,7 +298,8 @@ Page({
console.log('页面上拉触底')
var _this = this;
var curIndex = _this.__data__.curIndex
var strCity = _this.__data__.city
var curCommunity = _this.__data__.curCommunity
var strAddress = _this.__data__.communities[curCommunity]
var strCategory = _this.__data__.category[curIndex].order
var strSearch = _this.__data__.strSearch
var isHideLoadMore = _this.__data__.isHideLoadMore;
......@@ -301,7 +312,7 @@ Page({
console.log('加载更多')
setTimeout(() => {
_this.getActivities(1, pageIndex, 4, strCity, strCategory, strSearch);
_this.getActivities(1, pageIndex, 4, strAddress, strCategory, strSearch);
}, 1000)
}
else {
......@@ -328,12 +339,12 @@ Page({
2. tab, tag=strSearch
3. 新增的search tab, '搜索'tab的时候,需要转换为搜索的关键词(_this.__data__.strSearch)
*/
getActivities: function (scrollType, pageNum, pageCount, strCity, strCategory, strSearch) {
getActivities: function (scrollType, pageNum, pageCount, strAddress, strCategory, strSearch) {
var _this = this;
// 如果是"推荐"和"搜索",需要单独处理
// '搜索'tab的时候, 需要转换为搜索的关键词(_this.__data__.strSearch)
var query_url = '&title=' + strSearch + '&orderType=' + strCategory + '&city=' + strCity
var query_url = '&title=' + strSearch + '&orderType=' + strCategory + '&city=' + strAddress
var strUrl = config.activity_query_url + "?pageCount=" + pageCount
+ "&pageNum=" + pageNum + query_url
......@@ -436,7 +447,8 @@ Page({
hideInput: function () {
var _this = this;
var curIndex = _this.__data__.curIndex
var strCity = _this.__data__.city
var curCommunity = _this.__data__.curCommunity
var strAddress = _this.__data__.communities[curCommunity]
var strCategory = _this.__data__.category[curIndex].order
var strSearch = ""
......@@ -445,7 +457,7 @@ Page({
inputShowed: false,
});
_this.getActivities(0, 1, 4, strCity, strCategory, strSearch);
_this.getActivities(0, 1, 4, strAddress, strCategory, strSearch);
},
// * 删除输入字符串
......@@ -460,10 +472,11 @@ Page({
var _this = this;
var strSearch = e.detail.value
var curIndex = _this.__data__.curIndex
var strCity = _this.__data__.city
var curCommunity = _this.__data__.curCommunity
var strAddress = _this.__data__.communities[curCommunity]
var strCategory = _this.__data__.category[curIndex].order
console.log("===input search text_" + strSearch)
_this.getActivities(0, 1, 4, strCity, strCategory, strSearch);
_this.getActivities(0, 1, 4, strAddress, strCategory, strSearch);
_this.setData({
strSearch: strSearch,
......@@ -593,14 +606,37 @@ Page({
onUpdateData: function(){
var _this = this;
var strCity = app.globalData.defaultCity
var curIndex = _this.__data__.curIndex
var curCommunity = _this.__data__.curCommunity
var strAddress = _this.__data__.communities[curCommunity]
var strCategory = _this.__data__.category[curIndex].order
var strSearch = _this.__data__.strSearch
_this.getActivities(0, 1, 4, strCity, strCategory, strSearch);
_this.getActivities(0, 1, 4, strAddress, strCategory, strSearch);
},
/*
* 更换某一个memberInfo的地址信息
*/
onCommunityPicker: function (e) {
var _this = this;
var curCommunity = e.detail.value
var switchId = app.globalData.switchId
var curIndex = switchId != ""? switchId : _this.__data__.curIndex
var strAddress = _this.__data__.communities[curCommunity]
var strCategory = _this.__data__.category[curIndex].order
var strSearch = ""
this.setData({
curIndex, curCommunity, strSearch
});
app.globalData.switchId = ""
_this.getActivities(0, 1, 4, strAddress, strCategory, strSearch);
},
})
//通过Promise方式为wx.request添加同步操作
......
<wxs module="tutil" src="./../../utils/date.wxs"></wxs>
<wxs module="tutil" src="./../../utils/date.wxs"></wxs>
......@@ -7,21 +7,21 @@
<!-- refer https://www.jb51.net/article/158292.htm -->
<!-- refer https://github.com/cinoliu/-selectCity -->
<view class="weui-search-bar">
<navigator url="../switchcity/switchcity?city={{city}}&type=index">
<text>{{city}}</text>
<image src='../../icon/down.png' style='width: 32rpx;height: 32rpx;' class='selecrtImg'></image>
</navigator>
<picker mode="selector" range="{{communities}}" value="{{curCommunity}}" bindchange="onCommunityPicker" class='address_member'>
<text>{{communities[curCommunity]}}</text>
<image src='../../icon/down.png' style='width: 40rpx;height: 40rpx;' class='selecrtImg'></image>
</picker>
<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="发现{{communities[curCommunity]}}" 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">发现{{communities[curCommunity]}}·感兴趣的活动</view>
</label>
</view>
<view class="weui-search-bar__cancel-btn" hidden="{{!inputShowed}}" bindtap="hideInput">取消
......@@ -48,26 +48,19 @@
<!-- jscat20200816 添加活动日历 for convinience -->
<block>
<view class="items">
<navigator url="/pages/activity/activity-list/activity-list?city={{city}}">
<navigator url="/pages/activity/activity-list/activity-list?strAddress={{communities[curCommunity]}}">
<image src="../../icon/member/schedule.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image>
<text style="font-size:28rpx;">本周活动</text>
</navigator>
</view>
</block>
<view class="items">
<navigator url="/pages/my/my-collects/my-collects">
<image src="../../icon/my/fav.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image>
<text style="font-size:28rpx;">我的收藏</text>
</navigator>
</view>
<!-- todo 0828 我的活动暂时也不实现 -->
<view class="items">
<navigator url="/pages/my/my-orders/my-orders">
<navigator url="/pages/community/introduction/introduction?strAddress={{communities[curCommunity]}}">
<image src="../../icon/activity/order.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image>
</navigator>
<text>我的预订</text>
<text>{{communities[curCommunity]}}介绍</text>
</view>
</view>
......@@ -102,7 +95,7 @@
<view class="note-column">
<navigator url='{{item.url}}&num_like={{item.num_like}}' >
<!-- 商家信息 -->
{{item.title}}
<text>{{item.title}}</text>
<!-- 商品价格 -->
<span>
<view class="price-row">
......
/*
/*
......@@ -335,6 +335,16 @@
width: 55%;
}
.note-column text{
/* 多行溢出省略 */
display: -webkit-box;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp:2;
overflow: hidden;
text-overflow:ellipsis;
}
.writer-image{
width: 240rpx;
height: 240rpx;
......
import { LETTERS, HOT_CITY_LIST } from '../../locale/citydata'
import { LETTERS, HOT_CITY_LIST } from '../../locale/citydata'
......@@ -100,6 +100,7 @@ Page({
//直接更新app.globalData
appInstance.globalData.defaultCity = city
appInstance.globalData.defaultCounty = ''
appInstance.globalData.citySwitched = 1
// 同步更新storage记录
// start 记录最近访问
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论