Commit beb26ab1 by jscat

nyx dev: 功能新增

1. 添加园区和夜市功能
parent 07340e58
{
{
{
"pages": [
"pages/activity/activity",
"pages/community/community",
"pages/fair/fair",
"pages/mall/order/order",
"pages/activity/activity-list/activity-list",
"pages/my/my-members/my-members",
......@@ -40,12 +42,24 @@
"selectedIconPath": "./icon/my/activity.png"
},
{
"pagePath": "pages/fair/fair",
"text": "夜市",
"iconPath": "./icon/fair/fair.png",
"selectedIconPath": "./icon/fair/fair.png"
},
{
"pagePath": "pages/member/activity-post/activity-post",
"text": "添加",
"iconPath": "./icon/add.png",
"selectedIconPath": "./icon/add.png"
},
{
"pagePath": "pages/community/community",
"text": "园区",
"iconPath": "./icon/community/community.png",
"selectedIconPath": "./icon/community/community.png"
},
{
"pagePath": "pages/my/my",
"text": "个人",
"iconPath": "./icon/my.png",
......
//config.js API全局域名配置
//config.js API全局域名配置
......@@ -3,7 +3,7 @@
// env = 0; //本地java测试,需要启动java后台
// env = 1; //阿里云服务器测试版本
// env = 2; //阿里云服务器生产版本
var env = 2;
var env = 1;
var debug = 0; //是否打印调试信息
var host_key = "https://fun.hisuhong.com";
......
// pages/member/activity-post/activity-edit/activity-edit.js
// pages/member/activity-post/activity-edit/activity-edit.js
......@@ -25,6 +25,7 @@ Page({
// 城市模块
city: "",
strAddress: "",
// 分页加载部分
stride: 0,
......@@ -75,9 +76,14 @@ Page({
}
var city = app.globalData.defaultCity
var strAddress = city
if (options.city != "" && options.city != undefined )
{
city = options.city;
strAddress = options.city;
}
else if(options.strAddress != "" && options.strAddress != undefined)
{
strAddress = options.strAddress
}
wx.setNavigationBarTitle({
......@@ -96,9 +102,10 @@ Page({
curDate: curDate,
endDate: endDate,
city: city,
strAddress: strAddress,
});
_this.getActivitiesByPeriod(0, 1, stride, city, curDate, endDate);
_this.getActivitiesByPeriod(0, 1, stride, strAddress, curDate, endDate);
}
......@@ -149,7 +156,7 @@ Page({
console.log('页面上拉触底')
var _this = this;
// var curIndex = _this.__data__.curIndex
// var strSearch = _this.__data__.category[curIndex].name
// var strAddress = _this.__data__.category[curIndex].name
var isHideLoadMore = _this.__data__.isHideLoadMore;
var pageIndex = _this.__data__.pageIndex;
var stride = _this.__data__.stride;
......@@ -161,7 +168,7 @@ Page({
console.log('加载更多')
setTimeout(() => {
_this.getActivities(1, pageIndex, 4, strSearch);
_this.getActivities(1, pageIndex, 4, strAddress);
_this.getActivitiesByPeriod(1, pageIndex, stride, city, curDate, endDate);
}, 1000)
var bisHideLoadMoreType = true;
......
<!-- /page/post/edit/edit 添加分类的特点,以及自定义特点 -->
<!-- /page/post/edit/edit 添加分类的特点,以及自定义特点 -->
......@@ -4,13 +4,15 @@
<view class="page" style="height:100%;width:100%">
<view class="weui-search-bar">
<!-- <text>{{city}}</text>
<image src='../../../icon/down.png' style='width: 32rpx;height: 32rpx;' class='selecrtImg'></image> -->
<block wx:if="{{strSearch!=''}}">
<text>{{strSearch}}</text>
</block>
<block wx:else>
<navigator url="../../switchcity/switchcity?city={{city}}&type=list">
<text>{{city}}</text>
<image src='../../../icon/down.png' style='width: 32rpx;height: 32rpx;' class='selecrtImg'></image>
</navigator>
</block>
<view class="list-activity-number">
<label>
本周活动: {{num_activities-1}}场
......
{
{
"usingComponents": {}
}
\ No newline at end of file
<wxs module="tutil" src="./../../utils/date.wxs"></wxs>
<wxs module="tutil" src="./../../utils/date.wxs"></wxs>
<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">
<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="发现{{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">发现{{communities[curCommunity]}}·感兴趣的活动</view>
</label>
</view>
<view class="weui-search-bar__cancel-btn" hidden="{{!inputShowed}}" bindtap="hideInput">取消
</view>
</view>
<view class="workbench">
<view class="list">
<!-- jscat todo 0828 以用户为主, 扫一扫暂时也不实现 -->
<!-- <view class="items">
<view bindtap="getQRCode">
<image src="../../icon/activity/scan.png"></image>
</view>
<text>扫一扫</text>
</view> -->
<!-- todo 0820 以活动为主, 积分暂时也不实现 -->
<!-- <view class="items">
<navigator url="/pages/my/my-points/my-points">
<image src="../../icon/activity/points.png"></image>
</navigator>
<text>积分</text>
</view> -->
<!-- todo 0728 热销暂时也不实现 -->
<!-- jscat20200816 添加活动日历 for convinience -->
<block>
<view class="items">
<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>
<!-- todo 0828 我的活动暂时也不实现 -->
<view class="items">
<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>{{communities[curCommunity]}}介绍</text>
</view>
</view>
</view>
<!-- 导航栏 -->
<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>
</view>
<!-- 文章列表 -->
<!--
title
unit_price
date
like
member_name 进店 >
-->
<!-- Content: refer to 有品·优惠券 + 点评(可使用) -->
<view class="coupon-list" wx:for="{{activities}}" wx:for-item="item" wx:key="{{index}}">
<view class="item stamp stamp01" style="192rpx;">
<!-- 商品信息 -->
<view class="note-row">
<navigator url='{{item.url}}&num_like={{item.num_like}}' >
<image class="writer-image" src="{{item.note_image[0]}}"/>
</navigator>
<view class="note-column">
<navigator url='{{item.url}}&num_like={{item.num_like}}' >
<!-- 商家信息 -->
{{item.title}}
<!-- 商品价格 -->
<span>
<view class="price-row">
<view class="sub-price">¥{{item.unit_price}}</view>
</view>
</span>
<!-- 活动日期 -->
<span class="desc">
{{tutil.formatDate_mdw_interval(item.start_datetime, item.end_datetime)}}
</span>
</navigator>
<!-- 活动点赞 -->
<!-- <span>{{tutil.formatNumberLike(item.num_like)}}</span> -->
<!-- 商家名称 -->
<view class="note-row align">
<view class="desc-member-left">{{item.member_name}}</view>
<!-- todo 店铺功能尚未实现 -->
<!-- <view class="desc-member-right">进店 ></view> -->
</view>
</view>
</view>
</view>
</view>
<!-- 加载更多 -->
<view class="weui-loadmore" hidden="{{isHideLoadMore}}">
<view class="weui-loading"></view>
<view class="weui-loadmore__tips">正在加载</view>
</view>
<view class="weui-loadmore" hidden="{{!isHideLoadMore}}">
<view class="weui-loadmore__tips">没有更多啦 {{'>'}}_{{'<'}} </view>
</view>
</view>
// pages/user/user.js
// pages/user/user.js
Page({
/**
* 页面的初始数据
*/
data: {
strAddress: "",
strIntro: {},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
var strAddress = ""
if(options.strAddress != "" && options.strAddress != undefined)
{
strAddress = options.strAddress
}
var strIntro = {
"思南公馆": "思南公馆是中国上海市中心唯一一个以成片花园洋房的保留保护为宗旨的项目,坐拥51栋历史悠久的花园洋房,同时汇聚了独立式花园洋房、联立式花园洋房、带内院独立式花园洋房、联排式建筑、外廊式建筑、新式里弄、花园里弄、现代公寓等多种建筑样式 ,是上海近代居住类建筑的集中地。\n占地面积约5万平方米,总建筑面积近8万平方米,内设有精品酒店、酒店式公寓、企业公馆和商业区,与淮海路沿线的百年经典建筑、名人故居交相辉映,成为上海市中心集人文、历史和时尚底蕴于一身,最具特色的风景。",
"永平里":"永平里 (上海衡复历史文化风貌区之一)\n永平里,北临衡山路、南接永嘉路。内部建筑错落于其中,相互由道路和庭院形成整体贯通,成为连接衡山路和永嘉路的特别区域兼具历史风貌和现代欧式风格的步行街道。"
}
_this.setData({ strAddress, strIntro })
wx.setNavigationBarTitle({
title: '园区介绍',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
<view class="page">
<view class="page">
<view class="userInfo">
<view class="userDesc">
<span>{{strIntro[strAddress]}}</span>
</view>
</view>
</view>
.page{
.page{
height: 100vh;
background: #f5f8fa;
}
.userinfo{
width: 100%;
height: 450rpx;
background: rgb(185, 172, 155);
}
.head-img{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
padding-top: 30px;
}
.thumb{
width: 120rpx;
height: 120rpx;
border: 1px solid #ffffff;
border-radius: 50%;
overflow: hidden;
}
.name{
margin: 30rpx;
color: #ffffff;
}
.userMessage{
display: flex;
justify-content: center; /*子元素水平居中*/
align-items: center; /*子元素垂直居中*/
}
.messageBox{
width: 650rpx;
height: 150rpx;
}
.focus, .fans, .praise-collect{
width: 200rpx;
color: #ffffff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
float: left;
}
.border{
color: #ffffff;
width: 20rpx;
height: 150rpx;
float: left;
}
.grade{
height: 70rpx;
color: #6d6d6d;
background: #ffffff;
display: flex;
justify-content: center; /*子元素水平居中*/
align-items: center; /*子元素垂直居中*/
}
.grade-icon{
width: 50rpx;
height: 50rpx;
margin-right: 10rpx;
}
.userDesc{
height: 120rpx;
color: #6d6d6d;
background: #ffffff;
}
.userDesc span{
margin-left: 30rpx;
}
{
{
"usingComponents": {}
}
\ No newline at end of file
<wxs module="tutil" src="./../../utils/date.wxs"></wxs>
<wxs module="tutil" src="./../../utils/date.wxs"></wxs>
<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">
<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>
<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" />
<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>
</label>
</view>
<view class="weui-search-bar__cancel-btn" hidden="{{!inputShowed}}" bindtap="hideInput">取消
</view>
</view>
<view class="workbench">
<view class="list">
<!-- jscat todo 0828 以用户为主, 扫一扫暂时也不实现 -->
<!-- <view class="items">
<view bindtap="getQRCode">
<image src="../../icon/activity/scan.png"></image>
</view>
<text>扫一扫</text>
</view> -->
<!-- todo 0820 以活动为主, 积分暂时也不实现 -->
<!-- <view class="items">
<navigator url="/pages/my/my-points/my-points">
<image src="../../icon/activity/points.png"></image>
</navigator>
<text>积分</text>
</view> -->
<!-- todo 0728 热销暂时也不实现 -->
<!-- jscat20200816 添加活动日历 for convinience -->
<block>
<view class="items">
<navigator url="/pages/activity/activity-list/activity-list?city={{city}}">
<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">
<image src="../../icon/activity/order.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image>
</navigator>
<text>我的预订</text>
</view>
</view>
</view>
<!-- 导航栏 -->
<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>
</view>
<!-- 文章列表 -->
<!--
title
unit_price
date
like
member_name 进店 >
-->
<!-- Content: refer to 有品·优惠券 + 点评(可使用) -->
<view class="coupon-list" wx:for="{{activities}}" wx:for-item="item" wx:key="{{index}}">
<view class="item stamp stamp01" style="192rpx;">
<!-- 商品信息 -->
<view class="note-row">
<navigator url='{{item.url}}&num_like={{item.num_like}}' >
<image class="writer-image" src="{{item.note_image[0]}}"/>
</navigator>
<view class="note-column">
<navigator url='{{item.url}}&num_like={{item.num_like}}' >
<!-- 商家信息 -->
{{item.title}}
<!-- 商品价格 -->
<span>
<view class="price-row">
<view class="sub-price">¥{{item.unit_price}}</view>
</view>
</span>
<!-- 活动日期 -->
<span class="desc">
{{tutil.formatDate_mdw_interval(item.start_datetime, item.end_datetime)}}
</span>
</navigator>
<!-- 活动点赞 -->
<!-- <span>{{tutil.formatNumberLike(item.num_like)}}</span> -->
<!-- 商家名称 -->
<view class="note-row align">
<view class="desc-member-left">{{item.member_name}}</view>
<!-- todo 店铺功能尚未实现 -->
<!-- <view class="desc-member-right">进店 ></view> -->
</view>
</view>
</view>
</view>
</view>
<!-- 加载更多 -->
<view class="weui-loadmore" hidden="{{isHideLoadMore}}">
<view class="weui-loading"></view>
<view class="weui-loadmore__tips">正在加载</view>
</view>
<view class="weui-loadmore" hidden="{{!isHideLoadMore}}">
<view class="weui-loadmore__tips">没有更多啦 {{'>'}}_{{'<'}} </view>
</view>
</view>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论