Commit beb26ab1 by jscat

nyx dev: 功能新增

1. 添加园区和夜市功能
parent 07340e58
{ {
{ {
"pages": [ "pages": [
"pages/activity/activity", "pages/activity/activity",
"pages/community/community",
"pages/fair/fair",
"pages/mall/order/order", "pages/mall/order/order",
"pages/activity/activity-list/activity-list", "pages/activity/activity-list/activity-list",
"pages/my/my-members/my-members", "pages/my/my-members/my-members",
...@@ -40,12 +42,24 @@ ...@@ -40,12 +42,24 @@
"selectedIconPath": "./icon/my/activity.png" "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", "pagePath": "pages/member/activity-post/activity-post",
"text": "添加", "text": "添加",
"iconPath": "./icon/add.png", "iconPath": "./icon/add.png",
"selectedIconPath": "./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", "pagePath": "pages/my/my",
"text": "个人", "text": "个人",
"iconPath": "./icon/my.png", "iconPath": "./icon/my.png",
......
//config.js API全局域名配置 //config.js API全局域名配置
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// env = 0; //本地java测试,需要启动java后台 // env = 0; //本地java测试,需要启动java后台
// env = 1; //阿里云服务器测试版本 // env = 1; //阿里云服务器测试版本
// env = 2; //阿里云服务器生产版本 // env = 2; //阿里云服务器生产版本
var env = 2; var env = 1;
var debug = 0; //是否打印调试信息 var debug = 0; //是否打印调试信息
var host_key = "https://fun.hisuhong.com"; 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({ ...@@ -25,6 +25,7 @@ Page({
// 城市模块 // 城市模块
city: "", city: "",
strAddress: "",
// 分页加载部分 // 分页加载部分
stride: 0, stride: 0,
...@@ -75,9 +76,14 @@ Page({ ...@@ -75,9 +76,14 @@ Page({
} }
var city = app.globalData.defaultCity var city = app.globalData.defaultCity
var strAddress = city
if (options.city != "" && options.city != undefined ) if (options.city != "" && options.city != undefined )
{ {
city = options.city; strAddress = options.city;
}
else if(options.strAddress != "" && options.strAddress != undefined)
{
strAddress = options.strAddress
} }
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
...@@ -96,9 +102,10 @@ Page({ ...@@ -96,9 +102,10 @@ Page({
curDate: curDate, curDate: curDate,
endDate: endDate, endDate: endDate,
city: city, 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({ ...@@ -149,7 +156,7 @@ Page({
console.log('页面上拉触底') console.log('页面上拉触底')
var _this = this; var _this = this;
// var curIndex = _this.__data__.curIndex // 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 isHideLoadMore = _this.__data__.isHideLoadMore;
var pageIndex = _this.__data__.pageIndex; var pageIndex = _this.__data__.pageIndex;
var stride = _this.__data__.stride; var stride = _this.__data__.stride;
...@@ -161,7 +168,7 @@ Page({ ...@@ -161,7 +168,7 @@ Page({
console.log('加载更多') console.log('加载更多')
setTimeout(() => { setTimeout(() => {
_this.getActivities(1, pageIndex, 4, strSearch); _this.getActivities(1, pageIndex, 4, strAddress);
_this.getActivitiesByPeriod(1, pageIndex, stride, city, curDate, endDate); _this.getActivitiesByPeriod(1, pageIndex, stride, city, curDate, endDate);
}, 1000) }, 1000)
var bisHideLoadMoreType = true; var bisHideLoadMoreType = true;
......
<!-- /page/post/edit/edit 添加分类的特点,以及自定义特点 --> <!-- /page/post/edit/edit 添加分类的特点,以及自定义特点 -->
...@@ -4,13 +4,15 @@ ...@@ -4,13 +4,15 @@
<view class="page" style="height:100%;width:100%"> <view class="page" style="height:100%;width:100%">
<view class="weui-search-bar"> <view class="weui-search-bar">
<!-- <text>{{city}}</text> <block wx:if="{{strSearch!=''}}">
<image src='../../../icon/down.png' style='width: 32rpx;height: 32rpx;' class='selecrtImg'></image> --> <text>{{strSearch}}</text>
</block>
<block wx:else>
<navigator url="../../switchcity/switchcity?city={{city}}&type=list"> <navigator url="../../switchcity/switchcity?city={{city}}&type=list">
<text>{{city}}</text> <text>{{city}}</text>
<image src='../../../icon/down.png' style='width: 32rpx;height: 32rpx;' class='selecrtImg'></image> <image src='../../../icon/down.png' style='width: 32rpx;height: 32rpx;' class='selecrtImg'></image>
</navigator> </navigator>
</block>
<view class="list-activity-number"> <view class="list-activity-number">
<label> <label>
本周活动: {{num_activities-1}}场 本周活动: {{num_activities-1}}场
......
// pages/activity/activity.js
// pages/activity/activity.js
const app = getApp()
var config = wx.getStorageSync("config");
var util = require('./../../utils/util.js')
var event = require('./../../utils/event.js')
//const { globalData: { defaultCity, defaultCounty } } = app
Page({
/**
* 页面的初始数据
*/
data: {
/* 用户信息及商家信息 */
nyxCode : "",
authStatus : "", // 授权状态: 00-未授权, 01-已授权
userInfo : {},
members : "", // 商家信息
member : {},
city: "",
county: "",
category: [ // 导航栏内容数据
{ name: '点赞', order : 'like' },
{ name: '价格', order : 'price' },
{ name: '最新', order : 'nearest' },
],
curIndex: 0, // 给选中的tab加粗
activities: [],
// {
// note_image: [ "https://1.jpg", "https://2.jpg"],
// title: "一天",
// like: 10,
// writer_name: "无敌花木兰",
// writer_image: "../../icon/icon_avatar3.png"
// },
//分页加载部分
isHideLoadMore: false,
pageIndex: 1, //分页搜索的page index
//页面格式
deviceRatio: 1,
navHeight: 0,
searchHeight: 0,
noteTop: 0,
noteHeight: 0,
//搜索模块
inputShowed: false, //初始文本框不显示内容
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 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, strAddress, strCategory, strSearch);
},
// 搜索点击事件
entrySearch(e) {
wx.navigateTo({
url: '../index/searchbar/searchbar',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
//入口页面,先确定nyxCode
/*step1 先确定用户信息 -- global page 需求 */
var nyxCode = wx.getStorageSync('nyxCode');
//step2 确定城市信息 -- local page 需求
var LatestCityList = wx.getStorageSync('LatestCityList') || []
if( LatestCityList.length > 0 )
{
var city = LatestCityList[0]["city"]
app.globalData.defaultCity = city
_this.setData({ city })
}
else
{
var city = app.globalData.defaultCity
_this.setData({ city })
}
//不存在
if (!nyxCode)
{
//注册新用户
console.log("===onLoad_regUser")
wx.clearStorageSync('nyxCode');
var nyxCode = "uid_" + util.wxuuid()
wx.setStorageSync('nyxCode', nyxCode);
app.globalData.nyxCode = nyxCode;
app.regUser(nyxCode); // nyxCode, userInfo, authStatus: storage, globalData
}
else //存在
{
//初始化数据
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members : wx.getStorageSync('members'),
})
//更新用户信息
var strUrl = config.userinfo_query_url + "?userid=" + nyxCode
wx.setStorageSync('nyxCode', nyxCode);
app.globalData.nyxCode = nyxCode;
config.debug == 1 ? console.log("===getLatestUserInfo strUrl_" + strUrl) : 1
getData(strUrl, "").then(res => {
console.log(res.data)
if(res.data.length==0) //数据库不存在该用户(误删除或者测试数据已删除)
{
//以该id注册新用户
console.log("===onLoad_Update User Info")
app.regUser(nyxCode);
}
else
{
var list = res.data[0]
app.globalData.nyxCode = nyxCode;
wx.setStorageSync('nyxCode', nyxCode);
app.globalData.userInfo = list
wx.setStorageSync('userInfo', list)
console.log("==onLoad_userInfo success")
}
})
}
// step3 确定member信息, 写入 data.members
let promise_member = new Promise(function (resolve, reject) {
app.getMembers(0, 1, 20, resolve, reject);
})
promise_member.then(
function (value){
var members = wx.getStorageSync('members')
var member = wx.getStorageSync('member')
_this.setData({ member, members})
console.log("===enter promise_member then_passed_" + value)
},
function (value){
console.log("===enter promise_member then_failed_" + value)
},
);
// step4 数据载入页面, 初始化 - global page
// 初始载入'我已收藏'的清单, 存入storage
wx.setStorageSync('likeDictStorage', {})
let promise_like = new Promise(function (resolve, reject) {
app.getCollectsStorage(0, 1, 100, resolve, reject);
})
promise_like.then(
function (value){
console.log("===enter promise_like then_passed_" + value)
},
function (value){
console.log("===enter promise_like then_failed_" + value)
}
)
// step5 初始载入四个推荐的活动 - local page
if(_this.__data__.activities.length == 0)
{
var switchId = app.globalData.switchId
var curIndex = switchId != ""? switchId : _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.setData({
curIndex: curIndex,
});
app.globalData.switchId = ""
_this.getActivities(0, 1, 4, strAddress, strCategory, strSearch);
}
// step6 event 订阅, 主要接受activity-info.js里 emit 发送的消息 local page
event.on('LikeChanged', this, function(data) {
var activity_id = data['activity_id']
var num_like = data['num_like']
var activities = _this.__data__.activities;
for(var i=0; i< activities.length; i++)
{
if(activity_id == activities[i]['activity_id'])
{
activities[i]['num_like'] = num_like
}
}
_this.setData({
activities: activities,
})
})
// step7 窗口初始化
var device = wx.getSystemInfoSync()
//self.device = app.globalData.myDevice
// jscat miniprogram default width is 750rpx
var deviceRatio = device.windowWidth / 750
var winWidth = device.windowWidth * deviceRatio
var noteHeight = device.windowHeight - (40 - 60)
_this.setData({
searchHeight: 40,
navHeight: 40,
noteTop : (40+40),
noteHeight: noteHeight,
deviceRatio: deviceRatio,
})
wx.setNavigationBarTitle({
title: '园区活动',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var _this = this;
const { globalData: { defaultCity, defaultCounty } } = app
this.setData({
city: defaultCity,
county: defaultCounty
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
event.remove('LikeChanged', this);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
console.log('页面上拉触底')
var _this = this;
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
var isHideLoadMore = _this.__data__.isHideLoadMore;
var pageIndex = _this.__data__.pageIndex;
//控制逻辑, 在onClick之后或者onGetComment事件之后再允许下拉更新操作
//判断是否已经全部加载完毕
//没有则加载更多
if (!isHideLoadMore) {
console.log('加载更多')
setTimeout(() => {
_this.getActivities(1, pageIndex, 4, strAddress, strCategory, strSearch);
}, 1000)
}
else {
console.log('没有更多')
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/**
* 用户自定义函数
*
*/
// 获取Activities数据
// scrollType: 是否是翻页
/*
搜索逻辑:
1. 搜索框, tag=strSearch + title=strSearch
2. tab, tag=strSearch
3. 新增的search tab, '搜索'tab的时候,需要转换为搜索的关键词(_this.__data__.strSearch)
*/
getActivities: function (scrollType, pageNum, pageCount, strAddress, strCategory, strSearch) {
var _this = this;
// 如果是"推荐"和"搜索",需要单独处理
// '搜索'tab的时候, 需要转换为搜索的关键词(_this.__data__.strSearch)
var query_url = '&title=' + strSearch + '&orderType=' + strCategory + '&city=' + strAddress
var strUrl = config.activity_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;
}
for (var i = 0; i < res.data.data.length; i++) {
var index_id = i + _this.__data__.activities.length
var result = {}
result["activity_id"] = res.data.data[i].activityId
result["member_name"] = res.data.data[i].memberName
result["member_slogan"] = res.data.data[i].memberSlogan
result["member_id"] = res.data.data[i].memberId
result["member_status"] = res.data.data[i].memberStatus
result["member_logo"] = res.data.data[i].memberLogo
result["tag"] = res.data.data[i].tag
result["title"] = res.data.data[i].title
result["num_like"] = res.data.data[i].numLike
result["content"] = res.data.data[i].content
result["quiz"] = res.data.data[i].quiz
result["point"] = res.data.data[i].point
result["address_name"] = res.data.data[i].addressName
result["product_desc"] = res.data.data[i].productDesc
result["unit_price"] = res.data.data[i].unitPrice.toFixed(2)
result["note_image"] = res.data.data[i].noteImage.split("::")
var start_datetime = res.data.data[i].startDatetime
var end_datetime = res.data.data[i].endDatetime
result["start_datetime"] = start_datetime
result["end_datetime"] = end_datetime
var url_quiz = "../activity/quiz-info/quiz-info?"
+"activity_id="+result["activity_id"]
+"&index_id="+index_id
+"&note_image="+res.data.data[i].noteImage //传递原始string数据, List不正确
+"&title="+result["title"]
+"&content="+result["content"]
+"&quiz="+result["quiz"]
+"&point="+result["point"]
+"&member_id="+result["member_id"]
+"&member_name="+result["member_name"]
+"&member_slogan="+result["member_slogan"]
+"&member_logo="+result["member_logo"]
var url_activity = "../activity/activity-info/activity-info?"
+"activity_id="+result["activity_id"]
+"&index_id="+index_id
+"&note_image="+res.data.data[i].noteImage //传递原始string数据, List不正确
+"&title="+result["title"]
+"&content="+result["content"]
+"&address_name="+result["address_name"]
+"&unit_price="+result["unit_price"]
+"&product_desc="+result["product_desc"]
+"&member_id="+result["member_id"]
+"&member_name="+result["member_name"]
+"&member_slogan="+result["member_slogan"]
+"&member_logo="+result["member_logo"]
+"&start_datetime="+result["start_datetime"]
+"&end_datetime="+result["end_datetime"]
result["url"] = result["tag"]=='竞答'? url_quiz : url_activity
list.push(result)
}
//进行翻页设置(加载更多)
if (scrollType == 1) {
var activitiesList = _this.__data__.activities;
list = activitiesList.concat(list)
}
_this.setData({
activities: list,
pageIndex: pageNum + 1,
isHideLoadMore: bisHideLoadMoreType,
})
}
}
})
},
/* 搜索模块 */
// 使文本框进入可编辑状态
showInput: function () {
this.setData({
inputShowed: true //设置文本框可以输入内容
});
},
// 取消搜索
hideInput: function () {
var _this = this;
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.setData({
strSearch: strSearch,
inputShowed: false,
});
_this.getActivities(0, 1, 4, strAddress, strCategory, strSearch);
},
// * 删除输入字符串
clearInput: function(){
this.setData({
inputVal: "",
});
},
// 开始搜索
startSearch: function (e) {
var _this = this;
var strSearch = e.detail.value
var curIndex = _this.__data__.curIndex
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, strAddress, strCategory, strSearch);
_this.setData({
strSearch: strSearch,
inputVal: strSearch,
})
},
/*
二维码信息:
1. 二维码生成: https://cli.im/
2. 二维码返回值:
charSet: "UTF-8"
errMsg: "scanCode:ok"
rawData: "b2hsa3cgaXMgYSBwaWc="
result: "ohlkw is a pig"
scanType: "QR_CODE"
二维码流程:
1. 生成流程:
1) user答完一个quiz,会生成一条记录tbl_match,
记录了如下参数:
- match_id: matchid_123
- member_id: memid_001
- user_id: uid_456
- 积分使用状态match_status(可用|不可用): 1|0
- 积分值match_point: 4.5
- 答题结果match_result: 9/10
- 答题时间create_datetime: 2020/07/30 12:00:00
- 更新时间update_datetime: 2020/07/30 12:00:00
- 积分时效状态(有效|无效)(暂不实现)
2. 扫码流程; javaapp只负责获取数据; weapp负责解析数据
1) 扫码获取记录id,发给服务器后台,
msg:
- "成功", 如果 存在 && 未使用,则置为 "已使用", match_id && match_status='01'
{
"resultCode": "200",
"totalCount": 1,
"resultMsg": "OK",
"data": [
{
"matchId": "mid_002",
"matchStatus": "01",
}
]
}
- "失败, 已使用二维码", 如果 存在 && 已使用, match_id && match_status='00'
{
"resultCode": "200",
"totalCount": 1,
"resultMsg": "OK",
"data": [
{
"matchId": "mid_001",
"matchStatus": "00",
}
]
}
- "失败, 无效二维码", 未查询到 !match_id
{
"resultCode": "200",
"totalCount": 0,
"resultMsg": "OK",
"data": []
}
*/
getQRCode: function(){
var _this = this;
wx.scanCode({ //扫描API
success: function(res){
console.log(res); //输出回调信息
_this.checkQRCode(res.result)
}
})
},
checkQRCode(qrcode_string){
var _this = this;
var strUrl = config.match_query_then_update_url + "?matchId="+qrcode_string
config.debug == 1?console.log("===checkQRCode strUrl "+strUrl):""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if ( res.data.resultCode == 200 ) {
//表示query成功
console.log("qrcode查询完成");
console.log(res)
//得到matchId
var matchList = res.data.data;
var title = ""
if(matchList.length == 0)
{
title = "失败, 无效"
}
else if( matchList[0].matchStatus == '00' )
{
title = "失败,已使用"
}
else if( matchList[0].matchStatus == '01' )
{
title = "扫码成功"
}
console.log("title="+title)
wx.showToast({
title: title,
duration: 3000
})
}
},
fail : function(res)
{
console.log("failed")
}
})
},
// 刷新页面数据
// used by switchcity.js
onUpdateData: function(){
var _this = this;
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, 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添加同步操作
const getData = (url, param) => {
return new Promise((resolve, reject) => {
wx.request({
url: url,
method: 'GET',
data: param,
success(res) {
resolve(res.data)
},
fail(err) {
reject(err)
}
})
})
}
{
{
"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>
/*
/*
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,固定,比如搜索框
display: inline 行内元素 不带空格 block 块级元素 带空格
margin: 上右下左 top right bottom :left
*/
.page{
/*height:100vh; 相对于视口(Layout Viewport)的高度; 视口被均分为100单位的vh */
background-color:#f5f8fa;
}
/* start of navbar navBar -> navBar-box -> cate-list -> cate-list.on */
.navBar{
height: 60rpx;
background: #fff;
border-top: 1px solid #fafafa;
}
.navBar-box{
width: 100%;
height: 60rpx;
}
.cate-list{
display: inline;
margin: 15rpx 22rpx;
text-align: center;
font-size: 32rpx;
color: #9d9d9d;
margin-left: 30rpx;
}
.navBar-box .cate-list.on {
color: #000000;
font-weight: bold;
}
/* end of navbar */
.placeholder{
margin: 0px;
text-align: center;
vertical-align: middle;
line-height: 2.3em;
color: rgba(0,0,0);
}
/* justify-content: center;(水平居中) align-items: center;(垂直居中) */
.justify{
justify-content: center;
}
.align{
align-items: center;
}
.border{
border: 3rpx solid #ccc;
border-radius: 0rpx;
padding: 10rpx;
}
.text{
font-size: 34rpx;
}
.selected{
color: #ff0000;
}
/* coupon css */
.coupon-list{width: 100%; margin: 0 auto}
.coupon-list .item{width: 100%; height: 300rpx;}
.coupon-list .item .float-li{width: 100%; height: 100%; border-right: 2rpx dashed rgba(255,255,255,.3)}
.coupon-list .item .float-li-right{width: 220rpx; padding-right: 20rpx; height:100%; color: #fff}
.coupon-left{position: relative}
.coupon-left .t{position: absolute; color: #fff}
.coupon-left .t1{width: 710rpx; display: flex; margin-left: 20rpx; margin-top: 20rpx; height: 160rpx; color: #fff}
.coupon-left .t1-left{width: 160rpx; font-size: 70rpx; font-weight: bold}
.coupon-left .t1-right{width: 520rpx; font-size: 50rpx; }
/* .coupon-left .t2{left: 20rpx; top:160rpx} */
.coupon-left .t2{width: 710rpx; display: flex; margin-left: 20rpx; margin-top: 0rpx; height: 50rpx; color: #fff}
.coupon-left .t2-left{width: 520rpx; }
.coupon-left .t2-right{width: 160rpx;}
.coupon-left .t3{width: 710rpx; display: flex; margin-left: 20rpx; margin-top: 0rpx; height: 50rpx; color: #fff}
.coupon-left .t3-left{width: 520rpx; }
.coupon-left .t3-right{width: 160rpx;}
.coupon-left .t3-right image{
width: 40rpx;
height: 40rpx;
font-size: 0;
}
.coupon-left .t4{width: 710rpx; display: flex; margin-left: 20rpx; margin-top: 0rpx; height: 50rpx; color: #fff}
.coupon-left .t4-left{width: 520rpx; }
.coupon-left .t4-right{width: 160rpx;}
.coupon-left .t4-right image{
width: 40rpx;
height: 40rpx;
font-size: 0;
}
.coupon-right .t{text-align: center}
.coupon-right .t1{font-size: 40rpx; padding: 30rpx 0 10rpx 0;}
.coupon-right .t3{padding-top:20rpx}
.coupon-right .t3 text{background: #fff; color: #333; border-radius: 7rpx; padding: 10rpx 40rpx}
.note{background: #faeab7}
.stamp{position:relative;overflow:hidden}
.stamp i{position: absolute;left: 20%;top: 90rpx;height: 500rpx;width: 700rpx;background-color: rgba(255,255,255,.15);transform: rotate(-30deg);
}
.stamp01{background:radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 30rpx, #F39B00 30rpx);background-size:10rpx 10rpx;background-position:9rpx 3rpx; background: #FFFFFF}
/* 失效样式 */
.stamp06{background:radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 30rpx, #e2e2e2 30rpx);background-size:10rpx 10rpx;background-position:9rpx 3rpx; background: #acacac
}
/* start - 小程序自定义弹框css */
/* 遮罩层 */
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.5;
}
/* 弹出层 */
.modalDlg{
width: 80%;
height: 540rpx;
position: fixed;
top: 240rpx;
left: 0;
right: 0;
z-index: 9999;
margin: 0 auto;
background-color: #fff;
border-radius:5px;
display: flex;
flex-direction: column;
align-items: center;
}
/* 弹出层里面的图片 */
/* 弹出层里面的文字 */
.title{
display: flex;
font-size: 38rpx;
color: #cccccc;
width: 80%;
height: 80rpx;
padding: 20rpx;
align-items: center;
justify-content: center;
}
.title-right{
display: flex;
height: 80rpx;
position: absolute;
align-items: center;
text-align: right;
font-size: 38rpx;
color: #cccccc;
padding: 20rpx;
right: 20rpx;
}
.title-right image{
width: 50rpx;
height: 50rpx;
font-size: 0;
}
/* 图片+文字 */
.weui-width{
width: 80%;
}
.placeholder-modal{
margin: 0px;
text-align: center;
vertical-align: middle;
line-height: 2.3em;
background-color: #fff;
}
/* 好友助力积分列表 */
.list-point{
width: 100%;
height: 2rpx;
background: #ccc;
font-size: 32rpx;
display: flex;
flex-direction: column;
/* align-items: center; */
left: 40rpx;
}
.list-point .text{
margin-left: 160rpx;
}
.title-right image{
width: 50rpx;
height: 50rpx;
font-size: 0;
}
/* barcode券码查看 */
.list-barcode{
width: 100%;
height: 2rpx;
background: #ccc;
font-size: 32rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.list-barcode .text{
align-items: center;
margin-left: 20rpx;
}
.list-barcode image{
overflow: visible;
width: 300rpx;
height: 300rpx;
}
/* 弹出层里面的按钮 */
.ok{
width: 100%;
height: 2rpx;
background: #ccc;
text-align: center;
font-size: 38rpx;
color: #666666;
}
/* end - 小程序自定义弹框css */
/* start 加载更多 */
.weui-loading {
margin: 0 5px;
width: 20px;
height: 20px;
display: inline-block;
vertical-align: middle;
-webkit-animation: weuiLoading 1s steps(12, end) infinite;
animation: weuiLoading 1s steps(12, end) infinite;
background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;
background-size: 100%;
}
.weui-loadmore {
width: 65%;
margin: 1.5em auto;
line-height: 1.6em;
font-size: 14px;
text-align: center;
}
.weui-loadmore__tips {
display: inline-block;
vertical-align: middle;
}
/* end 加载更多*/
.note-info{
width: 100%;
/* position: fixed; */
border-radius: 5rpx;
float: left;
margin-top: 20rpx;
margin-bottom: 20rpx;
}
.note-member{
display: flex;
font-size: 32rpx;
margin-left: 5%;
margin-right: 5%;
margin-top: 0;
text-align:justify;
vertical-align: center;
}
.note-member .member-left{width: 520rpx; flex:1}
.note-member .member-right{width: 160rpx;justify-content: flex-end;display: flex;}
.note-member .member-right image{
width: 60rpx;
height: 60rpx;
font-size: 0;
}
.note-price{
color: #FF6600;
font-size: 16px;
margin-left: 5%;
margin-right: 5%;
margin-top: 0;
text-align:justify;
}
.note-content{
font-size: 16px;
/* 后期用于 '展开' 功能 */
/* 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;
}
.note-column{
display: flex;
flex-direction: column;
margin-left: 30rpx;
margin-right: 30rpx;
width: 55%;
}
.writer-image{
width: 240rpx;
height: 240rpx;
margin-left: 30rpx;
margin-top: 10rpx;
}
.price-row{
display: flex;
flex-direction: row;
}
.sub-price{
color: #FF6600;
font-size: 34rpx;
margin-right: 5%;
margin-top: 0;
text-align:justify;
flex: 1;
font-weight: bold;
}
.sub-quantity{
display: flex;
font-size: 16px;
justify-content: flex-end;
}
/* refer to jd */
.desc {
font-size: 30rpx;
color: #a7a7a7;
}
.desc-member-left {
font-size: 30rpx;
color: #a7a7a7;
margin-right: 20rpx;
}
.desc-member-right {
font-size: 30rpx;
}
/* start of workbench*/
.workbench{
font-size: 32rpx;
background: #fff;
padding-bottom: 10rpx;
margin-bottom:10rpx;
padding-top: 5rpx;
margin-top:5rpx;
color: #333;
}
.workbench .title{
font-size: 32rpx;
padding: 20rpx 20rpx;
margin-bottom: 40rpx;
display: block;
}
.workbench .items{
width: 100rpx;
flex:1;
text-align: center;
}
.workbench .items image{
width: 60rpx;
height: 60rpx;
}
.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/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;
}
// pages/activity/activity.js
// pages/activity/activity.js
const app = getApp()
var config = wx.getStorageSync("config");
var util = require('./../../utils/util.js')
var event = require('./../../utils/event.js')
//const { globalData: { defaultCity, defaultCounty } } = app
Page({
/**
* 页面的初始数据
*/
data: {
/* 用户信息及商家信息 */
nyxCode : "",
authStatus : "", // 授权状态: 00-未授权, 01-已授权
userInfo : {},
members : "", // 商家信息
member : {},
city: "",
county: "",
category: [ // 导航栏内容数据
{ name: '点赞', order : 'like' },
{ name: '价格', order : 'price' },
{ name: '最新', order : 'nearest' },
],
curIndex: 0, // 给选中的tab加粗
activities: [],
// {
// note_image: [ "https://1.jpg", "https://2.jpg"],
// title: "一天",
// like: 10,
// writer_name: "无敌花木兰",
// writer_image: "../../icon/icon_avatar3.png"
// },
//分页加载部分
isHideLoadMore: false,
pageIndex: 1, //分页搜索的page index
//页面格式
deviceRatio: 1,
navHeight: 0,
searchHeight: 0,
noteTop: 0,
noteHeight: 0,
//搜索模块
inputShowed: false, //初始文本框不显示内容
strSearch : "", //搜索的字串
inputVal : "", //输入字符串,主要用于页面显示
//二维码信息
qRCodeMsg: "",
},
switchCategory(e) {
var _this = this;
var curIndex = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
var strCity = _this.__data__.city
var strCategory = _this.__data__.category[curIndex].order
var strSearch = _this.__data__.strSearch
this.setData({
curIndex: curIndex,
})
_this.getActivities(0, 1, 4, strCity, strCategory, strSearch);
},
// 搜索点击事件
entrySearch(e) {
wx.navigateTo({
url: '../index/searchbar/searchbar',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
//入口页面,先确定nyxCode
/*step1 先确定用户信息 -- global page 需求 */
var nyxCode = wx.getStorageSync('nyxCode');
//step2 确定城市信息 -- local page 需求
var LatestCityList = wx.getStorageSync('LatestCityList') || []
if( LatestCityList.length > 0 )
{
var city = LatestCityList[0]["city"]
app.globalData.defaultCity = city
_this.setData({ city })
}
else
{
var city = app.globalData.defaultCity
_this.setData({ city })
}
//不存在
if (!nyxCode)
{
//注册新用户
console.log("===onLoad_regUser")
wx.clearStorageSync('nyxCode');
var nyxCode = "uid_" + util.wxuuid()
wx.setStorageSync('nyxCode', nyxCode);
app.globalData.nyxCode = nyxCode;
app.regUser(nyxCode); // nyxCode, userInfo, authStatus: storage, globalData
}
else //存在
{
//初始化数据
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members : wx.getStorageSync('members'),
})
//更新用户信息
var strUrl = config.userinfo_query_url + "?userid=" + nyxCode
wx.setStorageSync('nyxCode', nyxCode);
app.globalData.nyxCode = nyxCode;
config.debug == 1 ? console.log("===getLatestUserInfo strUrl_" + strUrl) : 1
getData(strUrl, "").then(res => {
console.log(res.data)
if(res.data.length==0) //数据库不存在该用户(误删除或者测试数据已删除)
{
//以该id注册新用户
console.log("===onLoad_Update User Info")
app.regUser(nyxCode);
}
else
{
var list = res.data[0]
app.globalData.nyxCode = nyxCode;
wx.setStorageSync('nyxCode', nyxCode);
app.globalData.userInfo = list
wx.setStorageSync('userInfo', list)
console.log("==onLoad_userInfo success")
}
})
}
// step3 确定member信息, 写入 data.members
let promise_member = new Promise(function (resolve, reject) {
app.getMembers(0, 1, 20, resolve, reject);
})
promise_member.then(
function (value){
var members = wx.getStorageSync('members')
var member = wx.getStorageSync('member')
_this.setData({ member, members})
console.log("===enter promise_member then_passed_" + value)
},
function (value){
console.log("===enter promise_member then_failed_" + value)
},
);
// step4 数据载入页面, 初始化 - global page
// 初始载入'我已收藏'的清单, 存入storage
wx.setStorageSync('likeDictStorage', {})
let promise_like = new Promise(function (resolve, reject) {
app.getCollectsStorage(0, 1, 100, resolve, reject);
})
promise_like.then(
function (value){
console.log("===enter promise_like then_passed_" + value)
},
function (value){
console.log("===enter promise_like then_failed_" + value)
}
)
// 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 strCategory = _this.__data__.category[curIndex].order
var strSearch = _this.__data__.strSearch
this.setData({
curIndex: curIndex,
});
app.globalData.switchId = ""
_this.getActivities(0, 1, 4, strCity, strCategory, strSearch);
}
// step6 event 订阅, 主要接受activity-info.js里 emit 发送的消息 local page
event.on('LikeChanged', this, function(data) {
var activity_id = data['activity_id']
var num_like = data['num_like']
var activities = _this.__data__.activities;
for(var i=0; i< activities.length; i++)
{
if(activity_id == activities[i]['activity_id'])
{
activities[i]['num_like'] = num_like
}
}
_this.setData({
activities: activities,
})
})
// step7 窗口初始化
var device = wx.getSystemInfoSync()
//self.device = app.globalData.myDevice
// jscat miniprogram default width is 750rpx
var deviceRatio = device.windowWidth / 750
var winWidth = device.windowWidth * deviceRatio
var noteHeight = device.windowHeight - (40 - 60)
_this.setData({
searchHeight: 40,
navHeight: 40,
noteTop : (40+40),
noteHeight: noteHeight,
deviceRatio: deviceRatio,
})
wx.setNavigationBarTitle({
title: '园区活动',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var _this = this;
const { globalData: { defaultCity, defaultCounty } } = app
this.setData({
city: defaultCity,
county: defaultCounty
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
event.remove('LikeChanged', this);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
console.log('页面上拉触底')
var _this = this;
var curIndex = _this.__data__.curIndex
var strCity = _this.__data__.city
var strCategory = _this.__data__.category[curIndex].order
var strSearch = _this.__data__.strSearch
var isHideLoadMore = _this.__data__.isHideLoadMore;
var pageIndex = _this.__data__.pageIndex;
//控制逻辑, 在onClick之后或者onGetComment事件之后再允许下拉更新操作
//判断是否已经全部加载完毕
//没有则加载更多
if (!isHideLoadMore) {
console.log('加载更多')
setTimeout(() => {
_this.getActivities(1, pageIndex, 4, strCity, strCategory, strSearch);
}, 1000)
}
else {
console.log('没有更多')
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/**
* 用户自定义函数
*
*/
// 获取Activities数据
// scrollType: 是否是翻页
/*
搜索逻辑:
1. 搜索框, tag=strSearch + title=strSearch
2. tab, tag=strSearch
3. 新增的search tab, '搜索'tab的时候,需要转换为搜索的关键词(_this.__data__.strSearch)
*/
getActivities: function (scrollType, pageNum, pageCount, strCity, strCategory, strSearch) {
var _this = this;
// 如果是"推荐"和"搜索",需要单独处理
// '搜索'tab的时候, 需要转换为搜索的关键词(_this.__data__.strSearch)
var query_url = '&title=' + strSearch + '&orderType=' + strCategory + '&city=' + strCity
var strUrl = config.activity_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;
}
for (var i = 0; i < res.data.data.length; i++) {
var index_id = i + _this.__data__.activities.length
var result = {}
result["activity_id"] = res.data.data[i].activityId
result["member_name"] = res.data.data[i].memberName
result["member_slogan"] = res.data.data[i].memberSlogan
result["member_id"] = res.data.data[i].memberId
result["member_status"] = res.data.data[i].memberStatus
result["member_logo"] = res.data.data[i].memberLogo
result["tag"] = res.data.data[i].tag
result["title"] = res.data.data[i].title
result["num_like"] = res.data.data[i].numLike
result["content"] = res.data.data[i].content
result["quiz"] = res.data.data[i].quiz
result["point"] = res.data.data[i].point
result["address_name"] = res.data.data[i].addressName
result["product_desc"] = res.data.data[i].productDesc
result["unit_price"] = res.data.data[i].unitPrice.toFixed(2)
result["note_image"] = res.data.data[i].noteImage.split("::")
var start_datetime = res.data.data[i].startDatetime
var end_datetime = res.data.data[i].endDatetime
result["start_datetime"] = start_datetime
result["end_datetime"] = end_datetime
var url_quiz = "../activity/quiz-info/quiz-info?"
+"activity_id="+result["activity_id"]
+"&index_id="+index_id
+"&note_image="+res.data.data[i].noteImage //传递原始string数据, List不正确
+"&title="+result["title"]
+"&content="+result["content"]
+"&quiz="+result["quiz"]
+"&point="+result["point"]
+"&member_id="+result["member_id"]
+"&member_name="+result["member_name"]
+"&member_slogan="+result["member_slogan"]
+"&member_logo="+result["member_logo"]
var url_activity = "../activity/activity-info/activity-info?"
+"activity_id="+result["activity_id"]
+"&index_id="+index_id
+"&note_image="+res.data.data[i].noteImage //传递原始string数据, List不正确
+"&title="+result["title"]
+"&content="+result["content"]
+"&address_name="+result["address_name"]
+"&unit_price="+result["unit_price"]
+"&product_desc="+result["product_desc"]
+"&member_id="+result["member_id"]
+"&member_name="+result["member_name"]
+"&member_slogan="+result["member_slogan"]
+"&member_logo="+result["member_logo"]
+"&start_datetime="+result["start_datetime"]
+"&end_datetime="+result["end_datetime"]
result["url"] = result["tag"]=='竞答'? url_quiz : url_activity
list.push(result)
}
//进行翻页设置(加载更多)
if (scrollType == 1) {
var activitiesList = _this.__data__.activities;
list = activitiesList.concat(list)
}
_this.setData({
activities: list,
pageIndex: pageNum + 1,
isHideLoadMore: bisHideLoadMoreType,
})
}
}
})
},
/* 搜索模块 */
// 使文本框进入可编辑状态
showInput: function () {
this.setData({
inputShowed: true //设置文本框可以输入内容
});
},
// 取消搜索
hideInput: function () {
var _this = this;
var curIndex = _this.__data__.curIndex
var strCity = _this.__data__.city
var strCategory = _this.__data__.category[curIndex].order
var strSearch = ""
this.setData({
strSearch: strSearch,
inputShowed: false,
});
_this.getActivities(0, 1, 4, strCity, strCategory, strSearch);
},
// * 删除输入字符串
clearInput: function(){
this.setData({
inputVal: "",
});
},
// 开始搜索
startSearch: function (e) {
var _this = this;
var strSearch = e.detail.value
var curIndex = _this.__data__.curIndex
var strCity = _this.__data__.city
var strCategory = _this.__data__.category[curIndex].order
console.log("===input search text_" + strSearch)
_this.getActivities(0, 1, 4, strCity, strCategory, strSearch);
_this.setData({
strSearch: strSearch,
inputVal: strSearch,
})
},
/*
二维码信息:
1. 二维码生成: https://cli.im/
2. 二维码返回值:
charSet: "UTF-8"
errMsg: "scanCode:ok"
rawData: "b2hsa3cgaXMgYSBwaWc="
result: "ohlkw is a pig"
scanType: "QR_CODE"
二维码流程:
1. 生成流程:
1) user答完一个quiz,会生成一条记录tbl_match,
记录了如下参数:
- match_id: matchid_123
- member_id: memid_001
- user_id: uid_456
- 积分使用状态match_status(可用|不可用): 1|0
- 积分值match_point: 4.5
- 答题结果match_result: 9/10
- 答题时间create_datetime: 2020/07/30 12:00:00
- 更新时间update_datetime: 2020/07/30 12:00:00
- 积分时效状态(有效|无效)(暂不实现)
2. 扫码流程; javaapp只负责获取数据; weapp负责解析数据
1) 扫码获取记录id,发给服务器后台,
msg:
- "成功", 如果 存在 && 未使用,则置为 "已使用", match_id && match_status='01'
{
"resultCode": "200",
"totalCount": 1,
"resultMsg": "OK",
"data": [
{
"matchId": "mid_002",
"matchStatus": "01",
}
]
}
- "失败, 已使用二维码", 如果 存在 && 已使用, match_id && match_status='00'
{
"resultCode": "200",
"totalCount": 1,
"resultMsg": "OK",
"data": [
{
"matchId": "mid_001",
"matchStatus": "00",
}
]
}
- "失败, 无效二维码", 未查询到 !match_id
{
"resultCode": "200",
"totalCount": 0,
"resultMsg": "OK",
"data": []
}
*/
getQRCode: function(){
var _this = this;
wx.scanCode({ //扫描API
success: function(res){
console.log(res); //输出回调信息
_this.checkQRCode(res.result)
}
})
},
checkQRCode(qrcode_string){
var _this = this;
var strUrl = config.match_query_then_update_url + "?matchId="+qrcode_string
config.debug == 1?console.log("===checkQRCode strUrl "+strUrl):""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if ( res.data.resultCode == 200 ) {
//表示query成功
console.log("qrcode查询完成");
console.log(res)
//得到matchId
var matchList = res.data.data;
var title = ""
if(matchList.length == 0)
{
title = "失败, 无效"
}
else if( matchList[0].matchStatus == '00' )
{
title = "失败,已使用"
}
else if( matchList[0].matchStatus == '01' )
{
title = "扫码成功"
}
console.log("title="+title)
wx.showToast({
title: title,
duration: 3000
})
}
},
fail : function(res)
{
console.log("failed")
}
})
},
// 刷新页面数据
// used by switchcity.js
onUpdateData: function(){
var _this = this;
var strCity = app.globalData.defaultCity
var curIndex = _this.__data__.curIndex
var strCategory = _this.__data__.category[curIndex].order
var strSearch = _this.__data__.strSearch
_this.getActivities(0, 1, 4, strCity, strCategory, strSearch);
},
})
//通过Promise方式为wx.request添加同步操作
const getData = (url, param) => {
return new Promise((resolve, reject) => {
wx.request({
url: url,
method: 'GET',
data: param,
success(res) {
resolve(res.data)
},
fail(err) {
reject(err)
}
})
})
}
{
{
"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>
/*
/*
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,固定,比如搜索框
display: inline 行内元素 不带空格 block 块级元素 带空格
margin: 上右下左 top right bottom :left
*/
.page{
/*height:100vh; 相对于视口(Layout Viewport)的高度; 视口被均分为100单位的vh */
background-color:#f5f8fa;
}
/* start of navbar navBar -> navBar-box -> cate-list -> cate-list.on */
.navBar{
height: 60rpx;
background: #fff;
border-top: 1px solid #fafafa;
}
.navBar-box{
width: 100%;
height: 60rpx;
}
.cate-list{
display: inline;
margin: 15rpx 22rpx;
text-align: center;
font-size: 32rpx;
color: #9d9d9d;
margin-left: 30rpx;
}
.navBar-box .cate-list.on {
color: #000000;
font-weight: bold;
}
/* end of navbar */
.placeholder{
margin: 0px;
text-align: center;
vertical-align: middle;
line-height: 2.3em;
color: rgba(0,0,0);
}
/* justify-content: center;(水平居中) align-items: center;(垂直居中) */
.justify{
justify-content: center;
}
.align{
align-items: center;
}
.border{
border: 3rpx solid #ccc;
border-radius: 0rpx;
padding: 10rpx;
}
.text{
font-size: 34rpx;
}
.selected{
color: #ff0000;
}
/* coupon css */
.coupon-list{width: 100%; margin: 0 auto}
.coupon-list .item{width: 100%; height: 300rpx;}
.coupon-list .item .float-li{width: 100%; height: 100%; border-right: 2rpx dashed rgba(255,255,255,.3)}
.coupon-list .item .float-li-right{width: 220rpx; padding-right: 20rpx; height:100%; color: #fff}
.coupon-left{position: relative}
.coupon-left .t{position: absolute; color: #fff}
.coupon-left .t1{width: 710rpx; display: flex; margin-left: 20rpx; margin-top: 20rpx; height: 160rpx; color: #fff}
.coupon-left .t1-left{width: 160rpx; font-size: 70rpx; font-weight: bold}
.coupon-left .t1-right{width: 520rpx; font-size: 50rpx; }
/* .coupon-left .t2{left: 20rpx; top:160rpx} */
.coupon-left .t2{width: 710rpx; display: flex; margin-left: 20rpx; margin-top: 0rpx; height: 50rpx; color: #fff}
.coupon-left .t2-left{width: 520rpx; }
.coupon-left .t2-right{width: 160rpx;}
.coupon-left .t3{width: 710rpx; display: flex; margin-left: 20rpx; margin-top: 0rpx; height: 50rpx; color: #fff}
.coupon-left .t3-left{width: 520rpx; }
.coupon-left .t3-right{width: 160rpx;}
.coupon-left .t3-right image{
width: 40rpx;
height: 40rpx;
font-size: 0;
}
.coupon-left .t4{width: 710rpx; display: flex; margin-left: 20rpx; margin-top: 0rpx; height: 50rpx; color: #fff}
.coupon-left .t4-left{width: 520rpx; }
.coupon-left .t4-right{width: 160rpx;}
.coupon-left .t4-right image{
width: 40rpx;
height: 40rpx;
font-size: 0;
}
.coupon-right .t{text-align: center}
.coupon-right .t1{font-size: 40rpx; padding: 30rpx 0 10rpx 0;}
.coupon-right .t3{padding-top:20rpx}
.coupon-right .t3 text{background: #fff; color: #333; border-radius: 7rpx; padding: 10rpx 40rpx}
.note{background: #faeab7}
.stamp{position:relative;overflow:hidden}
.stamp i{position: absolute;left: 20%;top: 90rpx;height: 500rpx;width: 700rpx;background-color: rgba(255,255,255,.15);transform: rotate(-30deg);
}
.stamp01{background:radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 30rpx, #F39B00 30rpx);background-size:10rpx 10rpx;background-position:9rpx 3rpx; background: #FFFFFF}
/* 失效样式 */
.stamp06{background:radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 30rpx, #e2e2e2 30rpx);background-size:10rpx 10rpx;background-position:9rpx 3rpx; background: #acacac
}
/* start - 小程序自定义弹框css */
/* 遮罩层 */
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.5;
}
/* 弹出层 */
.modalDlg{
width: 80%;
height: 540rpx;
position: fixed;
top: 240rpx;
left: 0;
right: 0;
z-index: 9999;
margin: 0 auto;
background-color: #fff;
border-radius:5px;
display: flex;
flex-direction: column;
align-items: center;
}
/* 弹出层里面的图片 */
/* 弹出层里面的文字 */
.title{
display: flex;
font-size: 38rpx;
color: #cccccc;
width: 80%;
height: 80rpx;
padding: 20rpx;
align-items: center;
justify-content: center;
}
.title-right{
display: flex;
height: 80rpx;
position: absolute;
align-items: center;
text-align: right;
font-size: 38rpx;
color: #cccccc;
padding: 20rpx;
right: 20rpx;
}
.title-right image{
width: 50rpx;
height: 50rpx;
font-size: 0;
}
/* 图片+文字 */
.weui-width{
width: 80%;
}
.placeholder-modal{
margin: 0px;
text-align: center;
vertical-align: middle;
line-height: 2.3em;
background-color: #fff;
}
/* 好友助力积分列表 */
.list-point{
width: 100%;
height: 2rpx;
background: #ccc;
font-size: 32rpx;
display: flex;
flex-direction: column;
/* align-items: center; */
left: 40rpx;
}
.list-point .text{
margin-left: 160rpx;
}
.title-right image{
width: 50rpx;
height: 50rpx;
font-size: 0;
}
/* barcode券码查看 */
.list-barcode{
width: 100%;
height: 2rpx;
background: #ccc;
font-size: 32rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.list-barcode .text{
align-items: center;
margin-left: 20rpx;
}
.list-barcode image{
overflow: visible;
width: 300rpx;
height: 300rpx;
}
/* 弹出层里面的按钮 */
.ok{
width: 100%;
height: 2rpx;
background: #ccc;
text-align: center;
font-size: 38rpx;
color: #666666;
}
/* end - 小程序自定义弹框css */
/* start 加载更多 */
.weui-loading {
margin: 0 5px;
width: 20px;
height: 20px;
display: inline-block;
vertical-align: middle;
-webkit-animation: weuiLoading 1s steps(12, end) infinite;
animation: weuiLoading 1s steps(12, end) infinite;
background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;
background-size: 100%;
}
.weui-loadmore {
width: 65%;
margin: 1.5em auto;
line-height: 1.6em;
font-size: 14px;
text-align: center;
}
.weui-loadmore__tips {
display: inline-block;
vertical-align: middle;
}
/* end 加载更多*/
.note-info{
width: 100%;
/* position: fixed; */
border-radius: 5rpx;
float: left;
margin-top: 20rpx;
margin-bottom: 20rpx;
}
.note-member{
display: flex;
font-size: 32rpx;
margin-left: 5%;
margin-right: 5%;
margin-top: 0;
text-align:justify;
vertical-align: center;
}
.note-member .member-left{width: 520rpx; flex:1}
.note-member .member-right{width: 160rpx;justify-content: flex-end;display: flex;}
.note-member .member-right image{
width: 60rpx;
height: 60rpx;
font-size: 0;
}
.note-price{
color: #FF6600;
font-size: 16px;
margin-left: 5%;
margin-right: 5%;
margin-top: 0;
text-align:justify;
}
.note-content{
font-size: 16px;
/* 后期用于 '展开' 功能 */
/* 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;
}
.note-column{
display: flex;
flex-direction: column;
margin-left: 30rpx;
margin-right: 30rpx;
width: 55%;
}
.writer-image{
width: 240rpx;
height: 240rpx;
margin-left: 30rpx;
margin-top: 10rpx;
}
.price-row{
display: flex;
flex-direction: row;
}
.sub-price{
color: #FF6600;
font-size: 34rpx;
margin-right: 5%;
margin-top: 0;
text-align:justify;
flex: 1;
font-weight: bold;
}
.sub-quantity{
display: flex;
font-size: 16px;
justify-content: flex-end;
}
/* refer to jd */
.desc {
font-size: 30rpx;
color: #a7a7a7;
}
.desc-member-left {
font-size: 30rpx;
color: #a7a7a7;
margin-right: 20rpx;
}
.desc-member-right {
font-size: 30rpx;
}
/* start of workbench*/
.workbench{
font-size: 32rpx;
background: #fff;
padding-bottom: 10rpx;
margin-bottom:10rpx;
padding-top: 5rpx;
margin-top:5rpx;
color: #333;
}
.workbench .title{
font-size: 32rpx;
padding: 20rpx 20rpx;
margin-bottom: 40rpx;
display: block;
}
.workbench .items{
width: 100rpx;
flex:1;
text-align: center;
}
.workbench .items image{
width: 60rpx;
height: 60rpx;
}
.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*/
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论