Commit 07340e58 by jscat

nyx dev: 功能更新

1. 新增园区和夜市功能
parent 3bb66646
{
{
"pages": [
"pages/activity/activity",
"pages/mall/order/order",
"pages/activity/activity-list/activity-list",
"pages/my/my-members/my-members",
"pages/member/activity-post/activity-edit/activity-edit",
"pages/member/activity-post/activity-submit/activity-submit",
"pages/member/quiz-post/quiz-edit/quiz-edit",
"pages/member/schedule/schedule",
"pages/member/activity-post/activity-post",
"pages/activity/quiz-result/quiz-result",
"pages/activity/quiz-info/quiz-info",
"pages/activity/activity-info/activity-info",
"pages/switchcity/switchcity",
"pages/my/my",
"pages/key/matchTest/matchTest",
"pages/my/my-points/my-points",
"pages/my/my-orders/my-orders",
"pages/my/my-collects/my-collects",
"pages/my/user/user",
"pages/logs/logs"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#000",
"navigationBarTitleText": "我",
"navigationBarTextStyle": "white"
},
"tabBar": {
"borderStyle": "white",
"color": "#a0a0a0",
"selectedColor": "#333333",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/activity/activity",
"text": "活动",
"iconPath": "./icon/my/activity.png",
"selectedIconPath": "./icon/my/activity.png"
},
{
"pagePath": "pages/member/activity-post/activity-post",
"text": "添加",
"iconPath": "./icon/add.png",
"selectedIconPath": "./icon/add.png"
},
{
"pagePath": "pages/my/my",
"text": "个人",
"iconPath": "./icon/my.png",
"selectedIconPath": "./icon/my.png"
}
]
},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
@import 'style/weui.wxss';
@import 'style/weui.wxss';
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
{
{
"component": true
}
\ No newline at end of file
<view class="flex b tb ac" wx:if="{{calendar}}">
<view class="flex b tb ac" wx:if="{{calendar}}">
<view class="calendar b tb">
<!-- 头部操作栏 -->
<view wx:if="{{!calendarConfig.hideHeadOnWeekMode}}" class="handle {{calendarConfig.theme}}_handle-color fs28 b lr ac pc">
<view class="prev fs36" wx:if="{{calendarConfig.showHandlerOnWeekMode || !calendarConfig.weekMode}}">
<text class="prev-handle iconfont icon-doubleleft" bindtap="chooseDate" data-type="prev_year"></text>
<text class="prev-handle iconfont icon-left" bindtap="chooseDate" data-type="prev_month"></text>
</view>
<view class="flex date-in-handle b lr cc" bindtap="doubleClickToToday">{{calendar.curYear || "--"}} 年 {{calendar.curMonth || "--"}} 月</view>
<view class="next fs36" wx:if="{{calendarConfig.showHandlerOnWeekMode || !calendarConfig.weekMode}}">
<text class="next-handle iconfont icon-right" bindtap="chooseDate" data-type="next_month"></text>
<text class="next-handle iconfont icon-doubleright" bindtap="chooseDate" data-type="next_year"></text>
</view>
</view>
<!-- 星期栏 -->
<view class="weeks b lr ac {{calendarConfig.theme}}_week-color">
<view class="week fs28" wx:for="{{calendar.weeksCh}}" wx:key="index" data-idx="{{index}}">{{item}}</view>
</view>
<!-- 日历面板主体 -->
<view class="b lr wrap"
bindtouchstart="calendarTouchstart"
catchtouchmove="calendarTouchmove"
catchtouchend="calendarTouchend">
<!-- 上月日期格子 -->
<view
class="grid b ac pc {{calendarConfig.theme}}_prev-month-date"
wx:if="{{calendar.empytGrids}}"
wx:for="{{calendar.empytGrids}}"
wx:key="index"
data-idx="{{index}}">
<view class="date-wrap b cc-top">
<view class="date">
{{item.day}}
<view
wx:if="{{calendarConfig.showLunar && item.lunar}}"
class="date-desc date-desc-bottom">
{{item.lunar.Term || item.lunar.IDayCn}}
</view>
</view>
</view>
</view>
<!-- 本月日期格子 -->
<view
wx:for="{{calendar.days}}"
wx:key="index"
data-idx="{{index}}"
data-date="{{item}}"
bindtap="tapDayItem"
class="grid {{item.class ? item.class : ''}} {{calendarConfig.theme}}_normal-date b ac pc">
<view
class="date-wrap b cc-top {{(item.week === 0 || item.week === 6) ? calendarConfig.theme + '_weekend-color' : ''}}">
<view class="date b ac pc {{item.class ? item.class : ''}} {{calendarConfig.chooseAreaMode ? 'date-area-mode' : ''}} {{calendar.todoLabelCircle && item.showTodoLabel && !item.choosed ? calendarConfig.theme + '_todo-circle todo-circle' : '' }} {{item.isToday ? calendarConfig.theme + '_today' : ''}} {{item.choosed ? calendarConfig.theme + '_choosed' : ''}} {{item.disable ? calendarConfig.theme + '_date-disable' : ''}}">
{{calendarConfig.markToday && item.isToday ? calendarConfig.markToday : item.day}}
<view
wx:if="{{(calendarConfig.showLunar && item.lunar && !item.showTodoLabel) || (item.showTodoLabel && calendar.todoLabelPos !== 'bottom')}}"
class="date-desc {{calendarConfig.theme}}_date-desc date-desc-bottom {{(item.choosed || item.isToday) ? 'date-desc-bottom-always' : ''}} {{item.disable ? calendarConfig.theme + '_date-desc-disable' : ''}}">
{{item.lunar.Term || item.lunar.IDayCn}}
</view>
<view
wx:if="{{item.showTodoLabel}}"
class="{{item.todoText ? 'date-desc' : ''}} {{calendarConfig.showLunar ? calendarConfig.theme + '_date-desc-lunar' : ''}} {{calendar.todoLabelPos === 'bottom' ? 'date-desc-bottom todo-dot-bottom' : 'date-desc-top todo-dot-top'}} {{calendar.showLabelAlways && item.choosed && calendar.todoLabelPos === 'bottom' ? 'date-desc-bottom-always todo-dot-bottom-always' : ''}} {{calendar.showLabelAlways && item.choosed && calendar.todoLabelPos === 'top' ? 'date-desc-top-always todo-dot-top-always' : ''}}"
style="background-color: {{item.todoText ? '' : item.color || calendar.todoLabelColor}}; color: {{item.color}}">
<text style="writing-mode: vertical-lr;text-align:left">{{item.todoText}}</text>
</view>
</view>
</view>
</view>
<!-- 下月日期格子 -->
<view
class="grid b ac pc {{calendarConfig.theme}}_next-month-date"
wx:for="{{calendar.lastEmptyGrids}}"
wx:key="index"
data-idx="{{index}}">
<view class="date-wrap b cc-top">
<view class="date">
{{item.day}}
<view
wx:if="{{calendarConfig.showLunar && item.lunar}}"
class="date-desc date-desc-bottom">
{{item.lunar.Term || item.lunar.IDayCn}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
@import './theme/iconfont.wxss';
@import './theme/iconfont.wxss';
@import './theme/theme-default.wxss';
@import './theme/theme-elegant.wxss';
.b {
display: flex;
}
.lr {
flex-direction: row;
}
.tb {
flex-direction: column;
}
.pc {
justify-content: center;
}
.ac {
align-items: center;
}
.cc {
align-items: center;
justify-content: center;
}
.cc-top {
justify-content: center;
}
.wrap {
flex-wrap: wrap;
}
.flex {
flex-grow: 1;
}
.bg {
background-image: linear-gradient(to bottom, #faefe7, #ffcbd7);
overflow: hidden;
}
.white-color {
color: #fff;
}
.fs24 {
font-size: 24rpx;
}
.fs28 {
font-size: 28rpx;
}
.fs32 {
font-size: 32rpx;
}
.fs36 {
font-size: 36rpx;
}
.calendar {
width: 100%;
box-sizing: border-box;
}
/* 日历操作栏 */
.handle {
height: 80rpx;
}
.prev-handle,
.next-handle {
padding: 20rpx;
}
.date-in-handle {
height: 80rpx;
}
/* 星期栏 */
.weeks {
height: 50rpx;
line-height: 50rpx;
opacity: 0.5;
}
.week {
text-align: center;
}
.grid,
.week {
width: 14.286014285714286%;
}
/* 高度调整=date+活动名 */
.date-wrap {
width: 100%;
height: 215rpx;
position: relative;
left: 0;
top: 0;
}
.date {
position: relative;
left: 0;
top: 0;
width: 55rpx;
height: 55rpx;
text-align: center;
line-height: 55rpx;
font-size: 50rpx;
font-weight: 200;
border-radius: 50%;
transition: all 0.3s;
animation-name: choosed;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: 1;
}
.date-area-mode {
width: 100%;
border-radius: 0;
}
/* date之间高度 */
.date-desc {
width: 280%;
height: 160rpx;
font-size: 26rpx;
line-height: 32rpx;
position: absolute;
left: 50%;
transform: translate(-50%, 91%);
overflow: hidden;
word-break: break-all;
text-overflow: ellipsis;
white-space: nowrap;
-webkit-line-clamp: 1;
text-align: center;
}
@keyframes choosed {
from {
transform: scale(1);
}
50% {
transform: scale(0.9);
}
to {
transform: scale(1);
}
}
/* 日期圆圈标记 */
.todo-circle {
border-width: 1rpx;
border-style: solid;
box-sizing: border-box;
}
/* 待办点标记相关样式 */
.todo-dot {
width: 10rpx;
height: 10rpx;
border-radius: 50%;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.todo-dot-top {
top: 3rpx;
}
.todo-dot.todo-dot-top-always {
top: -8rpx;
}
.todo-dot.todo-dot-bottom {
bottom: 0;
}
.todo-dot.todo-dot-bottom-always {
bottom: -10rpx;
}
/* 日期描述文字(待办文字/农历)相关样式 */
.date-desc.date-desc-top {
top: -6rpx;
}
.date-desc.date-desc-top-always {
top: -20rpx;
}
.date-desc.date-desc-bottom {
bottom: -14rpx;
}
.todo-circle .date-desc.date-desc-bottom {
bottom: -30rpx;
}
.date-desc.date-desc-bottom-always {
bottom: -28rpx;
}
@font-face {
@font-face {
font-family: 'iconfont';
src: url(data:font/truetype;charset=utf-8;base64,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) format('truetype');
font-weight: normal;
font-style: normal;
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
}
.icon-right::before {
content: "\e7eb";
}
.icon-left::before {
content: "\e7ec";
}
.icon-doubleleft::before {
content: "\e7ed";
}
.icon-doubleright::before {
content: "\e7ee";
}
/* 日历主要颜色相关样式 */
.default_color,
.default_weekend-color,
.default_handle-color,
.default_week-color {
color: #ff629a;
}
.default_today {
color: #fff;
background-color: #874fb4;
}
.default_choosed {
color: #fff;
background-color: #ff629a;
}
.default_date-disable {
color: #c7c7c7;
}
.default_prev-month-date,
.default_next-month-date {
color: #e2e2e2;
}
.default_normal-date {
color: #88d2ac;
}
.default_todo-circle {
border-color: #88d2ac;
}
.default_todo-dot {
background-color: #e54d42;
}
.default_date-desc {
color: #c2c2c2;
}
.default_date-desc-lunar {
color: #e54d42;
}
.default_date-desc-disable {
color: #e2e2e2;
}
.elegant_color,
.elegant_color,
.elegant_weekend-color,
.elegant_handle-color,
.elegant_week-color {
color: #333;
}
.elegant_today {
color: #000;
background-color: #e1e7f5;
}
.elegant_choosed {
color: #000;
background-color: #e2e2e2;
}
.elegant_date-disable {
color: #c7c7c7;
}
.elegant_prev-month-date,
.elegant_next-month-date {
color: #e2e2e2;
}
.elegant_normal-date {
color: #333;
}
.elegant_todo-circle {
border-color: #161035;
}
.elegant_todo-dot {
background-color: #161035;
}
.elegant_date-desc {
color: #c2c2c2;
}
.elegant_date-desc-lunar {
color: #161035;
}
.elegant_date-desc-disable {
color: #e2e2e2;
}
//config.js API全局域名配置
//config.js API全局域名配置
// env = 0; //本地java测试,需要启动java后台
// env = 1; //阿里云服务器测试版本
// env = 2; //阿里云服务器生产版本
var env = 2;
var debug = 0; //是否打印调试信息
var host_key = "https://fun.hisuhong.com";
var login_url = "https://fun.hisuhong.com";
var socket_url = ""
//https://fun.hisuhong.com/swagger-ui.html
if(env == 2)
{
host_key = "https://fun.hisuhong.com";
login_url = "https://fun.hisuhong.com";
socket_url = "wss://wssfun.hisuhong.com"
}
//https://wx.hisuhong.com/swagger-ui.html
else if(env == 1)
{
debug = 1
host_key = "https://wx.hisuhong.com";
login_url = "https://wx.hisuhong.com";
socket_url = "wss://wsswx.hisuhong.com"
}else if(env == 0)
{
debug = 1
host_key = "http://localhost:8086";
login_url = "https://wx.hisuhong.com";
socket_url = "ws://localhost:8086/websocket/chat"
}
var config={
env,
debug,
host_key,
rand_url : host_key + "/api/nyx/quiz/query/rand",
bug_url : host_key + "/api/nyx/quiz/defect/add",
data_url : host_key + "/api/nyx/quiz/query/item",
msg_query_url: host_key + "/api/nyx/msg/query",
msg_add_url: host_key + "/api/nyx/msg/add",
msg_like_url: host_key + "/api/nyx/msg/like",
user_login_url: login_url+"/api/nyx/user/wxLogin",
test_url : host_key + "/api/nyx/match/test",
match_add_item_url: host_key + "/api/nyx/match/add/item",
user_reg_url: host_key + "/api/nyx/user/reg",
member_reg_url: host_key + "/api/nyx/member/reg",
userinfo_query_url: host_key + "/api/nyx/userinfo/query",
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",
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",
match_query_by_id_url: host_key + "/api/nyx/match/query/id",
match_query_then_update_url: host_key + "/api/nyx/match/queryThenUpdate/id",
bonus_query_url: host_key + "/api/nyx/match/bonus/query/id",
collect_query_url: host_key + "/api/nyx/collect/query",
product_query_url: host_key + "/api/nyx/product/query",
user_member_query_url: host_key + "/api/nyx/user/member/query",
member_info_query_url: host_key + "/api/nyx/member/address/query",
member_edit_url: host_key + "/api/nyx/member/update",
member_add_address_url: host_key + "/api/nyx/member/add/address",
socket_url: socket_url,
oss_token_url: login_url + "/api/nyx/oss/getToken",
oss_callback_url: login_url + "/api/nyx/oss/callback",
oss_member_callback_url: login_url + "/api/nyx/oss/member/callback",
oss_activity_callback_url: login_url + "/api/nyx/oss/activity/callback",
post_like_url: host_key + "/api/nyx/post/like",
activity_like_url: host_key + "/api/nyx/activity/like",
activity_like_del_url: host_key + "/api/nyx/activity/like/del",
collect_like_url: host_key + "/api/nyx/collect/like",
collect_like_del_url: host_key + "/api/nyx/collect/like/del",
check_text_url: host_key + "/api/nyx/wx/check/text",
check_pic_url: host_key + "/api/nyx/wx/check/pic",
}
module.exports=config;
\ No newline at end of file
[
[
{"name": "Expression_1","text": "[微笑]"},
{"name": "Expression_2","text": "[撇嘴]"},
{"name": "Expression_3","text": "[色]"},
{"name": "Expression_4","text": "[发呆]"},
{"name": "Expression_5","text": "[得意]"},
{"name": "Expression_6","text": "[流泪]"},
{"name": "Expression_7","text": "[害羞]"},
{"name": "Expression_8","text": "[闭嘴]"},
{"name": "Expression_9","text": "[睡]"},
{"name": "Expression_10","text": "[大哭]"},
{"name": "Expression_11","text": "[尴尬]"},
{"name": "Expression_12","text": "[发怒]"},
{"name": "Expression_13","text": "[调皮]"},
{"name": "Expression_14","text": "[呲牙]"},
{"name": "Expression_15","text": "[惊讶]"},
{"name": "Expression_16","text": "[难过]"},
{"name": "Expression_17","text": "[酷]"},
{"name": "Expression_18","text": "[冷汗]"},
{"name": "Expression_19","text": "[抓狂]"},
{"name": "Expression_20","text": "[吐]"},
{"name": "Expression_21","text": "[偷笑]"},
{"name": "Expression_22","text": "[愉快]"},
{"name": "Expression_23","text": "[白眼]"},
{"name": "Expression_24","text": "[傲慢]"},
{"name": "Expression_25","text": "[饥饿]"},
{"name": "Expression_26","text": "[困]"},
{"name": "Expression_27","text": "[恐惧]"},
{"name": "Expression_28","text": "[流汗]"},
{"name": "Expression_29","text": "[憨笑]"},
{"name": "Expression_30","text": "[悠闲]"},
{"name": "Expression_31","text": "[奋斗]"},
{"name": "Expression_32","text": "[咒骂]"},
{"name": "Expression_33","text": "[疑问]"},
{"name": "Expression_34","text": "[嘘]"},
{"name": "Expression_35","text": "[晕]"},
{"name": "Expression_36","text": "[疯了]"},
{"name": "Expression_37","text": "[衰]"},
{"name": "Expression_38","text": "[骷髅]"},
{"name": "Expression_39","text": "[敲打]"},
{"name": "Expression_40","text": "[再见]"},
{"name": "Expression_41","text": "[擦汗]"},
{"name": "Expression_42","text": "[抠鼻]"},
{"name": "Expression_43","text": "[鼓掌]"},
{"name": "Expression_44","text": "[糗大了]"},
{"name": "Expression_45","text": "[坏笑]"},
{"name": "Expression_46","text": "[左哼哼]"},
{"name": "Expression_47","text": "[右哼哼]"},
{"name": "Expression_48","text": "[哈欠]"},
{"name": "Expression_49","text": "[鄙视]"},
{"name": "Expression_50","text": "[委屈]"},
{"name": "Expression_51","text": "[快哭了]"},
{"name": "Expression_52","text": "[阴险]"},
{"name": "Expression_53","text": "[亲亲]"},
{"name": "Expression_54","text": "[吓]"},
{"name": "Expression_55","text": "[可怜]"},
{"name": "Expression_56","text": "[菜刀]"},
{"name": "Expression_57","text": "[西瓜]"},
{"name": "Expression_58","text": "[啤酒]"},
{"name": "Expression_59","text": "[篮球]"},
{"name": "Expression_60","text": "[乒乓]"},
{"name": "Expression_61","text": "[咖啡]"},
{"name": "Expression_62","text": "[饭]"},
{"name": "Expression_63","text": "[猪头]"},
{"name": "Expression_64","text": "[玫瑰]"},
{"name": "Expression_65","text": "[凋谢]"},
{"name": "Expression_66","text": "[嘴唇]"},
{"name": "Expression_67","text": "[爱心]"},
{"name": "Expression_68","text": "[心碎]"},
{"name": "Expression_69","text": "[蛋糕]"},
{"name": "Expression_70","text": "[闪电]"},
{"name": "Expression_71","text": "[炸弹]"},
{"name": "Expression_72","text": "[刀]"},
{"name": "Expression_73","text": "[足球]"},
{"name": "Expression_74","text": "[瓢虫]"},
{"name": "Expression_75","text": "[便便]"},
{"name": "Expression_76","text": "[月亮]"},
{"name": "Expression_77","text": "[太阳]"},
{"name": "Expression_78","text": "[礼物]"},
{"name": "Expression_79","text": "[拥抱]"},
{"name": "Expression_80","text": "[强]"},
{"name": "Expression_81","text": "[弱]"},
{"name": "Expression_82","text": "[握手]"},
{"name": "Expression_83","text": "[胜利]"},
{"name": "Expression_84","text": "[抱拳]"},
{"name": "Expression_85","text": "[勾引]"},
{"name": "Expression_86","text": "[拳头]"},
{"name": "Expression_87","text": "[差劲]"},
{"name": "Expression_88","text": "[爱你]"},
{"name": "Expression_89","text": "[NO]"},
{"name": "Expression_90","text": "[OK]"},
{"name": "Expression_91","text": "[爱情]"},
{"name": "Expression_92","text": "[飞吻]"},
{"name": "Expression_93","text": "[跳跳]"},
{"name": "Expression_94","text": "[发抖]"},
{"name": "Expression_95","text": "[怄火]"},
{"name": "Expression_96","text": "[转圈]"},
{"name": "Expression_97","text": "[磕头]"},
{"name": "Expression_98","text": "[回头]"},
{"name": "Expression_99","text": "[跳绳]"},
{"name": "Expression_100","text": "[投降]"},
{"name": "Expression_101","text": "[激动]"},
{"name": "Expression_102","text": "[街舞]"},
{"name": "Expression_103","text": "[献吻]"},
{"name": "Expression_104","text": "[左太极]"},
{"name": "Expression_105","text": "[右太极]"}
]
\ No newline at end of file
export const commonMessage = {
export const commonMessage = {
'location.getting': '定位中',
'location.city.getting': '正在定位城市',
'location.county.getting': '正在获取区县',
'location.city.fail': '定位失败,请重试',
'location.county.fail': '请求区县失败,请重试',
}
Page({
Page({
/**
* 页面的初始数据
*/
data: {
historyRecord:[{
id: '0',
recordItem:' '
}],
hots:[{
id:'01',
text:'上海',
hotStatus:132
},{
id:'02',
text:'父亲节礼物',
hotStatus:103
},{
id:'03',
text:'cos',
hotStatus:43
},{
id:'04',
text:'vc水',
hotStatus:38
},{
id:'05',
text:'丸子头',
hotStatus:45
},{
id:'06',
text:'景甜',
hotStatus:92
},{
id:'07',
hotImg:'/images/hot.png',
text:'来小红书看世界杯',
hotStatus:156
},{
id:'08',
text:'APP',
hotStatus:85
}],
searchContext:'',
haveSerachLike: false,
searchLikeList: [],
searchLikeAllList: [{
text: '2018世界杯'
}, {
text: '世界杯赛程'
}, {
text: '世界杯狂欢色'
}, {
text: '为世界杯干杯'
}, {
text: '世界杯球迷上线'
}, {
text: '世界杯没有时差'
},{
text:'...'
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var hots = this.data.hots;
var hots2 = hots.sort((x, y) => y.hotStatus - x.hotStatus);
// reverse()方法会反转数组项的顺序
// hots.reverse();
console.log(hots2);
this.setData({
hots: hots2
})
wx.getStorage({
key: 'historyRecord',
success: (res) => {
// success
this.setData({
historyRecord: res.data
})
},
fail: function() {
// fail
},
complete: function() {
// complete
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
bindconfirm: function(e){
console.log(e);
var recordItem = e.detail.value;
this.saveHistory({
id: 0,
recordItem
})
wx.navigateTo({
url: '../searchbar/searchbar',
})
this.setData({
searchContext:''
})
},
changeSearch (e) {
let value = e.detail.value
if (value === '') {
this.setData({
haveSerachLike: false
})
return
}
let arr = this.data.searchLikeAllList.filter(item => item.text.indexOf(value) > -1)
console.log(arr)
this.setData({
haveSerachLike: true,
searchLikeList: arr,
})
},
backTo () {
wx.navigateBack({
delta: 1
})
},
deleteRecord: function(e){
console.log(e);
let filterArr = this.data.historyRecord.filter((item, index) => {
return index !== e.target.dataset.index
})
this.setData({
historyRecord: filterArr
})
wx.setStorage({
key: 'historyRecord',
data: filterArr
})
},
saveHistory (param) {
let arr = this.data.historyRecord
arr.unshift(param)
wx.setStorage({
key: 'historyRecord',
data: arr
})
this.setData({
historyRecord: arr
})
}
})
\ No newline at end of file
<view class="search">
<view class="search">
<view class="header">
<view class="header-top">
<view class="nav-search">
<icon class="weui-icon-search" type="search" size="14"></icon>
<input type="text" placeholder="來小红书看世界杯" class="text-search" bindinput="changeSearch" bindconfirm="bindconfirm" value="{{searchContext}}"/>
</view>
</view>
</view>
<view class="container">
<view class="content" wx:if="{{!haveSerachLike}}">
<view class="search-history">
<text class="history-record">历史记录</text>
<view class="search-history-item" wx:for="{{historyRecord}}" wx:key="{{index}}">
<text>{{item.recordItem}}</text>
</view>
</view>
<view class="hot-search">
<text class="search-hot">热门搜索</text>
<view class="search-item">
<view class="hot-search-item" wx:for="{{hots}}" wx:key="{{item.id}}">
<view class="hot-item">
<view class="text">
<image class="hot-img" src="{{item.hotImg}}" wx:if="{{item.hotImg}}"></image>
<text>{{item.text}}</text>
</view>
<view class="hot-status" >{{hotStatus}}</view>
</view>
</view>
</view>
</view>
</view>
<view wx:else class="search-like">
<view class="search-like-item" data-param="{{item.text}}" wx:for="{{searchLikeList}}" wx:key="{{index}}">
<icon class="weui-icon-search" type="search" size="14"></icon>
<text>{{item.text}}</text>
</view>
</view>
</view>
</view>
.header-top{
.header-top{
width: 100%;
height: 100rpx;
top: 0;
left: 0;
}
.nav-search{
margin: 20rpx 30rpx;
border-radius: 30px;
border:1px solid #f5f5f5;
background: #f5f5f5;
}
.weui-icon-search{
margin-left: 15rpx;
float: left;
}
.text-search{
padding-top: 10rpx;
}
.container{
width: 100%;
}
.content{
width: 90%;
height: 600rpx;
position: absolute;
top: 130rpx;
}
.search-history-item{
border-bottom: 1px solid #f5f5f5;
}
.search-history, .search-like{
width: 90%;
display: inline-block;
overflow: hidden;
}
.search-like{
position: absolute;
top: 100rpx;
}
.search-like-item{
border-bottom: 1px solid #f5f5f5;
}
.hot-search{
margin-top: 60rpx;
}
.hot-img{
width: 26rpx;
height: 26rpx;
padding-right: 20rpx;
}
.hot-search-icon{
width: 28rpx;
height: 28rpx;
}
.history-record{
font-weight: bold;
}
.search-item{
display: flex;
flex-wrap:wrap;
line-height: 80rpx;
}
.search-hot{
font-weight: bold;
}
.hot-status{
display: none;
}
.hot-search-item .text{
font-size: 30rpx;
height: 50rpx;
line-height: 50rpx;
color: #888;
background: #f5f5f5;
padding: 6rpx 14rpx;
border-radius: 46rpx;
margin: 16rpx 20rpx;
}
\ No newline at end of file
// pages/discover/note-writer/note-writer.js
// pages/discover/note-writer/note-writer.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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">
<span></span>
</view>
.page span{
.page span{
font-size: 45rpx;
}
\ 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">
<!-- 图片 -->
<scroll-view class="scroll-view_H" scroll-x scroll-with-animation style="width: 100%;height: 90%;" bindscroll="getSelectItem" scroll-left="{{scrollLeft}}">
<block wx:for="{{activityInfo.note_image}}" wx:key="unique" wx:for-index="id" wx:for-item="item">
<view class="scroll_item {{item.selected ? 'selected' : ''}}" data-index='{{item.index}}' bindtap='selectProItem'>
<image src="{{item}}" mode="widthFix"/>
</view>
</block>
</scroll-view>
<!-- 文字内容 -->
<view class="note">
<view class="note-price" style="font-weight: bold">
<view class="clone">
<view class="clone-left">¥{{products[curIndex].unitPrice}}</view>
<!-- start 点赞 like -->
<block>
<view class="clone-right" bindtap="onSubmitLike" data-id='{{activityInfo.activity_id}}'>
<view class="note-column" style="font-size: 24rpx;font-weight:normal;color: #000;align-items:center">
<image src="{{likeUrl}}"></image>
{{activityInfo.num_like}}
</view>
</view>
</block>
<!-- end 点赞 like -->
<!-- start 克隆 -->
<block wx:if="{{members.length > 0}}">
<view class="clone-right" bindtap="onClickClone" data-id='{{activityInfo.activity_id}}'>
<view class="note-column" style="font-size: 24rpx;font-weight:normal;color: #000;align-items:center;margin-left: 10rpx;">
<image src="../../../icon/activity/clone.png"></image>
克隆
</view>
</view>
</block>
<!-- end 克隆 -->
</view>
</view>
<view class="note-content" style="display: flex; flex-direction: column">
<span>主题: {{activityInfo.title}}</span>
<span>类别:
<view class="cate-list {{curIndex==index?'on':''}}" wx:for="{{products}}"
wx:for-item="sub_item" wx:key="{{index}}" data-index="{{index}}" bindtap="switchCategory">
{{sub_item.productDesc}}
</view>
</span>
<!-- 日期 -->
<span>日期: {{tutil.formatDate_ymdw_today_interval(activityInfo.start_datetime, activityInfo.end_datetime)}}</span>
<!-- 时间 -->
<span>时间: {{tutil.formatDate_hm_interval(activityInfo.start_datetime, activityInfo.end_datetime)}}</span>
<span>地点: {{activityInfo.address_name}}</span>
</view>
<view class="note-content">
<text>内容: {{activityInfo.content}}</text>
</view>
</view>
<!-- 企业信息 -->
<view class="note-row">
<view class="note-column-left align justify">
<image class="writer-image" src="{{activityInfo.member_logo}}"/>
</view>
<view class="note-column" style="margin-right: 4%">
<span class="name">{{activityInfo.member_name}}</span>
<span class="name">{{activityInfo.member_slogan}}</span>
</view>
</view>
<view class="bottom_placeholder"></view>
<!-- start bottom-->
<!-- refer to https://www.jb51.net/article/129438.htm -->
<view class="page__bd">
<view class="weui-tabbar">
<view class="weui-tabbar__item" bindtap="toHome">
<view style="position: relative;display:inline-block;">
<image src="../../../icon/index.png" class="weui-tabbar__icon"></image>
</view>
<view class="weui-tabbar__label">首页</view>
</view>
<view class="weui-tabbar__item">
<view style="position: relative;display:inline-block;">
<button class="share" open-type="share"></button>
<image src="../../../icon/activity/share.png" class="weui-tabbar__icon"></image>
</view>
<view class="weui-tabbar__label">分享</view>
</view>
<!-- todo toBuy 因为现在还没跟商家谈妥 -->
<!-- <view class="weui-tabbar__item">
<view style="position: relative;display:inline-block;">
<button class="button-red" bindtap="toBuy">立即购买</button>
</view>
</view> -->
<!-- toOrder 仅仅是先预定 -->
<view class="weui-tabbar__item">
<view style="position: relative;display:inline-block;">
<button class="button-red" bindtap="toOrder">立即预定</button>
</view>
</view>
</view>
</view>
<!-- end bottom-->
</view>
.scroll-view_H{
.scroll-view_H{
position: relative;
width: 100%;
text-align: center;
transform: scale(0.9);
white-space: nowrap;
}
.scroll_item {
position: relative;
width: 100%;
height: 90%;
margin: 0;
transform-origin: 50% 0;
left: 0%;
display: inline-block;
/* border-radius: 20rpx !important ; */
overflow: hidden;
/* transform: scale(0.9); */
vertical-align: middle;
/* top: 0%; */
/* height: 72%; */
background-color: #fff;
}
.scroll_item:first-child{
margin-left: 0%;
left: 0;
}
.scroll_item:last-child{
margin-right: 10%;
left: 0;
}
.scroll_item.selected{
/* transform: scale(0.9); */
border: solid 1px #ffcd54;
}
.scroll_item image {
width: 100%;
float: left;
margin-top: 0;
/* border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx; */
}
.note{
width: 100%;
/* position: fixed; */
background: #fff;
border-radius: 5rpx;
float: left;
margin-top: 20rpx;
margin-bottom: 20rpx;
}
.note-title{
font-size: 30rpx;
margin-left: 5%;
margin-right: 5%;
margin-top: 0;
text-align:justify;
}
.note-price{
font-size: 16px;
margin-left: 5%;
margin-right: 5%;
margin-top: 0;
text-align:justify;
color: #FF6600;
}
.note-content{
font-size: 32rpx;
/* 后期用于 '展开' 功能 */
/* overflow : hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical; */
margin-left: 5%;
margin-right: 4%;
/* margin-top: 20rpx; */
text-align:justify;
}
.note-row{
width: 100%;
display: flex;
flex-direction: row;
margin-bottom: 30rpx;
margin-top: 30rpx;
}
.note-column{
display: flex;
flex-direction: column;
margin-left: 30rpx;
}
.note-column-left{
width : 140rpx;
margin-left: 5%;
display: flex;
}
.writer-image{
width: 140rpx;
height: 140rpx;
}
/* start bottom style */
.column {
display: flex;
flex-direction: column;
}
.row {
display: flex;
flex-direction: row;
align-items: center;
}
.bottom_line {
width: 100%;
height: 2rpx;
background: lightgray;
}
.bottom_placeholder {
position: relative;
width: 100%;
height: 160rpx;
line-height: 10rpx;
}
.bottom_total {
position: fixed;
display: flex;
flex-direction: column;
bottom: 0;
width: 100%;
height: 160rpx;
line-height: 10rpx;
background: white;
}
.button-red {
background-color: #f44336; /* 红色 */
font-size: 14px;
}
.button-brown {
background-color: #D1A96E; /* 红色 */
}
button {
color: white;
text-align: center;
font-size:32rpx;
height: 2.6em;
line-height: 2.6em;
}
.placeholder{
margin-left: 20rpx;
margin-right: 20rpx;
text-align: center;
/* vertical-align: middle; */
padding: 0 10px;
line-height: 2.3em;
color: rgba(0,0,0);
}
/* justify-content: center;(水平居中) align-items: center;(垂直居中) */
.justify{
justify-content: center;
}
.align{
align-items: center;
}
.list .items{
display: flex;
flex-direction: column;
text-align: center;
align-items: center;
}
.items image{
width: 60rpx;
height: 60rpx;
margin-top: 20rpx;
font-size: 0;
}
.items text{
/* display: block; */
text-align: center;
margin-top: 0rpx;
margin-bottom: 20rpx;
padding: 0rpx;
font-size: 28rpx;
}
.list{
display: flex;
flex-direction: row;
justify-content: space-between;
margin-left: 30rpx;
margin-right: 30rpx;
margin-top: 20rpx;
}
/* end bottom style */
/* 分享按钮 */
.share {
position: absolute;
background-size: 50rpx 50rpx;
opacity: 0;
border:none;
}
/* 克隆图片 */
.clone{width: 100%; display: flex; margin-top: 0rpx; align-items: center;}
.clone-left{width: 80%; }
.cloner-right{width: 20%;}
.clone-right image{
width: 40rpx;
height: 40rpx;
font-size: 0;
}
.weui-tabbar{
position:fixed;
bottom:0;
left:0;
right:0;
}
.cate-list{
display: inline;
/* margin: 15rpx 22rpx; */
text-align: center;
font-size: 32rpx;
/* color: #9d9d9d; */
background: #F4F4F4;
margin-right: 20rpx;
padding-right: 10rpx;
padding-top: 10rpx;
padding-bottom: 10rpx;
}
.cate-list.on {
color: #FF6600;
font-weight: bold;
/*
border:1px solid #FF6600;
border-radius: 6rpx;
*/
}
\ No newline at end of file
// pages/member/activity-post/activity-edit/activity-edit.js
// pages/member/activity-post/activity-edit/activity-edit.js
var config = wx.getStorageSync("config");
var app = getApp();
var log = require('./../../../utils/log.js')
var util = require('./../../../utils/util.js')
Page({
data: {
/* 用户信息及商家信息 */
nyxCode : "",
authStatus : "",
userInfo : {},
members : [],
header_infoData: {
date: '日期',
info: [
{ member_name: "商家", title : "活动", unit_price: "价格" }
]
},
product_listData: [],
// 城市模块
city: "",
// 分页加载部分
stride: 0,
isHideLoadMore: false,
// 活动场次
num_activities: 0,
},
onLoad: function ( options ) {
var _this = this;
wx.getSystemInfo({
success: function (res) {
var a = res.windowHeight;
_this.setData({
scrollTop: a-200
})
}
})
var header_infoData = {
date: '日期',
info: [
{ member_name: "商家", title : "活动", unit_price: "价格" }
]
}
var product_listData = [
// {
// date: '日期',
// info: [
// { member_name: "商家", title : "活动", unit_price: "价格" }
// ]
// },
]
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members : wx.getStorageSync('members'),
})
}
var city = app.globalData.defaultCity
if (options.city != "" && options.city != undefined )
{
city = options.city;
}
wx.setNavigationBarTitle({
title: '活动列表',
})
//初始载入四个推荐的活动
if(_this.__data__.product_listData.length == 0)
{
var curDate = getCurDate()
var endDate = getWeekEndDate()
var header_infoData = _this.__data__.header_infoData
var stride = 20 // 每20条记录做为一个page
this.setData({
stride: stride,
curDate: curDate,
endDate: endDate,
city: city,
});
_this.getActivitiesByPeriod(0, 1, stride, city, curDate, endDate);
}
},
onReady: function (e) {
},
// 功能: 监听页面卸载 (如果是多个页面, 则需要多次销毁)
// 操作: 点击左上角'返回'时销毁当前页面
// 当通过左上角离开activity-list页面时,强制更新activity页面
onUnload:function(){
let pages = getCurrentPages().length - 1;
// console.log('需要销毁的页面:'+pages);
// console.log('onUnload page===', getCurrentPages())
// 当最后一个activity-list的数据被销毁之前,同步强制更新activity页面的数据
// ['/activity', '/activity-list']
if (getCurrentPages().length == 2) {
// 刷新第一个页面栈元素, 也就是首页的数据, 其实是activity.wxml页面的数据
getCurrentPages()[getCurrentPages().length - 2].onUpdateData()
}
// 将创建的activity-list页面依次进行销毁
wx.navigateBack({
delta: pages
})
},
// Date Flow
// 输入该组图片的标签
bindKeyInput(e) {
var _this = this;
_this.setData({
inputValue: e.detail.value
})
//全局赋值
app.globalData.postData.photoTag = e.detail.value
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
console.log('页面上拉触底')
var _this = this;
// var curIndex = _this.__data__.curIndex
// var strSearch = _this.__data__.category[curIndex].name
var isHideLoadMore = _this.__data__.isHideLoadMore;
var pageIndex = _this.__data__.pageIndex;
var stride = _this.__data__.stride;
//控制逻辑, 在onClick之后或者onGetComment事件之后再允许下拉更新操作
//判断是否已经全部加载完毕
//没有则加载更多
if (!isHideLoadMore) {
console.log('加载更多')
setTimeout(() => {
_this.getActivities(1, pageIndex, 4, strSearch);
_this.getActivitiesByPeriod(1, pageIndex, stride, city, curDate, endDate);
}, 1000)
var bisHideLoadMoreType = true;
_this.setData({
isHideLoadMore: bisHideLoadMoreType,
})
}
else {
console.log('没有更多')
}
},
/**
* 用户自定义函数
*
*/
// 获取Activities数据
// scrollType: 是否是翻页
/*
搜索逻辑:
1. 按照address_name和beginDate, endDate联合查询
*/
getActivitiesByPeriod : function (scrollType, pageNum, pageCount, city, beginDate, endDate) {
var _this = this;
var query_url = '&city=' + city + '&beginDate=' + beginDate + '&endDate=' + endDate
var strUrl = config.activity_period_query_url + "?pageCount=" + pageCount
+ "&pageNum=" + pageNum + query_url
config.debug == 1 ? console.log("===strUrl is: \"" + strUrl + "\"") : ""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.data.resultCode == 200) {
//表示HTTP请求成功
console.log(res.data);
var list = []
var bisHideLoadMoreType = false;
if (res.data.data.length < pageCount) {
bisHideLoadMoreType = true;
}
// 2020-08-24
var curDate = _this.__data__.curDate
var endDate = _this.__data__.endDate
var list = []
var result = {}
for (var i = 0; i < res.data.data.length; i++) {
var activity_id = res.data.data[i].activityId
var title = res.data.data[i].title
var member_name = res.data.data[i].memberName
var unit_price = res.data.data[i].unitPrice
var start_datetime = res.data.data[i].startDatetime
var end_datetime = res.data.data[i].endDatetime
_this.getYearAndMonthAndDay(start_datetime, end_datetime, curDate, endDate, activity_id, title, member_name, unit_price, result)
}
//进行setLabel
console.log("====",result);
var list = [];
//start 让result的key "2020-08-20" 进行排序
var keys = [];
for(var key in result){
keys.push(key);
}
keys = keys.sort();
//end 结束排序
for(var i=0; i<keys.length; i++){
var key = keys[i];
var dict = {}
dict['date'] = key
dict['info'] = result[key]
list.push(dict)
}
//进行翻页设置(加载更多)
if (scrollType == 1) {
var productList = _this.__data__.product_listData;
list = productList.concat(list)
}
else
{
list.unshift(_this.__data__.header_infoData)
}
var num_activities = 0
for(var i=0; i< list.length; i++)
{
num_activities += list[i]['info'].length
}
_this.setData({
product_listData: list,
pageIndex: pageNum + 1,
num_activities: num_activities,
isHideLoadMore: bisHideLoadMoreType,
})
}
}
})
},
// 获取Activities数据
getYearAndMonthAndDay: function(start, end, curDate, endDate, id, title, member_name, unit_price, result){
var i=0;
var startTime = new Date(start.split('-').join('/'));
var endTime = new Date(end.split('-').join('/'));
while((endTime.getTime()-startTime.getTime())>=0){
// console.log("===enter while")
var year = startTime.getFullYear();
var month = (startTime.getMonth()+1).toString().length==1?'0'+(startTime.getMonth()+1).toString():(startTime.getMonth()+1).toString();
var day = startTime.getDate().toString().length==1?'0'+startTime.getDate():startTime.getDate();
var strKey = year+"-"+month+"-"+day
//关键点
if(strKey >= curDate && strKey <=endDate && result.hasOwnProperty(strKey))
{
var dic = {}
dic['title'] = title
dic['activity_id'] = id
dic['member_name'] = member_name
dic['unit_price'] = unit_price
result[strKey].push(dic);
}
else if(strKey >= curDate && strKey <=endDate)
{
var dic = {}
dic['title'] = title
dic['activity_id'] = id
dic['member_name'] = member_name
dic['unit_price'] = unit_price
result[strKey] = [dic];
}
startTime.setDate(startTime.getDate()+1);
i+=1;
}
},
})
//格式化日期:yyyy-MM-dd
function formatDate(date) {
var myyear = date.getFullYear();
var mymonth = date.getMonth()+1;
var myweekday = date.getDate();
if(mymonth < 10){
mymonth = "0" + mymonth;
}
if(myweekday < 10){
myweekday = "0" + myweekday;
}
return (myyear+"-"+mymonth + "-" + myweekday);
}
//获得本周的结束日期
function getCurDate() {
var curDate = new Date();
return formatDate(curDate);
}
//获得本周的结束日期
function getWeekEndDate() {
var now = new Date(); //当前日期
var nowDayOfWeek = now.getDay(); //今天本周的第几天
var nowDay = now.getDate(); //当前日
var nowMonth = now.getMonth(); //当前月
var nowYear = now.getYear(); //当前年
nowYear += (nowYear < 2000) ? 1900 : 0; //
var weekEndDate = new Date(nowYear, nowMonth, nowDay + (7 - nowDayOfWeek));
return formatDate(weekEndDate);
}
<!-- /page/post/edit/edit 添加分类的特点,以及自定义特点 -->
<!-- /page/post/edit/edit 添加分类的特点,以及自定义特点 -->
<wxs module="tutil" src="./../../../utils/date.wxs"></wxs>
<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> -->
<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>
<view class="list-activity-number">
<label>
本周活动: {{num_activities-1}}场
</label>
</view>
</view>
<!-- 添加表格: 序号, 类别描述, 价格, 个数 -->
<view class='table'>
<block wx:for="{{product_listData}}" wx:for-item="item">
<block wx:for="{{item.info}}" wx:for-item="info" wx:key="{{index}}">
<view class='table_main'>
<!-- 日期 -->
<view class='td' style='width:120rpx;background-color:white;'>
<view class="cell_label">{{tutil.formatDate_md_week(index > 0 ? "" : item.date)}}</view>
</view>
<!-- member_name -->
<view class='td' style="width:250rpx">
<view class='table_Text_last_class'>
<text style="width:250rpx">{{info.member_name}}</text>
</view>
</view>
<view class='td' style="width:250rpx">
<view class='table_Text_last_class'>
<text style="width:250rpx">{{info.title}}</text>
</view>
</view>
<view class='td' style="width:20%;">
<view class='table_Text_last_class'>
{{tutil.formatNumberPrice(info.unit_price)}}
</view>
</view>
</view>
</block>
</block>
</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>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论